mirror of
https://github.com/unanmed/HumanBreak.git
synced 2026-11-11 16:14:30 +08:00
fix: 捡黄宝石报错
This commit is contained in:
1 parent
14aa4d6109
commit
ef48dc07cd
5 files changed
+110
-1156
No files matched your search
@@ -1,22 +1,22 @@
|
||||
import { gameKey } from '@motajs/system-action';
|
||||
import { MAIN_WIDTH, MAIN_HEIGHT, POP_BOX_WIDTH, CENTER_LOC } from './shared';
|
||||
import { POP_BOX_WIDTH, CENTER_LOC, FULL_LOC } from './shared';
|
||||
import {
|
||||
saveSave,
|
||||
mainUIController,
|
||||
saveLoad,
|
||||
openSettings,
|
||||
ReplaySettingsUI,
|
||||
openViewMap
|
||||
openViewMap,
|
||||
openReplay
|
||||
} from './ui';
|
||||
import { ElementLocator } from '@motajs/render-core';
|
||||
|
||||
export function createAction() {
|
||||
gameKey
|
||||
.realize('save', () => {
|
||||
saveSave(mainUIController, [0, 0, MAIN_WIDTH, MAIN_HEIGHT]);
|
||||
saveSave(mainUIController, FULL_LOC);
|
||||
})
|
||||
.realize('load', () => {
|
||||
saveLoad(mainUIController, [0, 0, MAIN_WIDTH, MAIN_HEIGHT]);
|
||||
saveLoad(mainUIController, FULL_LOC);
|
||||
})
|
||||
.realize('menu', () => {
|
||||
const loc = CENTER_LOC.slice() as ElementLocator;
|
||||
@@ -24,11 +24,11 @@ export function createAction() {
|
||||
openSettings(mainUIController, loc);
|
||||
})
|
||||
.realize('replay', () => {
|
||||
mainUIController.open(ReplaySettingsUI, {
|
||||
loc: CENTER_LOC
|
||||
});
|
||||
const loc = CENTER_LOC.slice() as ElementLocator;
|
||||
loc[2] = POP_BOX_WIDTH;
|
||||
openReplay(mainUIController, loc);
|
||||
})
|
||||
.realize('viewMap', () => {
|
||||
openViewMap(mainUIController, [0, 0, MAIN_WIDTH, MAIN_HEIGHT]);
|
||||
openViewMap(mainUIController, FULL_LOC);
|
||||
});
|
||||
}
|
||||
@@ -693,3 +693,14 @@ export function openSettings(
|
||||
loc
|
||||
});
|
||||
}
|
||||
|
||||
export function openReplay(
|
||||
controller: IUIMountable,
|
||||
loc: ElementLocator,
|
||||
props?: MainSettingsProps
|
||||
) {
|
||||
controller.open(ReplaySettingsUI, {
|
||||
...props,
|
||||
loc
|
||||
});
|
||||
}
|
||||
@@ -23,7 +23,7 @@ import { SetupComponentOptions } from '@motajs/system-ui';
|
||||
import { saveSave, saveLoad } from './save';
|
||||
import { mainUIController } from './controller';
|
||||
import { MAIN_HEIGHT, FULL_LOC, POP_BOX_WIDTH, CENTER_LOC } from '../shared';
|
||||
import { openSettings } from './settings';
|
||||
import { openReplay, openSettings } from './settings';
|
||||
import { openViewMap } from './viewmap';
|
||||
|
||||
interface ToolbarProps extends DefaultProps {
|
||||
@@ -112,7 +112,11 @@ export const PlayingToolbar = defineComponent<
|
||||
const view = () => {
|
||||
openViewMap(mainUIController, FULL_LOC);
|
||||
};
|
||||
const replay = () => core.ui._drawReplay();
|
||||
const replay = () => {
|
||||
const loc = CENTER_LOC.slice() as ElementLocator;
|
||||
loc[2] = POP_BOX_WIDTH;
|
||||
openReplay(mainUIController, loc);
|
||||
};
|
||||
const settings = () => {
|
||||
const loc = CENTER_LOC.slice() as ElementLocator;
|
||||
loc[2] = POP_BOX_WIDTH;
|
||||
|
||||
Reference in new issue
Block a user