mirror of
https://github.com/unanmed/HumanBreak.git
synced 2026-11-04 19:04:32 +08:00
feat: 小贴士
This commit is contained in:
1 parent
dbbc0f0d76
commit
3eab0b6cc5
7 files changed
+102
-39
No files matched your search
@@ -1,7 +1,8 @@
|
||||
// @ts-nocheck
|
||||
|
||||
export function init() {
|
||||
const { mainUi, fixedUi } = Mota.requireAll('var');
|
||||
const { mainUi, fixedUi, mainSetting } = Mota.requireAll('var');
|
||||
const CustomToolbar = Mota.require('class', 'CustomToolbar');
|
||||
|
||||
ui.prototype.drawBook = function () {
|
||||
if (!core.isReplaying()) return mainUi.open('book');
|
||||
@@ -35,18 +36,21 @@ export function init() {
|
||||
// todo: 多个状态栏分离与控制
|
||||
control.prototype.showStatusBar = function () {
|
||||
if (main.mode == 'editor') return;
|
||||
const CustomToolbar = Mota.require('class', 'CustomToolbar');
|
||||
const defaultsTool = CustomToolbar.get('@defaults');
|
||||
core.removeFlag('hideStatusBar');
|
||||
if (!fixedUi.hasName('statusBar')) {
|
||||
fixedUi.open('statusBar');
|
||||
}
|
||||
defaultsTool?.show();
|
||||
if (mainSetting.getValue('ui.tips')) {
|
||||
if (!fixedUi.hasName('tips')) {
|
||||
fixedUi.open('tips');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
control.prototype.hideStatusBar = function (showToolbox) {
|
||||
if (main.mode == 'editor') return;
|
||||
const CustomToolbar = Mota.require('class', 'CustomToolbar');
|
||||
const defaultsTool = CustomToolbar.get('@defaults');
|
||||
|
||||
// 如果原本就是隐藏的,则先显示
|
||||
@@ -56,6 +60,7 @@ export function init() {
|
||||
if (!showToolbox) {
|
||||
defaultsTool?.closeAll();
|
||||
}
|
||||
fixedUi.closeByName('tips');
|
||||
|
||||
core.setFlag('hideStatusBar', true);
|
||||
core.setFlag('showToolbox', showToolbox || null);
|
||||
|
||||
Reference in new issue
Block a user