game: add time scale slider to debug panel
This commit is contained in:
@@ -70,3 +70,7 @@ func update_debug_stats() -> void:
|
||||
value_label.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
gc.add_child(key_label)
|
||||
gc.add_child(value_label)
|
||||
|
||||
|
||||
func _on_time_scale_slider_value_changed(value: float) -> void:
|
||||
Engine.time_scale = value
|
||||
|
@@ -129,6 +129,27 @@ text = "Enemy god mode"
|
||||
layout_mode = 2
|
||||
text = "Show debug stats"
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="CanvasLayer/DebugUI/PanelContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_constants/margin_left = 6
|
||||
theme_override_constants/margin_right = 6
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="CanvasLayer/DebugUI/PanelContainer/VBoxContainer/MarginContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="CanvasLayer/DebugUI/PanelContainer/VBoxContainer/MarginContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Time scale"
|
||||
|
||||
[node name="TimeScaleSlider" type="HSlider" parent="CanvasLayer/DebugUI/PanelContainer/VBoxContainer/MarginContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
max_value = 1.0
|
||||
step = 0.1
|
||||
value = 1.0
|
||||
|
||||
[node name="StatsContainer" type="PanelContainer" parent="CanvasLayer/DebugUI"]
|
||||
layout_mode = 0
|
||||
offset_left = 938.0
|
||||
@@ -148,3 +169,4 @@ layout_mode = 2
|
||||
[connection signal="toggled" from="CanvasLayer/DebugUI/PanelContainer/VBoxContainer/GodModeCheck" to="CanvasLayer/DebugUI" method="_on_god_mode_check_toggled"]
|
||||
[connection signal="toggled" from="CanvasLayer/DebugUI/PanelContainer/VBoxContainer/EnemyGodModeCheck" to="CanvasLayer/DebugUI" method="_on_enemy_god_mode_check_toggled"]
|
||||
[connection signal="toggled" from="CanvasLayer/DebugUI/PanelContainer/VBoxContainer/StatsCheck" to="CanvasLayer/DebugUI" method="_on_stats_check_toggled"]
|
||||
[connection signal="value_changed" from="CanvasLayer/DebugUI/PanelContainer/VBoxContainer/MarginContainer/HBoxContainer/TimeScaleSlider" to="CanvasLayer/DebugUI" method="_on_time_scale_slider_value_changed"]
|
||||
|
Reference in New Issue
Block a user