diff options
| author | metamuffin <metamuffin@disroot.org> | 2024-09-07 03:31:36 +0200 | 
|---|---|---|
| committer | metamuffin <metamuffin@disroot.org> | 2024-09-07 03:31:36 +0200 | 
| commit | 78b7ec6ef9e343731cc496f11c76a0a3e5f37220 (patch) | |
| tree | 1bef1af129d3b1ff1e5ccd36dff7cc9c8bd302d9 /client/settings.gd | |
| parent | 239619be774855b372eea82213b4d8da2d906f52 (diff) | |
| parent | fd737a6399cd201f5f3a22df5db27fac095e63bf (diff) | |
| download | hurrycurry-78b7ec6ef9e343731cc496f11c76a0a3e5f37220.tar hurrycurry-78b7ec6ef9e343731cc496f11c76a0a3e5f37220.tar.bz2 hurrycurry-78b7ec6ef9e343731cc496f11c76a0a3e5f37220.tar.zst | |
Merge branch 'new-settings' of codeberg.org:hurrycurry/hurrycurry into new-settings
Diffstat (limited to 'client/settings.gd')
| -rw-r--r-- | client/settings.gd | 27 | 
1 files changed, 15 insertions, 12 deletions
| diff --git a/client/settings.gd b/client/settings.gd index 1c03ca5a..cb8f9cf0 100644 --- a/client/settings.gd +++ b/client/settings.gd @@ -81,8 +81,8 @@ static func get_root():  		SettingsCategory.new("ui", [  			DropdownSetting.new("touch_controls", 0, ["automatic", "enabled", "disabled"]),  			DropdownSetting.new("language", "system", Global.languages.map(func(e): return e[1])), -			DropdownSetting.new("ui_scale_mode", "resize", ["resize", "disabled"]), -			RangeSetting.new("ui_scale_factor", 1. if not Global.on_mobile() else 1.5, 0.5, 1.5, 3), +			DropdownSetting.new("scale_mode", "resize", ["resize", "disabled"]), +			RangeSetting.new("scale_factor", 1. if not Global.on_mobile() else 1.5, 0.5, 1.5, 3),  		]),  		SettingsCategory.new("input",  			InputManager.input_map_to_settings(InputManager.default_input_map) @@ -93,12 +93,17 @@ static func get_root():  		])  	]) -static func hook_changed(key: String, callable): +static func hook_changed(key: String, callable: Callable):  	change_hooks[key] = callable +static func hook_changed_init(key: String, callable: Callable): +	hook_changed(key, callable) +	callable.call(Global.get_setting(key)) +  static var change_hooks = {  	"graphics.aa": h_aa,  	"graphics.taa": h_taa, +	"ui.scale_mode": h_scale_mode,  }  static func h_aa(mode): @@ -123,19 +128,17 @@ static func h_aa(mode):  static func h_taa(enabled):  	Global.get_viewport().use_taa = enabled +static func h_scale_mode(mode: int): +	match mode: +		0: +			Global.get_tree().root.content_scale_mode = Window.CONTENT_SCALE_MODE_CANVAS_ITEMS +		1: +			Global.get_tree().root.content_scale_mode = Window.CONTENT_SCALE_MODE_DISABLED +  # func apply_settings():  # 	update_fullscreen()  # 	update_language() -# 	# Temporal Anti-aliasing - -# 	# 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") | 
