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

View File

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