diff options
author | tpart <tpart120@proton.me> | 2024-07-30 19:09:24 +0200 |
---|---|---|
committer | tpart <tpart120@proton.me> | 2024-07-30 19:09:24 +0200 |
commit | 384cf75485be9ede9b5dad8c735d6b9fc33e5bb8 (patch) | |
tree | 74602829c56be568fb46dc9ae5fbcd2cc59734cc /client/global.gd | |
parent | 81a09080594e0b29a6b367fe3b3dff51ddefdfb9 (diff) | |
download | hurrycurry-384cf75485be9ede9b5dad8c735d6b9fc33e5bb8.tar hurrycurry-384cf75485be9ede9b5dad8c735d6b9fc33e5bb8.tar.bz2 hurrycurry-384cf75485be9ede9b5dad8c735d6b9fc33e5bb8.tar.zst |
Add ui scale factor setting; Add more options to range settings to specify step
Diffstat (limited to 'client/global.gd')
-rw-r--r-- | client/global.gd | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/client/global.gd b/client/global.gd index 82409ae4..0d62931b 100644 --- a/client/global.gd +++ b/client/global.gd @@ -53,7 +53,8 @@ var default_settings := { "usernames": ToggleSetting.new(tr("Show username tags"), true), "server_binary": TextSetting.new(tr("Server binary (leave empty to search PATH)"), "", tr("Enter path")), "server_data": TextSetting.new(tr("Server data directory (leave empty to auto-detect)"), "", tr("Enter path")), - "ui_scale": DropdownSetting.new(tr("UI scale"), 0, [tr("Resize"), tr("Disabled")]), + "ui_scale_mode": DropdownSetting.new(tr("UI scale mode"), 0, [tr("Resize"), tr("Disabled")]), + "ui_scale_factor": RangeSetting.new(tr("UI scale factor"), 1, 0.5, 1.5, 3), "aa": DropdownSetting.new(tr("Anti-aliasing"), 2 if on_high_end() else 0, [tr("Disabled"), "FXAA", "MSAA 2x", "MSAA 4x"]), "ssao": ToggleSetting.new(tr("Ambient occlusion"), true if on_high_end() else false), "taa": ToggleSetting.new(tr("Temporal Anti-Aliasing"), false), @@ -62,7 +63,7 @@ var default_settings := { "shadows": ToggleSetting.new(tr("Enable shadows"), true if on_high_end() else false), "glow": ToggleSetting.new(tr("Enable glow"), true if on_high_end() else false), "debug_info": ToggleSetting.new(tr("Display debug info (Framerate, etc.)"), false), - "grass_amount": RangeSetting.new(tr("3D grass amount per grass tile"), 16 if on_high_end() else 0, 0, 32), + "grass_amount": RangeSetting.new(tr("3D grass amount per grass tile"), 16 if on_high_end() else 0, 0, 32, false), "lq_trees": ToggleSetting.new(tr("Low-poly trees"), false if on_high_end() else true), "setup_complete": ToggleSetting.new(tr("Initial setup complete. (Uncheck and restart to reenter)"), false), "tutorial_started": ToggleSetting.new(tr("Tutorial started"), false), @@ -85,7 +86,6 @@ func _ready(): get_viewport().gui_focus_changed.connect(Sound.play_hover_maybe) get_viewport().gui_focus_changed.connect(func (node): focused_node = node) - func _input(event): if Input.is_action_just_pressed("fullscreen"): match Global.get_setting("fullscreen"): @@ -151,12 +151,16 @@ func apply_settings(): # Temporal Anti-aliasing get_viewport().use_taa = get_setting("taa") - # UI scale - match get_setting("ui_scale"): + # UI scale mode + match get_setting("ui_scale_mode"): 0: get_tree().root.content_scale_mode = Window.CONTENT_SCALE_MODE_CANVAS_ITEMS 1: get_tree().root.content_scale_mode = Window.CONTENT_SCALE_MODE_DISABLED + + # UI scale factor + get_tree().root.content_scale_factor = get_setting("ui_scale_factor") + print("SCALE FACTOR ", get_tree().root.content_scale_factor) # Hints if not get_setting("tutorial_started"): |