refactoring UI

This commit was merged in pull request #26.
This commit is contained in:
2026-06-01 09:03:31 +00:00
parent 50ea1d8bbd
commit dcf5d28248
62 changed files with 2088 additions and 489 deletions

1096
addons/TweenFX/TweenFX.gd Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1 @@
uid://d2n10rw2dnx8o

View File

@@ -0,0 +1,43 @@
## Internal tracking system for TweenFX.
## [br][br]
## Manages active tweens per node, handles cleanup when nodes are freed,
## and provides stop/query methods. Not intended for direct use —
## access through [TweenFX] instead.
static var _active: Dictionary = {} # { node: { TweenFX.Animations.X: tween } }
static func track(node: CanvasItem, anim: TweenFX.Animations, tween: Tween) -> void:
if not _active.has(node):
_active[node] = {}
if not node.tree_exiting.is_connected(_on_node_exiting):
node.tree_exiting.connect(_on_node_exiting.bind(node), CONNECT_ONE_SHOT)
_active[node][anim] = tween
tween.finished.connect(_on_tween_finished.bind(node, anim), CONNECT_ONE_SHOT)
static func stop(node: CanvasItem, anim: TweenFX.Animations) -> void:
if not _active.has(node) or not _active[node].has(anim):
return
_active[node][anim].kill()
_active[node].erase(anim)
if _active[node].is_empty():
_active.erase(node)
static func stop_all(node: CanvasItem) -> void:
if not _active.has(node):
return
for tween in _active[node].values():
tween.kill()
_active.erase(node)
static func is_playing(node: CanvasItem, anim: TweenFX.Animations) -> bool:
return _active.has(node) and _active[node].has(anim)
static func _on_tween_finished(node: CanvasItem, anim: TweenFX.Animations) -> void:
if not _active.has(node):
return
_active[node].erase(anim)
if _active[node].is_empty():
_active.erase(node)
static func _on_node_exiting(node: CanvasItem) -> void:
_active.erase(node)

View File

@@ -0,0 +1 @@
uid://bc8i1qm1d8hrv

BIN
addons/TweenFX/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://chf2ss61jydw3"
path="res://.godot/imported/icon.png-1df28cd6ae5654ad60ac96bf24b7c782.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/TweenFX/icon.png"
dest_files=["res://.godot/imported/icon.png-1df28cd6ae5654ad60ac96bf24b7c782.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -0,0 +1,7 @@
[plugin]
name="TweenFX"+
icon="res://addons/TweenFX/icon.png"
description= "A simple, juicy tween animation library for Godot"
author="EvilBunnyMan"
version="1.2"
script="plugin.gd"

10
addons/TweenFX/plugin.gd Normal file
View File

@@ -0,0 +1,10 @@
@tool
extends EditorPlugin
func _enable_plugin():
add_autoload_singleton("TweenFX", "res://addons/TweenFX/TweenFX.gd")
print("[TweenFX] Enabled")
func _disable_plugin():
remove_autoload_singleton("TweenFX")
print("[TweenFX] Disabled")

View File

@@ -0,0 +1 @@
uid://wu3r36bvv8u