mirror of
https://github.com/unanmed/HumanBreak.git
synced 2026-11-16 20:24:31 +08:00
refactor: 游戏按键
This commit is contained in:
1 parent
9bf27f58e3
commit
337aaade8c
4 files changed
+67
-147
No files matched your search
@@ -327,6 +327,69 @@ gameKey.use(mainScope);
|
||||
|
||||
// ----- Realization
|
||||
|
||||
gameKey
|
||||
.when(() => !core.status.lockControl)
|
||||
.realize('book', () => {
|
||||
core.openBook(true);
|
||||
})
|
||||
.realize('save', () => {
|
||||
core.save(true);
|
||||
})
|
||||
.realize('load', () => {
|
||||
core.load(true);
|
||||
})
|
||||
.realize('toolbox', () => {
|
||||
core.openToolbox(true);
|
||||
})
|
||||
.realize('equipbox', () => {
|
||||
core.openEquipbox(true);
|
||||
})
|
||||
.realize('fly', () => {
|
||||
core.useFly(true);
|
||||
})
|
||||
.realize('menu', () => {
|
||||
core.openSettings(true);
|
||||
})
|
||||
.realize('replay', () => {
|
||||
core.ui._drawReplay();
|
||||
})
|
||||
.realize('shop', () => {
|
||||
core.openQuickShop(true);
|
||||
})
|
||||
.realize('statistics', () => {
|
||||
core.ui._drawStatistics();
|
||||
})
|
||||
.realize('viewMap', () => {
|
||||
core.ui._drawViewMaps();
|
||||
})
|
||||
.realize('skillTree', () => {
|
||||
core.useItem('skill1', true);
|
||||
})
|
||||
.realize('desc', () => {
|
||||
core.useItem('I560', true);
|
||||
})
|
||||
.realize('undo', () => {
|
||||
core.doSL('autoSave', 'load');
|
||||
})
|
||||
.realize('redo', () => {
|
||||
core.doSL('autoSave', 'reload');
|
||||
})
|
||||
.realize('turn', () => {
|
||||
core.turnHero();
|
||||
})
|
||||
.realize('getNext', () => {
|
||||
core.getNextItem();
|
||||
})
|
||||
.realize('mark', () => {})
|
||||
.realize('special', () => {})
|
||||
.realize('critical', () => {})
|
||||
.realize('restart', () => {
|
||||
core.confirmRestart();
|
||||
})
|
||||
.realize('comment', () => {
|
||||
core.actions._clickGameInfo_openComments();
|
||||
});
|
||||
|
||||
// ----- Listening
|
||||
document.addEventListener('keyup', e => {
|
||||
const assist = generateBinary([e.ctrlKey, e.shiftKey, e.altKey]);
|
||||
|
||||
Vendored
+3
-3
@@ -821,11 +821,11 @@ interface Ui {
|
||||
/**
|
||||
* 绘制浏览地图
|
||||
*/
|
||||
_drawViewMaps();
|
||||
_drawViewMaps(): void;
|
||||
|
||||
_drawReplay();
|
||||
_drawReplay(): void;
|
||||
|
||||
_drawStatistics();
|
||||
_drawStatistics(): void;
|
||||
}
|
||||
|
||||
declare const ui: new () => Ui;
|
||||
+1
-3
@@ -93,9 +93,7 @@ import {
|
||||
DoubleRightOutlined
|
||||
} from '@ant-design/icons-vue';
|
||||
import { debounce } from 'lodash-es';
|
||||
import { downloadCanvasImage, keycode, tip } from '../plugin/utils';
|
||||
import { sleep } from 'mutate-animate';
|
||||
import { KeyCode } from '../plugin/keyCodes';
|
||||
import { downloadCanvasImage, tip } from '../plugin/utils';
|
||||
import { GameUi } from '@/core/main/custom/ui';
|
||||
import { gameKey } from '@/core/main/init/hotkey';
|
||||
|
||||
|
||||
Reference in new issue
Block a user