chore(web): move skill check into dev draw tools

This commit is contained in:
Luke
2022-10-27 09:27:54 +02:00
parent 4f69c7c5c1
commit b354e0836c
3 changed files with 17 additions and 8 deletions

View File

@@ -0,0 +1,11 @@
import { debugData } from '../../../utils/debugData';
import { GameDifficulty } from '../../skillcheck';
export const debugSkillCheck = () => {
debugData<GameDifficulty | GameDifficulty[]>([
{
action: 'startSkillCheck',
data: ['easy', 'easy', 'hard'],
},
]);
};

View File

@@ -20,6 +20,7 @@ import { debugCustomNotification, debugNotification } from './debug/notification
import { debugCircleProgressbar, debugProgressbar } from './debug/progress'; import { debugCircleProgressbar, debugProgressbar } from './debug/progress';
import { debugTextUI } from './debug/textui'; import { debugTextUI } from './debug/textui';
import { debugSettings } from './debug/settings'; import { debugSettings } from './debug/settings';
import { debugSkillCheck } from './debug/skillcheck';
const Dev: React.FC = () => { const Dev: React.FC = () => {
const { isOpen, onOpen, onClose } = useDisclosure(); const { isOpen, onOpen, onClose } = useDisclosure();
@@ -82,6 +83,10 @@ const Dev: React.FC = () => {
<Button isFullWidth onClick={() => debugTextUI()}> <Button isFullWidth onClick={() => debugTextUI()}>
Show TextUI Show TextUI
</Button> </Button>
<Divider />
<Button isFullWidth onClick={() => debugSkillCheck()}>
Run skill check
</Button>
</VStack> </VStack>
</DrawerBody> </DrawerBody>
</DrawerContent> </DrawerContent>

View File

@@ -10,7 +10,7 @@ interface CustomGameDifficulty {
speedMultiplier: number; speedMultiplier: number;
} }
type GameDifficulty = 'easy' | 'medium' | 'hard' | CustomGameDifficulty; export type GameDifficulty = 'easy' | 'medium' | 'hard' | CustomGameDifficulty;
export interface SkillCheckProps { export interface SkillCheckProps {
angle: number; angle: number;
@@ -28,13 +28,6 @@ const difficultyOffsets = {
hard: 25, hard: 25,
}; };
debugData([
{
action: 'startSkillCheck',
data: ['hard'],
},
]);
const SkillCheck: React.FC = () => { const SkillCheck: React.FC = () => {
const [visible, setVisible] = useState(false); const [visible, setVisible] = useState(false);
const dataRef = useRef<GameDifficulty | GameDifficulty[] | null>(null); const dataRef = useRef<GameDifficulty | GameDifficulty[] | null>(null);