First work on dialogic, resized guild, and started implementing portraits.

This commit is contained in:
2025-08-14 10:26:24 -04:00
parent 95a7db036b
commit 3aeb3d44e6
959 changed files with 47688 additions and 46 deletions

View File

@@ -0,0 +1,47 @@
@tool
class_name DialogicPortraitAnimationUtil
enum AnimationType {ALL=-1, IN=1, OUT=2, ACTION=3, CROSSFADE=4}
static func guess_animation(string:String, type := AnimationType.ALL) -> String:
var default := {}
var filter := {}
var ignores := []
match type:
AnimationType.ALL:
pass
AnimationType.IN:
filter = {"type":AnimationType.IN}
ignores = ["in"]
AnimationType.OUT:
filter = {"type":AnimationType.OUT}
ignores = ["out"]
AnimationType.ACTION:
filter = {"type":AnimationType.ACTION}
AnimationType.CROSSFADE:
filter = {"type":AnimationType.CROSSFADE}
ignores = ["cross"]
return DialogicResourceUtil.guess_special_resource(&"PortraitAnimation", string, default, filter, ignores).get("path", "")
static func get_portrait_animations_filtered(type := AnimationType.ALL) -> Dictionary:
var filter := {"type":type}
if type == AnimationType.ALL:
filter["type"] = [AnimationType.IN, AnimationType.OUT, AnimationType.ACTION]
return DialogicResourceUtil.list_special_resources("PortraitAnimation", filter)
static func get_suggestions(_search_text := "", current_value:= "", empty_text := "Default", action := AnimationType.ALL) -> Dictionary:
var suggestions := {}
if empty_text and current_value:
suggestions[empty_text] = {'value':"", 'editor_icon':["GuiRadioUnchecked", "EditorIcons"]}
for anim_name in get_portrait_animations_filtered(action):
suggestions[DialogicUtil.pretty_name(anim_name)] = {
'value' : DialogicUtil.pretty_name(anim_name),
'editor_icon' : ["Animation", "EditorIcons"]
}
return suggestions