AssetTagManager๏ƒ

Inherits: Object

Manages the project asset tag dictionary.

Description๏ƒ

Singleton that stores hierarchical asset tags, supports CRUD operations, and validates tag hierarchy semantics.

Methods๏ƒ

void

abort_batch()

Error

add_tag(tag_name: String, comment: String = "", source: String = "default")

void

begin_batch()

Error

commit_batch(persist: bool = true)

bool

container_has_all(container: PackedStringArray, query_tags: PackedStringArray) const

bool

container_has_any(container: PackedStringArray, query_tags: PackedStringArray) const

bool

container_has_tag(container: PackedStringArray, tag: String) const

Dictionary

get_tag_info(tag_name: String) const

bool

has_tag_in_dictionary(tag_name: String) const

PackedStringArray

list_all_tags() const

PackedStringArray

list_tags(parent_tag: String = "") const

Error

load()

bool

matches_tag(tag: String, query_tag: String) const

Error

remove_tag(tag_name: String)

Error

rename_tag(old_name: String, new_name: String)

String

resolve_tag_alias(tag_name: String) const

Error

save()

Error

update_tag_comment(tag_name: String, comment: String)


Signals๏ƒ

redirects_changed() ๐Ÿ”—

Emitted when tag rename/remove redirects are updated.


tag_dictionary_changed() ๐Ÿ”—

Emitted when the tag dictionary contents change.


Method Descriptions๏ƒ

void abort_batch() ๐Ÿ”—

Discards the active dictionary batch without persisting changes.


Error add_tag(tag_name: String, comment: String = "", source: String = "default") ๐Ÿ”—

Adds tag_name to the dictionary with optional comment and source. Returns @GlobalScope.OK on success, or an Error if the name is invalid or already present.


void begin_batch() ๐Ÿ”—

Starts a nested dictionary batch so multiple mutations can be committed together.


Error commit_batch(persist: bool = true) ๐Ÿ”—

Ends one batch level and optionally persists the dictionary when persist is true. Returns @GlobalScope.OK on success, or an Error if saving fails.


bool container_has_all(container: PackedStringArray, query_tags: PackedStringArray) const ๐Ÿ”—

Returns true when container matches every tag in query_tags, including hierarchical parent matches.


bool container_has_any(container: PackedStringArray, query_tags: PackedStringArray) const ๐Ÿ”—

Returns true when container matches at least one tag in query_tags.


bool container_has_tag(container: PackedStringArray, tag: String) const ๐Ÿ”—

Returns true when container contains tag or a hierarchical child of it.


Dictionary get_tag_info(tag_name: String) const ๐Ÿ”—

Returns metadata for tag_name, including comment and source fields when the tag exists.


bool has_tag_in_dictionary(tag_name: String) const ๐Ÿ”—

Returns true when tag_name exists in the dictionary after alias resolution.


PackedStringArray list_all_tags() const ๐Ÿ”—

Returns every tag name currently stored in the dictionary.


PackedStringArray list_tags(parent_tag: String = "") const ๐Ÿ”—

Returns direct child tags of parent_tag, or root tags when parent_tag is empty.


Error load() ๐Ÿ”—

Loads the tag dictionary from disk. Returns @GlobalScope.OK on success, or an Error if the file cannot be read.


bool matches_tag(tag: String, query_tag: String) const ๐Ÿ”—

Returns true when tag equals query_tag or is a hierarchical descendant of it.


Error remove_tag(tag_name: String) ๐Ÿ”—

Removes tag_name from the dictionary and records a redirect. Returns @GlobalScope.OK on success, or an Error if the tag is missing.


Error rename_tag(old_name: String, new_name: String) ๐Ÿ”—

Renames old_name to new_name and updates redirects. Returns @GlobalScope.OK on success, or an Error if the rename is invalid.


String resolve_tag_alias(tag_name: String) const ๐Ÿ”—

Resolves tag_name through redirects and returns the canonical dictionary name.


Error save() ๐Ÿ”—

Persists the tag dictionary to disk. Returns @GlobalScope.OK on success, or an Error if writing fails.


Error update_tag_comment(tag_name: String, comment: String) ๐Ÿ”—

Sets the comment text for tag_name. Returns @GlobalScope.OK on success, or an Error if the tag is missing.