tagManager

Methods
16
Fields
None

Getting one

tagManager

Methods

MethodReturnsDescription
getTagString(number, boolean)stringThe item's tags as stored: comma-separated (variation: its base item's).
getTags(number, boolean){string}The item's tags, lower-cased, in order.
setTagString(number, string, boolean)()Replace the item's tags with a comma-separated string (empty removes them).
addTags(number, {string}, boolean)()Add tags to the item, as given (no standardizing).
addTag(number, string, boolean)()Add one tag to the item, standardized.
findTag(number, string)booleanWhether any of the item's tags (or its variation's) starts with search. Answered from the group parsed once per change (a bank search ask…
getItemsForTag(string){number}Every item carrying tag (by id; a variation's base item as its negative id), in id order.
removeTag(string)()(TagManager, string) -> (): Remove tag from every item, and unhide it.
removeTag(number, string)()
renameTag(string, string)()Rename a tag on every item carrying it.
isHidden(string)booleanWhether tag is hidden.
setHidden(string, boolean)()Hide or unhide tag.
registerTagItems(string, {number})()Register a tag as the set of item ids it contains, since a tag object's contains would run in another plugin's VM, once per bank item, ca…
unregisterTag(string)()Remove a registered tag.
getRegisteredTag(string){number}?A registered tag's items, or nil. A new array on every call: per bank item, ask registeredTagContains instead.
registeredTagContains(string, number)boolean?Whether the registered tag name contains itemId, nil for no such tag. Nothing is allocated.
getRegisteredTags(){string}The registered tags' names, in order.

Method details

getTagString

getTagString: (TagManager, number, boolean) -> string

The item's tags as stored: comma-separated (variation: its base item's).

getTags

getTags: (TagManager, number, boolean) -> {string}

The item's tags, lower-cased, in order.

setTagString

setTagString: (TagManager, number, string, boolean) -> ()

Replace the item's tags with a comma-separated string (empty removes them).

addTags

addTags: (TagManager, number, {string}, boolean) -> ()

Add tags to the item, as given (no standardizing).

addTag

addTag: (TagManager, number, string, boolean) -> ()

Add one tag to the item, standardized.

findTag

findTag: (TagManager, number, string) -> boolean

Whether any of the item's tags (or its variation's) starts with search. Answered from the group parsed once per change (a bank search asks once per bank item per keystroke): two map probes and a prefix scan.

getItemsForTag

getItemsForTag: (TagManager, string) -> {number}

Every item carrying tag (by id; a variation's base item as its negative id), in id order.

removeTag

removeTag: ((TagManager, string) -> ()) & ((TagManager, number, string) -> ())

(TagManager, string) -> (): Remove tag from every item, and unhide it.

(TagManager, number, string) -> (): Remove tag from one item (and its variation).

registerTagItems

registerTagItems: (TagManager, string, {number}) -> ()

Register a tag as the set of item ids it contains, since a tag object's contains would run in another plugin's VM, once per bank item, called from another plugin's callback (plugin VMs are kept apart). Register again whenever the set changes. It stays registered until unregisterTag, so unregister it in shutDown.

getRegisteredTag

getRegisteredTag: (TagManager, string) -> {number}?

A registered tag's items, or nil. A new array on every call: per bank item, ask registeredTagContains instead.

registeredTagContains

registeredTagContains: (TagManager, string, number) -> boolean?

Whether the registered tag name contains itemId, nil for no such tag. Nothing is allocated.