mirror of
https://github.com/RPG-Research/bcirpg.git
synced 2024-04-16 14:23:01 +00:00
Experimental Code for Location Folders with Tabbed Canvas
Test project that contains several variations. Current work in toolset_test_tabbed_merged folder. Contains canvas tab and ColorRect assets for place, WIP.
This commit is contained in:
parent
daac13b923
commit
d07a961de1
@ -0,0 +1 @@
|
|||||||
|
|
@ -0,0 +1,3 @@
|
|||||||
|
source_md5="47313fa4c47a9963fddd764e1ec6e4a8"
|
||||||
|
dest_md5="26ea799ea0a3da9e753b3ebe822e0570"
|
||||||
|
|
Binary file not shown.
Binary file not shown.
@ -0,0 +1,2 @@
|
|||||||
|
# Intro to Godot drag and drop for Controls
|
||||||
|
|
@ -0,0 +1,7 @@
|
|||||||
|
[gd_resource type="Environment" load_steps=2 format=2]
|
||||||
|
|
||||||
|
[sub_resource type="ProceduralSky" id=1]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
background_mode = 2
|
||||||
|
background_sky = SubResource( 1 )
|
Binary file not shown.
After Width: | Height: | Size: 3.2 KiB |
@ -0,0 +1,35 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="StreamTexture"
|
||||||
|
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://icon.png"
|
||||||
|
dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_mode=0
|
||||||
|
compress/bptc_ldr=0
|
||||||
|
compress/normal_map=0
|
||||||
|
flags/repeat=0
|
||||||
|
flags/filter=true
|
||||||
|
flags/mipmaps=false
|
||||||
|
flags/anisotropic=false
|
||||||
|
flags/srgb=2
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/HDR_as_SRGB=false
|
||||||
|
process/invert_color=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
stream=false
|
||||||
|
size_limit=0
|
||||||
|
detect_3d=true
|
||||||
|
svg/scale=1.0
|
@ -0,0 +1,43 @@
|
|||||||
|
; Engine configuration file.
|
||||||
|
; It's best edited using the editor UI and not directly,
|
||||||
|
; since the parameters that go here are not all obvious.
|
||||||
|
;
|
||||||
|
; Format:
|
||||||
|
; [section] ; section goes between []
|
||||||
|
; param=value ; assign values to parameters
|
||||||
|
|
||||||
|
config_version=4
|
||||||
|
|
||||||
|
_global_script_classes=[ {
|
||||||
|
"base": "ColorRect",
|
||||||
|
"class": "Draggable",
|
||||||
|
"language": "GDScript",
|
||||||
|
"path": "res://toolset_test/draggable_final.gd"
|
||||||
|
}, {
|
||||||
|
"base": "ColorRect",
|
||||||
|
"class": "Draggable_Assets",
|
||||||
|
"language": "GDScript",
|
||||||
|
"path": "res://toolset_test_tabbed_merged/draggable_assets_final.gd"
|
||||||
|
} ]
|
||||||
|
_global_script_class_icons={
|
||||||
|
"Draggable": "",
|
||||||
|
"Draggable_Assets": ""
|
||||||
|
}
|
||||||
|
|
||||||
|
[application]
|
||||||
|
|
||||||
|
config/name="Experiment_Location_Folders"
|
||||||
|
run/main_scene="res://toolset_test/drag_and_drop_demo_final.tscn"
|
||||||
|
config/icon="res://icon.png"
|
||||||
|
|
||||||
|
[gui]
|
||||||
|
|
||||||
|
common/drop_mouse_on_gui_input_disabled=true
|
||||||
|
|
||||||
|
[physics]
|
||||||
|
|
||||||
|
common/enable_pause_aware_picking=true
|
||||||
|
|
||||||
|
[rendering]
|
||||||
|
|
||||||
|
environment/default_environment="res://default_env.tres"
|
@ -0,0 +1,9 @@
|
|||||||
|
extends PanelContainer
|
||||||
|
|
||||||
|
|
||||||
|
# Called when the node enters the scene tree for the first time.
|
||||||
|
func _ready() -> void:
|
||||||
|
$VLayout/DragAndDropColumns/SourceContainer/FileDialog.popup()
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,213 @@
|
|||||||
|
[gd_scene load_steps=11 format=2]
|
||||||
|
|
||||||
|
[ext_resource path="res://Cabin-VariableFont_wdth,wght.ttf" type="DynamicFontData" id=1]
|
||||||
|
[ext_resource path="res://toolset_test/source_container.gd" type="Script" id=2]
|
||||||
|
[ext_resource path="res://toolset_test/target_container_final.gd" type="Script" id=3]
|
||||||
|
[ext_resource path="res://toolset_test/drag_and_drop_demo_final.gd" type="Script" id=4]
|
||||||
|
|
||||||
|
[sub_resource type="StyleBoxFlat" id=5]
|
||||||
|
bg_color = Color( 0, 0, 0, 1 )
|
||||||
|
|
||||||
|
[sub_resource type="DynamicFont" id=4]
|
||||||
|
size = 32
|
||||||
|
font_data = ExtResource( 1 )
|
||||||
|
|
||||||
|
[sub_resource type="StyleBoxFlat" id=7]
|
||||||
|
bg_color = Color( 0.760784, 0.760784, 0.760784, 1 )
|
||||||
|
|
||||||
|
[sub_resource type="StyleBoxFlat" id=6]
|
||||||
|
bg_color = Color( 1, 1, 1, 1 )
|
||||||
|
|
||||||
|
[sub_resource type="StyleBoxFlat" id=2]
|
||||||
|
|
||||||
|
[sub_resource type="StyleBoxFlat" id=3]
|
||||||
|
bg_color = Color( 1, 1, 1, 1 )
|
||||||
|
|
||||||
|
[node name="DragAndDropDemo" type="PanelContainer"]
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
script = ExtResource( 4 )
|
||||||
|
|
||||||
|
[node name="VLayout" type="VBoxContainer" parent="."]
|
||||||
|
margin_left = 7.0
|
||||||
|
margin_top = 7.0
|
||||||
|
margin_right = 1017.0
|
||||||
|
margin_bottom = 593.0
|
||||||
|
__meta__ = {
|
||||||
|
"_edit_use_anchors_": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[node name="DescriptionHeader" type="HBoxContainer" parent="VLayout"]
|
||||||
|
margin_right = 1010.0
|
||||||
|
margin_bottom = 50.0
|
||||||
|
rect_min_size = Vector2( 0, 50 )
|
||||||
|
__meta__ = {
|
||||||
|
"_edit_use_anchors_": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[node name="M1H" type="Panel" parent="VLayout/DescriptionHeader"]
|
||||||
|
margin_right = 250.0
|
||||||
|
margin_bottom = 50.0
|
||||||
|
rect_min_size = Vector2( 250, 50 )
|
||||||
|
custom_styles/panel = SubResource( 5 )
|
||||||
|
|
||||||
|
[node name="Menu One" type="Label" parent="VLayout/DescriptionHeader/M1H"]
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
custom_fonts/font = SubResource( 4 )
|
||||||
|
text = "Menu 1"
|
||||||
|
align = 1
|
||||||
|
valign = 1
|
||||||
|
|
||||||
|
[node name="M2H" type="Panel" parent="VLayout/DescriptionHeader"]
|
||||||
|
margin_left = 254.0
|
||||||
|
margin_right = 502.0
|
||||||
|
margin_bottom = 50.0
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
custom_styles/panel = SubResource( 5 )
|
||||||
|
|
||||||
|
[node name="MenuTwo" type="Label" parent="VLayout/DescriptionHeader/M2H"]
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
custom_fonts/font = SubResource( 4 )
|
||||||
|
text = "Menu 2"
|
||||||
|
align = 1
|
||||||
|
valign = 1
|
||||||
|
|
||||||
|
[node name="M3H" type="Panel" parent="VLayout/DescriptionHeader"]
|
||||||
|
margin_left = 506.0
|
||||||
|
margin_right = 756.0
|
||||||
|
margin_bottom = 50.0
|
||||||
|
rect_min_size = Vector2( 250, 0 )
|
||||||
|
custom_styles/panel = SubResource( 5 )
|
||||||
|
|
||||||
|
[node name="Menu3Label" type="Label" parent="VLayout/DescriptionHeader/M3H"]
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
custom_fonts/font = SubResource( 4 )
|
||||||
|
text = "Menu 3"
|
||||||
|
align = 1
|
||||||
|
valign = 1
|
||||||
|
|
||||||
|
[node name="M4H" type="Panel" parent="VLayout/DescriptionHeader"]
|
||||||
|
margin_left = 760.0
|
||||||
|
margin_right = 1010.0
|
||||||
|
margin_bottom = 50.0
|
||||||
|
rect_min_size = Vector2( 250, 0 )
|
||||||
|
custom_styles/panel = SubResource( 5 )
|
||||||
|
|
||||||
|
[node name="Menu4Label" type="Label" parent="VLayout/DescriptionHeader/M4H"]
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
custom_fonts/font = SubResource( 4 )
|
||||||
|
text = "Menu 4"
|
||||||
|
align = 1
|
||||||
|
valign = 1
|
||||||
|
|
||||||
|
[node name="ToolsOptions" type="HBoxContainer" parent="VLayout"]
|
||||||
|
margin_top = 54.0
|
||||||
|
margin_right = 1010.0
|
||||||
|
margin_bottom = 104.0
|
||||||
|
rect_min_size = Vector2( 0, 50 )
|
||||||
|
__meta__ = {
|
||||||
|
"_edit_use_anchors_": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[node name="ToolsContainer" type="Panel" parent="VLayout/ToolsOptions"]
|
||||||
|
margin_right = 1010.0
|
||||||
|
margin_bottom = 50.0
|
||||||
|
rect_min_size = Vector2( 1010, 50 )
|
||||||
|
custom_styles/panel = SubResource( 7 )
|
||||||
|
script = ExtResource( 2 )
|
||||||
|
|
||||||
|
[node name="Padding" type="MarginContainer" parent="VLayout/ToolsOptions/ToolsContainer"]
|
||||||
|
margin_right = 1005.0
|
||||||
|
margin_bottom = 47.0
|
||||||
|
rect_min_size = Vector2( 1005, 0 )
|
||||||
|
|
||||||
|
[node name="Columns" type="HBoxContainer" parent="VLayout/ToolsOptions/ToolsContainer/Padding"]
|
||||||
|
margin_right = 1005.0
|
||||||
|
margin_bottom = 47.0
|
||||||
|
rect_min_size = Vector2( 1005, 0 )
|
||||||
|
|
||||||
|
[node name="DragAndDropColumns" type="HBoxContainer" parent="VLayout"]
|
||||||
|
margin_top = 108.0
|
||||||
|
margin_right = 1010.0
|
||||||
|
margin_bottom = 586.0
|
||||||
|
size_flags_vertical = 3
|
||||||
|
__meta__ = {
|
||||||
|
"_edit_use_anchors_": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[node name="SourceContainer" type="Panel" parent="VLayout/DragAndDropColumns"]
|
||||||
|
margin_right = 175.0
|
||||||
|
margin_bottom = 478.0
|
||||||
|
rect_min_size = Vector2( 175, 0 )
|
||||||
|
custom_styles/panel = SubResource( 6 )
|
||||||
|
|
||||||
|
[node name="FileDialog" type="FileDialog" parent="VLayout/DragAndDropColumns/SourceContainer"]
|
||||||
|
visible = true
|
||||||
|
margin_top = 19.0
|
||||||
|
margin_right = 356.0
|
||||||
|
margin_bottom = 477.0
|
||||||
|
window_title = "Open a Directory"
|
||||||
|
mode = 2
|
||||||
|
access = 2
|
||||||
|
|
||||||
|
[node name="Padding" type="MarginContainer" parent="VLayout/DragAndDropColumns/SourceContainer"]
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
margin_right = 30.0
|
||||||
|
rect_clip_content = true
|
||||||
|
custom_constants/margin_right = 20
|
||||||
|
custom_constants/margin_top = 20
|
||||||
|
custom_constants/margin_left = 20
|
||||||
|
custom_constants/margin_bottom = 20
|
||||||
|
|
||||||
|
[node name="Rows" type="VBoxContainer" parent="VLayout/DragAndDropColumns/SourceContainer/Padding"]
|
||||||
|
margin_left = 20.0
|
||||||
|
margin_top = 20.0
|
||||||
|
margin_right = 185.0
|
||||||
|
margin_bottom = 458.0
|
||||||
|
custom_constants/separation = 15
|
||||||
|
__meta__ = {
|
||||||
|
"_edit_use_anchors_": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[node name="CanvasContainer" type="Panel" parent="VLayout/DragAndDropColumns"]
|
||||||
|
margin_left = 179.0
|
||||||
|
margin_right = 831.0
|
||||||
|
margin_bottom = 478.0
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
custom_styles/panel = SubResource( 2 )
|
||||||
|
script = ExtResource( 3 )
|
||||||
|
|
||||||
|
[node name="Padding" type="MarginContainer" parent="VLayout/DragAndDropColumns/CanvasContainer"]
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
margin_left = 33.0
|
||||||
|
margin_top = -5.0
|
||||||
|
margin_right = -2.0
|
||||||
|
margin_bottom = -1.0
|
||||||
|
mouse_filter = 1
|
||||||
|
custom_constants/margin_right = 20
|
||||||
|
custom_constants/margin_top = 20
|
||||||
|
custom_constants/margin_left = 20
|
||||||
|
custom_constants/margin_bottom = 20
|
||||||
|
|
||||||
|
[node name="Rows" type="VBoxContainer" parent="VLayout/DragAndDropColumns/CanvasContainer/Padding"]
|
||||||
|
margin_left = 20.0
|
||||||
|
margin_top = 20.0
|
||||||
|
margin_right = 597.0
|
||||||
|
margin_bottom = 462.0
|
||||||
|
custom_constants/separation = 15
|
||||||
|
__meta__ = {
|
||||||
|
"_edit_use_anchors_": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[node name="DetailsContainer" type="Panel" parent="VLayout/DragAndDropColumns"]
|
||||||
|
margin_left = 835.0
|
||||||
|
margin_right = 1010.0
|
||||||
|
margin_bottom = 478.0
|
||||||
|
rect_min_size = Vector2( 175, 0 )
|
||||||
|
custom_styles/panel = SubResource( 3 )
|
@ -0,0 +1,26 @@
|
|||||||
|
[gd_scene load_steps=4 format=2]
|
||||||
|
|
||||||
|
[ext_resource path="res://Cabin-VariableFont_wdth,wght.ttf" type="DynamicFontData" id=1]
|
||||||
|
[ext_resource path="res://toolset_test/draggable_final.gd" type="Script" id=2]
|
||||||
|
|
||||||
|
[sub_resource type="DynamicFont" id=6]
|
||||||
|
size = 24
|
||||||
|
font_data = ExtResource( 1 )
|
||||||
|
|
||||||
|
[node name="Draggable" type="ColorRect"]
|
||||||
|
margin_right = 210.0
|
||||||
|
margin_bottom = 50.0
|
||||||
|
rect_min_size = Vector2( 210, 50 )
|
||||||
|
color = Color( 0.752941, 0.305882, 0.305882, 1 )
|
||||||
|
script = ExtResource( 2 )
|
||||||
|
|
||||||
|
[node name="Label" type="Label" parent="."]
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
custom_fonts/font = SubResource( 6 )
|
||||||
|
text = "Drag Me"
|
||||||
|
align = 1
|
||||||
|
valign = 1
|
||||||
|
__meta__ = {
|
||||||
|
"_edit_use_anchors_": false
|
||||||
|
}
|
@ -0,0 +1,42 @@
|
|||||||
|
extends ColorRect
|
||||||
|
class_name Draggable
|
||||||
|
|
||||||
|
var id: int
|
||||||
|
var label: String
|
||||||
|
# set this to true once we've been dropped on our target
|
||||||
|
var dropped_on_target: bool = false
|
||||||
|
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
add_to_group("DRAGGABLE")
|
||||||
|
$Label.text = label
|
||||||
|
|
||||||
|
|
||||||
|
func get_drag_data(_position: Vector2):
|
||||||
|
print("[Draggable] get_drag_data has run")
|
||||||
|
if not dropped_on_target:
|
||||||
|
set_drag_preview(_get_preview_control())
|
||||||
|
return self
|
||||||
|
|
||||||
|
|
||||||
|
func _on_item_dropped_on_target(draggable):
|
||||||
|
print("[Draggable] Signal item_dropped_on_target received")
|
||||||
|
if draggable.get("id") != id:
|
||||||
|
return
|
||||||
|
print("[Draggable] Iven been dropped, removing myself from source container")
|
||||||
|
queue_free()
|
||||||
|
|
||||||
|
|
||||||
|
func _get_preview_control() -> Control:
|
||||||
|
"""
|
||||||
|
The preview control must not be in the scene tree. You should not free the control, and
|
||||||
|
you should not keep a reference to the control beyond the duration of the drag.
|
||||||
|
It will be deleted automatically after the drag has ended.
|
||||||
|
"""
|
||||||
|
var preview = ColorRect.new()
|
||||||
|
preview.rect_size = rect_size
|
||||||
|
var preview_color = color
|
||||||
|
preview_color.a = .5
|
||||||
|
preview.color = preview_color
|
||||||
|
preview.set_rotation(.1) # in readians
|
||||||
|
return preview
|
@ -0,0 +1,31 @@
|
|||||||
|
extends Panel
|
||||||
|
|
||||||
|
onready var drop_target = get_node("/root/DragAndDropDemo/VLayout/DragAndDropColumns/CanvasContainer")
|
||||||
|
onready var draggable_scene: PackedScene = preload("res://toolset_test/draggable.tscn")
|
||||||
|
onready var draggable_container = $Padding/Columns
|
||||||
|
|
||||||
|
var dragables = [
|
||||||
|
{"id": 1, "label": "dialog"},
|
||||||
|
{"id": 2, "label": "object"},
|
||||||
|
{"id": 3, "label": "encounter"}
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
drop_target.connect("item_dropped_on_target", self, "_on_item_dropped_on_target")
|
||||||
|
_populate_dragables()
|
||||||
|
|
||||||
|
func _populate_dragables():
|
||||||
|
for dragable in dragables:
|
||||||
|
var drag_item = draggable_scene.instance()
|
||||||
|
drag_item.id = dragable["id"]
|
||||||
|
drag_item.label = dragable["label"]
|
||||||
|
draggable_container.add_child(drag_item)
|
||||||
|
|
||||||
|
func _on_item_dropped_on_target(dropped_item: Draggable) -> void:
|
||||||
|
for drag_item in draggable_container.get_children():
|
||||||
|
drag_item = (drag_item as Draggable)
|
||||||
|
if drag_item.id == dropped_item.id:
|
||||||
|
#draggable_container.remove_child(drag_item)
|
||||||
|
#drag_item.queue_free()
|
||||||
|
break
|
@ -0,0 +1,26 @@
|
|||||||
|
extends Panel
|
||||||
|
|
||||||
|
|
||||||
|
signal item_dropped_on_target(draggable)
|
||||||
|
var draggable: PackedScene = preload("res://toolset_test/draggable.tscn")
|
||||||
|
|
||||||
|
func can_drop_data(position: Vector2, data) -> bool:
|
||||||
|
var can_drop: bool = data is Node and data.is_in_group("DRAGGABLE")
|
||||||
|
print("[TargetContainer] can_drop_data has run, returning %s" % can_drop)
|
||||||
|
return can_drop
|
||||||
|
|
||||||
|
func drop_data(position: Vector2, data) -> void:
|
||||||
|
print("[TargetContainer] drop_data has run")
|
||||||
|
print("[TargetContainer] Emiting signal: item_dropped_on_target")
|
||||||
|
|
||||||
|
#DKM TEMP: here we'd open wizard or create new item.
|
||||||
|
# How should this display when it's finalized?
|
||||||
|
var draggable_copy: ColorRect = draggable.instance()
|
||||||
|
draggable_copy.id = data.id
|
||||||
|
#Instantiate a new version of the specific item in this content capsule
|
||||||
|
draggable_copy.label = data.label
|
||||||
|
draggable_copy.dropped_on_target = true # disable further dragging
|
||||||
|
$Padding/Rows.add_child(draggable_copy)
|
||||||
|
|
||||||
|
emit_signal("item_dropped_on_target", data)
|
||||||
|
|
@ -0,0 +1,16 @@
|
|||||||
|
extends PanelContainer
|
||||||
|
|
||||||
|
|
||||||
|
# Declare member variables here. Examples:
|
||||||
|
# var a: int = 2
|
||||||
|
# var b: String = "text"
|
||||||
|
|
||||||
|
|
||||||
|
# Called when the node enters the scene tree for the first time.
|
||||||
|
func _ready() -> void:
|
||||||
|
var outputFolderStr = "Region\n\tLocation\n\t\tSpace\n\t\t\tScene" + "\n\t\tSpace"
|
||||||
|
$VLayout/HBoxContainer/TabContainer/Structural_Tab/TextEdit.text = outputFolderStr
|
||||||
|
|
||||||
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||||
|
#func _process(delta: float) -> void:
|
||||||
|
# pass
|
@ -0,0 +1,198 @@
|
|||||||
|
[gd_scene load_steps=11 format=2]
|
||||||
|
|
||||||
|
[ext_resource path="res://Cabin-VariableFont_wdth,wght.ttf" type="DynamicFontData" id=1]
|
||||||
|
[ext_resource path="res://toolset_test/source_container.gd" type="Script" id=2]
|
||||||
|
[ext_resource path="res://toolset_test/target_container_final.gd" type="Script" id=3]
|
||||||
|
[ext_resource path="res://toolset_test_manual/Control_Manual_MasterScript.gd" type="Script" id=4]
|
||||||
|
|
||||||
|
[sub_resource type="StyleBoxFlat" id=5]
|
||||||
|
bg_color = Color( 0, 0, 0, 1 )
|
||||||
|
|
||||||
|
[sub_resource type="DynamicFont" id=4]
|
||||||
|
size = 32
|
||||||
|
font_data = ExtResource( 1 )
|
||||||
|
|
||||||
|
[sub_resource type="StyleBoxFlat" id=7]
|
||||||
|
bg_color = Color( 0.760784, 0.760784, 0.760784, 1 )
|
||||||
|
|
||||||
|
[sub_resource type="StyleBoxFlat" id=6]
|
||||||
|
bg_color = Color( 1, 1, 1, 1 )
|
||||||
|
|
||||||
|
[sub_resource type="StyleBoxFlat" id=2]
|
||||||
|
|
||||||
|
[sub_resource type="StyleBoxFlat" id=3]
|
||||||
|
bg_color = Color( 1, 1, 1, 1 )
|
||||||
|
|
||||||
|
[node name="DragAndDropDemo" type="PanelContainer"]
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
script = ExtResource( 4 )
|
||||||
|
|
||||||
|
[node name="VLayout" type="VBoxContainer" parent="."]
|
||||||
|
margin_left = 7.0
|
||||||
|
margin_top = 7.0
|
||||||
|
margin_right = 1017.0
|
||||||
|
margin_bottom = 593.0
|
||||||
|
__meta__ = {
|
||||||
|
"_edit_use_anchors_": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[node name="DescriptionHeader" type="HBoxContainer" parent="VLayout"]
|
||||||
|
margin_right = 1010.0
|
||||||
|
margin_bottom = 50.0
|
||||||
|
rect_min_size = Vector2( 0, 50 )
|
||||||
|
__meta__ = {
|
||||||
|
"_edit_use_anchors_": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[node name="M1H" type="Panel" parent="VLayout/DescriptionHeader"]
|
||||||
|
margin_right = 250.0
|
||||||
|
margin_bottom = 50.0
|
||||||
|
rect_min_size = Vector2( 250, 50 )
|
||||||
|
custom_styles/panel = SubResource( 5 )
|
||||||
|
|
||||||
|
[node name="Menu One" type="Label" parent="VLayout/DescriptionHeader/M1H"]
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
custom_fonts/font = SubResource( 4 )
|
||||||
|
text = "Menu 1"
|
||||||
|
align = 1
|
||||||
|
valign = 1
|
||||||
|
|
||||||
|
[node name="M2H" type="Panel" parent="VLayout/DescriptionHeader"]
|
||||||
|
margin_left = 254.0
|
||||||
|
margin_right = 502.0
|
||||||
|
margin_bottom = 50.0
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
custom_styles/panel = SubResource( 5 )
|
||||||
|
|
||||||
|
[node name="MenuTwo" type="Label" parent="VLayout/DescriptionHeader/M2H"]
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
custom_fonts/font = SubResource( 4 )
|
||||||
|
text = "Menu 2"
|
||||||
|
align = 1
|
||||||
|
valign = 1
|
||||||
|
|
||||||
|
[node name="M3H" type="Panel" parent="VLayout/DescriptionHeader"]
|
||||||
|
margin_left = 506.0
|
||||||
|
margin_right = 756.0
|
||||||
|
margin_bottom = 50.0
|
||||||
|
rect_min_size = Vector2( 250, 0 )
|
||||||
|
custom_styles/panel = SubResource( 5 )
|
||||||
|
|
||||||
|
[node name="Menu3Label" type="Label" parent="VLayout/DescriptionHeader/M3H"]
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
custom_fonts/font = SubResource( 4 )
|
||||||
|
text = "Menu 3"
|
||||||
|
align = 1
|
||||||
|
valign = 1
|
||||||
|
|
||||||
|
[node name="M4H" type="Panel" parent="VLayout/DescriptionHeader"]
|
||||||
|
margin_left = 760.0
|
||||||
|
margin_right = 1010.0
|
||||||
|
margin_bottom = 50.0
|
||||||
|
rect_min_size = Vector2( 250, 0 )
|
||||||
|
custom_styles/panel = SubResource( 5 )
|
||||||
|
|
||||||
|
[node name="Menu4Label" type="Label" parent="VLayout/DescriptionHeader/M4H"]
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
custom_fonts/font = SubResource( 4 )
|
||||||
|
text = "Menu 4"
|
||||||
|
align = 1
|
||||||
|
valign = 1
|
||||||
|
|
||||||
|
[node name="ToolsOptions" type="HBoxContainer" parent="VLayout"]
|
||||||
|
margin_top = 54.0
|
||||||
|
margin_right = 1010.0
|
||||||
|
margin_bottom = 104.0
|
||||||
|
rect_min_size = Vector2( 0, 50 )
|
||||||
|
__meta__ = {
|
||||||
|
"_edit_use_anchors_": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[node name="ToolsContainer" type="Panel" parent="VLayout/ToolsOptions"]
|
||||||
|
margin_right = 1010.0
|
||||||
|
margin_bottom = 50.0
|
||||||
|
rect_min_size = Vector2( 1010, 50 )
|
||||||
|
custom_styles/panel = SubResource( 7 )
|
||||||
|
script = ExtResource( 2 )
|
||||||
|
|
||||||
|
[node name="Padding" type="MarginContainer" parent="VLayout/ToolsOptions/ToolsContainer"]
|
||||||
|
margin_right = 1005.0
|
||||||
|
margin_bottom = 47.0
|
||||||
|
rect_min_size = Vector2( 1005, 0 )
|
||||||
|
|
||||||
|
[node name="Columns" type="HBoxContainer" parent="VLayout/ToolsOptions/ToolsContainer/Padding"]
|
||||||
|
margin_right = 1005.0
|
||||||
|
margin_bottom = 47.0
|
||||||
|
rect_min_size = Vector2( 1005, 0 )
|
||||||
|
|
||||||
|
[node name="DragAndDropColumns" type="HBoxContainer" parent="VLayout"]
|
||||||
|
margin_top = 108.0
|
||||||
|
margin_right = 1010.0
|
||||||
|
margin_bottom = 586.0
|
||||||
|
size_flags_vertical = 3
|
||||||
|
__meta__ = {
|
||||||
|
"_edit_use_anchors_": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[node name="SourceContainer" type="Panel" parent="VLayout/DragAndDropColumns"]
|
||||||
|
margin_right = 175.0
|
||||||
|
margin_bottom = 478.0
|
||||||
|
rect_min_size = Vector2( 175, 0 )
|
||||||
|
custom_styles/panel = SubResource( 6 )
|
||||||
|
|
||||||
|
[node name="Padding" type="MarginContainer" parent="VLayout/DragAndDropColumns/SourceContainer"]
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
margin_right = 30.0
|
||||||
|
rect_clip_content = true
|
||||||
|
custom_constants/margin_right = 20
|
||||||
|
custom_constants/margin_top = 20
|
||||||
|
custom_constants/margin_left = 20
|
||||||
|
custom_constants/margin_bottom = 20
|
||||||
|
|
||||||
|
[node name="TextEdit" type="TextEdit" parent="VLayout/DragAndDropColumns/SourceContainer"]
|
||||||
|
margin_right = 175.0
|
||||||
|
margin_bottom = 478.0
|
||||||
|
|
||||||
|
[node name="CanvasContainer" type="Panel" parent="VLayout/DragAndDropColumns"]
|
||||||
|
margin_left = 179.0
|
||||||
|
margin_right = 831.0
|
||||||
|
margin_bottom = 478.0
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
custom_styles/panel = SubResource( 2 )
|
||||||
|
script = ExtResource( 3 )
|
||||||
|
|
||||||
|
[node name="Padding" type="MarginContainer" parent="VLayout/DragAndDropColumns/CanvasContainer"]
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
margin_left = 33.0
|
||||||
|
margin_top = -5.0
|
||||||
|
margin_right = -2.0
|
||||||
|
margin_bottom = -1.0
|
||||||
|
mouse_filter = 1
|
||||||
|
custom_constants/margin_right = 20
|
||||||
|
custom_constants/margin_top = 20
|
||||||
|
custom_constants/margin_left = 20
|
||||||
|
custom_constants/margin_bottom = 20
|
||||||
|
|
||||||
|
[node name="Rows" type="VBoxContainer" parent="VLayout/DragAndDropColumns/CanvasContainer/Padding"]
|
||||||
|
margin_left = 20.0
|
||||||
|
margin_top = 20.0
|
||||||
|
margin_right = 597.0
|
||||||
|
margin_bottom = 462.0
|
||||||
|
custom_constants/separation = 15
|
||||||
|
__meta__ = {
|
||||||
|
"_edit_use_anchors_": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[node name="DetailsContainer" type="Panel" parent="VLayout/DragAndDropColumns"]
|
||||||
|
margin_left = 835.0
|
||||||
|
margin_right = 1010.0
|
||||||
|
margin_bottom = 478.0
|
||||||
|
rect_min_size = Vector2( 175, 0 )
|
||||||
|
custom_styles/panel = SubResource( 3 )
|
@ -0,0 +1,31 @@
|
|||||||
|
extends Panel
|
||||||
|
|
||||||
|
onready var drop_target = get_node("/root/DragAndDropDemo/VLayout/DragAndDropColumns/CanvasContainer")
|
||||||
|
onready var draggable_scene: PackedScene = preload("res://toolset_test/draggable.tscn")
|
||||||
|
onready var draggable_container = $Padding/Columns
|
||||||
|
|
||||||
|
var dragables = [
|
||||||
|
{"id": 1, "label": "dialog"},
|
||||||
|
{"id": 2, "label": "object"},
|
||||||
|
{"id": 3, "label": "encounter"}
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
drop_target.connect("item_dropped_on_target", self, "_on_item_dropped_on_target")
|
||||||
|
_populate_dragables()
|
||||||
|
|
||||||
|
func _populate_dragables():
|
||||||
|
for dragable in dragables:
|
||||||
|
var drag_item = draggable_scene.instance()
|
||||||
|
drag_item.id = dragable["id"]
|
||||||
|
drag_item.label = dragable["label"]
|
||||||
|
draggable_container.add_child(drag_item)
|
||||||
|
|
||||||
|
func _on_item_dropped_on_target(dropped_item: Draggable) -> void:
|
||||||
|
for drag_item in draggable_container.get_children():
|
||||||
|
drag_item = (drag_item as Draggable)
|
||||||
|
if drag_item.id == dropped_item.id:
|
||||||
|
#draggable_container.remove_child(drag_item)
|
||||||
|
#drag_item.queue_free()
|
||||||
|
break
|
@ -0,0 +1,26 @@
|
|||||||
|
extends Panel
|
||||||
|
|
||||||
|
|
||||||
|
signal item_dropped_on_target(draggable)
|
||||||
|
var draggable: PackedScene = preload("res://toolset_test/draggable.tscn")
|
||||||
|
|
||||||
|
func can_drop_data(position: Vector2, data) -> bool:
|
||||||
|
var can_drop: bool = data is Node and data.is_in_group("DRAGGABLE")
|
||||||
|
print("[TargetContainer] can_drop_data has run, returning %s" % can_drop)
|
||||||
|
return can_drop
|
||||||
|
|
||||||
|
func drop_data(position: Vector2, data) -> void:
|
||||||
|
print("[TargetContainer] drop_data has run")
|
||||||
|
print("[TargetContainer] Emiting signal: item_dropped_on_target")
|
||||||
|
|
||||||
|
#DKM TEMP: here we'd open wizard or create new item.
|
||||||
|
# How should this display when it's finalized?
|
||||||
|
var draggable_copy: ColorRect = draggable.instance()
|
||||||
|
draggable_copy.id = data.id
|
||||||
|
#Instantiate a new version of the specific item in this content capsule
|
||||||
|
draggable_copy.label = data.label
|
||||||
|
draggable_copy.dropped_on_target = true # disable further dragging
|
||||||
|
$Padding/Rows.add_child(draggable_copy)
|
||||||
|
|
||||||
|
emit_signal("item_dropped_on_target", data)
|
||||||
|
|
@ -0,0 +1,16 @@
|
|||||||
|
extends PanelContainer
|
||||||
|
|
||||||
|
|
||||||
|
# Declare member variables here. Examples:
|
||||||
|
# var a: int = 2
|
||||||
|
# var b: String = "text"
|
||||||
|
|
||||||
|
|
||||||
|
# Called when the node enters the scene tree for the first time.
|
||||||
|
func _ready() -> void:
|
||||||
|
var outputFolderStr = "Region\n\tLocation\n\t\tSpace\n\t\t\tScene" + "\n\t\tSpace"
|
||||||
|
$VLayout/DragAndDropColumns/SourceContainer/TextEdit.text = outputFolderStr
|
||||||
|
|
||||||
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||||
|
#func _process(delta: float) -> void:
|
||||||
|
# pass
|
@ -0,0 +1,31 @@
|
|||||||
|
extends Panel
|
||||||
|
|
||||||
|
onready var drop_target = get_node("/root/DragAndDropDemo/VLayout/DragAndDropColumns/CanvasContainer")
|
||||||
|
onready var draggable_scene: PackedScene = preload("res://toolset_test/draggable.tscn")
|
||||||
|
onready var draggable_container = $Padding/Columns
|
||||||
|
|
||||||
|
var dragables = [
|
||||||
|
{"id": 1, "label": "dialog"},
|
||||||
|
{"id": 2, "label": "object"},
|
||||||
|
{"id": 3, "label": "encounter"}
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
drop_target.connect("item_dropped_on_target", self, "_on_item_dropped_on_target")
|
||||||
|
_populate_dragables()
|
||||||
|
|
||||||
|
func _populate_dragables():
|
||||||
|
for dragable in dragables:
|
||||||
|
var drag_item = draggable_scene.instance()
|
||||||
|
drag_item.id = dragable["id"]
|
||||||
|
drag_item.label = dragable["label"]
|
||||||
|
draggable_container.add_child(drag_item)
|
||||||
|
|
||||||
|
func _on_item_dropped_on_target(dropped_item: Draggable) -> void:
|
||||||
|
for drag_item in draggable_container.get_children():
|
||||||
|
drag_item = (drag_item as Draggable)
|
||||||
|
if drag_item.id == dropped_item.id:
|
||||||
|
#draggable_container.remove_child(drag_item)
|
||||||
|
#drag_item.queue_free()
|
||||||
|
break
|
@ -0,0 +1,33 @@
|
|||||||
|
[gd_scene format=2]
|
||||||
|
|
||||||
|
[node name="Node2D" type="Node2D"]
|
||||||
|
|
||||||
|
[node name="TabContainer" type="TabContainer" parent="."]
|
||||||
|
margin_right = 1027.0
|
||||||
|
margin_bottom = 604.0
|
||||||
|
|
||||||
|
[node name="Visual_Tab" type="Tabs" parent="TabContainer"]
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
margin_left = 4.0
|
||||||
|
margin_top = 32.0
|
||||||
|
margin_right = -4.0
|
||||||
|
margin_bottom = -4.0
|
||||||
|
|
||||||
|
[node name="ColorPicker" type="ColorPicker" parent="TabContainer/Visual_Tab"]
|
||||||
|
margin_left = 4.0
|
||||||
|
margin_top = 4.0
|
||||||
|
margin_right = 312.0
|
||||||
|
margin_bottom = 466.0
|
||||||
|
|
||||||
|
[node name="Structural_Tab" type="Tabs" parent="TabContainer"]
|
||||||
|
visible = false
|
||||||
|
margin_right = 40.0
|
||||||
|
margin_bottom = 24.0
|
||||||
|
|
||||||
|
[node name="TextEdit" type="TextEdit" parent="TabContainer/Structural_Tab"]
|
||||||
|
margin_left = 4.0
|
||||||
|
margin_top = 32.0
|
||||||
|
margin_right = 1023.0
|
||||||
|
margin_bottom = 600.0
|
||||||
|
text = "Location folder data loads here"
|
@ -0,0 +1,26 @@
|
|||||||
|
extends Panel
|
||||||
|
|
||||||
|
|
||||||
|
signal item_dropped_on_target(draggable)
|
||||||
|
var draggable: PackedScene = preload("res://toolset_test/draggable.tscn")
|
||||||
|
|
||||||
|
func can_drop_data(position: Vector2, data) -> bool:
|
||||||
|
var can_drop: bool = data is Node and data.is_in_group("DRAGGABLE")
|
||||||
|
print("[TargetContainer] can_drop_data has run, returning %s" % can_drop)
|
||||||
|
return can_drop
|
||||||
|
|
||||||
|
func drop_data(position: Vector2, data) -> void:
|
||||||
|
print("[TargetContainer] drop_data has run")
|
||||||
|
print("[TargetContainer] Emiting signal: item_dropped_on_target")
|
||||||
|
|
||||||
|
#DKM TEMP: here we'd open wizard or create new item.
|
||||||
|
# How should this display when it's finalized?
|
||||||
|
var draggable_copy: ColorRect = draggable.instance()
|
||||||
|
draggable_copy.id = data.id
|
||||||
|
#Instantiate a new version of the specific item in this content capsule
|
||||||
|
draggable_copy.label = data.label
|
||||||
|
draggable_copy.dropped_on_target = true # disable further dragging
|
||||||
|
$Padding/Rows.add_child(draggable_copy)
|
||||||
|
|
||||||
|
emit_signal("item_dropped_on_target", data)
|
||||||
|
|
@ -0,0 +1,33 @@
|
|||||||
|
extends Panel
|
||||||
|
|
||||||
|
onready var drop_target = get_node("/root/Tabbed_merged_test/VLayout/HBoxContainer/TabContainer/Structural_Tab/PanelCanvas_Temp")
|
||||||
|
|
||||||
|
onready var draggable_assets_scene: PackedScene = preload("res://toolset_test_tabbed_merged/draggable_assets.tscn")
|
||||||
|
onready var draggable_assets_container = $Padding/AssetsRows
|
||||||
|
|
||||||
|
var dragables = [
|
||||||
|
{"id": 1, "label": "region"},
|
||||||
|
{"id": 2, "label": "location"},
|
||||||
|
{"id": 3, "label": "space"},
|
||||||
|
{"id": 4, "label": "scene"},
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
drop_target.connect("item_dropped_on_target", self, "_on_item_dropped_on_target")
|
||||||
|
_populate_dragables()
|
||||||
|
|
||||||
|
func _populate_dragables():
|
||||||
|
for dragable in dragables:
|
||||||
|
var drag_item = draggable_assets_scene.instance()
|
||||||
|
drag_item.id = dragable["id"]
|
||||||
|
drag_item.label = dragable["label"]
|
||||||
|
draggable_assets_container.add_child(drag_item)
|
||||||
|
|
||||||
|
func _on_item_dropped_on_target(dropped_item: Draggable_Assets) -> void:
|
||||||
|
for drag_item in draggable_assets_container.get_children():
|
||||||
|
drag_item = (drag_item as Draggable_Assets)
|
||||||
|
if drag_item.id == dropped_item.id:
|
||||||
|
#draggable_container.remove_child(drag_item)
|
||||||
|
#drag_item.queue_free()
|
||||||
|
break
|
@ -0,0 +1,25 @@
|
|||||||
|
extends Panel
|
||||||
|
|
||||||
|
|
||||||
|
signal item_dropped_on_target(draggable_assets)
|
||||||
|
var draggable_assets: PackedScene = preload("res://toolset_test_tabbed_merged/draggable_assets.tscn")
|
||||||
|
|
||||||
|
func can_drop_data(position: Vector2, data) -> bool:
|
||||||
|
var can_drop: bool = data is Node and data.is_in_group("DRAGGABLE_ASSETS")
|
||||||
|
print("[TargetContainer] can_drop_data has run, returning %s" % can_drop)
|
||||||
|
return can_drop
|
||||||
|
|
||||||
|
func drop_data(position: Vector2, data) -> void:
|
||||||
|
print("[TargetContainer] drop_data has run")
|
||||||
|
print("[TargetContainer] Emiting signal: item_dropped_on_target")
|
||||||
|
|
||||||
|
#DKM TEMP: here we'd open wizard or create new item.
|
||||||
|
# How should this display when it's finalized?
|
||||||
|
var draggable_copy: ColorRect = draggable_assets.instance()
|
||||||
|
draggable_copy.id = data.id
|
||||||
|
#Instantiate a new version of the specific item in this content capsule
|
||||||
|
draggable_copy.label = data.label
|
||||||
|
draggable_copy.dropped_on_target = true # disable further dragging
|
||||||
|
$Padding/Rows.add_child(draggable_copy)
|
||||||
|
|
||||||
|
emit_signal("item_dropped_on_target", data)
|
@ -0,0 +1,23 @@
|
|||||||
|
[gd_scene load_steps=4 format=2]
|
||||||
|
|
||||||
|
[ext_resource path="res://Cabin-VariableFont_wdth,wght.ttf" type="DynamicFontData" id=1]
|
||||||
|
[ext_resource path="res://toolset_test/draggable_final.gd" type="Script" id=2]
|
||||||
|
|
||||||
|
[sub_resource type="DynamicFont" id=6]
|
||||||
|
size = 24
|
||||||
|
font_data = ExtResource( 1 )
|
||||||
|
|
||||||
|
[node name="Draggable" type="ColorRect"]
|
||||||
|
margin_right = 150.0
|
||||||
|
margin_bottom = 35.0
|
||||||
|
rect_min_size = Vector2( 150, 35 )
|
||||||
|
color = Color( 0.752941, 0.305882, 0.305882, 1 )
|
||||||
|
script = ExtResource( 2 )
|
||||||
|
|
||||||
|
[node name="Label" type="Label" parent="."]
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
custom_fonts/font = SubResource( 6 )
|
||||||
|
text = "Drag Me"
|
||||||
|
align = 1
|
||||||
|
valign = 1
|
@ -0,0 +1,42 @@
|
|||||||
|
extends ColorRect
|
||||||
|
class_name Draggable_Assets
|
||||||
|
|
||||||
|
var id: int
|
||||||
|
var label: String
|
||||||
|
# set this to true once we've been dropped on our target
|
||||||
|
var dropped_on_target: bool = false
|
||||||
|
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
add_to_group("DRAGGABLE_ASSETS")
|
||||||
|
$Label.text = label
|
||||||
|
|
||||||
|
|
||||||
|
func get_drag_data(_position: Vector2):
|
||||||
|
print("[Draggable_Assets] get_drag_data has run")
|
||||||
|
if not dropped_on_target:
|
||||||
|
set_drag_preview(_get_preview_control())
|
||||||
|
return self
|
||||||
|
|
||||||
|
|
||||||
|
func _on_item_dropped_on_target(draggable_assets):
|
||||||
|
print("[Draggable_Assets] Signal item_dropped_on_target received")
|
||||||
|
if draggable_assets.get("id") != id:
|
||||||
|
return
|
||||||
|
print("[Draggable_Assets] Iven been dropped, removing myself from source container")
|
||||||
|
queue_free()
|
||||||
|
|
||||||
|
|
||||||
|
func _get_preview_control() -> Control:
|
||||||
|
"""
|
||||||
|
The preview control must not be in the scene tree. You should not free the control, and
|
||||||
|
you should not keep a reference to the control beyond the duration of the drag.
|
||||||
|
It will be deleted automatically after the drag has ended.
|
||||||
|
"""
|
||||||
|
var preview = ColorRect.new()
|
||||||
|
preview.rect_size = rect_size
|
||||||
|
var preview_color = color
|
||||||
|
preview_color.a = .5
|
||||||
|
preview.color = preview_color
|
||||||
|
preview.set_rotation(.1) # in readians
|
||||||
|
return preview
|
@ -0,0 +1,31 @@
|
|||||||
|
extends Panel
|
||||||
|
|
||||||
|
onready var drop_target = get_node("/root/DragAndDropDemo/VLayout/DragAndDropColumns/CanvasContainer")
|
||||||
|
onready var draggable_scene: PackedScene = preload("res://toolset_test/draggable.tscn")
|
||||||
|
onready var draggable_container = $Padding/Columns
|
||||||
|
|
||||||
|
var dragables = [
|
||||||
|
{"id": 1, "label": "dialog"},
|
||||||
|
{"id": 2, "label": "object"},
|
||||||
|
{"id": 3, "label": "encounter"}
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
drop_target.connect("item_dropped_on_target", self, "_on_item_dropped_on_target")
|
||||||
|
_populate_dragables()
|
||||||
|
|
||||||
|
func _populate_dragables():
|
||||||
|
for dragable in dragables:
|
||||||
|
var drag_item = draggable_scene.instance()
|
||||||
|
drag_item.id = dragable["id"]
|
||||||
|
drag_item.label = dragable["label"]
|
||||||
|
draggable_container.add_child(drag_item)
|
||||||
|
|
||||||
|
func _on_item_dropped_on_target(dropped_item: Draggable) -> void:
|
||||||
|
for drag_item in draggable_container.get_children():
|
||||||
|
drag_item = (drag_item as Draggable)
|
||||||
|
if drag_item.id == dropped_item.id:
|
||||||
|
#draggable_container.remove_child(drag_item)
|
||||||
|
#drag_item.queue_free()
|
||||||
|
break
|
@ -0,0 +1,172 @@
|
|||||||
|
[gd_scene load_steps=8 format=2]
|
||||||
|
|
||||||
|
[ext_resource path="res://Cabin-VariableFont_wdth,wght.ttf" type="DynamicFontData" id=1]
|
||||||
|
[ext_resource path="res://toolset_test_tabbed_merged/toolset_test_tabbed_merged.gd" type="Script" id=2]
|
||||||
|
[ext_resource path="res://toolset_test_tabbed_merged/AssetsContainer.gd" type="Script" id=3]
|
||||||
|
[ext_resource path="res://toolset_test_tabbed_merged/PanelCanvas_Temp.gd" type="Script" id=4]
|
||||||
|
|
||||||
|
[sub_resource type="StyleBoxFlat" id=5]
|
||||||
|
bg_color = Color( 0, 0, 0, 1 )
|
||||||
|
|
||||||
|
[sub_resource type="DynamicFont" id=4]
|
||||||
|
size = 32
|
||||||
|
font_data = ExtResource( 1 )
|
||||||
|
|
||||||
|
[sub_resource type="StyleBoxFlat" id=3]
|
||||||
|
bg_color = Color( 1, 1, 1, 1 )
|
||||||
|
|
||||||
|
[node name="Tabbed_merged_test" type="PanelContainer"]
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
script = ExtResource( 2 )
|
||||||
|
|
||||||
|
[node name="VLayout" type="VBoxContainer" parent="."]
|
||||||
|
margin_left = 7.0
|
||||||
|
margin_top = 7.0
|
||||||
|
margin_right = 1017.0
|
||||||
|
margin_bottom = 596.0
|
||||||
|
__meta__ = {
|
||||||
|
"_edit_use_anchors_": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[node name="DescriptionHeader" type="HBoxContainer" parent="VLayout"]
|
||||||
|
margin_right = 1010.0
|
||||||
|
margin_bottom = 50.0
|
||||||
|
rect_min_size = Vector2( 0, 50 )
|
||||||
|
__meta__ = {
|
||||||
|
"_edit_use_anchors_": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[node name="M1H" type="Panel" parent="VLayout/DescriptionHeader"]
|
||||||
|
margin_right = 250.0
|
||||||
|
margin_bottom = 50.0
|
||||||
|
rect_min_size = Vector2( 250, 50 )
|
||||||
|
custom_styles/panel = SubResource( 5 )
|
||||||
|
|
||||||
|
[node name="Menu One" type="Label" parent="VLayout/DescriptionHeader/M1H"]
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
custom_fonts/font = SubResource( 4 )
|
||||||
|
text = "Menu 1"
|
||||||
|
align = 1
|
||||||
|
valign = 1
|
||||||
|
|
||||||
|
[node name="M2H" type="Panel" parent="VLayout/DescriptionHeader"]
|
||||||
|
margin_left = 254.0
|
||||||
|
margin_right = 502.0
|
||||||
|
margin_bottom = 50.0
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
custom_styles/panel = SubResource( 5 )
|
||||||
|
|
||||||
|
[node name="MenuTwo" type="Label" parent="VLayout/DescriptionHeader/M2H"]
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
custom_fonts/font = SubResource( 4 )
|
||||||
|
text = "Menu 2"
|
||||||
|
align = 1
|
||||||
|
valign = 1
|
||||||
|
|
||||||
|
[node name="M3H" type="Panel" parent="VLayout/DescriptionHeader"]
|
||||||
|
margin_left = 506.0
|
||||||
|
margin_right = 756.0
|
||||||
|
margin_bottom = 50.0
|
||||||
|
rect_min_size = Vector2( 250, 0 )
|
||||||
|
custom_styles/panel = SubResource( 5 )
|
||||||
|
|
||||||
|
[node name="Menu3Label" type="Label" parent="VLayout/DescriptionHeader/M3H"]
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
custom_fonts/font = SubResource( 4 )
|
||||||
|
text = "Menu 3"
|
||||||
|
align = 1
|
||||||
|
valign = 1
|
||||||
|
|
||||||
|
[node name="M4H" type="Panel" parent="VLayout/DescriptionHeader"]
|
||||||
|
margin_left = 760.0
|
||||||
|
margin_right = 1010.0
|
||||||
|
margin_bottom = 50.0
|
||||||
|
rect_min_size = Vector2( 250, 0 )
|
||||||
|
custom_styles/panel = SubResource( 5 )
|
||||||
|
|
||||||
|
[node name="Menu4Label" type="Label" parent="VLayout/DescriptionHeader/M4H"]
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
custom_fonts/font = SubResource( 4 )
|
||||||
|
text = "Menu 4"
|
||||||
|
align = 1
|
||||||
|
valign = 1
|
||||||
|
|
||||||
|
[node name="HBoxContainer" type="HBoxContainer" parent="VLayout"]
|
||||||
|
margin_top = 54.0
|
||||||
|
margin_right = 1010.0
|
||||||
|
margin_bottom = 589.0
|
||||||
|
|
||||||
|
[node name="AssetsContainer" type="Panel" parent="VLayout/HBoxContainer"]
|
||||||
|
margin_right = 175.0
|
||||||
|
margin_bottom = 535.0
|
||||||
|
rect_min_size = Vector2( 175, 0 )
|
||||||
|
script = ExtResource( 3 )
|
||||||
|
|
||||||
|
[node name="Padding" type="MarginContainer" parent="VLayout/HBoxContainer/AssetsContainer"]
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
margin_top = 34.0
|
||||||
|
rect_clip_content = true
|
||||||
|
custom_constants/margin_right = 20
|
||||||
|
custom_constants/margin_top = 20
|
||||||
|
custom_constants/margin_left = 20
|
||||||
|
custom_constants/margin_bottom = 20
|
||||||
|
|
||||||
|
[node name="AssetsRows" type="VBoxContainer" parent="VLayout/HBoxContainer/AssetsContainer/Padding"]
|
||||||
|
margin_left = 20.0
|
||||||
|
margin_top = 20.0
|
||||||
|
margin_right = 155.0
|
||||||
|
margin_bottom = 481.0
|
||||||
|
|
||||||
|
[node name="Label" type="Label" parent="VLayout/HBoxContainer/AssetsContainer"]
|
||||||
|
margin_right = 172.0
|
||||||
|
margin_bottom = 31.0
|
||||||
|
text = "Assets:"
|
||||||
|
|
||||||
|
[node name="TabContainer" type="TabContainer" parent="VLayout/HBoxContainer"]
|
||||||
|
margin_left = 179.0
|
||||||
|
margin_right = 829.0
|
||||||
|
margin_bottom = 535.0
|
||||||
|
rect_min_size = Vector2( 650, 535 )
|
||||||
|
|
||||||
|
[node name="Visual_Tab" type="Tabs" parent="VLayout/HBoxContainer/TabContainer"]
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
margin_left = 4.0
|
||||||
|
margin_top = 32.0
|
||||||
|
margin_right = -4.0
|
||||||
|
margin_bottom = -4.0
|
||||||
|
|
||||||
|
[node name="Structural_Tab" type="Tabs" parent="VLayout/HBoxContainer/TabContainer"]
|
||||||
|
margin_right = 40.0
|
||||||
|
margin_bottom = 24.0
|
||||||
|
|
||||||
|
[node name="TextEdit" type="TextEdit" parent="VLayout/HBoxContainer/TabContainer/Structural_Tab"]
|
||||||
|
margin_left = -1.0
|
||||||
|
margin_top = 20.0
|
||||||
|
margin_right = 648.0
|
||||||
|
margin_bottom = 529.0
|
||||||
|
|
||||||
|
[node name="PanelCanvas_Temp" type="Panel" parent="VLayout/HBoxContainer/TabContainer/Structural_Tab"]
|
||||||
|
margin_left = 3.0
|
||||||
|
margin_top = 274.0
|
||||||
|
margin_right = 643.0
|
||||||
|
margin_bottom = 525.0
|
||||||
|
script = ExtResource( 4 )
|
||||||
|
|
||||||
|
[node name="DetailsContainer" type="Panel" parent="VLayout/HBoxContainer"]
|
||||||
|
margin_left = 833.0
|
||||||
|
margin_right = 1008.0
|
||||||
|
margin_bottom = 535.0
|
||||||
|
rect_min_size = Vector2( 175, 0 )
|
||||||
|
custom_styles/panel = SubResource( 3 )
|
||||||
|
|
||||||
|
[node name="Text_Details" type="TextEdit" parent="VLayout/HBoxContainer/DetailsContainer"]
|
||||||
|
margin_right = 177.0
|
||||||
|
margin_bottom = 537.0
|
||||||
|
text = "Details:"
|
@ -0,0 +1,26 @@
|
|||||||
|
extends Panel
|
||||||
|
|
||||||
|
|
||||||
|
signal item_dropped_on_target(draggable)
|
||||||
|
var draggable: PackedScene = preload("res://toolset_test/draggable.tscn")
|
||||||
|
|
||||||
|
func can_drop_data(position: Vector2, data) -> bool:
|
||||||
|
var can_drop: bool = data is Node and data.is_in_group("DRAGGABLE")
|
||||||
|
print("[TargetContainer] can_drop_data has run, returning %s" % can_drop)
|
||||||
|
return can_drop
|
||||||
|
|
||||||
|
func drop_data(position: Vector2, data) -> void:
|
||||||
|
print("[TargetContainer] drop_data has run")
|
||||||
|
print("[TargetContainer] Emiting signal: item_dropped_on_target")
|
||||||
|
|
||||||
|
#DKM TEMP: here we'd open wizard or create new item.
|
||||||
|
# How should this display when it's finalized?
|
||||||
|
var draggable_copy: ColorRect = draggable.instance()
|
||||||
|
draggable_copy.id = data.id
|
||||||
|
#Instantiate a new version of the specific item in this content capsule
|
||||||
|
draggable_copy.label = data.label
|
||||||
|
draggable_copy.dropped_on_target = true # disable further dragging
|
||||||
|
$Padding/Rows.add_child(draggable_copy)
|
||||||
|
|
||||||
|
emit_signal("item_dropped_on_target", data)
|
||||||
|
|
@ -0,0 +1,17 @@
|
|||||||
|
extends PanelContainer
|
||||||
|
|
||||||
|
|
||||||
|
# Declare member variables here. Examples:
|
||||||
|
# var a: int = 2
|
||||||
|
# var b: String = "text"
|
||||||
|
|
||||||
|
|
||||||
|
# Called when the node enters the scene tree for the first time.
|
||||||
|
func _ready() -> void:
|
||||||
|
var outputFolderStr = "Region\n\tLocation\n\t\tSpace\n\t\t\tScene" + "\n\t\tSpace"
|
||||||
|
$VLayout/HBoxContainer/TabContainer/Structural_Tab/TextEdit.text = outputFolderStr
|
||||||
|
|
||||||
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||||
|
#func _process(delta: float) -> void:
|
||||||
|
# pass
|
||||||
|
|
Loading…
Reference in New Issue
Block a user