api/LibDogTag-3.0.lua

:AddAddonFinder("namespace" , "kind" , "name" , func)

Arguments

"namespace"
string - namespace the addon finder is associated with
"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 This should only really be called by sublibraries or addons that register tags.

Example

LibStub("DogTag-3.0"):AddAddonFinder("MyNamespace", "LibStub", "LibMonkey-1.0", function(LibMonkey)
	-- do something with LibMonkey now
end)

string table

:AddFontString(fs , frame , "code" [, nsList] [, kwargs])

Arguments

fs
frame - the FontString to register
frame
frame - the Frame which holds the FontString
"code"
string - the tag sequence
nsList
string - a semicolon-separated list of namespaces. Base is implied
kwargs
table - a dictionary of default kwargs for all tags in the code to receive

Notes

Adds a FontString to LibDogTag-3.0's registry, which will be updated automatically. You can add twice without removing. It will just overwrite the previous registration. You can specify any number of namespaces. "Base" is always included as a namespace. The kwargs table is optional and always goes on the end after the namespaces. You can recycle the table after registering.

Example

LibStub("LibDogTag-3.0"):AddFontString(fs, fs:GetParent(), "[Name]", "Unit", { unit = 'mouseover' })
LibStub("LibDogTag-3.0"):AddFontString(fs, fs:GetParent(), "[Tag]", "MyNamespace")
LibStub("LibDogTag-3.0"):AddFontString(fs, fs:GetParent(), "[Tag] [Name]", "MyNamespace;Unit", { value = 5, unit = 'player', }) -- two namespaces at once

:AddTag("namespace" , "tag" , data)

Arguments

"namespace"
string - namespace to add to
"tag"
string - name of the tag
data
table - data of the tag

Notes

Adds a tag to the specified namespace

Example

LibStub("LibDogTag-3.0"):AddTag("MyNamespace", "Square", {
	code = function(number) -- actual function that will be called
		return number * number
	end,
	arg = {
		'number', 'number', '@req', -- name, types, default
	},
	ret = 'number', -- return value
	events = "SOME_EVENT#$number", -- will update when SOME_EVENT with the argument `number` is dispatched
	doc = "Return the square of number", -- the description
	example = '[4:Square] => "16"; [5:Square] => "25"', -- show one or more examples in this format
	category = "Category name",
})

:ClearNamespace("namespace")

Arguments

"namespace"
string - namespace that is to be cleared

Notes

Clears a namespace's tags and any other relevant data. This should be called when a sublibrary is upgrading.

Example

LibStub("LibDogTag-3.0"):ClearNamespace("MyNamespace")

:RemoveFontString(fs)

Arguments

fs
frame - the FontString previously registered

Notes

Removes a registered FontString from LibDogTag-3.0's registry. You can remove twice without issues.

Example

LibStub("LibDogTag-3.0"):RemoveFontString(fs)

:UpdateAllForFrame(frame)

Arguments

frame
frame - the frame which to update all FontStrings on

Notes

Manually updates all FontStrings on a specified frame.

Example

LibStub("LibDogTag-3.0"):UpdateAllForFrame(frame)

:UpdateFontString(fs)

Arguments

fs
frame - the FontString previously registered

Notes

Manually updates a FontString previously registered.

Example

LibStub("LibDogTag-3.0"):UpdateFontString(fs)



Comments

Posts Quoted:
Reply
Clear All Quotes