mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-01-31 23:19:35 +08:00
refactor: 优化ui控制器
This commit is contained in:
parent
669ad11c82
commit
9a97a470f1
@ -2317,7 +2317,7 @@ control.prototype._doSL_load = function (id, callback) {
|
||||
1
|
||||
)[0];
|
||||
if (!main.replayChecking) {
|
||||
mota.ui.fixed.open('start');
|
||||
mota.ui.fixed.closeByName('start');
|
||||
}
|
||||
if (core.isPlaying() && !core.status.gameOver) {
|
||||
core.control.autosave(0);
|
||||
|
@ -64,32 +64,19 @@ fixedUi.register(
|
||||
);
|
||||
|
||||
hook.once('mounted', () => {
|
||||
const ui = document.getElementById('ui-main')!;
|
||||
const fixed = document.getElementById('ui-fixed')!;
|
||||
|
||||
mainUi.on('start', () => {
|
||||
const ui = document.getElementById('ui-main');
|
||||
if (ui) {
|
||||
ui.style.display = 'flex';
|
||||
}
|
||||
ui.style.display = 'flex';
|
||||
});
|
||||
mainUi.on('end', () => {
|
||||
const ui = document.getElementById('ui-main');
|
||||
if (ui) {
|
||||
ui.style.display = 'none';
|
||||
}
|
||||
ui.style.display = 'none';
|
||||
});
|
||||
fixedUi.on('start', () => {
|
||||
console.log(1);
|
||||
const ui = document.getElementById('ui-fixed');
|
||||
if (ui) {
|
||||
ui.style.display = 'block';
|
||||
}
|
||||
fixed.style.display = 'block';
|
||||
});
|
||||
fixedUi.on('end', () => {
|
||||
console.log(1);
|
||||
const ui = document.getElementById('ui-fixed');
|
||||
if (ui) {
|
||||
ui.style.display = 'none';
|
||||
}
|
||||
fixed.style.display = 'none';
|
||||
});
|
||||
|
||||
mainUi.focusByNum(fixedUi.open('start'));
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user