mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-10-15 17:32:58 +08:00
fix: 捡黄宝石报错
This commit is contained in:
parent
14aa4d6109
commit
ef48dc07cd
@ -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;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -2241,15 +2241,19 @@ ui.prototype.drawChoices = async function (content, choices, width) {
|
||||
core.insertAction(choices[selected].action);
|
||||
core.doAction();
|
||||
} else {
|
||||
const { routedChoices, mainUIController } = Mota.require(
|
||||
'@user/client-modules'
|
||||
);
|
||||
const {
|
||||
routedChoices,
|
||||
mainUIController,
|
||||
HALF_WIDTH,
|
||||
HALF_HEIGHT,
|
||||
POP_BOX_WIDTH
|
||||
} = Mota.require('@user/client-modules');
|
||||
const choice = choices.map((v, i) => [i, v.text]);
|
||||
const selected = await routedChoices(
|
||||
mainUIController,
|
||||
choice,
|
||||
[420, 240, void 0, void 0, 0.5, 0.5],
|
||||
width,
|
||||
[HALF_WIDTH, HALF_HEIGHT, void 0, void 0, 0.5, 0.5],
|
||||
width ?? POP_BOX_WIDTH,
|
||||
{ title: content ?? '' }
|
||||
);
|
||||
core.insertAction(choices[selected].action);
|
||||
@ -2295,14 +2299,18 @@ ui.prototype.drawConfirmBox = async function (
|
||||
noCallback?.();
|
||||
}
|
||||
} else {
|
||||
const { routedConfirm, mainUIController } = Mota.require(
|
||||
'@user/client-modules'
|
||||
);
|
||||
const {
|
||||
routedConfirm,
|
||||
mainUIController,
|
||||
HALF_WIDTH,
|
||||
HALF_HEIGHT,
|
||||
POP_BOX_WIDTH
|
||||
} = Mota.require('@user/client-modules');
|
||||
const confirm = await routedConfirm(
|
||||
mainUIController,
|
||||
text,
|
||||
[420, 240, void 0, void 0, 0.5, 0.5],
|
||||
240
|
||||
[HALF_WIDTH, HALF_HEIGHT, void 0, void 0, 0.5, 0.5],
|
||||
POP_BOX_WIDTH
|
||||
);
|
||||
if (confirm) {
|
||||
yesCallback?.();
|
||||
|
Loading…
Reference in New Issue
Block a user