From a46a035b2684f0308ab81f173025007b6f902ff2 Mon Sep 17 00:00:00 2001 From: tpart Date: Mon, 8 Jul 2024 00:18:02 +0200 Subject: Add UI scale setting --- client/global.gd | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'client/global.gd') diff --git a/client/global.gd b/client/global.gd index 2ee08c6b..3e46b1dc 100644 --- a/client/global.gd +++ b/client/global.gd @@ -37,6 +37,7 @@ var default_settings := { "usernames": ToggleSetting.new(tr("Show username tags"), false), "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")]), "aa": DropdownSetting.new(tr("Anti-aliasing"), 2, [tr("Disabled"), "FXAA", "MSAA 2x", "MSAA 4x"]), "ssao": ToggleSetting.new(tr("Ambient occlusion"), true), "taa": ToggleSetting.new(tr("Temporal Anti-Aliasing"), false), @@ -109,6 +110,13 @@ func apply_settings(): get_viewport().use_taa = get_setting("taa") emit_signal("settings_changed") + + # UI scale + match get_setting("ui_scale"): + 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 func update_language(): var lang_idx: int = get_setting("language") -- cgit v1.2.3-70-g09d2