mirror of
https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
synced 2025-10-22 23:48:11 +00:00
Merge pull request #182 from KustaaGames/main
Added a Frame Limit Option
This commit is contained in:
@@ -257,7 +257,7 @@ size_flags_vertical = 3
|
|||||||
theme_override_constants/separation = -4
|
theme_override_constants/separation = -4
|
||||||
script = ExtResource("4_avtty")
|
script = ExtResource("4_avtty")
|
||||||
category_name = "SETTINGS_VIDEO"
|
category_name = "SETTINGS_VIDEO"
|
||||||
options = [NodePath("Language"), NodePath("WindowMode"), NodePath("Size"), NodePath("Visuals"), NodePath("Scaling"), NodePath("VSync"), NodePath("DropShadows"), NodePath("HudStyle")]
|
options = [NodePath("Language"), NodePath("WindowMode"), NodePath("Size"), NodePath("Visuals"), NodePath("Scaling"), NodePath("VSync"), NodePath("DropShadows"), NodePath("HudStyle"), NodePath("FrameLimit")]
|
||||||
|
|
||||||
[node name="Control" type="Control" parent="PanelContainer/MarginContainer/VBoxContainer/Video"]
|
[node name="Control" type="Control" parent="PanelContainer/MarginContainer/VBoxContainer/Video"]
|
||||||
custom_minimum_size = Vector2(0, 4)
|
custom_minimum_size = Vector2(0, 4)
|
||||||
@@ -321,6 +321,12 @@ option_key = "hud_scaling"
|
|||||||
title = "VIDEO_HUD_SCALING"
|
title = "VIDEO_HUD_SCALING"
|
||||||
values = ["VIDEO_HUD_STRETCHED", "VIDEO_HUD_CENTER"]
|
values = ["VIDEO_HUD_STRETCHED", "VIDEO_HUD_CENTER"]
|
||||||
|
|
||||||
|
[node name="FrameLimit" parent="PanelContainer/MarginContainer/VBoxContainer/Video" instance=ExtResource("3_dl6kk")]
|
||||||
|
layout_mode = 2
|
||||||
|
option_key = "frame_limit"
|
||||||
|
title = "FRAME LIMIT"
|
||||||
|
values = ["Unlimited", "60fps", "120fps", "144fps", "240fps"]
|
||||||
|
|
||||||
[node name="WindowChanger" type="Node" parent="PanelContainer/MarginContainer/VBoxContainer/Video"]
|
[node name="WindowChanger" type="Node" parent="PanelContainer/MarginContainer/VBoxContainer/Video"]
|
||||||
script = ExtResource("5_hnwhb")
|
script = ExtResource("5_hnwhb")
|
||||||
|
|
||||||
@@ -884,6 +890,7 @@ script = ExtResource("19_k6yev")
|
|||||||
[connection signal="value_changed" from="PanelContainer/MarginContainer/VBoxContainer/Video/VSync" to="PanelContainer/MarginContainer/VBoxContainer/Video/WindowChanger" method="vsync_changed"]
|
[connection signal="value_changed" from="PanelContainer/MarginContainer/VBoxContainer/Video/VSync" to="PanelContainer/MarginContainer/VBoxContainer/Video/WindowChanger" method="vsync_changed"]
|
||||||
[connection signal="value_changed" from="PanelContainer/MarginContainer/VBoxContainer/Video/DropShadows" to="PanelContainer/MarginContainer/VBoxContainer/Video/WindowChanger" method="drop_shadows_changed"]
|
[connection signal="value_changed" from="PanelContainer/MarginContainer/VBoxContainer/Video/DropShadows" to="PanelContainer/MarginContainer/VBoxContainer/Video/WindowChanger" method="drop_shadows_changed"]
|
||||||
[connection signal="value_changed" from="PanelContainer/MarginContainer/VBoxContainer/Video/HudStyle" to="PanelContainer/MarginContainer/VBoxContainer/Video/WindowChanger" method="hud_style_changed"]
|
[connection signal="value_changed" from="PanelContainer/MarginContainer/VBoxContainer/Video/HudStyle" to="PanelContainer/MarginContainer/VBoxContainer/Video/WindowChanger" method="hud_style_changed"]
|
||||||
|
[connection signal="value_changed" from="PanelContainer/MarginContainer/VBoxContainer/Video/FrameLimit" to="PanelContainer/MarginContainer/VBoxContainer/Video/WindowChanger" method="frame_limit_changed"]
|
||||||
[connection signal="value_changed" from="PanelContainer/MarginContainer/VBoxContainer/Audio/SelectableOptionNode" to="PanelContainer/MarginContainer/VBoxContainer/Audio/AudioAdjuster" method="master_changed"]
|
[connection signal="value_changed" from="PanelContainer/MarginContainer/VBoxContainer/Audio/SelectableOptionNode" to="PanelContainer/MarginContainer/VBoxContainer/Audio/AudioAdjuster" method="master_changed"]
|
||||||
[connection signal="value_changed" from="PanelContainer/MarginContainer/VBoxContainer/Audio/SelectableOptionNode2" to="PanelContainer/MarginContainer/VBoxContainer/Audio/AudioAdjuster" method="music_changed"]
|
[connection signal="value_changed" from="PanelContainer/MarginContainer/VBoxContainer/Audio/SelectableOptionNode2" to="PanelContainer/MarginContainer/VBoxContainer/Audio/AudioAdjuster" method="music_changed"]
|
||||||
[connection signal="value_changed" from="PanelContainer/MarginContainer/VBoxContainer/Audio/SelectableOptionNode3" to="PanelContainer/MarginContainer/VBoxContainer/Audio/AudioAdjuster" method="sfx_changed"]
|
[connection signal="value_changed" from="PanelContainer/MarginContainer/VBoxContainer/Audio/SelectableOptionNode3" to="PanelContainer/MarginContainer/VBoxContainer/Audio/AudioAdjuster" method="sfx_changed"]
|
||||||
|
@@ -8,7 +8,8 @@ var file := {
|
|||||||
"drop_shadows": 1,
|
"drop_shadows": 1,
|
||||||
"scaling": 0,
|
"scaling": 0,
|
||||||
"visuals": 0,
|
"visuals": 0,
|
||||||
"hud_size": 0
|
"hud_size": 0,
|
||||||
|
"frame_limit" : 0,
|
||||||
},
|
},
|
||||||
"audio": {
|
"audio": {
|
||||||
"master": 10.0,
|
"master": 10.0,
|
||||||
|
@@ -22,6 +22,7 @@ func window_size_changed(new_value := 0) -> void:
|
|||||||
|
|
||||||
func vsync_changed(new_value := 0) -> void:
|
func vsync_changed(new_value := 0) -> void:
|
||||||
DisplayServer.window_set_vsync_mode(DisplayServer.VSYNC_ENABLED if new_value == 1 else DisplayServer.VSYNC_DISABLED)
|
DisplayServer.window_set_vsync_mode(DisplayServer.VSYNC_ENABLED if new_value == 1 else DisplayServer.VSYNC_DISABLED)
|
||||||
|
|
||||||
Settings.file.video.vsync = new_value
|
Settings.file.video.vsync = new_value
|
||||||
|
|
||||||
func drop_shadows_changed(new_value := 0) -> void:
|
func drop_shadows_changed(new_value := 0) -> void:
|
||||||
@@ -44,6 +45,20 @@ func language_changed(new_value := 0) -> void:
|
|||||||
Settings.file.game.lang = Global.lang_codes[new_value]
|
Settings.file.game.lang = Global.lang_codes[new_value]
|
||||||
%Flag.region_rect.position.x = new_value * 16
|
%Flag.region_rect.position.x = new_value * 16
|
||||||
|
|
||||||
|
func frame_limit_changed(new_value := 0) -> void:
|
||||||
|
print_debug(str(new_value))
|
||||||
|
|
||||||
|
var new_framerate := 0
|
||||||
|
match new_value:
|
||||||
|
|
||||||
|
1: new_framerate = 60
|
||||||
|
2: new_framerate = 120
|
||||||
|
3: new_framerate = 144
|
||||||
|
4: new_framerate = 240
|
||||||
|
|
||||||
|
Engine.max_fps = new_framerate
|
||||||
|
Settings.file.video.frame_limit = new_value
|
||||||
|
|
||||||
func set_value(value_name := "", value := 0) -> void:
|
func set_value(value_name := "", value := 0) -> void:
|
||||||
{
|
{
|
||||||
"mode": window_mode_changed,
|
"mode": window_mode_changed,
|
||||||
@@ -54,5 +69,6 @@ func set_value(value_name := "", value := 0) -> void:
|
|||||||
"visuals": visuals_changed,
|
"visuals": visuals_changed,
|
||||||
"palette": null_function,
|
"palette": null_function,
|
||||||
"hud_size": hud_style_changed,
|
"hud_size": hud_style_changed,
|
||||||
"hud_style": hud_style_changed
|
"hud_style": hud_style_changed,
|
||||||
|
"frame_limit": frame_limit_changed,
|
||||||
}[value_name].call(value)
|
}[value_name].call(value)
|
||||||
|
Reference in New Issue
Block a user