File tree Expand file tree Collapse file tree
packages/webgal/src/hooks Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import { setVisibility } from '@/store/GUIReducer';
1010import { RootState } from '@/store/store' ;
1111import { setOptionData } from '@/store/userDataReducer' ;
1212import styles from '@/UI/Backlog/backlog.module.scss' ;
13+ import bottomControlPanelStyles from '@/UI/BottomControlPanel/bottomControlPanel.module.scss' ;
1314import throttle from 'lodash/throttle' ;
1415import { useCallback , useEffect , useRef } from 'react' ;
1516import { useDispatch } from 'react-redux' ;
@@ -139,10 +140,18 @@ export function useMouseWheel() {
139140 // setComponentVisibility('showBacklog', false);
140141 } else if ( isGameActive ( ) && direction === 'down' && ! ctrlKey ) {
141142 clearTimeout ( wheelTimeout ) ;
143+ // 已开启快进模式
144+ if ( WebGAL . gameplay . fastInterval !== null ) {
145+ clearInterval ( WebGAL . gameplay . fastInterval ) ;
146+ WebGAL . gameplay . fastInterval = null ;
147+ }
148+ const autoIcon = document . getElementById ( 'Button_ControlPanel_fast' ) ;
142149 WebGAL . gameplay . isFast = true ;
143150 // 滚轮视作快进
151+ if ( autoIcon ) autoIcon . className = bottomControlPanelStyles . button_on ;
144152 setTimeout ( ( ) => {
145153 WebGAL . gameplay . isFast = false ;
154+ if ( autoIcon ) autoIcon . className = bottomControlPanelStyles . singleButton ;
146155 } , 150 ) ;
147156 next ( ) ;
148157 }
You can’t perform that action at this time.
0 commit comments