mirror of
https://github.com/Relintai/material-maker.git
synced 2024-11-13 06:27:18 +01:00
Fixed control label edition in remote
This commit is contained in:
parent
825d98e0fe
commit
19b9d804b9
@ -92,6 +92,9 @@ func create_config_control(label):
|
|||||||
widgets.push_back({ label=label, type="config_control", linked_widgets=[], configurations={} })
|
widgets.push_back({ label=label, type="config_control", linked_widgets=[], configurations={} })
|
||||||
return index
|
return index
|
||||||
|
|
||||||
|
func set_label(index, new_label):
|
||||||
|
widgets[index].label = new_label
|
||||||
|
|
||||||
func can_link_parameter(index, generator, param):
|
func can_link_parameter(index, generator, param):
|
||||||
return true
|
return true
|
||||||
|
|
||||||
|
@ -112,7 +112,8 @@ func update_view(g):
|
|||||||
clear_view()
|
clear_view()
|
||||||
generator = g
|
generator = g
|
||||||
update_graph(generator.get_children(), generator.connections)
|
update_graph(generator.get_children(), generator.connections)
|
||||||
$ButtonUp.visible = generator != top_generator
|
$SubGraphUI.visible = generator != top_generator
|
||||||
|
$SubGraphUI/Label.text = generator.label
|
||||||
center_view()
|
center_view()
|
||||||
|
|
||||||
func clear_material():
|
func clear_material():
|
||||||
@ -285,6 +286,9 @@ func on_ButtonUp_pressed():
|
|||||||
if generator != top_generator && generator.get_parent() is MMGenGraph:
|
if generator != top_generator && generator.get_parent() is MMGenGraph:
|
||||||
call_deferred("update_view", generator.get_parent())
|
call_deferred("update_view", generator.get_parent())
|
||||||
|
|
||||||
|
func _on_Label_text_changed(new_text):
|
||||||
|
generator.label = new_text
|
||||||
|
|
||||||
# Create subgraph
|
# Create subgraph
|
||||||
|
|
||||||
func create_subgraph():
|
func create_subgraph():
|
||||||
@ -293,3 +297,5 @@ func create_subgraph():
|
|||||||
generators.push_back(n.generator)
|
generators.push_back(n.generator)
|
||||||
generator.create_subgraph(generators)
|
generator.create_subgraph(generators)
|
||||||
update_view(generator)
|
update_view(generator)
|
||||||
|
|
||||||
|
|
||||||
|
@ -14,15 +14,25 @@ script = ExtResource( 1 )
|
|||||||
wait_time = 0.2
|
wait_time = 0.2
|
||||||
one_shot = true
|
one_shot = true
|
||||||
|
|
||||||
[node name="ButtonUp" type="Button" parent="."]
|
[node name="SubGraphUI" type="HBoxContainer" parent="."]
|
||||||
anchor_left = 1.0
|
anchor_left = 1.0
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
margin_left = -44.0
|
margin_left = -197.0
|
||||||
margin_top = 4.0
|
margin_right = -13.0
|
||||||
margin_right = -14.0
|
margin_bottom = 24.0
|
||||||
|
|
||||||
|
[node name="Label" type="LineEdit" parent="SubGraphUI"]
|
||||||
|
margin_right = 150.0
|
||||||
|
margin_bottom = 24.0
|
||||||
|
rect_min_size = Vector2( 150, 0 )
|
||||||
|
|
||||||
|
[node name="ButtonUp" type="Button" parent="SubGraphUI"]
|
||||||
|
margin_left = 154.0
|
||||||
|
margin_right = 184.0
|
||||||
margin_bottom = 24.0
|
margin_bottom = 24.0
|
||||||
text = "Up"
|
text = "Up"
|
||||||
[connection signal="connection_request" from="." to="." method="connect_node"]
|
[connection signal="connection_request" from="." to="." method="connect_node"]
|
||||||
[connection signal="disconnection_request" from="." to="." method="disconnect_node"]
|
[connection signal="disconnection_request" from="." to="." method="disconnect_node"]
|
||||||
[connection signal="timeout" from="Timer" to="." method="do_send_changed_signal"]
|
[connection signal="timeout" from="Timer" to="." method="do_send_changed_signal"]
|
||||||
[connection signal="pressed" from="ButtonUp" to="." method="on_ButtonUp_pressed"]
|
[connection signal="text_changed" from="SubGraphUI/Label" to="." method="_on_Label_text_changed"]
|
||||||
|
[connection signal="pressed" from="SubGraphUI/ButtonUp" to="." method="on_ButtonUp_pressed"]
|
||||||
|
@ -10,6 +10,7 @@ func add_control(text, control):
|
|||||||
var index = grid.get_child_count() / 4
|
var index = grid.get_child_count() / 4
|
||||||
var label = preload("res://addons/material_maker/widgets/linked_widgets/editable_label.tscn").instance()
|
var label = preload("res://addons/material_maker/widgets/linked_widgets/editable_label.tscn").instance()
|
||||||
label.set_text(text)
|
label.set_text(text)
|
||||||
|
label.connect("label_changed", self, "on_label_changed", [ index ])
|
||||||
grid.add_child(label)
|
grid.add_child(label)
|
||||||
grid.add_child(control)
|
grid.add_child(control)
|
||||||
control.connect("mouse_entered", self, "on_enter_widget", [ control ])
|
control.connect("mouse_entered", self, "on_enter_widget", [ control ])
|
||||||
@ -85,6 +86,9 @@ func _on_value_changed(new_value, variable):
|
|||||||
func do_add_configuration(config_name, param_index):
|
func do_add_configuration(config_name, param_index):
|
||||||
generator.add_configuration(param_index, config_name)
|
generator.add_configuration(param_index, config_name)
|
||||||
|
|
||||||
|
func on_label_changed(new_name, index):
|
||||||
|
generator.set_label(index, new_name)
|
||||||
|
|
||||||
func _on_AddLink_pressed():
|
func _on_AddLink_pressed():
|
||||||
var widget = Control.new()
|
var widget = Control.new()
|
||||||
add_control("Unnamed", widget)
|
add_control("Unnamed", widget)
|
||||||
|
@ -1,338 +1,132 @@
|
|||||||
[gd_scene load_steps=8 format=2]
|
[gd_scene load_steps=9 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://addons/material_maker/widgets/about.gd" type="Script" id=1]
|
[ext_resource path="res://addons/material_maker/widgets/about.gd" type="Script" id=1]
|
||||||
[ext_resource path="res://addons/material_maker/icons/icon.png" type="Texture" id=2]
|
[ext_resource path="res://addons/material_maker/icons/icon.png" type="Texture" id=2]
|
||||||
[ext_resource path="res://addons/material_maker/widgets/icon.png" type="Texture" id=3]
|
[ext_resource path="res://addons/material_maker/widgets/icon.png" type="Texture" id=3]
|
||||||
[ext_resource path="res://addons/material_maker/widgets/facebook.png" type="Texture" id=4]
|
[ext_resource path="res://rodz_labs_logo.png" type="Texture" id=4]
|
||||||
[ext_resource path="res://addons/material_maker/widgets/twitter.png" type="Texture" id=5]
|
[ext_resource path="res://addons/material_maker/widgets/facebook.png" type="Texture" id=5]
|
||||||
[ext_resource path="res://addons/material_maker/widgets/youtube.png" type="Texture" id=6]
|
[ext_resource path="res://addons/material_maker/widgets/twitter.png" type="Texture" id=6]
|
||||||
[ext_resource path="res://addons/material_maker/widgets/github.png" type="Texture" id=7]
|
[ext_resource path="res://addons/material_maker/widgets/youtube.png" type="Texture" id=7]
|
||||||
|
[ext_resource path="res://addons/material_maker/widgets/github.png" type="Texture" id=8]
|
||||||
|
|
||||||
[node name="About" type="WindowDialog" index="0"]
|
[node name="About" type="WindowDialog"]
|
||||||
|
visible = true
|
||||||
anchor_left = 0.0
|
margin_right = 138.0
|
||||||
anchor_top = 0.0
|
margin_bottom = 241.0
|
||||||
anchor_right = 0.0
|
|
||||||
anchor_bottom = 0.0
|
|
||||||
margin_right = 152.0
|
|
||||||
margin_bottom = 191.0
|
|
||||||
rect_pivot_offset = Vector2( 0, 0 )
|
|
||||||
rect_clip_content = false
|
|
||||||
mouse_filter = 0
|
|
||||||
mouse_default_cursor_shape = 0
|
|
||||||
size_flags_horizontal = 1
|
|
||||||
size_flags_vertical = 1
|
|
||||||
popup_exclusive = false
|
|
||||||
window_title = "About..."
|
window_title = "About..."
|
||||||
resizable = false
|
|
||||||
script = ExtResource( 1 )
|
script = ExtResource( 1 )
|
||||||
_sections_unfolded = [ "Anchor", "custom_styles" ]
|
|
||||||
|
|
||||||
[node name="VBoxContainer" type="VBoxContainer" parent="." index="1"]
|
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
||||||
|
|
||||||
anchor_left = 0.0
|
|
||||||
anchor_top = 0.0
|
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
anchor_bottom = 1.0
|
anchor_bottom = 1.0
|
||||||
rect_pivot_offset = Vector2( 0, 0 )
|
custom_constants/separation = 8
|
||||||
rect_clip_content = false
|
|
||||||
mouse_filter = 1
|
|
||||||
mouse_default_cursor_shape = 0
|
|
||||||
size_flags_horizontal = 1
|
|
||||||
size_flags_vertical = 1
|
|
||||||
alignment = 0
|
|
||||||
|
|
||||||
[node name="VBoxContainer1" type="VBoxContainer" parent="VBoxContainer" index="0"]
|
[node name="VBoxContainer1" type="VBoxContainer" parent="VBoxContainer"]
|
||||||
|
margin_left = 21.0
|
||||||
anchor_left = 0.0
|
margin_right = 116.0
|
||||||
anchor_top = 0.0
|
margin_bottom = 83.0
|
||||||
anchor_right = 0.0
|
|
||||||
anchor_bottom = 0.0
|
|
||||||
margin_left = 28.0
|
|
||||||
margin_right = 123.0
|
|
||||||
margin_bottom = 82.0
|
|
||||||
rect_pivot_offset = Vector2( 0, 0 )
|
|
||||||
rect_clip_content = false
|
|
||||||
mouse_filter = 1
|
|
||||||
mouse_default_cursor_shape = 0
|
|
||||||
size_flags_horizontal = 4
|
size_flags_horizontal = 4
|
||||||
size_flags_vertical = 2
|
size_flags_vertical = 2
|
||||||
alignment = 0
|
custom_constants/separation = 5
|
||||||
_sections_unfolded = [ "Size Flags" ]
|
|
||||||
|
|
||||||
[node name="TextureRect" type="TextureRect" parent="VBoxContainer/VBoxContainer1" index="0"]
|
[node name="ApplicationName" type="Label" parent="VBoxContainer/VBoxContainer1"]
|
||||||
|
|
||||||
anchor_left = 0.0
|
|
||||||
anchor_top = 0.0
|
|
||||||
anchor_right = 0.0
|
|
||||||
anchor_bottom = 0.0
|
|
||||||
margin_right = 95.0
|
margin_right = 95.0
|
||||||
margin_bottom = 64.0
|
margin_bottom = 14.0
|
||||||
rect_pivot_offset = Vector2( 0, 0 )
|
text = "Material Maker"
|
||||||
rect_clip_content = false
|
align = 1
|
||||||
mouse_filter = 1
|
|
||||||
mouse_default_cursor_shape = 0
|
[node name="MMLogo" type="TextureRect" parent="VBoxContainer/VBoxContainer1"]
|
||||||
size_flags_horizontal = 1
|
margin_top = 19.0
|
||||||
size_flags_vertical = 1
|
margin_right = 95.0
|
||||||
|
margin_bottom = 83.0
|
||||||
texture = ExtResource( 2 )
|
texture = ExtResource( 2 )
|
||||||
stretch_mode = 4
|
stretch_mode = 4
|
||||||
|
|
||||||
[node name="ApplicationName" type="Label" parent="VBoxContainer/VBoxContainer1" index="1"]
|
[node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer"]
|
||||||
|
margin_left = 8.0
|
||||||
anchor_left = 0.0
|
margin_top = 100.0
|
||||||
anchor_top = 0.0
|
margin_right = 129.0
|
||||||
anchor_right = 0.0
|
margin_bottom = 132.0
|
||||||
anchor_bottom = 0.0
|
|
||||||
margin_top = 68.0
|
|
||||||
margin_right = 95.0
|
|
||||||
margin_bottom = 82.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 = "Material Maker"
|
|
||||||
align = 1
|
|
||||||
percent_visible = 1.0
|
|
||||||
lines_skipped = 0
|
|
||||||
max_lines_visible = -1
|
|
||||||
_sections_unfolded = [ "Rect", "custom_fonts" ]
|
|
||||||
|
|
||||||
[node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer" index="1"]
|
|
||||||
|
|
||||||
anchor_left = 0.0
|
|
||||||
anchor_top = 0.0
|
|
||||||
anchor_right = 0.0
|
|
||||||
anchor_bottom = 0.0
|
|
||||||
margin_left = 15.0
|
|
||||||
margin_top = 95.0
|
|
||||||
margin_right = 136.0
|
|
||||||
margin_bottom = 127.0
|
|
||||||
rect_pivot_offset = Vector2( 0, 0 )
|
|
||||||
rect_clip_content = false
|
|
||||||
mouse_filter = 1
|
|
||||||
mouse_default_cursor_shape = 0
|
|
||||||
size_flags_horizontal = 4
|
size_flags_horizontal = 4
|
||||||
size_flags_vertical = 6
|
size_flags_vertical = 6
|
||||||
alignment = 0
|
|
||||||
_sections_unfolded = [ "Size Flags" ]
|
|
||||||
|
|
||||||
[node name="Godot" type="TextureButton" parent="VBoxContainer/HBoxContainer2" index="0"]
|
[node name="Godot" type="TextureButton" parent="VBoxContainer/HBoxContainer2"]
|
||||||
|
|
||||||
anchor_left = 0.0
|
|
||||||
anchor_top = 0.0
|
|
||||||
anchor_right = 0.0
|
|
||||||
anchor_bottom = 0.0
|
|
||||||
margin_right = 32.0
|
margin_right = 32.0
|
||||||
margin_bottom = 32.0
|
margin_bottom = 32.0
|
||||||
rect_min_size = Vector2( 32, 32 )
|
rect_min_size = Vector2( 32, 32 )
|
||||||
rect_pivot_offset = Vector2( 0, 0 )
|
|
||||||
rect_clip_content = false
|
|
||||||
focus_mode = 2
|
|
||||||
mouse_filter = 0
|
|
||||||
mouse_default_cursor_shape = 0
|
|
||||||
size_flags_horizontal = 1
|
|
||||||
size_flags_vertical = 1
|
|
||||||
toggle_mode = false
|
|
||||||
enabled_focus_mode = 2
|
|
||||||
shortcut = null
|
|
||||||
group = null
|
|
||||||
texture_normal = ExtResource( 3 )
|
texture_normal = ExtResource( 3 )
|
||||||
expand = true
|
expand = true
|
||||||
stretch_mode = 4
|
stretch_mode = 4
|
||||||
_sections_unfolded = [ "Rect", "Textures" ]
|
|
||||||
|
|
||||||
[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer2" index="1"]
|
[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer2"]
|
||||||
|
|
||||||
anchor_left = 0.0
|
|
||||||
anchor_top = 0.0
|
|
||||||
anchor_right = 0.0
|
|
||||||
anchor_bottom = 0.0
|
|
||||||
margin_left = 36.0
|
margin_left = 36.0
|
||||||
margin_right = 121.0
|
margin_right = 121.0
|
||||||
margin_bottom = 31.0
|
margin_bottom = 31.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 = "Based on
|
text = "Based on
|
||||||
Godot Engine"
|
Godot Engine"
|
||||||
align = 1
|
align = 1
|
||||||
percent_visible = 1.0
|
|
||||||
lines_skipped = 0
|
|
||||||
max_lines_visible = -1
|
|
||||||
|
|
||||||
[node name="VBoxContainer3" type="VBoxContainer" parent="VBoxContainer" index="2"]
|
[node name="VBoxContainer3" type="VBoxContainer" parent="VBoxContainer"]
|
||||||
|
margin_left = 15.0
|
||||||
anchor_left = 0.0
|
|
||||||
anchor_top = 0.0
|
|
||||||
anchor_right = 0.0
|
|
||||||
anchor_bottom = 0.0
|
|
||||||
margin_left = 22.0
|
|
||||||
margin_top = 149.0
|
margin_top = 149.0
|
||||||
margin_right = 130.0
|
margin_right = 123.0
|
||||||
margin_bottom = 191.0
|
margin_bottom = 241.0
|
||||||
rect_pivot_offset = Vector2( 0, 0 )
|
|
||||||
rect_clip_content = false
|
|
||||||
mouse_filter = 1
|
|
||||||
mouse_default_cursor_shape = 0
|
|
||||||
size_flags_horizontal = 4
|
size_flags_horizontal = 4
|
||||||
size_flags_vertical = 10
|
size_flags_vertical = 8
|
||||||
alignment = 0
|
custom_constants/separation = 4
|
||||||
_sections_unfolded = [ "Anchor", "Size Flags" ]
|
|
||||||
|
|
||||||
[node name="RodzLabs" type="Label" parent="VBoxContainer/VBoxContainer3" index="0"]
|
[node name="RZLogo" type="TextureRect" parent="VBoxContainer/VBoxContainer3"]
|
||||||
|
margin_left = 22.0
|
||||||
anchor_left = 0.0
|
margin_right = 86.0
|
||||||
anchor_top = 0.0
|
margin_bottom = 64.0
|
||||||
anchor_right = 0.0
|
rect_min_size = Vector2( 64, 64 )
|
||||||
anchor_bottom = 0.0
|
size_flags_horizontal = 4
|
||||||
margin_right = 108.0
|
|
||||||
margin_bottom = 14.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
|
size_flags_vertical = 4
|
||||||
text = "Rodz Labs"
|
texture = ExtResource( 4 )
|
||||||
align = 1
|
expand = true
|
||||||
percent_visible = 1.0
|
|
||||||
lines_skipped = 0
|
|
||||||
max_lines_visible = -1
|
|
||||||
|
|
||||||
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/VBoxContainer3" index="1"]
|
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/VBoxContainer3"]
|
||||||
|
margin_top = 68.0
|
||||||
anchor_left = 0.0
|
|
||||||
anchor_top = 0.0
|
|
||||||
anchor_right = 0.0
|
|
||||||
anchor_bottom = 0.0
|
|
||||||
margin_top = 18.0
|
|
||||||
margin_right = 108.0
|
margin_right = 108.0
|
||||||
margin_bottom = 42.0
|
margin_bottom = 92.0
|
||||||
rect_pivot_offset = Vector2( 0, 0 )
|
|
||||||
rect_clip_content = false
|
|
||||||
mouse_filter = 1
|
|
||||||
mouse_default_cursor_shape = 0
|
|
||||||
size_flags_horizontal = 4
|
size_flags_horizontal = 4
|
||||||
size_flags_vertical = 1
|
|
||||||
alignment = 0
|
|
||||||
_sections_unfolded = [ "Size Flags" ]
|
|
||||||
|
|
||||||
[node name="Facebook" type="TextureButton" parent="VBoxContainer/VBoxContainer3/HBoxContainer" index="0"]
|
[node name="Facebook" type="TextureButton" parent="VBoxContainer/VBoxContainer3/HBoxContainer"]
|
||||||
|
|
||||||
anchor_left = 0.0
|
|
||||||
anchor_top = 0.0
|
|
||||||
anchor_right = 0.0
|
|
||||||
anchor_bottom = 0.0
|
|
||||||
margin_right = 24.0
|
margin_right = 24.0
|
||||||
margin_bottom = 24.0
|
margin_bottom = 24.0
|
||||||
rect_min_size = Vector2( 24, 24 )
|
rect_min_size = Vector2( 24, 24 )
|
||||||
rect_pivot_offset = Vector2( 0, 0 )
|
texture_normal = ExtResource( 5 )
|
||||||
rect_clip_content = false
|
|
||||||
focus_mode = 2
|
|
||||||
mouse_filter = 0
|
|
||||||
mouse_default_cursor_shape = 0
|
|
||||||
size_flags_horizontal = 1
|
|
||||||
size_flags_vertical = 1
|
|
||||||
toggle_mode = false
|
|
||||||
enabled_focus_mode = 2
|
|
||||||
shortcut = null
|
|
||||||
group = null
|
|
||||||
texture_normal = ExtResource( 4 )
|
|
||||||
expand = true
|
expand = true
|
||||||
stretch_mode = 4
|
stretch_mode = 4
|
||||||
_sections_unfolded = [ "Size Flags", "Textures" ]
|
|
||||||
|
|
||||||
[node name="Twitter" type="TextureButton" parent="VBoxContainer/VBoxContainer3/HBoxContainer" index="1"]
|
[node name="Twitter" type="TextureButton" parent="VBoxContainer/VBoxContainer3/HBoxContainer"]
|
||||||
|
|
||||||
anchor_left = 0.0
|
|
||||||
anchor_top = 0.0
|
|
||||||
anchor_right = 0.0
|
|
||||||
anchor_bottom = 0.0
|
|
||||||
margin_left = 28.0
|
margin_left = 28.0
|
||||||
margin_right = 52.0
|
margin_right = 52.0
|
||||||
margin_bottom = 24.0
|
margin_bottom = 24.0
|
||||||
rect_min_size = Vector2( 24, 24 )
|
rect_min_size = Vector2( 24, 24 )
|
||||||
rect_pivot_offset = Vector2( 0, 0 )
|
texture_normal = ExtResource( 6 )
|
||||||
rect_clip_content = false
|
|
||||||
focus_mode = 2
|
|
||||||
mouse_filter = 0
|
|
||||||
mouse_default_cursor_shape = 0
|
|
||||||
size_flags_horizontal = 1
|
|
||||||
size_flags_vertical = 1
|
|
||||||
toggle_mode = false
|
|
||||||
enabled_focus_mode = 2
|
|
||||||
shortcut = null
|
|
||||||
group = null
|
|
||||||
texture_normal = ExtResource( 5 )
|
|
||||||
expand = true
|
expand = true
|
||||||
stretch_mode = 4
|
stretch_mode = 4
|
||||||
_sections_unfolded = [ "Textures" ]
|
|
||||||
|
|
||||||
[node name="Youtube" type="TextureButton" parent="VBoxContainer/VBoxContainer3/HBoxContainer" index="2"]
|
[node name="Youtube" type="TextureButton" parent="VBoxContainer/VBoxContainer3/HBoxContainer"]
|
||||||
|
|
||||||
anchor_left = 0.0
|
|
||||||
anchor_top = 0.0
|
|
||||||
anchor_right = 0.0
|
|
||||||
anchor_bottom = 0.0
|
|
||||||
margin_left = 56.0
|
margin_left = 56.0
|
||||||
margin_right = 80.0
|
margin_right = 80.0
|
||||||
margin_bottom = 24.0
|
margin_bottom = 24.0
|
||||||
rect_min_size = Vector2( 24, 24 )
|
rect_min_size = Vector2( 24, 24 )
|
||||||
rect_pivot_offset = Vector2( 0, 0 )
|
texture_normal = ExtResource( 7 )
|
||||||
rect_clip_content = false
|
|
||||||
focus_mode = 2
|
|
||||||
mouse_filter = 0
|
|
||||||
mouse_default_cursor_shape = 0
|
|
||||||
size_flags_horizontal = 1
|
|
||||||
size_flags_vertical = 1
|
|
||||||
toggle_mode = false
|
|
||||||
enabled_focus_mode = 2
|
|
||||||
shortcut = null
|
|
||||||
group = null
|
|
||||||
texture_normal = ExtResource( 6 )
|
|
||||||
expand = true
|
expand = true
|
||||||
stretch_mode = 4
|
stretch_mode = 4
|
||||||
_sections_unfolded = [ "Textures" ]
|
|
||||||
|
|
||||||
[node name="Github" type="TextureButton" parent="VBoxContainer/VBoxContainer3/HBoxContainer" index="3"]
|
[node name="Github" type="TextureButton" parent="VBoxContainer/VBoxContainer3/HBoxContainer"]
|
||||||
|
|
||||||
anchor_left = 0.0
|
|
||||||
anchor_top = 0.0
|
|
||||||
anchor_right = 0.0
|
|
||||||
anchor_bottom = 0.0
|
|
||||||
margin_left = 84.0
|
margin_left = 84.0
|
||||||
margin_right = 108.0
|
margin_right = 108.0
|
||||||
margin_bottom = 24.0
|
margin_bottom = 24.0
|
||||||
rect_min_size = Vector2( 24, 24 )
|
rect_min_size = Vector2( 24, 24 )
|
||||||
rect_pivot_offset = Vector2( 0, 0 )
|
texture_normal = ExtResource( 8 )
|
||||||
rect_clip_content = false
|
|
||||||
focus_mode = 2
|
|
||||||
mouse_filter = 0
|
|
||||||
mouse_default_cursor_shape = 0
|
|
||||||
size_flags_horizontal = 1
|
|
||||||
size_flags_vertical = 1
|
|
||||||
toggle_mode = false
|
|
||||||
enabled_focus_mode = 2
|
|
||||||
shortcut = null
|
|
||||||
group = null
|
|
||||||
texture_normal = ExtResource( 7 )
|
|
||||||
expand = true
|
expand = true
|
||||||
stretch_mode = 4
|
stretch_mode = 4
|
||||||
_sections_unfolded = [ "Textures" ]
|
|
||||||
|
|
||||||
[connection signal="pressed" from="VBoxContainer/HBoxContainer2/Godot" to="." method="open_url" binds= [ "https://godotengine.org/" ]]
|
[connection signal="pressed" from="VBoxContainer/HBoxContainer2/Godot" to="." method="open_url" binds= [ "https://godotengine.org/" ]]
|
||||||
|
|
||||||
[connection signal="pressed" from="VBoxContainer/VBoxContainer3/HBoxContainer/Facebook" to="." method="open_url" binds= [ "https://www.facebook.com/RodzLabs" ]]
|
[connection signal="pressed" from="VBoxContainer/VBoxContainer3/HBoxContainer/Facebook" to="." method="open_url" binds= [ "https://www.facebook.com/RodzLabs" ]]
|
||||||
|
|
||||||
[connection signal="pressed" from="VBoxContainer/VBoxContainer3/HBoxContainer/Twitter" to="." method="open_url" binds= [ "https://twitter.com/R0dZill4" ]]
|
[connection signal="pressed" from="VBoxContainer/VBoxContainer3/HBoxContainer/Twitter" to="." method="open_url" binds= [ "https://twitter.com/R0dZill4" ]]
|
||||||
|
|
||||||
[connection signal="pressed" from="VBoxContainer/VBoxContainer3/HBoxContainer/Youtube" to="." method="open_url" binds= [ "https://www.youtube.com/channel/UCTDByv9i3ul_qQ98zUYlNAQ" ]]
|
[connection signal="pressed" from="VBoxContainer/VBoxContainer3/HBoxContainer/Youtube" to="." method="open_url" binds= [ "https://www.youtube.com/channel/UCTDByv9i3ul_qQ98zUYlNAQ" ]]
|
||||||
|
|
||||||
[connection signal="pressed" from="VBoxContainer/VBoxContainer3/HBoxContainer/Github" to="." method="open_url" binds= [ "https://github.com/RodZill4" ]]
|
[connection signal="pressed" from="VBoxContainer/VBoxContainer3/HBoxContainer/Github" to="." method="open_url" binds= [ "https://github.com/RodZill4" ]]
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,13 +1,32 @@
|
|||||||
tool
|
tool
|
||||||
extends Label
|
extends HBoxContainer
|
||||||
|
|
||||||
|
var text setget set_text, get_text
|
||||||
|
|
||||||
|
signal label_changed(new_label)
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
func get_text():
|
||||||
|
return $Label.text
|
||||||
|
|
||||||
|
func set_text(t):
|
||||||
|
$Label.text = t
|
||||||
|
|
||||||
func _on_gui_input(ev):
|
func _on_gui_input(ev):
|
||||||
if ev is InputEventMouseButton and ev.doubleclick and ev.button_index == BUTTON_LEFT:
|
if ev is InputEventMouseButton and ev.pressed and ev.button_index == BUTTON_LEFT:
|
||||||
var dialog = preload("res://addons/material_maker/widgets/line_dialog.tscn").instance()
|
$Label.visible = false
|
||||||
add_child(dialog)
|
$Editor.text = $Label.text
|
||||||
dialog.set_texts("Remote", "Enter a name this control")
|
$Editor.visible = true
|
||||||
dialog.connect("ok", self, "set_text", [])
|
$Editor.select()
|
||||||
dialog.popup_centered()
|
$Editor.grab_focus()
|
||||||
|
|
||||||
|
func _on_Editor_text_entered(__):
|
||||||
|
_on_Editor_focus_exited()
|
||||||
|
|
||||||
|
func _on_Editor_focus_exited():
|
||||||
|
$Label.text = $Editor.text
|
||||||
|
$Label.visible = true
|
||||||
|
$Editor.visible = false
|
||||||
|
emit_signal("label_changed", $Editor.text)
|
||||||
|
@ -2,9 +2,21 @@
|
|||||||
|
|
||||||
[ext_resource path="res://addons/material_maker/widgets/linked_widgets/editable_label.gd" type="Script" id=1]
|
[ext_resource path="res://addons/material_maker/widgets/linked_widgets/editable_label.gd" type="Script" id=1]
|
||||||
|
|
||||||
[node name="Label" type="Label"]
|
[node name="EditableLabel" type="HBoxContainer"]
|
||||||
margin_right = 40.0
|
margin_right = 40.0
|
||||||
margin_bottom = 14.0
|
margin_bottom = 40.0
|
||||||
mouse_filter = 0
|
|
||||||
script = ExtResource( 1 )
|
script = ExtResource( 1 )
|
||||||
[connection signal="gui_input" from="." to="." method="_on_gui_input"]
|
|
||||||
|
[node name="Label" type="Label" parent="."]
|
||||||
|
margin_top = 13.0
|
||||||
|
margin_bottom = 27.0
|
||||||
|
mouse_filter = 0
|
||||||
|
|
||||||
|
[node name="Editor" type="LineEdit" parent="."]
|
||||||
|
visible = false
|
||||||
|
margin_left = 4.0
|
||||||
|
margin_right = 62.0
|
||||||
|
margin_bottom = 40.0
|
||||||
|
[connection signal="gui_input" from="Label" to="." method="_on_gui_input"]
|
||||||
|
[connection signal="focus_exited" from="Editor" to="." method="_on_Editor_focus_exited"]
|
||||||
|
[connection signal="text_entered" from="Editor" to="." method="_on_Editor_text_entered"]
|
||||||
|
@ -155,6 +155,7 @@ margin_top = 32.0
|
|||||||
margin_right = -4.0
|
margin_right = -4.0
|
||||||
margin_bottom = -4.0
|
margin_bottom = -4.0
|
||||||
mouse_default_cursor_shape = 0
|
mouse_default_cursor_shape = 0
|
||||||
|
custom_fonts/font = SubResource( 3 )
|
||||||
syntax_highlighting = true
|
syntax_highlighting = true
|
||||||
show_line_numbers = true
|
show_line_numbers = true
|
||||||
|
|
||||||
@ -167,6 +168,7 @@ margin_top = 32.0
|
|||||||
margin_right = -4.0
|
margin_right = -4.0
|
||||||
margin_bottom = -4.0
|
margin_bottom = -4.0
|
||||||
mouse_default_cursor_shape = 0
|
mouse_default_cursor_shape = 0
|
||||||
|
custom_fonts/font = SubResource( 3 )
|
||||||
syntax_highlighting = true
|
syntax_highlighting = true
|
||||||
show_line_numbers = true
|
show_line_numbers = true
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user