mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-10-29 02:12:58 +08:00
fix: 确认框与选择框的录像问题
This commit is contained in:
parent
10620bd2f8
commit
860cbd7ea6
@ -383,7 +383,7 @@ export const Save = defineComponent<SaveProps, SaveEmits, keyof SaveEmits>(
|
||||
if (selected.value < count - 1) {
|
||||
selected.value++;
|
||||
} else {
|
||||
selected.value = 0;
|
||||
selected.value = 1;
|
||||
pageRef.value?.movePage(1);
|
||||
}
|
||||
},
|
||||
|
||||
@ -976,70 +976,10 @@ actions.prototype._clickConfirmBox = function (x, y, px, py) {
|
||||
};
|
||||
|
||||
////// 键盘操作确认框时 //////
|
||||
actions.prototype._keyUpConfirmBox = function (keycode) {
|
||||
if (keycode == 37 || keycode == 39) {
|
||||
core.status.event.selection = 1 - core.status.event.selection;
|
||||
core.playSound('光标移动');
|
||||
core.ui.drawConfirmBox(
|
||||
core.status.event.ui,
|
||||
core.status.event.data.yes,
|
||||
core.status.event.data.no
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (keycode == 13 || keycode == 32 || keycode == 67) {
|
||||
if (core.status.event.selection == 0 && core.status.event.data.yes) {
|
||||
// core.playSound('确定');
|
||||
core.status.event.selection = null;
|
||||
core.status.event.data.yes();
|
||||
return;
|
||||
}
|
||||
if (core.status.event.selection == 1 && core.status.event.data.no) {
|
||||
// core.playSound('确定');
|
||||
core.status.event.selection = null;
|
||||
core.status.event.data.no();
|
||||
return;
|
||||
}
|
||||
}
|
||||
};
|
||||
actions.prototype._keyUpConfirmBox = function (keycode) {};
|
||||
|
||||
////// 鼠标在确认框上移动时 //////
|
||||
actions.prototype._onMoveConfirmBox = function (x, y, px, py) {
|
||||
if (py >= core._PY_ / 2 && py <= core._PY_ / 2 + 64) {
|
||||
if (px >= core._PX_ / 2 - 70 && px <= core._PX_ / 2 - 10) {
|
||||
if (core.status.event.selection != 0) {
|
||||
core.status.event.selection = 0;
|
||||
core.playSound('光标移动');
|
||||
if (core.status.event.id == 'action') {
|
||||
core.ui.drawConfirmBox(core.status.event.ui.text);
|
||||
} else {
|
||||
core.ui.drawConfirmBox(
|
||||
core.status.event.ui,
|
||||
core.status.event.data.yes,
|
||||
core.status.event.data.no
|
||||
);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (px >= core._PX_ / 2 + 10 && px <= core._PX_ / 2 + 70) {
|
||||
if (core.status.event.selection != 1) {
|
||||
core.status.event.selection = 1;
|
||||
core.playSound('光标移动');
|
||||
if (core.status.event.id == 'action') {
|
||||
core.ui.drawConfirmBox(core.status.event.ui.text);
|
||||
} else {
|
||||
core.ui.drawConfirmBox(
|
||||
core.status.event.ui,
|
||||
core.status.event.data.yes,
|
||||
core.status.event.data.no
|
||||
);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
};
|
||||
actions.prototype._onMoveConfirmBox = function (x, y, px, py) {};
|
||||
|
||||
actions.prototype._clickAction_text = function () {
|
||||
// 正在淡入淡出的话不执行
|
||||
|
||||
@ -1584,7 +1584,8 @@ control.prototype._replay_finished = function () {
|
||||
core.status.replay.replaying = true;
|
||||
core.ui.closePanel();
|
||||
core.pauseReplay();
|
||||
}
|
||||
},
|
||||
true
|
||||
);
|
||||
};
|
||||
|
||||
@ -1639,7 +1640,8 @@ control.prototype._replay_error = function (action, callback) {
|
||||
core.ui.closePanel();
|
||||
core.stopReplay(true);
|
||||
if (callback) callback();
|
||||
}
|
||||
},
|
||||
true
|
||||
);
|
||||
};
|
||||
|
||||
@ -2335,7 +2337,8 @@ control.prototype._syncLoad_write = function (data) {
|
||||
function () {
|
||||
core.status.event.selection = 0;
|
||||
core.ui._drawSyncSave();
|
||||
}
|
||||
},
|
||||
true
|
||||
);
|
||||
} else {
|
||||
// 只覆盖单存档
|
||||
|
||||
@ -187,7 +187,8 @@ events.prototype._gameOver_confirmUpload = function (ending, norank) {
|
||||
if (main.isCompetition)
|
||||
core.events._gameOver_confirmDownload(ending);
|
||||
else core.events._gameOver_doUpload(null, ending, norank);
|
||||
}
|
||||
},
|
||||
true
|
||||
);
|
||||
};
|
||||
|
||||
@ -251,7 +252,8 @@ events.prototype._gameOver_confirmDownload = function (ending) {
|
||||
},
|
||||
function () {
|
||||
core.events._gameOver_askRate(ending);
|
||||
}
|
||||
},
|
||||
true
|
||||
);
|
||||
};
|
||||
|
||||
@ -284,7 +286,8 @@ events.prototype._gameOver_askRate = function (ending) {
|
||||
function () {
|
||||
core.ui.closePanel();
|
||||
core.restart();
|
||||
}
|
||||
},
|
||||
true
|
||||
);
|
||||
return;
|
||||
}
|
||||
@ -301,7 +304,8 @@ events.prototype._gameOver_askRate = function (ending) {
|
||||
},
|
||||
function () {
|
||||
core.restart();
|
||||
}
|
||||
},
|
||||
true
|
||||
);
|
||||
};
|
||||
|
||||
@ -327,7 +331,8 @@ events.prototype.confirmRestart = function () {
|
||||
function () {
|
||||
core.playSound('取消');
|
||||
core.ui.closePanel();
|
||||
}
|
||||
},
|
||||
true
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@ -2228,7 +2228,7 @@ ui.prototype.textImage = function (content, lineHeight) {
|
||||
};
|
||||
|
||||
////// 绘制一个选项界面 //////
|
||||
ui.prototype.drawChoices = async function (content, choices, width) {
|
||||
ui.prototype.drawChoices = async function (content, choices, width, noRoute) {
|
||||
if (main.replayChecking) {
|
||||
const selected = (() => {
|
||||
const route = core.status.replay.toReplay[0];
|
||||
@ -2243,13 +2243,15 @@ ui.prototype.drawChoices = async function (content, choices, width) {
|
||||
} else {
|
||||
const {
|
||||
routedChoices,
|
||||
getChoices,
|
||||
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(
|
||||
const fn = noRoute ? getChoices : routedChoices;
|
||||
const selected = await fn(
|
||||
mainUIController,
|
||||
choice,
|
||||
[HALF_WIDTH, HALF_HEIGHT, void 0, void 0, 0.5, 0.5],
|
||||
@ -2282,7 +2284,7 @@ ui.prototype.drawConfirmBox = async function (
|
||||
text,
|
||||
yesCallback,
|
||||
noCallback,
|
||||
ctx
|
||||
noRoute
|
||||
) {
|
||||
if (main.replayChecking) {
|
||||
const confirm = (() => {
|
||||
@ -2301,12 +2303,14 @@ ui.prototype.drawConfirmBox = async function (
|
||||
} else {
|
||||
const {
|
||||
routedConfirm,
|
||||
getConfirm,
|
||||
mainUIController,
|
||||
HALF_WIDTH,
|
||||
HALF_HEIGHT,
|
||||
POP_BOX_WIDTH
|
||||
} = Mota.require('@user/client-modules');
|
||||
const confirm = await routedConfirm(
|
||||
const fn = noRoute ? getConfirm : routedConfirm;
|
||||
const confirm = await fn(
|
||||
mainUIController,
|
||||
text,
|
||||
[HALF_WIDTH, HALF_HEIGHT, void 0, void 0, 0.5, 0.5],
|
||||
@ -2369,7 +2373,7 @@ ui.prototype._drawQuickShop = function () {
|
||||
};
|
||||
});
|
||||
choices.push('返回游戏');
|
||||
this.drawChoices(null, choices);
|
||||
this.drawChoices(null, choices, void 0, true);
|
||||
};
|
||||
|
||||
ui.prototype._drawSyncSave = function () {
|
||||
|
||||
4
src/types/declaration/ui.d.ts
vendored
4
src/types/declaration/ui.d.ts
vendored
@ -766,7 +766,7 @@ interface Ui {
|
||||
content: string,
|
||||
choices: object[],
|
||||
width?: number,
|
||||
ctx?: CtxRefer
|
||||
noRoute?: CtxRefer
|
||||
): void;
|
||||
|
||||
/**
|
||||
@ -777,7 +777,7 @@ interface Ui {
|
||||
text: string,
|
||||
yesCallback?: () => void,
|
||||
noCallback?: () => void,
|
||||
ctx?: CtxRefer
|
||||
noRoute?: boolean
|
||||
): void;
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user