add github and discord

This commit is contained in:
Vick Scarlet
2021-11-13 01:24:04 +08:00
parent bff0109cc5
commit 05e02de3db
10 changed files with 340 additions and 24 deletions

View File

@@ -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

View File

@@ -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;
}