implement save and load settings

This commit is contained in:
LabyStudio
2022-02-12 22:42:35 +01:00
parent f4ac35665f
commit 9e0045f807
5 changed files with 36 additions and 2 deletions
+6
View File
@@ -13,6 +13,7 @@ window.Minecraft = class {
this.timer = new Timer(20);
this.settings = new GameSettings();
this.settings.load();
// Create window and world renderer
this.window = new GameWindow(this, canvasWrapperId);
@@ -139,6 +140,11 @@ window.Minecraft = class {
return;
}
// Close previous screen
if (!(this.currentScreen === null)) {
this.currentScreen.onClose();
}
// Switch screen
this.currentScreen = screen;