Skip to content

Commit f6b796f

Browse files
Merge pull request #787 from xiaoxustudio/fix/fast-cannot-cancel
fix: fast cannot cancel when mouse wheel down roll
2 parents 9ab1246 + 7daf299 commit f6b796f

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

packages/webgal/src/Core/controller/gamePlay/fastSkip.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ const setButton = (on: boolean) => {
1919
}
2020
};
2121

22+
export { setButton as setFastButton };
23+
2224
/**
2325
* 停止快进模式
2426
*/

packages/webgal/src/hooks/useHotkey.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { startFast, stopAll, stopFast } from '@/Core/controller/gamePlay/fastSkip';
1+
import { setFastButton, startFast, stopAll, stopFast } from '@/Core/controller/gamePlay/fastSkip';
22
import { nextSentence } from '@/Core/controller/gamePlay/nextSentence';
33
import { fastSaveGame } from '@/Core/controller/storage/fastSaveLoad';
44
import { setStorage } from '@/Core/controller/storage/storageController';
@@ -139,10 +139,14 @@ export function useMouseWheel() {
139139
// setComponentVisibility('showBacklog', false);
140140
} else if (isGameActive() && direction === 'down' && !ctrlKey) {
141141
clearTimeout(wheelTimeout);
142+
// 已开启快进模式
143+
if (WebGAL.gameplay.isFast) stopFast();
142144
WebGAL.gameplay.isFast = true;
143145
// 滚轮视作快进
146+
setFastButton(true);
144147
setTimeout(() => {
145148
WebGAL.gameplay.isFast = false;
149+
setFastButton(false);
146150
}, 150);
147151
next();
148152
}

0 commit comments

Comments
 (0)