feat: provide announce time for theme change.
This commit is contained in:
parent
98f180b330
commit
e050c8b166
25
game/game.js
25
game/game.js
|
@ -1563,25 +1563,30 @@ new Promise(resolve=>{
|
||||||
node.menu=ui.create.div(node,'','<div></div><div></div><div></div><div></div>');
|
node.menu=ui.create.div(node,'','<div></div><div></div><div></div><div></div>');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onclick:function(theme){
|
onclick:gnc.of(function*(theme){
|
||||||
game.saveConfig('theme',theme);
|
game.saveConfig('theme',theme);
|
||||||
ui.arena.hide();
|
ui.arena.hide();
|
||||||
lib.init.background();
|
lib.init.background();
|
||||||
if(lib.config.autostyle){
|
if(lib.config.autostyle){
|
||||||
if(theme=='simple'){
|
if(theme === "simple"){
|
||||||
lib.configMenu.appearence.config.player_border.onclick('slim');
|
lib.configMenu.appearence.config.player_border.onclick("slim");
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
lib.configMenu.appearence.config.player_border.onclick('normal');
|
lib.configMenu.appearence.config.player_border.onclick("normal");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
setTimeout(function(){
|
lib.announce.publish("Noname.Apperaence.Theme.onChanging", theme);
|
||||||
var theme=ui.css.theme;
|
yield new Promise(resolve => setTimeout(resolve, 500));
|
||||||
|
|
||||||
|
const deletingTheme = ui.css.theme;
|
||||||
ui.css.theme=lib.init.css(lib.assetURL+'theme/'+lib.config.theme,'style');
|
ui.css.theme=lib.init.css(lib.assetURL+'theme/'+lib.config.theme,'style');
|
||||||
theme.remove();
|
deletingTheme.remove();
|
||||||
setTimeout(function(){ui.arena.show();},100);
|
lib.announce.publish("Noname.Apperaence.Theme.onChanged", theme);
|
||||||
},500);
|
yield new Promise(resolve => setTimeout(resolve, 100));
|
||||||
}
|
|
||||||
|
ui.arena.show();
|
||||||
|
lib.announce.publish("Noname.Apperaence.Theme.onChangeFinished", theme);
|
||||||
|
})
|
||||||
},
|
},
|
||||||
layout:{
|
layout:{
|
||||||
name:'布局',
|
name:'布局',
|
||||||
|
|
Loading…
Reference in New Issue