diff options
author | Hop311 <hop3114@gmail.com> | 2023-09-02 13:55:36 +0200 |
---|---|---|
committer | Hop311 <hop3114@gmail.com> | 2023-09-09 22:57:26 +0200 |
commit | c715187bffa8c84428acf3631e3d03c088a719d9 (patch) | |
tree | b880594195ad803fe716c9c6184591b8b47fa42c /game/src/Game | |
parent | aa49dbbb3cf9dbff18c08245b0e46a9943df9b15 (diff) |
Followup big dataloader commit
Diffstat (limited to 'game/src/Game')
-rw-r--r-- | game/src/Game/GameStart.gd | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/game/src/Game/GameStart.gd b/game/src/Game/GameStart.gd index a5524d6..422a42a 100644 --- a/game/src/Game/GameStart.gd +++ b/game/src/Game/GameStart.gd @@ -25,12 +25,7 @@ func _ready() -> void: loading_screen.start_loading_screen(_initialize_game) -# REQUIREMENTS -# * FS-333, FS-334, FS-335, FS-341 -func _initialize_game() -> void: - GameSingleton.setup_logger() - loading_screen.try_update_loading_screen(5) - +func _load_compatibility_mode(): # Set this to your Vic2 install dir or a mod's dir to enable compatibility mode # (this won't work for mods which rely on vanilla map assets, copy missing assets # into the mod's dir for a temporary fix) @@ -48,21 +43,24 @@ func _initialize_game() -> void: # Example for adding mod paths #compatibility_mode_paths.push_back("C:/Program Files (x86)/Steam/steamapps/common/Victoria 2/mod/TGC") + if GameSingleton.load_defines_compatibility_mode(compatibility_mode_paths) != OK: + push_error("Errors loading game defines!") + +# REQUIREMENTS +# * FS-333, FS-334, FS-335, FS-341 +func _initialize_game() -> void: var start := Time.get_ticks_usec() + loading_screen.try_update_loading_screen(0) + GameSingleton.setup_logger() - loading_screen.try_update_loading_screen(15) - loading_screen.try_update_loading_screen(25) Localisation.initialize() - loading_screen.try_update_loading_screen(45) - loading_screen.try_update_loading_screen(50, true) + loading_screen.try_update_loading_screen(15, true) - # TODO: Loading takes way too long to keep the LoadingScreen at 50% - # Should either split this up or seperately multithread the compatibility mode loader - # Or both and emit a signal that allows us to add percentages to the LoadingScreen - if GameSingleton.load_defines_compatibility_mode(compatibility_mode_paths) != OK: - push_error("Errors loading game defines!") + _load_compatibility_mode() + loading_screen.try_update_loading_screen(75, true) loading_screen.try_update_loading_screen(100) + var end := Time.get_ticks_usec() print("Loading took ", float(end - start) / 1000000, " seconds") |