Amelioration du plugin de fenetre qui fonctionne corretement et ajoute meme les node ajouter via l'editeur automatiquement sous le node content.
This commit is contained in:
parent
97c99cc0ef
commit
c0e426ca00
4 changed files with 319 additions and 146 deletions
|
@ -10,11 +10,25 @@ export(String) var background_texture = "res://assets/GUI/images/background_test
|
|||
|
||||
signal window_clicked( window )
|
||||
|
||||
onready var header_box = $parts/header_box
|
||||
onready var content_box = $parts/content_box
|
||||
onready var footer_box = $parts/footer_box
|
||||
|
||||
var current_rect_size = Vector2( 0, 0 )
|
||||
var current_rect_position = Vector2( -1, -1 )
|
||||
var is_resizing = false
|
||||
var is_moving = false
|
||||
|
||||
func add_child( node):
|
||||
if self.get_content():
|
||||
self.get_content().add_child(node)
|
||||
# else:
|
||||
# .add_child( node )
|
||||
# prints(self.get_name()+" just fathered", node.get_name())
|
||||
|
||||
func add_window_part( node ):
|
||||
.add_child( node )
|
||||
|
||||
func set_mouse_pass_to_children( node ):
|
||||
for child in node.get_children():
|
||||
set_mouse_pass_to_children( child )
|
||||
|
@ -23,6 +37,26 @@ func set_mouse_pass_to_children( node ):
|
|||
|
||||
#func _ready():
|
||||
func _enter_tree():
|
||||
########
|
||||
#### Window's part création.
|
||||
# The interal elements structure is:
|
||||
# self - MarginContainer
|
||||
# background - NinePatchRect
|
||||
# parts - VBoxContainer
|
||||
# header_box - MarginContainer
|
||||
# header - HBoxContainer
|
||||
# quit - TextureButton
|
||||
# close - TextureButton
|
||||
# open - TextureButton
|
||||
# label - Label
|
||||
# content_box - MarginContainer
|
||||
# scroll_container - Scrollcontainer
|
||||
# content - VBoxContainer
|
||||
# footer_box - MarginContainer
|
||||
# footer - HBoxContainer
|
||||
# contextual_help - Label
|
||||
# resize - TextureButton
|
||||
|
||||
###
|
||||
# self
|
||||
self.size_flags_horizontal = SIZE_EXPAND
|
||||
|
@ -37,11 +71,11 @@ func _enter_tree():
|
|||
self.connect ( "gui_input", self, "_on_window_gui_input" )
|
||||
###
|
||||
###
|
||||
# Background
|
||||
# background
|
||||
var background
|
||||
if not self.has_node( "Background" ):
|
||||
if not self.has_node( "background" ):
|
||||
background = NinePatchRect.new()
|
||||
background.name = "Background"
|
||||
background.name = "background"
|
||||
var background_image = Image.new()
|
||||
if not background_image.load( background_texture ):
|
||||
print("Erreur lors du chargement de l'image: "+background_texture )
|
||||
|
@ -62,61 +96,59 @@ func _enter_tree():
|
|||
|
||||
background.self_modulate = background_color
|
||||
|
||||
self.add_child( background )
|
||||
self.add_window_part( background )
|
||||
background.set_owner( self )
|
||||
###
|
||||
|
||||
###
|
||||
var v_box_container
|
||||
# VBoxContainer
|
||||
if not self.has_node( "VBoxContainer" ):
|
||||
v_box_container = VBoxContainer.new()
|
||||
v_box_container.name = "VBoxContainer"
|
||||
v_box_container.size_flags_horizontal = SIZE_EXPAND_FILL
|
||||
v_box_container.size_flags_vertical = SIZE_EXPAND_FILL
|
||||
self.add_child( v_box_container )
|
||||
v_box_container.set_owner( self )
|
||||
###
|
||||
|
||||
###
|
||||
# Header
|
||||
var header
|
||||
if not v_box_container.has_node( "Header" ):
|
||||
header = MarginContainer.new()
|
||||
header.name = "Header"
|
||||
header.size_flags_horizontal = SIZE_EXPAND_FILL
|
||||
header.size_flags_vertical = SIZE_SHRINK_CENTER
|
||||
|
||||
header.set( "custom_constants/margin_right", 0)
|
||||
header.set( "custom_constants/margin_top", 4)
|
||||
header.set( "custom_constants/margin_left", 4)
|
||||
header.set( "custom_constants/margin_bottom", 4)
|
||||
|
||||
if is_movable:
|
||||
header.mouse_default_cursor_shape = CURSOR_MOVE
|
||||
v_box_container.add_child( header )
|
||||
header.set_owner( v_box_container )
|
||||
header.connect ( "gui_input", self, "_on_Header_gui_input" )
|
||||
###
|
||||
# parts
|
||||
var parts
|
||||
if not self.has_node( "parts" ):
|
||||
parts = VBoxContainer.new()
|
||||
parts.name = "parts"
|
||||
parts.size_flags_horizontal = SIZE_EXPAND_FILL
|
||||
parts.size_flags_vertical = SIZE_EXPAND_FILL
|
||||
self.add_window_part( parts )
|
||||
parts.set_owner( self )
|
||||
###
|
||||
###
|
||||
# header_box
|
||||
var header_box
|
||||
# Header/HBoxContainer
|
||||
if not header.has_node( "HBoxContainer" ):
|
||||
header_box = HBoxContainer.new()
|
||||
header_box.name = "HBoxContainer"
|
||||
if not parts.has_node( "header_box" ):
|
||||
header_box = MarginContainer.new()
|
||||
header_box.name = "header_box"
|
||||
header_box.size_flags_horizontal = SIZE_EXPAND_FILL
|
||||
header_box.size_flags_vertical = SIZE_EXPAND | SIZE_SHRINK_CENTER
|
||||
header_box.size_flags_vertical = SIZE_SHRINK_CENTER
|
||||
|
||||
header_box.set( "custom_constants/margin_right", 0)
|
||||
header_box.set( "custom_constants/margin_top", 4)
|
||||
header_box.set( "custom_constants/margin_left", 4)
|
||||
header_box.set( "custom_constants/margin_bottom", 4)
|
||||
|
||||
if is_movable:
|
||||
header_box.mouse_default_cursor_shape = CURSOR_MOVE
|
||||
parts.add_child( header_box )
|
||||
header_box.set_owner( parts )
|
||||
header_box.connect ( "gui_input", self, "_on_Header_gui_input" )
|
||||
###
|
||||
###
|
||||
# header
|
||||
var header
|
||||
if not header_box.has_node( "header" ):
|
||||
header = HBoxContainer.new()
|
||||
header.name = "header"
|
||||
header.size_flags_horizontal = SIZE_EXPAND_FILL
|
||||
header.size_flags_vertical = SIZE_EXPAND | SIZE_SHRINK_CENTER
|
||||
if is_movable:
|
||||
header.mouse_default_cursor_shape = CURSOR_MOVE
|
||||
header.add_child( header_box )
|
||||
header_box.set_owner( header )
|
||||
###
|
||||
header_box.add_child( header )
|
||||
header.set_owner( header )
|
||||
###
|
||||
# Quit
|
||||
###
|
||||
# quit
|
||||
var quit_button
|
||||
if not header_box.has_node( "Quit" ):
|
||||
if not header.has_node( "quit" ):
|
||||
quit_button = TextureButton.new()
|
||||
quit_button.name = "Quit"
|
||||
quit_button.name = "quit"
|
||||
quit_button.size_flags_horizontal = SIZE_SHRINK_END
|
||||
quit_button.size_flags_vertical = SIZE_SHRINK_CENTER
|
||||
|
||||
|
@ -126,15 +158,15 @@ func _enter_tree():
|
|||
tex_quit.create_from_image( img_quit )
|
||||
quit_button.texture_normal = tex_quit
|
||||
|
||||
header_box.add_child( quit_button )
|
||||
quit_button.set_owner( header_box )
|
||||
header.add_child( quit_button )
|
||||
quit_button.set_owner( header )
|
||||
quit_button.connect ( "pressed", self, "_on_Quit_pressed" )
|
||||
###
|
||||
# Close
|
||||
###
|
||||
# close
|
||||
var close_button = TextureButton.new()
|
||||
if not header_box.has_node( "Close" ):
|
||||
if not header.has_node( "close" ):
|
||||
close_button = TextureButton.new()
|
||||
close_button.name = "Close"
|
||||
close_button.name = "close"
|
||||
close_button.size_flags_horizontal = SIZE_SHRINK_END
|
||||
close_button.size_flags_vertical = SIZE_SHRINK_CENTER
|
||||
|
||||
|
@ -144,15 +176,15 @@ func _enter_tree():
|
|||
tex_close.create_from_image( img_close )
|
||||
close_button.texture_normal = tex_close
|
||||
|
||||
header_box.add_child( close_button )
|
||||
close_button.set_owner( header_box )
|
||||
header.add_child( close_button )
|
||||
close_button.set_owner( header )
|
||||
close_button.connect ( "pressed", self, "_on_Close_pressed" )
|
||||
###
|
||||
# Open
|
||||
###
|
||||
# open
|
||||
var open_button
|
||||
if not header_box.has_node( "Open" ):
|
||||
if not header.has_node( "open" ):
|
||||
open_button = TextureButton.new()
|
||||
open_button.name = "Open"
|
||||
open_button.name = "open"
|
||||
open_button.size_flags_horizontal = SIZE_SHRINK_END
|
||||
open_button.size_flags_vertical = SIZE_SHRINK_CENTER
|
||||
|
||||
|
@ -162,64 +194,88 @@ func _enter_tree():
|
|||
tex_open.create_from_image( img_open )
|
||||
open_button.texture_normal = tex_open
|
||||
open_button.visible = false
|
||||
header_box.add_child( open_button )
|
||||
open_button.set_owner( header_box )
|
||||
header.add_child( open_button )
|
||||
open_button.set_owner( header )
|
||||
open_button.connect ( "pressed", self, "_on_Open_pressed" )
|
||||
###
|
||||
###
|
||||
###
|
||||
# Title Label
|
||||
var title_label
|
||||
if not header_box.has_node( "Label" ):
|
||||
if not header.has_node( "label" ):
|
||||
title_label = Label.new()
|
||||
title_label.name = "Label"
|
||||
title_label.name = "label"
|
||||
title_label.text = title
|
||||
title_label.size_flags_horizontal = SIZE_EXPAND_FILL
|
||||
title_label.size_flags_vertical = SIZE_SHRINK_CENTER
|
||||
if is_movable:
|
||||
title_label.mouse_default_cursor_shape = CURSOR_MOVE
|
||||
header_box.add_child( title_label )
|
||||
title_label.set_owner( header_box )
|
||||
###
|
||||
header.add_child( title_label )
|
||||
title_label.set_owner( header )
|
||||
###
|
||||
###
|
||||
# Content
|
||||
var content_box
|
||||
if not parts.has_node( "content_box" ):
|
||||
content_box = MarginContainer.new()
|
||||
content_box.name = "content_box"
|
||||
content_box.size_flags_horizontal = SIZE_EXPAND_FILL
|
||||
content_box.size_flags_vertical = SIZE_EXPAND_FILL
|
||||
content_box.set( "custom_constants/margin_right", 8)
|
||||
content_box.set( "custom_constants/margin_top", 8)
|
||||
content_box.set( "custom_constants/margin_left", 8)
|
||||
content_box.set( "custom_constants/margin_bottom", 8)
|
||||
parts.add_child( content_box )
|
||||
content_box.set_owner( parts )
|
||||
###
|
||||
###
|
||||
# content_box/scroll_container
|
||||
var content_scroll_container
|
||||
if not content_box.has_node( "scroll_container" ):
|
||||
content_scroll_container = ScrollContainer.new()
|
||||
content_scroll_container.name = "scroll_container"
|
||||
content_scroll_container.size_flags_horizontal = SIZE_FILL
|
||||
content_scroll_container.size_flags_vertical = SIZE_FILL
|
||||
content_box.add_child( content_scroll_container )
|
||||
content_scroll_container.set_owner( content_box )
|
||||
###
|
||||
###
|
||||
# content
|
||||
var content
|
||||
if not v_box_container.has_node( "Content" ):
|
||||
content = MarginContainer.new()
|
||||
content.name = "Content"
|
||||
if not content_scroll_container.has_node( "content" ):
|
||||
content = VBoxContainer.new()
|
||||
content.name = "content"
|
||||
content.size_flags_horizontal = SIZE_EXPAND_FILL
|
||||
content.size_flags_vertical = SIZE_EXPAND_FILL
|
||||
content.set( "custom_constants/margin_right", 8)
|
||||
content.set( "custom_constants/margin_top", 8)
|
||||
content.set( "custom_constants/margin_left", 8)
|
||||
content.set( "custom_constants/margin_bottom", 8)
|
||||
v_box_container.add_child( content )
|
||||
content.set_owner( v_box_container )
|
||||
###
|
||||
content_scroll_container.add_child( content )
|
||||
content.set_owner( content_scroll_container )
|
||||
###
|
||||
|
||||
|
||||
###
|
||||
# Footer
|
||||
var footer
|
||||
if not v_box_container.has_node( "Footer" ):
|
||||
footer = MarginContainer.new()
|
||||
footer.name = "Footer"
|
||||
footer.size_flags_horizontal = SIZE_FILL
|
||||
footer.size_flags_vertical = SIZE_FILL
|
||||
footer.set( "custom_constants/margin_right", 6)
|
||||
footer.set( "custom_constants/margin_top", 2)
|
||||
footer.set( "custom_constants/margin_left", 6)
|
||||
footer.set( "custom_constants/margin_bottom", 6)
|
||||
v_box_container.add_child( footer )
|
||||
footer.set_owner( v_box_container )
|
||||
var footer_box
|
||||
if not parts.has_node( "footer_box" ):
|
||||
footer_box = MarginContainer.new()
|
||||
footer_box.name = "footer_box"
|
||||
footer_box.size_flags_horizontal = SIZE_FILL
|
||||
footer_box.size_flags_vertical = SIZE_FILL
|
||||
footer_box.set( "custom_constants/margin_right", 6)
|
||||
footer_box.set( "custom_constants/margin_top", 2)
|
||||
footer_box.set( "custom_constants/margin_left", 6)
|
||||
footer_box.set( "custom_constants/margin_bottom", 6)
|
||||
parts.add_child( footer_box )
|
||||
footer_box.set_owner( parts )
|
||||
###
|
||||
###
|
||||
# Header/HBoxContainer
|
||||
var footer_box
|
||||
if not footer.has_node( "HBoxContainer" ):
|
||||
footer_box = HBoxContainer.new()
|
||||
footer_box.name = "HBoxContainer"
|
||||
footer_box.size_flags_horizontal = SIZE_FILL
|
||||
footer_box.size_flags_vertical = SIZE_FILL
|
||||
footer.add_child( footer_box )
|
||||
footer_box.set_owner( footer )
|
||||
var footer
|
||||
if not footer_box.has_node( "footer" ):
|
||||
footer = HBoxContainer.new()
|
||||
footer.name = "footer"
|
||||
footer.size_flags_horizontal = SIZE_FILL
|
||||
footer.size_flags_vertical = SIZE_FILL
|
||||
footer_box.add_child( footer )
|
||||
footer.set_owner( footer_box )
|
||||
###
|
||||
###
|
||||
# Open
|
||||
|
@ -245,23 +301,27 @@ func _enter_tree():
|
|||
current_rect_size = self.rect_min_size
|
||||
|
||||
if is_borderless:
|
||||
$Background.region_rect = Rect2( 3, 28+3, 512-6, 512-28-6 )
|
||||
$VBoxContainer/Header/HBoxContainer/Close.visible = false
|
||||
$VBoxContainer/Header/HBoxContainer/Open.visible = false
|
||||
$VBoxContainer/Header/HBoxContainer/Quit.visible = false
|
||||
$VBoxContainer/Header/HBoxContainer/Label.visible = false
|
||||
# else:
|
||||
# $Background.region_rect = Rect2( 0, 0, 512, 512 )
|
||||
# $VBoxContainer/Header/HBoxContainer/Close.visible = true
|
||||
# $VBoxContainer/Header/HBoxContainer/Open.visible = false
|
||||
# $VBoxContainer/Header/HBoxContainer/Quit.visible = true
|
||||
# $VBoxContainer/Header/HBoxContainer/Label.visible = true
|
||||
$background.region_rect = Rect2( 3, 28+3, 512-6, 512-28-6 )
|
||||
header.get_node( "header/close").visible = false
|
||||
header.get_node( "header/open" ).visible = false
|
||||
header.get_node( "header/quit" ).visible = false
|
||||
header.get_node( "header/label").visible = false
|
||||
|
||||
if not is_resizable:
|
||||
$VBoxContainer/Footer/HBoxContainer/Resize.visible = false
|
||||
$v_box_container/Footer/HBoxContainer/Resize.visible = false
|
||||
|
||||
func _ready():
|
||||
set_mouse_pass_to_children( self )
|
||||
|
||||
# On déplace les enfants ajouter via l'editeur sous content.
|
||||
for child in self.get_children():
|
||||
if not child.name =="parts" and not child.name =="background":
|
||||
self.remove_child( child )
|
||||
get_content().add_child( child )
|
||||
|
||||
|
||||
|
||||
|
||||
func _on_Window_mouse_entered():
|
||||
print("mouse_entered")
|
||||
|
||||
|
@ -274,23 +334,23 @@ func _on_Quit_pressed():
|
|||
self.visible = false
|
||||
|
||||
func get_content():
|
||||
return $VBoxContainer/Content
|
||||
return content_box.get_node( "scroll_container/content" )
|
||||
|
||||
|
||||
|
||||
func close():
|
||||
if not is_borderless:
|
||||
$VBoxContainer/Header/HBoxContainer/Close.visible = false
|
||||
$VBoxContainer/Header/HBoxContainer/Open.visible = true
|
||||
$VBoxContainer/Content.visible = false
|
||||
$VBoxContainer/Footer.visible = false
|
||||
header_box.get_node( "header/close" ).visible = false
|
||||
header_box.get_node( "header/open" ).visible = true
|
||||
content_box.visible = false
|
||||
footer_box.visible = false
|
||||
current_rect_size = self.rect_size
|
||||
self.rect_size = Vector2( 0, 0 )
|
||||
else:
|
||||
$VBoxContainer/Header/HBoxContainer/Close.visible = false
|
||||
$VBoxContainer/Header/HBoxContainer/Open.visible = false
|
||||
$VBoxContainer/Content.visible = false
|
||||
$VBoxContainer/Footer.visible = false
|
||||
header_box.get_node( "header/close" ).visible = false
|
||||
header_box.get_node( "header/open" ).visible = false
|
||||
content_box.visible = false
|
||||
footer_box.visible = false
|
||||
current_rect_size = self.rect_size
|
||||
self.rect_size = Vector2( 0, 0 )
|
||||
|
||||
|
@ -300,16 +360,16 @@ func _on_Close_pressed():
|
|||
|
||||
func open():
|
||||
if not is_borderless:
|
||||
$VBoxContainer/Header/HBoxContainer/Close.visible = true
|
||||
$VBoxContainer/Header/HBoxContainer/Open.visible = false
|
||||
$VBoxContainer/Content.visible = true
|
||||
$VBoxContainer/Footer.visible = true
|
||||
header_box.get_node( "header/close" ).visible = true
|
||||
header_box.get_node( "header/open" ).visible = false
|
||||
content_box.visible = true
|
||||
footer_box.visible = true
|
||||
self.rect_size = current_rect_size
|
||||
else:
|
||||
$VBoxContainer/Header/HBoxContainer/Close.visible = false
|
||||
$VBoxContainer/Header/HBoxContainer/Open.visible = false
|
||||
$VBoxContainer/Content.visible = true
|
||||
$VBoxContainer/Footer.visible = true
|
||||
header_box.get_node( "header/close" ).visible = false
|
||||
header_box.get_node( "header/open" ).visible = false
|
||||
content_box.visible = true
|
||||
footer_box.visible = true
|
||||
self.rect_size = current_rect_size
|
||||
|
||||
func _on_Open_pressed():
|
||||
|
|
|
@ -87,6 +87,7 @@ _sections_unfolded = [ "Mouse", "Size Flags", "Theme", "Visibility", "custom_sty
|
|||
|
||||
[node name="Test" type="MarginContainer" parent="Windows" index="0"]
|
||||
|
||||
editor/display_folded = true
|
||||
anchor_left = 0.0
|
||||
anchor_top = 0.0
|
||||
anchor_right = 0.0
|
||||
|
@ -158,7 +159,6 @@ _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
|
||||
|
@ -179,7 +179,6 @@ _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
|
||||
|
@ -309,7 +308,7 @@ custom_constants/margin_left = 8
|
|||
custom_constants/margin_bottom = 8
|
||||
_sections_unfolded = [ "Mouse", "Rect", "Size Flags", "custom_constants" ]
|
||||
|
||||
[node name="RichTextLabel" type="RichTextLabel" parent="Windows/Test/VBoxContainer/Content" index="0"]
|
||||
[node name="scroll_container" type="ScrollContainer" parent="Windows/Test/VBoxContainer/Content" index="0"]
|
||||
|
||||
anchor_left = 0.0
|
||||
anchor_top = 0.0
|
||||
|
@ -321,27 +320,77 @@ margin_right = 281.0
|
|||
margin_bottom = 72.0
|
||||
rect_pivot_offset = Vector2( 0, 0 )
|
||||
rect_clip_content = true
|
||||
focus_mode = 2
|
||||
mouse_filter = 1
|
||||
mouse_filter = 0
|
||||
mouse_default_cursor_shape = 0
|
||||
size_flags_horizontal = 1
|
||||
size_flags_vertical = 1
|
||||
bbcode_enabled = false
|
||||
bbcode_text = ""
|
||||
visible_characters = -1
|
||||
scroll_horizontal_enabled = true
|
||||
scroll_horizontal = 0
|
||||
scroll_vertical_enabled = true
|
||||
scroll_vertical = 0
|
||||
scroll_deadzone = 0
|
||||
_sections_unfolded = [ "Scroll", "Size Flags" ]
|
||||
|
||||
[node name="v_box_container" type="VBoxContainer" parent="Windows/Test/VBoxContainer/Content/scroll_container" index="2"]
|
||||
|
||||
anchor_left = 0.0
|
||||
anchor_top = 0.0
|
||||
anchor_right = 0.0
|
||||
anchor_bottom = 0.0
|
||||
margin_right = 261.0
|
||||
margin_bottom = 440.0
|
||||
rect_pivot_offset = Vector2( 0, 0 )
|
||||
rect_clip_content = false
|
||||
mouse_filter = 1
|
||||
mouse_default_cursor_shape = 0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
alignment = 0
|
||||
_sections_unfolded = [ "Size Flags" ]
|
||||
|
||||
[node name="label" type="Label" parent="Windows/Test/VBoxContainer/Content/scroll_container/v_box_container" index="0"]
|
||||
|
||||
anchor_left = 0.0
|
||||
anchor_top = 0.0
|
||||
anchor_right = 0.0
|
||||
anchor_bottom = 0.0
|
||||
margin_right = 261.0
|
||||
margin_bottom = 218.0
|
||||
rect_pivot_offset = Vector2( 0, 0 )
|
||||
rect_clip_content = false
|
||||
mouse_filter = 2
|
||||
mouse_default_cursor_shape = 0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 1
|
||||
text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
|
||||
autowrap = true
|
||||
percent_visible = 1.0
|
||||
meta_underlined = true
|
||||
tab_size = 4
|
||||
text = "Lorem [url]ipsum[/url] dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\\nLorem [url]ipsum[/url] dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
|
||||
scroll_active = true
|
||||
scroll_following = true
|
||||
selection_enabled = true
|
||||
override_selected_font_color = false
|
||||
_sections_unfolded = [ "BBCode", "Mouse", "Rect", "Size Flags" ]
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="label2" type="Label" parent="Windows/Test/VBoxContainer/Content/scroll_container/v_box_container" index="1"]
|
||||
|
||||
anchor_left = 0.0
|
||||
anchor_top = 0.0
|
||||
anchor_right = 0.0
|
||||
anchor_bottom = 0.0
|
||||
margin_top = 222.0
|
||||
margin_right = 261.0
|
||||
margin_bottom = 440.0
|
||||
rect_pivot_offset = Vector2( 0, 0 )
|
||||
rect_clip_content = false
|
||||
mouse_filter = 2
|
||||
mouse_default_cursor_shape = 0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 1
|
||||
text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
|
||||
autowrap = true
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[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
|
||||
|
@ -380,7 +429,29 @@ size_flags_vertical = 1
|
|||
alignment = 0
|
||||
_sections_unfolded = [ "Mouse", "Size Flags" ]
|
||||
|
||||
[node name="Resize" type="TextureButton" parent="Windows/Test/VBoxContainer/Footer/HBoxContainer" index="0"]
|
||||
[node name="label" type="Label" parent="Windows/Test/VBoxContainer/Footer/HBoxContainer" index="0"]
|
||||
|
||||
anchor_left = 0.0
|
||||
anchor_top = 0.0
|
||||
anchor_right = 0.0
|
||||
anchor_bottom = 0.0
|
||||
margin_left = 82.0
|
||||
margin_top = 1.0
|
||||
margin_right = 175.0
|
||||
margin_bottom = 15.0
|
||||
rect_pivot_offset = Vector2( 0, 0 )
|
||||
rect_clip_content = false
|
||||
mouse_filter = 2
|
||||
mouse_default_cursor_shape = 0
|
||||
size_flags_horizontal = 6
|
||||
size_flags_vertical = 4
|
||||
text = "Contetual help"
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
_sections_unfolded = [ "Size Flags" ]
|
||||
|
||||
[node name="Resize" type="TextureButton" parent="Windows/Test/VBoxContainer/Footer/HBoxContainer" index="1"]
|
||||
|
||||
anchor_left = 0.0
|
||||
anchor_top = 0.0
|
||||
|
@ -394,7 +465,7 @@ rect_clip_content = false
|
|||
focus_mode = 2
|
||||
mouse_filter = 0
|
||||
mouse_default_cursor_shape = 12
|
||||
size_flags_horizontal = 10
|
||||
size_flags_horizontal = 8
|
||||
size_flags_vertical = 2
|
||||
toggle_mode = false
|
||||
action_mode = 0
|
||||
|
@ -406,6 +477,8 @@ _sections_unfolded = [ "Mouse", "Size Flags", "Textures" ]
|
|||
|
||||
[node name="TestBorderless" type="MarginContainer" parent="Windows" index="1"]
|
||||
|
||||
editor/display_folded = true
|
||||
visible = false
|
||||
anchor_left = 0.0
|
||||
anchor_top = 0.0
|
||||
anchor_right = 0.0
|
||||
|
@ -772,6 +845,7 @@ _sections_unfolded = [ "Mouse", "Size Flags", "Textures" ]
|
|||
[node name="Music" type="MarginContainer" parent="Windows" index="2"]
|
||||
|
||||
editor/display_folded = true
|
||||
visible = false
|
||||
anchor_left = 0.0
|
||||
anchor_top = 0.0
|
||||
anchor_right = 0.0
|
||||
|
@ -1125,6 +1199,28 @@ 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="label" type="Label" parent="Windows/ui_window" index="0"]
|
||||
|
||||
anchor_left = 0.0
|
||||
anchor_top = 0.0
|
||||
anchor_right = 0.0
|
||||
anchor_bottom = 0.0
|
||||
margin_left = 8.0
|
||||
margin_top = 62.0
|
||||
margin_right = 238.0
|
||||
margin_bottom = 76.0
|
||||
rect_pivot_offset = Vector2( 0, 0 )
|
||||
rect_clip_content = false
|
||||
mouse_filter = 2
|
||||
mouse_default_cursor_shape = 0
|
||||
size_flags_horizontal = 1
|
||||
size_flags_vertical = 4
|
||||
text = "Test label editeur."
|
||||
autowrap = true
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="Music" parent="." index="3" instance=ExtResource( 9 )]
|
||||
|
||||
margin_left = 942.0
|
||||
|
|
|
@ -11,6 +11,13 @@ var current_rect_position = Vector2( -1, -1 )
|
|||
var is_resizing = false
|
||||
var is_moving = false
|
||||
|
||||
|
||||
|
||||
func add_child(node):
|
||||
$VBoxContainer/Content/scroll_container/v_box_container.add_child(node)
|
||||
prints(self.get_name()+" just fathered", node.get_name())
|
||||
|
||||
|
||||
func set_mouse_pass_to_children( node ):
|
||||
for child in node.get_children():
|
||||
set_mouse_pass_to_children( child )
|
||||
|
|
|
@ -5,6 +5,17 @@ func _ready():
|
|||
for child in self.get_children():
|
||||
child.connect( "window_clicked", self, "_on_window_clicked" )
|
||||
|
||||
var new_label = Label.new()
|
||||
new_label.set_name( "azerty" )
|
||||
new_label.set_text( "azertyuiop sdfghjklm wxcvbn" )
|
||||
new_label.set_autowrap( true )
|
||||
$ui_window.add_child( new_label )
|
||||
new_label = Label.new()
|
||||
new_label.set_name( "azerty2" )
|
||||
new_label.set_text( "2azertyuiop2 2sdfghjklm2 wxcvbn2" )
|
||||
new_label.set_autowrap( true )
|
||||
$ui_window.add_child( new_label )
|
||||
|
||||
|
||||
func _on_window_clicked( window ):
|
||||
var index = 0
|
||||
|
@ -13,4 +24,3 @@ func _on_window_clicked( window ):
|
|||
index += 1
|
||||
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.
|
Loading…
Reference in a new issue