mirror of
https://github.com/VickScarlet/lifeRestart.git
synced 2026-08-30 02:24:42 +08:00
add: channel switch
This commit is contained in:
+29
-24
@@ -1,38 +1,43 @@
|
||||
export default class CyberMain extends ui.view.CyberTheme.CyberMainUI {
|
||||
constructor() {
|
||||
super();
|
||||
this.btnRemake.on(Laya.Event.CLICK, this, ()=>$ui.switchView(UI.pages.MODE));
|
||||
this.btnAchievement.on(Laya.Event.CLICK, this, ()=>$ui.switchView(UI.pages.ACHIEVEMENT));
|
||||
this.btnThanks.on(Laya.Event.CLICK, this, ()=>$ui.switchView(UI.pages.THANKS));
|
||||
this.btnGithub.on(Laya.Event.CLICK, this, goto, ['github']);
|
||||
this.btnDiscord.on(Laya.Event.CLICK, this, goto, ['discord']);
|
||||
this.btnThemes.on(Laya.Event.CLICK, this, ()=>$ui.showDialog(UI.pages.THEMES));
|
||||
this.btnSaveLoad.on(Laya.Event.CLICK, this, ()=>$ui.showDialog(UI.pages.SAVELOAD));
|
||||
super()
|
||||
this.btnRemake.on(Laya.Event.CLICK, this, () => $ui.switchView(UI.pages.MODE))
|
||||
this.btnAchievement.on(Laya.Event.CLICK, this, () => $ui.switchView(UI.pages.ACHIEVEMENT))
|
||||
this.btnThanks.on(Laya.Event.CLICK, this, () => $ui.switchView(UI.pages.THANKS))
|
||||
this.btnGithub.on(Laya.Event.CLICK, this, goto, ['github'])
|
||||
this.btnDiscord.on(Laya.Event.CLICK, this, goto, ['discord'])
|
||||
this.btnThemes.on(Laya.Event.CLICK, this, () => $ui.showDialog(UI.pages.THEMES))
|
||||
this.btnSaveLoad.on(Laya.Event.CLICK, this, () => $ui.showDialog(UI.pages.SAVELOAD))
|
||||
this.on(Laya.Event.RESIZE, this, () => {
|
||||
const scale = Math.max(
|
||||
this.width / this.imgBg.width,
|
||||
this.height / this.imgBg.height
|
||||
);
|
||||
this.imgBg.scale(scale, scale);
|
||||
});
|
||||
this.height / this.imgBg.height,
|
||||
)
|
||||
this.imgBg.scale(scale, scale)
|
||||
})
|
||||
}
|
||||
|
||||
static load() {
|
||||
return [
|
||||
"fonts/方正像素12.ttf",
|
||||
"images/atlas/images/accessories.atlas",
|
||||
"images/atlas/images/border.atlas",
|
||||
"images/atlas/images/button.atlas",
|
||||
"images/atlas/images/icons.atlas",
|
||||
"images/atlas/images/progress.atlas",
|
||||
"images/atlas/images/slider.atlas",
|
||||
'fonts/方正像素12.ttf',
|
||||
'images/atlas/images/accessories.atlas',
|
||||
'images/atlas/images/border.atlas',
|
||||
'images/atlas/images/button.atlas',
|
||||
'images/atlas/images/icons.atlas',
|
||||
'images/atlas/images/progress.atlas',
|
||||
'images/atlas/images/slider.atlas',
|
||||
]
|
||||
}
|
||||
|
||||
init() {
|
||||
this.banner.visible =
|
||||
this.btnDiscord.visible =
|
||||
this.btnAchievement.visible =
|
||||
this.btnThanks.visible = !!core.times;
|
||||
const leastOnce = !!core.times
|
||||
this.banner.visible = leastOnce
|
||||
this.btnAchievement.visible = leastOnce
|
||||
this.btnThanks.visible = leastOnce
|
||||
|
||||
const disabled = globalThis.$channel?.disabled || {}
|
||||
this.btnDiscord.visible = leastOnce && !disabled.discord
|
||||
this.btnGithub.visible = !disabled.github
|
||||
this.btnSaveLoad.visible = !disabled.saveload
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user