From f27d152cb3de31372d42da3bdf47b11587ba2844 Mon Sep 17 00:00:00 2001 From: Kiisu_Master <142301391+Kiisu-Master@users.noreply.github.com> Date: Tue, 30 Jul 2024 19:02:10 +0300 Subject: [PATCH] Add setting for Godots low processor usage mode (#1056) * Add setting for Godots low processor usage mode * Update name and description of low processor usage mode setting in preferences * Fix a tiny mistake --- src/Autoload/Global.gd | 4 ++++ src/Preferences/PreferencesDialog.gd | 6 ++++++ src/Preferences/PreferencesDialog.tscn | 13 +++++++++++++ 3 files changed, 23 insertions(+) diff --git a/src/Autoload/Global.gd b/src/Autoload/Global.gd index f29a267c2..52f5b35a4 100644 --- a/src/Autoload/Global.gd +++ b/src/Autoload/Global.gd @@ -475,6 +475,10 @@ var fps_limit := 0: ## Found in Preferences. Affects the per_pixel_transparency project setting. ## If [code]true[/code], it allows for the window to be transparent. ## This affects performance, so keep it [code]false[/code] if you don't need it. +var update_continuously := false: + set(value): + update_continuously = value + OS.low_processor_usage_mode = !value var window_transparency := false: set(value): if value == window_transparency: diff --git a/src/Preferences/PreferencesDialog.gd b/src/Preferences/PreferencesDialog.gd index 827243408..bea75ff3e 100644 --- a/src/Preferences/PreferencesDialog.gd +++ b/src/Preferences/PreferencesDialog.gd @@ -175,6 +175,12 @@ var preferences: Array[Preference] = [ "button_pressed", true ), + Preference.new( + "update_continuously", + "Performance/PerformanceContainer/UpdateContinuously", + "button_pressed", + false + ), Preference.new( "window_transparency", "Performance/PerformanceContainer/WindowTransparency", diff --git a/src/Preferences/PreferencesDialog.tscn b/src/Preferences/PreferencesDialog.tscn index 2d3a404a9..dd1a040fd 100644 --- a/src/Preferences/PreferencesDialog.tscn +++ b/src/Preferences/PreferencesDialog.tscn @@ -1058,6 +1058,19 @@ mouse_default_cursor_shape = 2 button_pressed = true text = "On" +[node name="UpdateContinuouslyLabel" type="Label" parent="HSplitContainer/VBoxContainer/ScrollContainer/RightSide/Performance/PerformanceContainer"] +layout_mode = 2 +tooltip_text = "If this is toggled on, the application will redraw the screen continuously, even while it's not used. Turning this off helps lower CPU and GPU usage when idle." +mouse_filter = 0 +text = "Update Continuously" + +[node name="UpdateContinuously" type="CheckBox" parent="HSplitContainer/VBoxContainer/ScrollContainer/RightSide/Performance/PerformanceContainer"] +layout_mode = 2 +tooltip_text = "If this is toggled on, the application will redraw the screen continuously, even while it's not used. Turning this off helps lower CPU and GPU usage when idle." +mouse_default_cursor_shape = 2 +button_pressed = true +text = "On" + [node name="WindowTransparencyLabel" type="Label" parent="HSplitContainer/VBoxContainer/ScrollContainer/RightSide/Performance/PerformanceContainer"] layout_mode = 2 tooltip_text = "If enabled, the application window can become transparent. This affects performance, so keep it off if you don't need it."