Skip to content

Commit

Permalink
Add setting for Godots low processor usage mode (#1056)
Browse files Browse the repository at this point in the history
* Add setting for Godots low processor usage mode

* Update name and description of low processor usage mode setting in preferences

* Fix a tiny mistake
  • Loading branch information
Kiisu-Master authored Jul 30, 2024
1 parent 7d30aed commit f27d152
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Autoload/Global.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 6 additions & 0 deletions src/Preferences/PreferencesDialog.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
13 changes: 13 additions & 0 deletions src/Preferences/PreferencesDialog.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down

0 comments on commit f27d152

Please sign in to comment.