mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-17 06:56:03 +01:00
refactor(web/skillcheck): remove unused code and comments
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Box, Center } from '@chakra-ui/react';
|
||||
import { useEffect, useMemo, useRef, useState } from 'react';
|
||||
import { useRef, useState } from 'react';
|
||||
import { useNuiEvent } from '../../hooks/useNuiEvent';
|
||||
import { debugData } from '../../utils/debugData';
|
||||
import Indicator from './indicator';
|
||||
@@ -29,7 +29,7 @@ const difficultyOffsets = {
|
||||
debugData([
|
||||
{
|
||||
action: 'startSkillCheck',
|
||||
data: [{ areaSize: 250, speedMultiplier: 2 }, 'easy'],
|
||||
data: [{ areaSize: 250, speedMultiplier: 2 }, 'easy', 'hard'],
|
||||
},
|
||||
]);
|
||||
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
import { useEffect, useRef, useState } from 'react';
|
||||
import { useNuiEvent } from '../../hooks/useNuiEvent';
|
||||
import { useKeyPress } from '../../hooks/useKeyPress';
|
||||
import { fetchNui } from '../../utils/fetchNui';
|
||||
import skillcheck, { SkillCheckProps } from './index';
|
||||
import { SkillCheckProps } from './index';
|
||||
import { useInterval } from '@chakra-ui/react';
|
||||
import { Simulate } from 'react-dom/test-utils';
|
||||
import keyPress = Simulate.keyPress;
|
||||
|
||||
interface Props {
|
||||
angle: number;
|
||||
@@ -36,7 +32,6 @@ const Indicator: React.FC<Props> = ({ angle, offset, multiplier, handleComplete,
|
||||
|
||||
useEffect(() => {
|
||||
if (indicatorAngle + 90 >= 360) {
|
||||
// fetchNui('skillCheckOver', { success: false });
|
||||
setGameState(false);
|
||||
handleComplete(false);
|
||||
}
|
||||
@@ -44,18 +39,10 @@ const Indicator: React.FC<Props> = ({ angle, offset, multiplier, handleComplete,
|
||||
|
||||
useEffect(() => {
|
||||
if (!isKeyPressed) return;
|
||||
//
|
||||
|
||||
setGameState(false);
|
||||
if (isKeyPressed) {
|
||||
if (indicatorAngle < angle || indicatorAngle > angle + (315 - offset)) {
|
||||
// fetchNui('skillCheckOver', { success: false });
|
||||
handleComplete(false);
|
||||
} else {
|
||||
// fetchNui('skillCheckOver', { success: true });
|
||||
handleComplete(true);
|
||||
}
|
||||
}
|
||||
if (indicatorAngle < angle || indicatorAngle > angle + (315 - offset)) handleComplete(false);
|
||||
else handleComplete(true);
|
||||
}, [isKeyPressed]);
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user