From 0aaa638c0cf28cb8d32b4880a574f9fdc31b6553 Mon Sep 17 00:00:00 2001 From: osquallo Date: Fri, 27 Jul 2018 16:13:54 +0200 Subject: [PATCH] =?UTF-8?q?diverses=20am=C3=A9liorations.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scenes/GUI/HUD/HUD.gd | 6 +++++- scenes/GUI/HUD/HUD.tscn | 5 +++-- scenes/GUI/HUD/WindowControl.gd | 2 +- scenes/GUI/HUD/oubli.gd | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/scenes/GUI/HUD/HUD.gd b/scenes/GUI/HUD/HUD.gd index 3b57bca..33b71f4 100644 --- a/scenes/GUI/HUD/HUD.gd +++ b/scenes/GUI/HUD/HUD.gd @@ -27,4 +27,8 @@ func _on_SaveHUD_pressed(): for child in get_node("Windows" ).get_children(): child.save_to_file( config_file ) - config_file.save( HUD_config_file ) \ No newline at end of file + config_file.save( HUD_config_file ) + +func _on_Windows_gui_input( event ): + if event is InputEventMouseButton and not event.is_echo() and not event.pressed: + Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED) diff --git a/scenes/GUI/HUD/HUD.tscn b/scenes/GUI/HUD/HUD.tscn index 5930ea6..f732dd5 100644 --- a/scenes/GUI/HUD/HUD.tscn +++ b/scenes/GUI/HUD/HUD.tscn @@ -67,7 +67,6 @@ _sections_unfolded = [ "Visibility" ] [node name="Windows" type="ReferenceRect" parent="." index="2"] -editor/display_folded = true anchor_left = 0.0 anchor_top = 0.0 anchor_right = 0.0 @@ -76,7 +75,7 @@ margin_right = 1024.0 margin_bottom = 600.0 rect_pivot_offset = Vector2( 0, 0 ) rect_clip_content = false -mouse_filter = 2 +mouse_filter = 1 mouse_default_cursor_shape = 0 size_flags_horizontal = 3 size_flags_vertical = 3 @@ -1339,6 +1338,8 @@ flat = false align = 1 _sections_unfolded = [ "Size Flags" ] +[connection signal="gui_input" from="Windows" to="." method="_on_Windows_gui_input"] + [connection signal="gui_input" from="Windows/Test/VBoxContainer/Header" to="Windows/Test" method="_on_Header_gui_input"] [connection signal="pressed" from="Windows/Test/VBoxContainer/Header/HBoxContainer/Quit" to="Windows/Test" method="_on_Quit_pressed"] diff --git a/scenes/GUI/HUD/WindowControl.gd b/scenes/GUI/HUD/WindowControl.gd index 4021a82..da3ab84 100644 --- a/scenes/GUI/HUD/WindowControl.gd +++ b/scenes/GUI/HUD/WindowControl.gd @@ -124,7 +124,7 @@ func save_to_file( config_file ): print( "" ) config_file.set_value(self.name, "position", self.rect_position) - config_file.set_value(self.name, "size", self.rect_size) + config_file.set_value(self.name, "size", current_rect_size) if $VBoxContainer/Content.visible: config_file.set_value(self.name, "opened", true) else: diff --git a/scenes/GUI/HUD/oubli.gd b/scenes/GUI/HUD/oubli.gd index 95176dc..ae9a442 100644 --- a/scenes/GUI/HUD/oubli.gd +++ b/scenes/GUI/HUD/oubli.gd @@ -17,4 +17,4 @@ func _ready(): func _on_ProgressBar_value_changed(value): self.modulate = Color( 1.0, 1.0, 1.0, clamp(value/50, 20/255, 1 ) ) - get_node( "../../overlay_oubli" ).modulate.a = self.modulate.a-self.modulate.a/2 \ No newline at end of file + get_node( "../../overlay_oubli" ).modulate.a = self.modulate.a/2 \ No newline at end of file