LibDogTag-2.0
From WowAce Wiki
| Summary | |
|---|---|
| Lib: DogTag-2.0 | |
| A library to provide a markup syntax for unit frame FontStrings | |
| TOC | 2.3 (20300) |
| Category | Libraries |
| Author | ckknight |
| Details | |
| Version | 1.0 |
| OptionalDeps | LibRock-1.0, Babble-2.2, Babble-Spell-2.2, LibBabble-Spell-3.0, MobHealth, MobInfo2, Threat-1.0, RangeCheck-1.0, LibDruidMana-1.0, LibMobHealth-4.0 |
| Links | |
| Betas | Ace SVN Zip |
| Changelog | FishEye |
API Documentation
Note: This documentation is auto-generated. Please note that direct modifications may be overwritten on next autogenerate.
:AddAddonFinder("kind" , "name" , func)
Arguments
- "kind"
- string - "_G" for a value on the global table or "LibStub", "Rock", "AceLibrary" for a library of the specified type
- "name"
- string - name of the addon or library
- func
- function - function to be called when addon or library is found
Notes
Adds a handler to be called when an addon or library comes into being
string
:AddEventHandler("event" , tab [, method])
Arguments
- "event"
- string - name of the Blizzard event
- tab
- table or function - object that method exists on or function to call
- method
- string - name of the method on object
Notes
Adds a simplistic event handler. You should likely manage your own event handler if adding tags from an external addon.
:AddFakeGlobal("ns" , "key" , value)
Arguments
- "ns"
- string - namespace to add the fake global to
- "key"
- string - name of the fake global
- value
- table or function - value of the fake global
Notes
Adds a fake global value that can be easily accessed by a tag or modifier. Though adding with the key "something", it is accessed by "DogTag___something" and defined as a global with "DogTag.__something"
:AddFontString(text , frame , "unit" , "code" , ...)
Arguments
- text
- frame - the FontString to register
- frame
- frame - the Frame which holds the FontString
- "unit"
- string - the unit associated with the FontString
- "code"
- string - the tag sequence
- ...
- tuple - extra namespaces
Notes
Adds a FontString to LibDogTag-2.0's registry, which will be updated automatically. You can add twice without removing. It will just overwrite the previous registration. This will not update tags of units that Blizzard does not have events for, e.g. targettarget, mouseovertarget, partyNtarget
:AddModifier("ns" , "mod" , data)
Arguments
- "ns"
- string - namespace to add to
- "mod"
- string - name of the modifier
- data
- table - data of the modifier, see Modules\Example.lua for more details
Notes
Adds a modifier to the specified namespace
:AddTag("ns" , "tag" , data , withMod)
Arguments
- "ns"
- string - namespace to add to
- "tag"
- string - name of the tag
- data
- table - data of the tag, see Modules\Example.lua for more details
- withMod
- type - (needs documentation)
Notes
Adds a tag to the specified namespace
:AddTagAndModifier("ns" , "name" , data)
Arguments
- "ns"
- string - namespace to add to
- "name"
- string - name of the tag/modifier
- data
- table - data of the tag/modifier, see Modules\Example.lua for more details
Notes
Adds a tag/modifier combination to the specified namespace
:AddTagCallback(unit , code , func)
Arguments
- unit
- type - (needs documentation)
- code
- type - (needs documentation)
- func
- type - (needs documentation)
string
:AddTimerHandler(tab [, method])
Arguments
- tab
- table or function - object that method exists on or function to call
- method
- string - name of the method on object
Notes
Adds a simplistic timer handler, called roughly every 0.05 seconds, right before texts are updated. You should likely manage your own timer handler if adding tags from an external addon.
string
:AddUpdateAllForUnitHandler(tab [, method])
Arguments
- tab
- table or function - object that method exists on or function to call
- method
- string - name of the method on object
Notes
Adds a handler to be called when a unit is completely refreshed
:ColorizeCode("code" , ...)
Arguments
- "code"
- string - the tag sequence to check
- ...
- tuple - tuple of extra namespaces
Notes
This colorizes a tag sequence by syntax to make it easier to understand.
Returns
string - the same tag sequence, with colors applied.
:CreateFunctionFromCode("code" , ...)
Arguments
- "code"
- string - a tag sequence
- ...
- tuple - tuple of extra namespaces
Notes
This is mostly used for debugging purposes
Returns
string - a block of code which could have loadstring called on it.
:Evaluate("unit" , "code" , ...)
Arguments
- "unit"
- string - the unit associated with the tag sequence
- "code"
- string - the tag sequence to compile and evaluate
- ...
- tuple - tuple of extra namespaces
Returns
string - the resultant generated text number or nil - the expected opacity of the generated text, specified by the [Alpha(num)] tag. nil if not specified.
:FixCodeStyle("code" , ...)
Arguments
- "code"
- string - the tag sequence to check
- ...
- tuple - tuple of extra namespaces
Notes
This takes a tag sequence that a user can enter and updates it for style purposes. e.g. [name] => [Name], [5:Sub(12)] => [5 - 12]
Returns
string - the same tag sequence, corrected for style.
:OpenHelp()
No arguments
:RemoveFontString(text)
Arguments
- text
- frame - the FontString previously registered
Notes
Removes a registered FontString from LibDogTag-2.0's registry. You can remove twice without issues.
:RemoveTagCallback(unit , code , func)
Arguments
- unit
- type - (needs documentation)
- code
- type - (needs documentation)
- func
- type - (needs documentation)
:SetColorConstantTable(t)
Arguments
- t
- table - a table which holds all the colors
Notes
This allows addons to set the color scheme for LibDogTag-2.0. If one addon sets the color constant table, it affect all addons that use LibDogTag-2.0.
:UnaliasCode("code" , ...)
Arguments
- "code"
- string - a tag sequence
- ...
- tuple - tuple of extra namespaces used
Notes
Some tags are mere aliases of others, UnaliasCode can turn these into the proper form as seen on the backend. It is unlikely this would need to be called by most addons.
Returns
string - an unalised form of the given tag sequence
:UpdateAllForFrame(frame)
Arguments
- frame
- frame - the frame which to update all FontStrings on
Notes
Manually updates all FontStrings on a specified frame.
:UpdateAllForUnit("unit")
Arguments
- "unit"
- string - the unit to update
Notes
Manually updates all FontStrings for a specified unit. You shouldn't need to call this from addons.
:UpdateFontString(text)
Arguments
- text
- frame - the FontString previously registered
Notes
Manually updates a FontString previously registered. This is necessary to call on FontStrings whose units have no associated Blizzard events, e.g. targettarget, mouseovertarget, partyNtarget.

