I apologize if I sounded rude, my attention issues aren’t a fault of my own. I also kinda want to learn advanced exports, because this isn’t a think I run into that rarely. Next time it happens, I want to be ready. Even if it never happens, just the learning is worth it.
I found this upon many web searches:
It seems promising, but I can’t for the life of me make the export work. I tried the following:
func _validate_property(property: Dictionary) -> void:
if property.name == "stat":
# Load the item db
#var item_db = preload("res://item_db.tres")
# Join the items array by comma
var items = ",".join(Stats.get_category_buffable_list(category))
# Create the hint string <type>/<hint>:<hint_string>
property.hint_string = "%d/%d:%s" % [TYPE_STRING, PROPERTY_HINT_ENUM, items]
#notify_property_list_changed()
And the get_category_buffable_list():
static func get_category_buffable_list(category: BuffableCategories) -> Array:
match category:
BuffableCategories.HEALTH:
return HealthComponent.BUFFABLE_STATS.keys()
BuffableCategories.STAMINA:
return StaminaComponent.BUFFABLE_STATS.keys()
BuffableCategories.ATTACK:
return AttackComponent.BUFFABLE_STATS.keys()
BuffableCategories.DEFENSE:
return DefenseComponent.BUFFABLE_STATS.keys()
BuffableCategories.SPEED:
return SpeedComponent.BUFFABLE_STATS.keys()
return []
It doesn’t seem to me that I’ll need a much more complex solution, but maybe that’s why I can’t find a solution…