aboutsummaryrefslogtreecommitdiff
path: root/game/src/Game/GameStart.gd
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2024-01-13 23:04:26 +0100
committer hop311 <hop3114@gmail.com>2024-01-14 12:29:22 +0100
commit03ecd41a38acff5588f01568bdf5d61067a266ce (patch)
treeac4893e2a7cc33a5f60d910717da51962a9ceef7 /game/src/Game/GameStart.gd
parentdd008b3c0aa27be0cbe9a0ed5a9811c76f9cb13a (diff)
Added mod command line option
Diffstat (limited to 'game/src/Game/GameStart.gd')
-rw-r--r--game/src/Game/GameStart.gd11
1 files changed, 8 insertions, 3 deletions
diff --git a/game/src/Game/GameStart.gd b/game/src/Game/GameStart.gd
index 4b93077..3a98dca 100644
--- a/game/src/Game/GameStart.gd
+++ b/game/src/Game/GameStart.gd
@@ -57,6 +57,7 @@ func _load_compatibility_mode() -> void:
push_warning("Exact base path and search base path arguments both used:\nBase: ", arg_base_path, "\nSearch: ", arg_search_path)
actual_base_path = arg_base_path
elif arg_search_path:
+ # This will also search for a Steam install if the hint doesn't help
actual_base_path = GameSingleton.search_for_game_path(arg_search_path)
if not actual_base_path:
push_warning("Failed to find assets using search hint: ", arg_search_path)
@@ -65,7 +66,9 @@ func _load_compatibility_mode() -> void:
if _settings_base_path:
actual_base_path = _settings_base_path
else:
- actual_base_path = GameSingleton.search_for_game_path()
+ # Check if the program is being run from inside the install directory,
+ # and if not also search for a Steam install
+ actual_base_path = GameSingleton.search_for_game_path("..")
if not actual_base_path:
var title : String = "Failed to find game asset path!"
var msg : String = "The path can be specified with the \"base-path\" command line option."
@@ -80,8 +83,10 @@ func _load_compatibility_mode() -> void:
var paths : PackedStringArray = [actual_base_path]
- # Example for adding mod paths
- #paths.push_back(actual_base_path + "/mod/TGC")
+ # Add mod paths
+ var settings_mod_names : PackedStringArray = ArgumentParser.get_argument(&"mod", "")
+ for mod_name : String in settings_mod_names:
+ paths.push_back(actual_base_path + "/mod/" + mod_name)
if GameSingleton.load_defines_compatibility_mode(paths) != OK:
push_error("Errors loading game defines!")