diff options
Diffstat (limited to 'game/src/Game/Autoload')
-rw-r--r-- | game/src/Game/Autoload/Argument/ArgumentParser.gd | 4 | ||||
-rw-r--r-- | game/src/Game/Autoload/GameLoader.gd | 12 | ||||
-rw-r--r-- | game/src/Game/Autoload/WindowOverride.gd | 27 |
3 files changed, 28 insertions, 15 deletions
diff --git a/game/src/Game/Autoload/Argument/ArgumentParser.gd b/game/src/Game/Autoload/Argument/ArgumentParser.gd index b463c74..b012215 100644 --- a/game/src/Game/Autoload/Argument/ArgumentParser.gd +++ b/game/src/Game/Autoload/Argument/ArgumentParser.gd @@ -309,10 +309,8 @@ Options: ("Type: %s - Default Value: %s" % [option.get_type_string(), option.default_value]).rpad(45), option.description ]) + func _ready(): if Engine.is_editor_hint(): return _set_argument_setting() GameDebug._singleton = GameDebug.new() - if get_argument(&"help"): - _print_help() - get_tree().quit() diff --git a/game/src/Game/Autoload/GameLoader.gd b/game/src/Game/Autoload/GameLoader.gd index 1720e3c..8c14c7e 100644 --- a/game/src/Game/Autoload/GameLoader.gd +++ b/game/src/Game/Autoload/GameLoader.gd @@ -1,17 +1,5 @@ extends Node -var define_filepaths_dict : Dictionary = { - GameSingleton.get_province_identifier_file_key(): "res://common/map/provinces.json", - GameSingleton.get_water_province_file_key(): "res://common/map/water.json", - GameSingleton.get_region_file_key(): "res://common/map/regions.json", - GameSingleton.get_terrain_variant_file_key(): "res://common/map/terrain.json", - GameSingleton.get_terrain_texture_dir_key(): "res://art/terrain/", - GameSingleton.get_province_image_file_key(): "res://common/map/provinces.png", - GameSingleton.get_terrain_image_file_key(): "res://common/map/terrain.png", - GameSingleton.get_goods_file_key(): "res://common/goods.json", - GameSingleton.get_good_icons_dir_key(): "res://art/economy/goods" -} - var ShaderManager : ShaderManagerClass func _init(): diff --git a/game/src/Game/Autoload/WindowOverride.gd b/game/src/Game/Autoload/WindowOverride.gd new file mode 100644 index 0000000..837570e --- /dev/null +++ b/game/src/Game/Autoload/WindowOverride.gd @@ -0,0 +1,27 @@ +extends Node + +const VideoOptions = preload("res://src/Game/Menu/OptionMenu/VideoTab.tscn") + +func _init(): + var window_id := DisplayServer.get_window_list()[0] + DisplayServer.window_set_size(Vector2(1280.0, 720.0), window_id) + +func _ready(): + if ArgumentParser.get_argument(&"help"): return + _on_SceneTree_idle() + # Hack to ensure Video Options load + var video := VideoOptions.instantiate() + video.visible = false + add_child(video) + video.queue_free() + +func _on_SceneTree_idle(): + var window := get_window() + window.set_mode(Window.MODE_FULLSCREEN) + await get_tree().process_frame + window.transparent = false + window.borderless = false + var screen_pos := DisplayServer.screen_get_position(window.current_screen) + var screen_size := DisplayServer.screen_get_size(window.current_screen) + window.position = screen_pos + (screen_size - window.size) / 2 + ProjectSettings.set_setting.call_deferred("display/window/per_pixel_transparency/allowed", false) |