From 2160e9c9a86ecfd8606a7db36a172661313141e2 Mon Sep 17 00:00:00 2001 From: JulianEgbert <57799997+JulianEgbert@users.noreply.github.com> Date: Tue, 14 Nov 2023 15:56:21 +0100 Subject: [PATCH] Add simple restart button to PUI --- addons/pronto/behaviors/PrototypingUIBehavior.gd | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/addons/pronto/behaviors/PrototypingUIBehavior.gd b/addons/pronto/behaviors/PrototypingUIBehavior.gd index 51a9b105..7972c98f 100644 --- a/addons/pronto/behaviors/PrototypingUIBehavior.gd +++ b/addons/pronto/behaviors/PrototypingUIBehavior.gd @@ -594,9 +594,20 @@ func create_header(): var hbox = HBoxContainer.new() hbox.add_child(create_minimizing_button()) hbox.size_flags_horizontal = Control.SIZE_EXPAND_FILL + # Add the title of the PUI var text = Label.new() text.text = self.name hbox.add_child(text) + + # Quick and dirty solution for restart button + var restart_button = Button.new() + restart_button.text = "⟳" + restart_button.focus_mode = 0 + restart_button.alignment = HORIZONTAL_ALIGNMENT_RIGHT + restart_button.tooltip_text = "Restart the game" + restart_button.connect("pressed", func(): get_tree().reload_current_scene()) + hbox.add_child(restart_button) + return hbox func _sync_editor_value(value: ValueBehavior):