Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
drag and drop basic
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Rösel committed May 28, 2024
1 parent a2f1324 commit 804b9c2
Show file tree
Hide file tree
Showing 14 changed files with 540 additions and 1 deletion.
67 changes: 67 additions & 0 deletions godot/.godot/global_script_class_cache.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
list=Array[Dictionary]([{
"base": &"VBoxContainer",
"class": &"AutoRefresh",
"icon": "",
"language": &"GDScript",
"path": "res://src/widgets/AutoRefresh/auto_refresh.gd"
}, {
"base": &"Button",
"class": &"DragAndDropItem",
"icon": "",
"language": &"GDScript",
"path": "res://src/widgets/dragable_item/draggable.gd"
}, {
"base": &"Control",
"class": &"DragLeaf",
"icon": "",
"language": &"GDScript",
"path": "res://src/widgets/draggable tree/draggable_leaf.gd"
}, {
"base": &"Control",
"class": &"DragNode",
"icon": "",
"language": &"GDScript",
"path": "res://src/widgets/draggable tree/draggable_node.gd"
}, {
"base": &"Control",
"class": &"DragNodeStart",
"icon": "",
"language": &"GDScript",
"path": "res://src/widgets/draggable tree/draggable_node_start.gd"
}, {
"base": &"EditorPlugin",
"class": &"FormatOnSave",
"icon": "",
"language": &"GDScript",
"path": "res://addons/format_on_save/format_on_save.gd"
}, {
"base": &"RefCounted",
"class": &"GutHookScript",
"icon": "",
"language": &"GDScript",
"path": "res://addons/gut/hook_script.gd"
}, {
"base": &"RefCounted",
"class": &"GutStringUtils",
"icon": "",
"language": &"GDScript",
"path": "res://addons/gut/strutils.gd"
}, {
"base": &"Node",
"class": &"GutTest",
"icon": "",
"language": &"GDScript",
"path": "res://addons/gut/test.gd"
}, {
"base": &"Object",
"class": &"GutUtils",
"icon": "",
"language": &"GDScript",
"path": "res://addons/gut/utils.gd"
}, {
"base": &"Control",
"class": &"NonDragLabel",
"icon": "",
"language": &"GDScript",
"path": "res://src/widgets/draggable tree/non_dragable_label.gd"
}])
17 changes: 17 additions & 0 deletions godot/src/script_editor/AddTurnButton.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
extends Button

const MoveFragment: Resource = preload(
"res://src/script_editor/fragments/move_fragment/turn_fragment.tscn"
)


func _on_pressed():
#print_tree_pretty()
API.insert(200)
(
get_tree()
. get_current_scene()
. get_node("VBoxContainer/VScrollContainer/AutoRefresh/Code")
. add_child(MoveFragment.instantiate())
)
#get_tree().get_current_scene().print_tree_pretty()
12 changes: 12 additions & 0 deletions godot/src/script_editor/button_add.gd
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
extends Button

const TurnFragment: Resource = preload(
"res://src/script_editor/fragments/move_fragment/move_fragment.tscn"
)


func _on_pressed():
#print_tree_pretty()
API.insert(200)
(
get_tree()
. get_current_scene()
. get_node("VBoxContainer/VScrollContainer/AutoRefresh/Code")
. add_child(TurnFragment.instantiate())
)
#get_tree().get_current_scene().print_tree_pretty()
17 changes: 17 additions & 0 deletions godot/src/script_editor/button_for.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
extends Button

const MoveFragment: Resource = preload(
"res://src/script_editor/fragments/move_fragment/for_fragment.tscn"
)


func _on_pressed():
#print_tree_pretty()
API.insert(200)
(
get_tree()
. get_current_scene()
. get_node("VBoxContainer/VScrollContainer/AutoRefresh/Code")
. add_child(MoveFragment.instantiate())
)
#get_tree().get_current_scene().print_tree_pretty()
17 changes: 17 additions & 0 deletions godot/src/script_editor/button_while.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
extends Button

const MoveFragment: Resource = preload(
"res://src/script_editor/fragments/move_fragment/while_fragment.tscn"
)


func _on_pressed():
#print_tree_pretty()
API.insert(200)
(
get_tree()
. get_current_scene()
. get_node("VBoxContainer/VScrollContainer/AutoRefresh/Code")
. add_child(MoveFragment.instantiate())
)
#get_tree().get_current_scene().print_tree_pretty()
76 changes: 76 additions & 0 deletions godot/src/script_editor/fragments/move_fragment/for_fragment.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
[gd_scene load_steps=4 format=3 uid="uid://oiepjld6lwrp"]

[ext_resource type="Script" path="res://src/widgets/draggable tree/draggable_node.gd" id="1_o43h1"]
[ext_resource type="Script" path="res://src/widgets/draggable tree/non_dragable_label.gd" id="2_37oc4"]
[ext_resource type="Script" path="res://src/widgets/draggable tree/draggable_node_start.gd" id="3_wsklg"]

[node name="ForFragment" type="Control"]
custom_minimum_size = Vector2(0, 200)
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
script = ExtResource("1_o43h1")

[node name="VBoxContainer2" type="VBoxContainer" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2

[node name="NonDragLabel" type="Control" parent="VBoxContainer2"]
custom_minimum_size = Vector2(0, 20)
layout_mode = 2
script = ExtResource("2_37oc4")

[node name="Label" type="Label" parent="VBoxContainer2/NonDragLabel"]
custom_minimum_size = Vector2(0, 20)
layout_mode = 0
offset_right = 40.0
offset_bottom = 23.0
text = "For sdfsdfsdf"

[node name="DragNodeStart" type="Control" parent="VBoxContainer2"]
visible = false
custom_minimum_size = Vector2(0, 20)
layout_mode = 2
script = ExtResource("3_wsklg")

[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer2"]
custom_minimum_size = Vector2(200, 200)
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 2

[node name="Label3" type="Label" parent="VBoxContainer2/VBoxContainer"]
custom_minimum_size = Vector2(200, 20)
layout_mode = 2
size_flags_vertical = 3
text = "wrwerwer"
autowrap_mode = 3

[node name="Label2" type="Label" parent="VBoxContainer2/VBoxContainer"]
custom_minimum_size = Vector2(200, 20)
layout_mode = 2
size_flags_vertical = 3
text = "wrwer"
autowrap_mode = 3

[node name="Label" type="Label" parent="VBoxContainer2/VBoxContainer"]
custom_minimum_size = Vector2(200, 20)
layout_mode = 2
size_flags_vertical = 3
text = "werwer"
autowrap_mode = 3

[node name="Label4" type="Label" parent="VBoxContainer2/VBoxContainer"]
custom_minimum_size = Vector2(200, 20)
layout_mode = 2
size_flags_vertical = 3
text = "werwer"
autowrap_mode = 3
27 changes: 27 additions & 0 deletions godot/src/script_editor/fragments/move_fragment/move_fragment.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[gd_scene load_steps=2 format=3 uid="uid://bsutrnlas8do1"]

[ext_resource type="Script" path="res://src/widgets/draggable tree/draggable_leaf.gd" id="1_8mp6h"]

[node name="Move Fragment" type="Control"]
custom_minimum_size = Vector2(0, 20)
layout_mode = 3
anchors_preset = 0
offset_right = 40.0
offset_bottom = 40.0
script = ExtResource("1_8mp6h")

[node name="VBoxContainer" type="VBoxContainer" parent="."]
custom_minimum_size = Vector2(0, 20)
layout_mode = 2
offset_right = 74.0
offset_bottom = 23.0
size_flags_horizontal = 3
size_flags_vertical = 3

[node name="Label" type="Label" parent="VBoxContainer"]
custom_minimum_size = Vector2(0, 20)
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
text = "MOVE X Y"
vertical_alignment = 1
28 changes: 28 additions & 0 deletions godot/src/script_editor/fragments/move_fragment/turn_fragment.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[gd_scene load_steps=2 format=3 uid="uid://ccy3ijvvrbguo"]

[ext_resource type="Script" path="res://src/widgets/draggable tree/draggable_leaf.gd" id="1_8rgbb"]

[node name="MoveFragment" type="Container"]
custom_minimum_size = Vector2(0, 20)
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
size_flags_vertical = 3
script = ExtResource("1_8rgbb")

[node name="VBoxContainer" type="VBoxContainer" parent="."]
custom_minimum_size = Vector2(0, 20)
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3

[node name="Label" type="Label" parent="VBoxContainer"]
custom_minimum_size = Vector2(0, 20)
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
text = "TURN X"
vertical_alignment = 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
[gd_scene load_steps=4 format=3 uid="uid://d215f38mcypns"]

[ext_resource type="Script" path="res://src/widgets/draggable tree/draggable_node.gd" id="1_oy1be"]
[ext_resource type="Script" path="res://src/widgets/draggable tree/non_dragable_label.gd" id="2_wuun8"]
[ext_resource type="Script" path="res://src/widgets/draggable tree/draggable_node_start.gd" id="3_jnb65"]

[node name="ForFragment" type="Control"]
custom_minimum_size = Vector2(0, 200)
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
script = ExtResource("1_oy1be")

[node name="VBoxContainer2" type="VBoxContainer" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2

[node name="NonDragLabel" type="Control" parent="VBoxContainer2"]
custom_minimum_size = Vector2(0, 20)
layout_mode = 2
script = ExtResource("2_wuun8")

[node name="Label" type="Label" parent="VBoxContainer2/NonDragLabel"]
custom_minimum_size = Vector2(0, 20)
layout_mode = 0
offset_right = 40.0
offset_bottom = 23.0
text = "while sdfsdfsdf"

[node name="DragNodeStart" type="Control" parent="VBoxContainer2"]
visible = false
custom_minimum_size = Vector2(0, 20)
layout_mode = 2
script = ExtResource("3_jnb65")

[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer2"]
custom_minimum_size = Vector2(200, 200)
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 2

[node name="Label3" type="Label" parent="VBoxContainer2/VBoxContainer"]
custom_minimum_size = Vector2(200, 20)
layout_mode = 2
size_flags_vertical = 3
text = "wrwerwer"
autowrap_mode = 3

[node name="Label2" type="Label" parent="VBoxContainer2/VBoxContainer"]
custom_minimum_size = Vector2(200, 20)
layout_mode = 2
size_flags_vertical = 3
text = "wrwer"
autowrap_mode = 3

[node name="Label" type="Label" parent="VBoxContainer2/VBoxContainer"]
custom_minimum_size = Vector2(200, 20)
layout_mode = 2
size_flags_vertical = 3
text = "werwer"
autowrap_mode = 3

[node name="Label4" type="Label" parent="VBoxContainer2/VBoxContainer"]
custom_minimum_size = Vector2(200, 20)
layout_mode = 2
size_flags_vertical = 3
text = "werwer"
autowrap_mode = 3
Loading

0 comments on commit 804b9c2

Please sign in to comment.