1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2026-03-02 03:39:21 +00:00

Fix language choose

This commit is contained in:
tobspr
2020-10-08 11:06:56 +02:00
parent b54ecdc906
commit 7744712f39
4 changed files with 174 additions and 163 deletions

View File

@@ -320,20 +320,23 @@ export class MainMenuState extends GameState {
});
optionSelected.add(value => {
this.app.settings.updateLanguage(value);
if (setting.restartRequired) {
if (this.app.platformWrapper.getSupportsRestart()) {
this.app.platformWrapper.performRestart();
} else {
this.dialogs.showInfo(T.dialogs.restartRequired.title, T.dialogs.restartRequired.text, [
"ok:good",
]);
this.app.settings.updateLanguage(value).then(() => {
if (setting.restartRequired) {
if (this.app.platformWrapper.getSupportsRestart()) {
this.app.platformWrapper.performRestart();
} else {
this.dialogs.showInfo(
T.dialogs.restartRequired.title,
T.dialogs.restartRequired.text,
["ok:good"]
);
}
}
}
if (setting.changeCb) {
setting.changeCb(this.app, value);
}
if (setting.changeCb) {
setting.changeCb(this.app, value);
}
});
// Update current icon
this.htmlElement.querySelector("button.languageChoose").setAttribute("data-languageIcon", value);