mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-09-17 11:11:47 +08:00
fix: 打字机速度 & 选择框确认框界面按键报错
This commit is contained in:
parent
b74c61b8ba
commit
1ce79154d2
@ -94,7 +94,7 @@ export const ConfirmBox = defineComponent<
|
||||
});
|
||||
const yesText = computed(() => props.yesText ?? '确认');
|
||||
const noText = computed(() => props.noText ?? '取消');
|
||||
const pad = computed(() => props.pad ?? 32);
|
||||
const pad = computed(() => props.pad ?? 24);
|
||||
const yesLoc = computed<ElementLocator>(() => {
|
||||
const y = height.value - pad.value;
|
||||
return [props.width / 3, y, void 0, void 0, 0.5, 1];
|
||||
|
@ -462,7 +462,7 @@ export class TextContentTyper extends EventEmitter<TextContentTyperEvent> {
|
||||
renderable.cut = false;
|
||||
const chars = renderable.text.length - renderable.pointer;
|
||||
if (chars >= rest) {
|
||||
renderable.pointer += chars;
|
||||
renderable.pointer += rest;
|
||||
return false;
|
||||
} else {
|
||||
renderable.pointer = renderable.text.length;
|
||||
@ -1257,7 +1257,7 @@ export class TextContentParser {
|
||||
if (
|
||||
breakChars.has(char) ||
|
||||
isCJK(char.charCodeAt(0)) ||
|
||||
isCJK(next.charCodeAt(0))
|
||||
isCJK(next?.charCodeAt(0))
|
||||
) {
|
||||
this.wordBreak.push(pointer + 1);
|
||||
const rest = width - this.lineWidth;
|
||||
|
@ -1222,21 +1222,7 @@ actions.prototype._clickAction = function (x, y, px, py) {
|
||||
};
|
||||
|
||||
////// 自定义事件时,按下某个键的操作 //////
|
||||
actions.prototype._keyDownAction = function (keycode) {
|
||||
if (core.status.event.data.type == 'choices') {
|
||||
this._keyDownChoices(keycode);
|
||||
return;
|
||||
}
|
||||
if (
|
||||
core.status.event.data.type == 'confirm' &&
|
||||
(keycode == 37 || keycode == 39)
|
||||
) {
|
||||
core.status.event.selection = 1 - core.status.event.selection;
|
||||
core.playSound('光标移动');
|
||||
core.drawConfirmBox(core.status.event.ui.text);
|
||||
return;
|
||||
}
|
||||
};
|
||||
actions.prototype._keyDownAction = function (keycode) {};
|
||||
|
||||
////// 自定义事件时,放开某个键的操作 //////
|
||||
actions.prototype._keyUpAction = function (keycode) {
|
||||
|
Loading…
Reference in New Issue
Block a user