From d573beff976c48aaa80428d3db8ce78dd93f34ee Mon Sep 17 00:00:00 2001 From: osquallo Date: Thu, 16 Aug 2018 14:53:10 +0200 Subject: [PATCH] =?UTF-8?q?Am=C3=A9liorationdes=20fenetres=20et=20fix=20du?= =?UTF-8?q?=20plugin=20de=20fenetre=20qui=20repetait=20mal=20les=20texture?= =?UTF-8?q?=20a=20cause=20du=20filtre=20manquant=20sur=20la=20texture=20cr?= =?UTF-8?q?=C3=A9er=20par=20le=20script.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addons/ui_window/ui_window.gd | 78 +++++++++++++++++++------- assets/GUI/images/background_test.jpg | Bin 0 -> 7884 bytes assets/GUI/images/background_test.png | Bin 0 -> 10989 bytes scenes/GUI/HUD/HUD.tscn | 71 ++++++++++++++--------- scenes/GUI/HUD/WindowControl.gd | 46 +++++++-------- scenes/GUI/HUD/Windows.gd | 4 +- 6 files changed, 125 insertions(+), 74 deletions(-) create mode 100644 assets/GUI/images/background_test.jpg create mode 100644 assets/GUI/images/background_test.png diff --git a/addons/ui_window/ui_window.gd b/addons/ui_window/ui_window.gd index 73b8f14..ea449b9 100644 --- a/addons/ui_window/ui_window.gd +++ b/addons/ui_window/ui_window.gd @@ -5,11 +5,22 @@ export(bool) var is_resizable = true export(bool) var is_borderless = false export(String) var title = "Window" export(Color) var background_color = Color( 1.0, 1.0, 1.0, 1.0 ) + +export(String) var background_texture = "res://assets/GUI/images/background_test.png" + +signal window_clicked( window ) + var current_rect_size = Vector2( 0, 0 ) var current_rect_position = Vector2( -1, -1 ) var is_resizing = false var is_moving = false +func set_mouse_pass_to_children( node ): + for child in node.get_children(): + set_mouse_pass_to_children( child ) + if node is Control: + node.mouse_filter = MOUSE_FILTER_PASS + #func _ready(): func _enter_tree(): ### @@ -21,6 +32,9 @@ func _enter_tree(): self.set( "custom_constants/margin_top", 0) self.set( "custom_constants/margin_left", 0) self.set( "custom_constants/margin_bottom", 0) + + + self.connect ( "gui_input", self, "_on_window_gui_input" ) ### ### # Background @@ -29,22 +43,24 @@ func _enter_tree(): background = NinePatchRect.new() background.name = "Background" var background_image = Image.new() - if not background_image.load( "res://assets/GUI/images/bg2.jpg" ): - print("Erreur lors du chargement de l'image: res://assets/GUI/images/bg2.jpg" ) + if not background_image.load( background_texture ): + print("Erreur lors du chargement de l'image: "+background_texture ) background.texture = ImageTexture.new() background.texture.create_from_image( background_image ) - + background.texture.flags = Texture.FLAG_FILTER | Texture.FLAG_REPEAT background.axis_stretch_horizontal = NinePatchRect.AXIS_STRETCH_MODE_TILE background.axis_stretch_vertical = NinePatchRect.AXIS_STRETCH_MODE_TILE background.size_flags_horizontal = SIZE_EXPAND_FILL background.size_flags_vertical = SIZE_EXPAND_FILL - background.region_rect = Rect2( 0, 0, 0, 0 ) +# background.rect_clip_content = true + +# background.region_rect = Rect2( 0, 0, 0, 0 ) background.patch_margin_left = 4 background.patch_margin_top = 32 background.patch_margin_right = 4 - background.patch_margin_bottom = 3 + background.patch_margin_bottom = 4 background.self_modulate = background_color @@ -67,7 +83,7 @@ func _enter_tree(): ### # Header var header - if not self.has_node( "Header" ): + if not v_box_container.has_node( "Header" ): header = MarginContainer.new() header.name = "Header" header.size_flags_horizontal = SIZE_EXPAND_FILL @@ -87,7 +103,7 @@ func _enter_tree(): ### var header_box # Header/HBoxContainer - if not self.has_node( "HBoxContainer" ): + if not header.has_node( "HBoxContainer" ): header_box = HBoxContainer.new() header_box.name = "HBoxContainer" header_box.size_flags_horizontal = SIZE_EXPAND_FILL @@ -100,7 +116,7 @@ func _enter_tree(): ### # Quit var quit_button - if not self.has_node( "Quit" ): + if not header_box.has_node( "Quit" ): quit_button = TextureButton.new() quit_button.name = "Quit" quit_button.size_flags_horizontal = SIZE_SHRINK_END @@ -118,7 +134,7 @@ func _enter_tree(): ### # Close var close_button = TextureButton.new() - if not self.has_node( "Close" ): + if not header_box.has_node( "Close" ): close_button = TextureButton.new() close_button.name = "Close" close_button.size_flags_horizontal = SIZE_SHRINK_END @@ -136,7 +152,7 @@ func _enter_tree(): ### # Open var open_button - if not self.has_node( "Open" ): + if not header_box.has_node( "Open" ): open_button = TextureButton.new() open_button.name = "Open" open_button.size_flags_horizontal = SIZE_SHRINK_END @@ -155,7 +171,7 @@ func _enter_tree(): ### # Title Label var title_label - if not self.has_node( "Label" ): + if not header_box.has_node( "Label" ): title_label = Label.new() title_label.name = "Label" title_label.text = title @@ -169,7 +185,7 @@ func _enter_tree(): ### # Content var content - if not self.has_node( "Content" ): + if not v_box_container.has_node( "Content" ): content = MarginContainer.new() content.name = "Content" content.size_flags_horizontal = SIZE_EXPAND_FILL @@ -184,7 +200,7 @@ func _enter_tree(): ### # Footer var footer - if not self.has_node( "Footer" ): + if not v_box_container.has_node( "Footer" ): footer = MarginContainer.new() footer.name = "Footer" footer.size_flags_horizontal = SIZE_FILL @@ -199,7 +215,7 @@ func _enter_tree(): ### # Header/HBoxContainer var footer_box - if not self.has_node( "HBoxContainer" ): + if not footer.has_node( "HBoxContainer" ): footer_box = HBoxContainer.new() footer_box.name = "HBoxContainer" footer_box.size_flags_horizontal = SIZE_FILL @@ -210,7 +226,7 @@ func _enter_tree(): ### # Open var resize_button - if not self.has_node( "Resize" ): + if not footer_box.has_node( "Resize" ): resize_button = TextureButton.new() resize_button.name = "Resize" resize_button.size_flags_horizontal = SIZE_EXPAND | SIZE_SHRINK_END @@ -245,7 +261,9 @@ func _enter_tree(): if not is_resizable: $VBoxContainer/Footer/HBoxContainer/Resize.visible = false - +func _ready(): + set_mouse_pass_to_children( self ) + func _on_Window_mouse_entered(): print("mouse_entered") @@ -309,17 +327,35 @@ func _input( event ): if event is InputEventMouseMotion and is_resizing: var delta = event.relative self.rect_size += delta +# +# var mouse_position = get_viewport().get_mouse_position() +# var size_modulo = Vector2( int(self.rect_size.x) % 2, int(self.rect_size.y) % 2 ) +# self.rect_size -= size_modulo +# get_viewport().warp_mouse( mouse_position - size_modulo ) -func _on_Header_gui_input(ev): + +func check_if_clicked( event ): + if not is_moving and event is InputEventMouseButton and event.is_pressed() and not event.is_echo() and event.button_index == 1 : + emit_signal( "window_clicked", self ) + +func _on_Header_gui_input( event ): + + check_if_clicked( event ) + if is_movable: - if is_moving and ev is InputEventMouseButton and not ev.pressed: + if is_moving and event is InputEventMouseButton and not event.pressed: is_moving = false - elif not is_moving and ev is InputEventMouseButton and ev.pressed: + elif not is_moving and event is InputEventMouseButton and event.pressed: is_moving = true - if ev is InputEventMouseMotion and is_moving: - var delta = ev.relative + if event is InputEventMouseMotion and is_moving: + var delta = event.relative self.rect_position += delta +# self.rect_position -= Vector2( int(self.rect_size.x) % 2, int(self.rect_size.y) % 2 ) +# get_viewport().warp_mouse( get_viewport().get_mouse_position() - Vector2( int(get_viewport().get_mouse_position().x) % 2, int(get_viewport().get_mouse_position().y) % 2 ) ) +func _on_window_gui_input( event ): + check_if_clicked( event ) + func load_from_file( config_file ): if config_file.has_section( self.name ): self.rect_position = config_file.get_value( self.name, "position" ) diff --git a/assets/GUI/images/background_test.jpg b/assets/GUI/images/background_test.jpg new file mode 100644 index 0000000000000000000000000000000000000000..2fa626a8ac8f132ffab101a7665dda3d1542e8f2 GIT binary patch literal 7884 zcmd6L2UJr{*X~I|ZzchxH!0GkgMjqj2^~bb0#ZU%s`Mr;5PDU5C?XvZ5b3=LC<03F zpnwGd<>u8_-|v?7-G6=SuJzxYtaJA4=b1Tk&g|JUvoGFUECEmr6?GK=gcV*8F92Np z0LT?R9c;WE?3wR5c{?(zs%z_A%ma!)DSy%aQ~9fr|FrI(dKWJN7y$?X0T2)j0K-5K z80ex0V8nI~0D~de>u(_>Ai~9m;NXG(!YTd*_?vL?79fFOD?uSp006x{|6T9Dc*p&5 z?c+aGFc5a}PYD2+3I2DK3`pvCN)!1_`->uhP=?)~vmdoP{cVNfP{nN5<7#CJPJCPG z{A~q7*fxc?2H^dS+x^*3=(Oku{zf1tcddg^wI2ca^ln}M-^NR@uFMT*F+JOA@`dfG zIhrYdmCC-UJ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T=+JKA5(*iJ~)s{fKOgI71eC z&`zV4NSS+*Kxa$X-rl}OJQYE+0#*`HKM@udb_6n-1?JyKTDeFO)8QMSPs6;$oJf7k z2>F+nRY*WK%_G%pGW_rexU)I1*1*ighULc{cGK{Qbc~FQ(p{aMgE0PSLPEqylA}P1k)+9n|usch;bVjaQvUvDlJ&6V88KN-Bn%XgS5cRu}l@tkOGFPbVCV!QY(N>s14(C^HfW`>g0WU{B4ON;p&vIv{ zjuuZ+!%IoI#8%thl9G}b)$xMfIm%(;-3XZ?u&OSwxZ!)v(v8#AxqpBV9Sd$Edp3;~ zoJD~Dft9ijqAGtD5@YN$8c>41%m-5JTNN=uWO-m5io(zi-raC~);?MLiPaAj66?|dG0@P>afb4b z;zZ6P$miUe8aZpx)OZH!W-W6C>2y^#TD3i}go*wl{G5OQQE8i*d6!pLcNE(-UH9pM z4;&P5s~8f8=gOhN1ZU~$PuhwOM1uBOg=Pei{$^T7ANYL(pvJV8nVf{RB;?cl9vR6U zaFGD4Y&{{R6AC*&#+|Gwtj&`&|GWg5otm<UFO6?cop>`AEd!QWJ94InJp8U zs{ij^R8uL9E`N*Fc(KCkndz_3L73tYW+tat)fwB7JPV~0S#;1uAg4-*_^=3zf<;xBWs_JL76aIm;ZdG zbnFs>a9n}XfVcm9j~4#lpIbbItT6unJ@)utuMH9aQGkmRuK)Ts|Mwq{4L{_f(vPSh iL1zBfef5;fAtcPyH+uI1X^-G-MB}=SN}-Zf`2PTN?ua4) literal 0 HcmV?d00001 diff --git a/scenes/GUI/HUD/HUD.tscn b/scenes/GUI/HUD/HUD.tscn index 793bb5c..c1988bb 100644 --- a/scenes/GUI/HUD/HUD.tscn +++ b/scenes/GUI/HUD/HUD.tscn @@ -91,9 +91,9 @@ anchor_left = 0.0 anchor_top = 0.0 anchor_right = 0.0 anchor_bottom = 0.0 -margin_left = 237.0 +margin_left = 238.0 margin_top = 15.0 -margin_right = 526.0 +margin_right = 527.0 margin_bottom = 143.0 rect_pivot_offset = Vector2( 0, 0 ) rect_clip_content = false @@ -136,10 +136,11 @@ patch_margin_right = 4 patch_margin_bottom = 4 axis_stretch_horizontal = 1 axis_stretch_vertical = 1 -_sections_unfolded = [ "Axis Stretch", "Material", "Mouse", "Patch Margin", "Rect", "Size Flags", "Theme", "Visibility" ] +_sections_unfolded = [ "Axis Stretch", "Grow Direction", "Material", "Mouse", "Patch Margin", "Rect", "Size Flags", "Theme", "Visibility" ] [node name="VBoxContainer" type="VBoxContainer" parent="Windows/Test" index="1"] +editor/display_folded = true anchor_left = 0.0 anchor_top = 0.0 anchor_right = 0.0 @@ -158,6 +159,7 @@ _sections_unfolded = [ "Mouse", "Rect", "Size Flags", "Visibility", "custom_cons [node name="Header" type="MarginContainer" parent="Windows/Test/VBoxContainer" index="0"] +editor/display_folded = true anchor_left = 0.0 anchor_top = 0.0 anchor_right = 0.0 @@ -178,6 +180,7 @@ _sections_unfolded = [ "Margin", "Mouse", "Rect", "Size Flags", "custom_constant [node name="HBoxContainer" type="HBoxContainer" parent="Windows/Test/VBoxContainer/Header" index="0"] +editor/display_folded = true anchor_left = 0.0 anchor_top = 0.0 anchor_right = 0.0 @@ -288,7 +291,6 @@ _sections_unfolded = [ "Hint", "Mouse", "Size Flags" ] [node name="Content" type="MarginContainer" parent="Windows/Test/VBoxContainer" index="1"] -editor/display_folded = true anchor_left = 0.0 anchor_top = 0.0 anchor_right = 0.0 @@ -298,7 +300,7 @@ margin_right = 289.0 margin_bottom = 104.0 rect_pivot_offset = Vector2( 0, 0 ) rect_clip_content = false -mouse_filter = 0 +mouse_filter = 1 mouse_default_cursor_shape = 0 size_flags_horizontal = 3 size_flags_vertical = 3 @@ -306,7 +308,7 @@ custom_constants/margin_right = 8 custom_constants/margin_top = 8 custom_constants/margin_left = 8 custom_constants/margin_bottom = 8 -_sections_unfolded = [ "Rect", "Size Flags", "custom_constants" ] +_sections_unfolded = [ "Mouse", "Rect", "Size Flags", "custom_constants" ] [node name="RichTextLabel" type="RichTextLabel" parent="Windows/Test/VBoxContainer/Content" index="0"] @@ -321,7 +323,7 @@ margin_bottom = 72.0 rect_pivot_offset = Vector2( 0, 0 ) rect_clip_content = true focus_mode = 2 -mouse_filter = 0 +mouse_filter = 1 mouse_default_cursor_shape = 0 size_flags_horizontal = 1 size_flags_vertical = 1 @@ -336,10 +338,11 @@ scroll_active = true scroll_following = true selection_enabled = true override_selected_font_color = false -_sections_unfolded = [ "BBCode", "Rect", "Size Flags" ] +_sections_unfolded = [ "BBCode", "Mouse", "Rect", "Size Flags" ] [node name="Footer" type="MarginContainer" parent="Windows/Test/VBoxContainer" index="2"] +editor/display_folded = true anchor_left = 0.0 anchor_top = 0.0 anchor_right = 0.0 @@ -404,15 +407,14 @@ _sections_unfolded = [ "Mouse", "Size Flags", "Textures" ] [node name="TestBorderless" type="MarginContainer" parent="Windows" index="1"] -editor/display_folded = true anchor_left = 0.0 anchor_top = 0.0 anchor_right = 0.0 anchor_bottom = 0.0 margin_left = 266.0 -margin_top = 154.0 +margin_top = 153.0 margin_right = 513.0 -margin_bottom = 341.0 +margin_bottom = 340.0 rect_pivot_offset = Vector2( 0, 0 ) rect_clip_content = false hint_tooltip = "Tooltips test." @@ -452,12 +454,13 @@ patch_margin_left = 4 patch_margin_top = 32 patch_margin_right = 4 patch_margin_bottom = 4 -axis_stretch_horizontal = 1 -axis_stretch_vertical = 1 +axis_stretch_horizontal = 2 +axis_stretch_vertical = 2 _sections_unfolded = [ "Axis Stretch", "Material", "Patch Margin", "Rect", "Size Flags", "Theme", "Visibility" ] [node name="VBoxContainer" type="VBoxContainer" parent="Windows/TestBorderless" index="1"] +editor/display_folded = true anchor_left = 0.0 anchor_top = 0.0 anchor_right = 0.0 @@ -472,10 +475,11 @@ size_flags_horizontal = 3 size_flags_vertical = 3 custom_constants/separation = 0 alignment = 0 -_sections_unfolded = [ "Rect", "Size Flags", "Visibility", "custom_constants" ] +_sections_unfolded = [ "Mouse", "Rect", "Size Flags", "Visibility", "custom_constants" ] [node name="Header" type="MarginContainer" parent="Windows/TestBorderless/VBoxContainer" index="0"] +editor/display_folded = true anchor_left = 0.0 anchor_top = 0.0 anchor_right = 0.0 @@ -484,7 +488,7 @@ margin_right = 247.0 margin_bottom = 24.0 rect_pivot_offset = Vector2( 0, 0 ) rect_clip_content = false -mouse_filter = 0 +mouse_filter = 1 mouse_default_cursor_shape = 13 size_flags_horizontal = 1 size_flags_vertical = 0 @@ -496,6 +500,7 @@ _sections_unfolded = [ "Mouse", "Rect", "Size Flags", "custom_constants" ] [node name="HBoxContainer" type="HBoxContainer" parent="Windows/TestBorderless/VBoxContainer/Header" index="0"] +editor/display_folded = true anchor_left = 0.0 anchor_top = 0.0 anchor_right = 0.0 @@ -606,7 +611,6 @@ _sections_unfolded = [ "Hint", "Mouse", "Size Flags" ] [node name="Content" type="MarginContainer" parent="Windows/TestBorderless/VBoxContainer" index="1"] -editor/display_folded = true anchor_left = 0.0 anchor_top = 0.0 anchor_right = 0.0 @@ -616,7 +620,7 @@ margin_right = 247.0 margin_bottom = 163.0 rect_pivot_offset = Vector2( 0, 0 ) rect_clip_content = false -mouse_filter = 0 +mouse_filter = 1 mouse_default_cursor_shape = 0 size_flags_horizontal = 3 size_flags_vertical = 3 @@ -624,7 +628,7 @@ custom_constants/margin_right = 8 custom_constants/margin_top = 8 custom_constants/margin_left = 8 custom_constants/margin_bottom = 8 -_sections_unfolded = [ "Rect", "Size Flags", "custom_constants" ] +_sections_unfolded = [ "Mouse", "Rect", "Size Flags", "custom_constants" ] [node name="VBoxContainer" type="VBoxContainer" parent="Windows/TestBorderless/VBoxContainer/Content" index="0"] @@ -643,6 +647,7 @@ mouse_default_cursor_shape = 0 size_flags_horizontal = 1 size_flags_vertical = 1 alignment = 0 +_sections_unfolded = [ "Mouse" ] [node name="RichTextLabel" type="RichTextLabel" parent="Windows/TestBorderless/VBoxContainer/Content/VBoxContainer" index="0"] @@ -655,7 +660,7 @@ margin_bottom = 59.0 rect_pivot_offset = Vector2( 0, 0 ) rect_clip_content = true focus_mode = 2 -mouse_filter = 0 +mouse_filter = 1 mouse_default_cursor_shape = 0 size_flags_horizontal = 1 size_flags_vertical = 3 @@ -670,7 +675,7 @@ scroll_active = true scroll_following = true selection_enabled = true override_selected_font_color = false -_sections_unfolded = [ "BBCode", "Focus", "Rect", "Size Flags" ] +_sections_unfolded = [ "BBCode", "Focus", "Mouse", "Rect", "Size Flags" ] [node name="RichTextLabel2" type="RichTextLabel" parent="Windows/TestBorderless/VBoxContainer/Content/VBoxContainer" index="1"] @@ -684,7 +689,7 @@ margin_bottom = 123.0 rect_pivot_offset = Vector2( 0, 0 ) rect_clip_content = true focus_mode = 2 -mouse_filter = 0 +mouse_filter = 1 mouse_default_cursor_shape = 0 size_flags_horizontal = 5 size_flags_vertical = 11 @@ -699,7 +704,7 @@ scroll_active = true scroll_following = true selection_enabled = true override_selected_font_color = false -_sections_unfolded = [ "BBCode", "Focus", "Rect", "Size Flags" ] +_sections_unfolded = [ "BBCode", "Focus", "Mouse", "Rect", "Size Flags" ] [node name="Footer" type="MarginContainer" parent="Windows/TestBorderless/VBoxContainer" index="2"] @@ -739,6 +744,7 @@ mouse_default_cursor_shape = 0 size_flags_horizontal = 1 size_flags_vertical = 1 alignment = 0 +_sections_unfolded = [ "Mouse" ] [node name="Resize" type="TextureButton" parent="Windows/TestBorderless/VBoxContainer/Footer/HBoxContainer" index="0"] @@ -752,7 +758,7 @@ margin_bottom = 16.0 rect_pivot_offset = Vector2( 0, 0 ) rect_clip_content = false focus_mode = 2 -mouse_filter = 0 +mouse_filter = 1 mouse_default_cursor_shape = 12 size_flags_horizontal = 10 size_flags_vertical = 2 @@ -766,6 +772,7 @@ _sections_unfolded = [ "Mouse", "Size Flags", "Textures" ] [node name="Music" type="MarginContainer" parent="Windows" index="2"] +editor/display_folded = true anchor_left = 0.0 anchor_top = 0.0 anchor_right = 0.0 @@ -979,7 +986,7 @@ margin_right = 129.0 margin_bottom = 106.0 rect_pivot_offset = Vector2( 0, 0 ) rect_clip_content = false -mouse_filter = 0 +mouse_filter = 1 mouse_default_cursor_shape = 0 size_flags_horizontal = 3 size_flags_vertical = 3 @@ -987,7 +994,7 @@ custom_constants/margin_right = 8 custom_constants/margin_top = 8 custom_constants/margin_left = 8 custom_constants/margin_bottom = 8 -_sections_unfolded = [ "Rect", "Size Flags", "custom_constants" ] +_sections_unfolded = [ "Mouse", "Rect", "Size Flags", "custom_constants" ] [node name="RichTextLabel" type="RichTextLabel" parent="Windows/Music/VBoxContainer/Content" index="0"] @@ -1003,7 +1010,7 @@ margin_bottom = 74.0 rect_pivot_offset = Vector2( 0, 0 ) rect_clip_content = true focus_mode = 2 -mouse_filter = 0 +mouse_filter = 1 mouse_default_cursor_shape = 0 size_flags_horizontal = 1 size_flags_vertical = 1 @@ -1108,14 +1115,16 @@ mouse_default_cursor_shape = 0 size_flags_horizontal = 1 size_flags_vertical = 1 script = ExtResource( 10 ) +_sections_unfolded = [ "custom_constants" ] __meta__ = { "_editor_icon": ExtResource( 11 ) } is_movable = true is_resizable = true is_borderless = false -title = "Window test" +title = "Test window plugin" background_color = Color( 0.808594, 0.808594, 0.808594, 1 ) +background_texture = "res://assets/GUI/images/background_test.png" [node name="Music" parent="." index="3" instance=ExtResource( 9 )] @@ -1368,6 +1377,8 @@ flat = false align = 1 _sections_unfolded = [ "Size Flags" ] +[connection signal="gui_input" from="Windows/Test" to="Windows/Test" method="_on_window_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"] @@ -1378,6 +1389,8 @@ _sections_unfolded = [ "Size Flags" ] [connection signal="pressed" from="Windows/Test/VBoxContainer/Footer/HBoxContainer/Resize" to="Windows/Test" method="_on_Resize_pressed"] +[connection signal="gui_input" from="Windows/TestBorderless" to="Windows/TestBorderless" method="_on_window_gui_input"] + [connection signal="gui_input" from="Windows/TestBorderless/VBoxContainer/Header" to="Windows/TestBorderless" method="_on_Header_gui_input"] [connection signal="pressed" from="Windows/TestBorderless/VBoxContainer/Header/HBoxContainer/Quit" to="Windows/TestBorderless" method="_on_Quit_pressed"] @@ -1386,8 +1399,12 @@ _sections_unfolded = [ "Size Flags" ] [connection signal="pressed" from="Windows/TestBorderless/VBoxContainer/Header/HBoxContainer/Open" to="Windows/TestBorderless" method="_on_Open_pressed"] +[connection signal="gui_input" from="Windows/TestBorderless/VBoxContainer/Footer" to="Windows/TestBorderless" method="_on_footer_gui_input"] + [connection signal="pressed" from="Windows/TestBorderless/VBoxContainer/Footer/HBoxContainer/Resize" to="Windows/TestBorderless" method="_on_Resize_pressed"] +[connection signal="gui_input" from="Windows/Music" to="Windows/Music" method="_on_window_gui_input"] + [connection signal="gui_input" from="Windows/Music/VBoxContainer/Header" to="Windows/Music" method="_on_Header_gui_input"] [connection signal="pressed" from="Windows/Music/VBoxContainer/Header/HBoxContainer/Quit" to="Windows/Music" method="_on_Quit_pressed"] diff --git a/scenes/GUI/HUD/WindowControl.gd b/scenes/GUI/HUD/WindowControl.gd index 959e432..96ee675 100644 --- a/scenes/GUI/HUD/WindowControl.gd +++ b/scenes/GUI/HUD/WindowControl.gd @@ -11,6 +11,12 @@ var current_rect_position = Vector2( -1, -1 ) var is_resizing = false var is_moving = false +func set_mouse_pass_to_children( node ): + for child in node.get_children(): + set_mouse_pass_to_children( child ) + if node is Control: + node.mouse_filter = MOUSE_FILTER_PASS + func _ready(): current_rect_size = self.rect_min_size @@ -28,6 +34,9 @@ func _ready(): # $VBoxContainer/Header/HBoxContainer/Label.visible = true if not is_resizable: $VBoxContainer/Footer/HBoxContainer/Resize.visible = false + + set_mouse_pass_to_children( self ) + func _on_Window_mouse_entered(): print("mouse_entered") @@ -85,10 +94,7 @@ func _on_Open_pressed(): func _on_Resize_pressed(): is_resizing = true -func _input( event ): - - - +func _input( event ): if is_resizable: if is_resizing and event is InputEventMouseButton and not event.pressed: is_resizing = false @@ -96,11 +102,14 @@ func _input( event ): var delta = event.relative self.rect_size += delta + +func check_if_clicked( event ): + if not is_moving and event is InputEventMouseButton and event.is_pressed() and not event.is_echo() and event.button_index == 1 : + emit_signal( "window_clicked", self ) + func _on_Header_gui_input( event ): - if not is_moving and event is InputEventMouseButton and event.is_pressed() and not event.is_echo() and event.button_index == 1 : - put_above_other() - + check_if_clicked( event ) if is_movable: if is_moving and event is InputEventMouseButton and not event.pressed: @@ -143,23 +152,10 @@ func save_to_file( config_file ): config_file.set_value(self.name, "opened", false) config_file.set_value(self.name, "borderless", is_borderless) - -func put_above_other(): -# var index = 0 -# for child in get_parent().get_children(): -# get_parent().move_child(child, index) -# index += 1 -# get_parent().move_child(self, index) - -# var parent = self.get_parent() -# var last_child = parent.get_child( parent.get_child_count()-1 ) -# if not self.is_greater_than( last_child ): -# parent.remove_child( self ) -# parent.add_child_below_node( last_child, self ) - -# self.raise() - emit_signal( "window_clicked", self ) - pass - +func _on_window_gui_input( event ): + check_if_clicked( event ) +func _on_footer_gui_input( event ): +# check_if_clicked( event ) + pass \ No newline at end of file diff --git a/scenes/GUI/HUD/Windows.gd b/scenes/GUI/HUD/Windows.gd index 4830532..eb95ff2 100644 --- a/scenes/GUI/HUD/Windows.gd +++ b/scenes/GUI/HUD/Windows.gd @@ -11,4 +11,6 @@ func _on_window_clicked( window ): for child in self.get_children(): self.move_child(child, index) index += 1 - self.move_child(window, index) \ No newline at end of file + self.move_child(window, index) + +# TODO deplacer le deplacement des fenetres ici et tout ce qui est management des fenetre et non de leur contenu. \ No newline at end of file