init
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
@tool
|
||||
extends Button
|
||||
|
||||
signal node_dropped(node_path)
|
||||
|
||||
func _can_drop_data(_pos, data):
|
||||
if data.type == "nodes":
|
||||
var node = get_node(data.nodes[0])
|
||||
return node is AnimationPlayer
|
||||
return false
|
||||
|
||||
|
||||
func _drop_data(_pos, data):
|
||||
var path = data.nodes[0]
|
||||
node_dropped.emit(path)
|
||||
@@ -0,0 +1,12 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://x1f1t87m582u"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/AsepriteWizard/interface/shared/animation_player_drop_button.gd" id="1_tfmxw"]
|
||||
|
||||
[node name="options" type="OptionButton"]
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 2.0
|
||||
item_count = 1
|
||||
selected = 0
|
||||
popup/item_0/text = "[empty]"
|
||||
popup/item_0/id = 0
|
||||
script = ExtResource("1_tfmxw")
|
||||
14
addons/AsepriteWizard/interface/shared/dir_drop_button.gd
Normal file
14
addons/AsepriteWizard/interface/shared/dir_drop_button.gd
Normal file
@@ -0,0 +1,14 @@
|
||||
@tool
|
||||
extends Button
|
||||
|
||||
signal dir_dropped(path)
|
||||
|
||||
func _can_drop_data(_pos, data):
|
||||
if data.type == "files_and_dirs":
|
||||
var dir_access = DirAccess.open(data.files[0])
|
||||
return dir_access != null
|
||||
return false
|
||||
|
||||
|
||||
func _drop_data(_pos, data):
|
||||
dir_dropped.emit(data.files[0])
|
||||
10
addons/AsepriteWizard/interface/shared/dir_drop_button.tscn
Normal file
10
addons/AsepriteWizard/interface/shared/dir_drop_button.tscn
Normal file
@@ -0,0 +1,10 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://cwvgnm3o7eed2"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/AsepriteWizard/interface/shared/dir_drop_button.gd" id="1_7uqph"]
|
||||
|
||||
[node name="button" type="Button"]
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 2.0
|
||||
text = "[empty]"
|
||||
clip_text = true
|
||||
script = ExtResource("1_7uqph")
|
||||
15
addons/AsepriteWizard/interface/shared/source_drop_button.gd
Normal file
15
addons/AsepriteWizard/interface/shared/source_drop_button.gd
Normal file
@@ -0,0 +1,15 @@
|
||||
@tool
|
||||
extends Button
|
||||
|
||||
signal aseprite_file_dropped(path)
|
||||
|
||||
func _can_drop_data(_pos, data):
|
||||
if data.type == "files":
|
||||
var extension = data.files[0].get_extension()
|
||||
return extension == "ase" or extension == "aseprite"
|
||||
return false
|
||||
|
||||
|
||||
func _drop_data(_pos, data):
|
||||
var path = data.files[0]
|
||||
aseprite_file_dropped.emit(path)
|
||||
@@ -0,0 +1,10 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://dj1uo3blocr8e"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/AsepriteWizard/interface/shared/source_drop_button.gd" id="1_smfgi"]
|
||||
|
||||
[node name="source_drop_button" type="Button"]
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 2.0
|
||||
text = "[empty]"
|
||||
clip_text = true
|
||||
script = ExtResource("1_smfgi")
|
||||
Reference in New Issue
Block a user