mirror of
https://github.com/VickScarlet/lifeRestart.git
synced 2026-03-30 05:58:03 +08:00
add github and discord
This commit is contained in:
15
src/index.js
15
src/index.js
@@ -1,6 +1,19 @@
|
||||
import App from './app.js';
|
||||
import Life from './modules/life.js';
|
||||
|
||||
globalThis.goto = async tag => {
|
||||
let url;
|
||||
switch(tag) {
|
||||
case 'github': url = 'https://github.com/VickScarlet/lifeRestart'; break;
|
||||
case 'discord': url = 'https://discord.gg/U3qrf49NMQ'; break;
|
||||
}
|
||||
try {
|
||||
window.open(url, '_blank');
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
|
||||
globalThis.$$eventMap = new Map();
|
||||
globalThis.$$event = (tag, data) => {
|
||||
const listener = $$eventMap.get(tag);
|
||||
@@ -165,5 +178,5 @@ core.config({
|
||||
],
|
||||
},
|
||||
},
|
||||
})
|
||||
});
|
||||
game.start(query);
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -4,9 +4,12 @@ export default class cyberMain extends CyberMainUI {
|
||||
this.btnRemake.on(Laya.Event.CLICK, this, ()=>UIManager.getInstance().switchView(UIManager.getInstance().themes.TALENT));
|
||||
this.btnAchievement.on(Laya.Event.CLICK, this, ()=>UIManager.getInstance().switchView(UIManager.getInstance().themes.ACHIEVEMENT));
|
||||
this.btnThanks.on(Laya.Event.CLICK, this, ()=>UIManager.getInstance().switchView(UIManager.getInstance().themes.THANKS));
|
||||
this.btnGithub.on(Laya.Event.CLICK, this, goto, ['github']);
|
||||
this.btnDiscord.on(Laya.Event.CLICK, this, goto, ['discord']);
|
||||
}
|
||||
|
||||
init() {
|
||||
this.btnDiscord.visible =
|
||||
this.btnAchievement.visible =
|
||||
this.btnThanks.visible = !!core.times;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user