mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-10-29 10:22:59 +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) {
|
if (selected.value < count - 1) {
|
||||||
selected.value++;
|
selected.value++;
|
||||||
} else {
|
} else {
|
||||||
selected.value = 0;
|
selected.value = 1;
|
||||||
pageRef.value?.movePage(1);
|
pageRef.value?.movePage(1);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -976,70 +976,10 @@ actions.prototype._clickConfirmBox = function (x, y, px, py) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
////// 键盘操作确认框时 //////
|
////// 键盘操作确认框时 //////
|
||||||
actions.prototype._keyUpConfirmBox = function (keycode) {
|
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._onMoveConfirmBox = function (x, y, px, py) {
|
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._clickAction_text = function () {
|
actions.prototype._clickAction_text = function () {
|
||||||
// 正在淡入淡出的话不执行
|
// 正在淡入淡出的话不执行
|
||||||
|
|||||||
@ -1584,7 +1584,8 @@ control.prototype._replay_finished = function () {
|
|||||||
core.status.replay.replaying = true;
|
core.status.replay.replaying = true;
|
||||||
core.ui.closePanel();
|
core.ui.closePanel();
|
||||||
core.pauseReplay();
|
core.pauseReplay();
|
||||||
}
|
},
|
||||||
|
true
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1639,7 +1640,8 @@ control.prototype._replay_error = function (action, callback) {
|
|||||||
core.ui.closePanel();
|
core.ui.closePanel();
|
||||||
core.stopReplay(true);
|
core.stopReplay(true);
|
||||||
if (callback) callback();
|
if (callback) callback();
|
||||||
}
|
},
|
||||||
|
true
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -2335,7 +2337,8 @@ control.prototype._syncLoad_write = function (data) {
|
|||||||
function () {
|
function () {
|
||||||
core.status.event.selection = 0;
|
core.status.event.selection = 0;
|
||||||
core.ui._drawSyncSave();
|
core.ui._drawSyncSave();
|
||||||
}
|
},
|
||||||
|
true
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
// 只覆盖单存档
|
// 只覆盖单存档
|
||||||
|
|||||||
@ -187,7 +187,8 @@ events.prototype._gameOver_confirmUpload = function (ending, norank) {
|
|||||||
if (main.isCompetition)
|
if (main.isCompetition)
|
||||||
core.events._gameOver_confirmDownload(ending);
|
core.events._gameOver_confirmDownload(ending);
|
||||||
else core.events._gameOver_doUpload(null, ending, norank);
|
else core.events._gameOver_doUpload(null, ending, norank);
|
||||||
}
|
},
|
||||||
|
true
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -251,7 +252,8 @@ events.prototype._gameOver_confirmDownload = function (ending) {
|
|||||||
},
|
},
|
||||||
function () {
|
function () {
|
||||||
core.events._gameOver_askRate(ending);
|
core.events._gameOver_askRate(ending);
|
||||||
}
|
},
|
||||||
|
true
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -284,7 +286,8 @@ events.prototype._gameOver_askRate = function (ending) {
|
|||||||
function () {
|
function () {
|
||||||
core.ui.closePanel();
|
core.ui.closePanel();
|
||||||
core.restart();
|
core.restart();
|
||||||
}
|
},
|
||||||
|
true
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -301,7 +304,8 @@ events.prototype._gameOver_askRate = function (ending) {
|
|||||||
},
|
},
|
||||||
function () {
|
function () {
|
||||||
core.restart();
|
core.restart();
|
||||||
}
|
},
|
||||||
|
true
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -327,7 +331,8 @@ events.prototype.confirmRestart = function () {
|
|||||||
function () {
|
function () {
|
||||||
core.playSound('取消');
|
core.playSound('取消');
|
||||||
core.ui.closePanel();
|
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) {
|
if (main.replayChecking) {
|
||||||
const selected = (() => {
|
const selected = (() => {
|
||||||
const route = core.status.replay.toReplay[0];
|
const route = core.status.replay.toReplay[0];
|
||||||
@ -2243,13 +2243,15 @@ ui.prototype.drawChoices = async function (content, choices, width) {
|
|||||||
} else {
|
} else {
|
||||||
const {
|
const {
|
||||||
routedChoices,
|
routedChoices,
|
||||||
|
getChoices,
|
||||||
mainUIController,
|
mainUIController,
|
||||||
HALF_WIDTH,
|
HALF_WIDTH,
|
||||||
HALF_HEIGHT,
|
HALF_HEIGHT,
|
||||||
POP_BOX_WIDTH
|
POP_BOX_WIDTH
|
||||||
} = Mota.require('@user/client-modules');
|
} = Mota.require('@user/client-modules');
|
||||||
const choice = choices.map((v, i) => [i, v.text]);
|
const choice = choices.map((v, i) => [i, v.text]);
|
||||||
const selected = await routedChoices(
|
const fn = noRoute ? getChoices : routedChoices;
|
||||||
|
const selected = await fn(
|
||||||
mainUIController,
|
mainUIController,
|
||||||
choice,
|
choice,
|
||||||
[HALF_WIDTH, HALF_HEIGHT, void 0, void 0, 0.5, 0.5],
|
[HALF_WIDTH, HALF_HEIGHT, void 0, void 0, 0.5, 0.5],
|
||||||
@ -2282,7 +2284,7 @@ ui.prototype.drawConfirmBox = async function (
|
|||||||
text,
|
text,
|
||||||
yesCallback,
|
yesCallback,
|
||||||
noCallback,
|
noCallback,
|
||||||
ctx
|
noRoute
|
||||||
) {
|
) {
|
||||||
if (main.replayChecking) {
|
if (main.replayChecking) {
|
||||||
const confirm = (() => {
|
const confirm = (() => {
|
||||||
@ -2301,12 +2303,14 @@ ui.prototype.drawConfirmBox = async function (
|
|||||||
} else {
|
} else {
|
||||||
const {
|
const {
|
||||||
routedConfirm,
|
routedConfirm,
|
||||||
|
getConfirm,
|
||||||
mainUIController,
|
mainUIController,
|
||||||
HALF_WIDTH,
|
HALF_WIDTH,
|
||||||
HALF_HEIGHT,
|
HALF_HEIGHT,
|
||||||
POP_BOX_WIDTH
|
POP_BOX_WIDTH
|
||||||
} = Mota.require('@user/client-modules');
|
} = Mota.require('@user/client-modules');
|
||||||
const confirm = await routedConfirm(
|
const fn = noRoute ? getConfirm : routedConfirm;
|
||||||
|
const confirm = await fn(
|
||||||
mainUIController,
|
mainUIController,
|
||||||
text,
|
text,
|
||||||
[HALF_WIDTH, HALF_HEIGHT, void 0, void 0, 0.5, 0.5],
|
[HALF_WIDTH, HALF_HEIGHT, void 0, void 0, 0.5, 0.5],
|
||||||
@ -2369,7 +2373,7 @@ ui.prototype._drawQuickShop = function () {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
choices.push('返回游戏');
|
choices.push('返回游戏');
|
||||||
this.drawChoices(null, choices);
|
this.drawChoices(null, choices, void 0, true);
|
||||||
};
|
};
|
||||||
|
|
||||||
ui.prototype._drawSyncSave = function () {
|
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,
|
content: string,
|
||||||
choices: object[],
|
choices: object[],
|
||||||
width?: number,
|
width?: number,
|
||||||
ctx?: CtxRefer
|
noRoute?: CtxRefer
|
||||||
): void;
|
): void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -777,7 +777,7 @@ interface Ui {
|
|||||||
text: string,
|
text: string,
|
||||||
yesCallback?: () => void,
|
yesCallback?: () => void,
|
||||||
noCallback?: () => void,
|
noCallback?: () => void,
|
||||||
ctx?: CtxRefer
|
noRoute?: boolean
|
||||||
): void;
|
): void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user