This commit is contained in:
Eric Vande Voort
2025-01-07 16:10:03 -06:00
commit 7eb0dea424
147 changed files with 9096 additions and 0 deletions

View File

@@ -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)

View File

@@ -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")

View 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])

View 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")

View 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)

View File

@@ -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")

View File

@@ -0,0 +1,19 @@
@tool
extends PanelContainer
@onready var _message = $MarginContainer/HBoxContainer/Label
func _ready():
_configure_source_warning()
func _configure_source_warning():
var sb = self.get_theme_stylebox("panel")
var color = EditorInterface.get_editor_settings().get_setting("interface/theme/accent_color")
color.a = 0.2
sb.bg_color = color
self.get_node("MarginContainer/HBoxContainer/Icon").texture = get_theme_icon("NodeInfo", "EditorIcons")
func set_text(text: String):
_message.text = text

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,55 @@
@tool
extends VBoxContainer
signal refresh_triggered
signal multi_selected(item: TreeItem, column: int, selected: bool)
@onready var _tree: Tree = $Tree
func _on_tree_filter_change_finished(text):
var tree_root: TreeItem = _tree.get_root()
if text == "":
tree_root.call_recursive("set", "visible", true)
return
tree_root.call_recursive("set", "visible", false)
_make_matching_children_visible(tree_root, text.to_lower())
func _make_matching_children_visible(tree_root: TreeItem, text: String) -> void:
for c in tree_root.get_children():
if c.get_text(0).to_lower().contains(text):
c.visible = true
_ensure_parent_visible(c)
_make_matching_children_visible(c, text)
func _ensure_parent_visible(tree_item: TreeItem) -> void:
var node_parent = tree_item.get_parent()
if node_parent != null and not node_parent.visible:
node_parent.visible = true
_ensure_parent_visible(node_parent)
func _on_expand_all_pressed():
var tree_root: TreeItem = _tree.get_root()
tree_root.set_collapsed_recursive(false)
func _on_collapse_all_pressed():
var tree_root: TreeItem = _tree.get_root()
tree_root.set_collapsed_recursive(true)
tree_root.collapsed = false
func _on_refresh_tree_pressed():
refresh_triggered.emit()
func _on_tree_multi_selected(item: TreeItem, column: int, selected: bool):
multi_selected.emit(item, column, selected)
func get_resource_tree() -> Tree:
return _tree

View File

@@ -0,0 +1,51 @@
[gd_scene load_steps=3 format=3 uid="uid://cisgsfvp4nf1g"]
[ext_resource type="Script" path="res://addons/AsepriteWizard/interface/shared/tree/resource_tree.gd" id="1_io4rc"]
[ext_resource type="Script" path="res://addons/AsepriteWizard/interface/imports_manager/tree_filter_field.gd" id="1_q7epo"]
[node name="resource_tree" type="VBoxContainer"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
script = ExtResource("1_io4rc")
[node name="buttons" type="HFlowContainer" parent="."]
layout_mode = 2
[node name="tree_filter" type="LineEdit" parent="buttons"]
layout_mode = 2
size_flags_horizontal = 3
placeholder_text = "Filter..."
clear_button_enabled = true
script = ExtResource("1_q7epo")
[node name="expand_all" type="Button" parent="buttons"]
custom_minimum_size = Vector2(150, 0)
layout_mode = 2
text = "Expand All"
[node name="collapse_all" type="Button" parent="buttons"]
custom_minimum_size = Vector2(150, 0)
layout_mode = 2
text = "Collapse All"
[node name="refresh_tree" type="Button" parent="buttons"]
custom_minimum_size = Vector2(150, 0)
layout_mode = 2
text = "Refresh Tree"
[node name="Tree" type="Tree" parent="."]
layout_mode = 2
size_flags_vertical = 3
hide_root = true
select_mode = 2
[connection signal="change_finished" from="buttons/tree_filter" to="." method="_on_tree_filter_change_finished"]
[connection signal="text_changed" from="buttons/tree_filter" to="buttons/tree_filter" method="_on_text_changed"]
[connection signal="pressed" from="buttons/expand_all" to="." method="_on_expand_all_pressed"]
[connection signal="pressed" from="buttons/collapse_all" to="." method="_on_collapse_all_pressed"]
[connection signal="pressed" from="buttons/refresh_tree" to="." method="_on_refresh_tree_pressed"]
[connection signal="multi_selected" from="Tree" to="." method="_on_tree_multi_selected"]

View File

@@ -0,0 +1,18 @@
@tool
extends VBoxContainer
signal warning_confirmed
signal warning_declined
@onready var _warning_message = $MarginContainer/warning_message
func set_message(text: String) -> void:
_warning_message.text = text
func _on_confirm_button_up():
warning_confirmed.emit()
func _on_cancel_button_up():
warning_declined.emit()

View File

@@ -0,0 +1,34 @@
[gd_scene load_steps=2 format=3 uid="uid://qgmln507kjnm"]
[ext_resource type="Script" path="res://addons/AsepriteWizard/interface/shared/tree/tree_selection_confirmation_warning.gd" id="1_7gtu1"]
[node name="confirmation_warning" type="VBoxContainer"]
script = ExtResource("1_7gtu1")
[node name="MarginContainer" type="MarginContainer" parent="."]
layout_mode = 2
theme_override_constants/margin_left = 10
theme_override_constants/margin_top = 10
theme_override_constants/margin_right = 10
theme_override_constants/margin_bottom = 10
[node name="warning_message" type="Label" parent="MarginContainer"]
custom_minimum_size = Vector2(100, 0)
layout_mode = 2
autowrap_mode = 2
[node name="buttons" type="HFlowContainer" parent="."]
layout_mode = 2
[node name="confirm" type="Button" parent="buttons"]
layout_mode = 2
size_flags_horizontal = 3
text = "Confirm"
[node name="cancel" type="Button" parent="buttons"]
layout_mode = 2
size_flags_horizontal = 3
text = "Cancel"
[connection signal="button_up" from="buttons/confirm" to="." method="_on_confirm_button_up"]
[connection signal="button_up" from="buttons/cancel" to="." method="_on_cancel_button_up"]