api/Main

PitBull4.del(t)

Delete a table, clearing it and putting it back into the queue

Parameters

t

Return value

nil

Usage

local t = PitBull4.new()
	t = del(t)


PitBull4.new()

Return a table

Return value

a blank table

Usage

local t = PitBull4.new()


PitBull4:CallMethodOnModules(method_name, ...)

Call a given method on all modules if those modules have the method.
This will iterate over disabled modules.

Parameters

method_name
name of the method
...
arguments that will pass in to the module


PitBull4:CheckGUIDForUnitID(unit, is_pet)

Check the GUID of the given UnitID and send that info to all frames for that UnitID

Parameters

unit
the UnitID to check
is_pet
pass true if calling from UNIT_PET

Usage

PitBull4:CheckGUIDForUnitID("player")


PitBull4:CheckWackyFramesForGUIDUpdate()

Iterate over all wacky frames, and call their respective :UpdateGUID methods.

Usage

PitBull4:CheckWackyFramesForGUIDUpdate()


PitBull4:GetState()

Get the current state that the player is in.
This will return one of "solo", "party", "raid", "raid10", "raid15", "raid20", "raid25", or "raid40". Setting config mode does override this.

Return value

the state of the player.

Usage

local state = PitBull4:GetState()


PitBull4:IterateFrames(also_hidden)

Iterate over all frames.
This iterates over only shown frames unless also_hidden is passed in.

Parameters

also_hidden
also return frames that are hidden

Return value

iterator which returns frames

Usage

for frame in PitBull4:IterateFrames() do
    doSomethingWith(frame)
end
for frame in PitBull4:IterateFrames(true) do
    doSomethingWith(frame)
end


PitBull4:IterateFramesForClassification(classification, also_hidden)

Iterate over all frames with the given classification.
This iterates over only shown frames unless also_hidden is passed in.

Parameters

classification
the classification to check
also_hidden
also return frames that are hidden

Return value

iterator which returns frames

Usage

for frame in PitBull4:IterateFramesForClassification("player") do
    doSomethingWith(frame)
end
for frame in PitBull4:IterateFramesForClassification("party", true) do
    doSomethingWith(frame)
end


PitBull4:IterateFramesForGUID(guid)

Iterate over all frames with the given GUID

Parameters

guid
the GUID to check. can be nil, which will cause no frames to return.

Return value

iterator which returns frames

Usage

for frame in PitBull4:IterateFramesForGUID("0x0000000000071278") do
    doSomethingWith(frame)
end


PitBull4:IterateFramesForGUIDs(...)

Iterate over all frames with the given GUIDs

Parameters

...
the GUIDs to check. Can be nil.

Return value

iterator which returns frames

Usage

for frame in PitBull4:IterateFramesForGUIDs(UnitGUID) do
    doSomethingWith(frame)
end


PitBull4:IterateFramesForLayout(layout, also_hidden)

Iterate over all frames with the given layout.
This iterates over only shown frames unless also_hidden is passed in.

Parameters

layout
the layout to check
also_hidden
also return frames that are hidden

Return value

iterator which returns frames

Usage

for frame in PitBull4:IterateFramesForLayout("Normal") do
    frame:UpdateLayout()
end
for frame in PitBull4:IterateFramesForLayout("Normal", true) do
    frame:UpdateLayout()
end


PitBull4:IterateFramesForName(name, server)

Iterate over all frames with the given name

Parameters

name
the name to check. can be nil, which will cause no frames to return.
server
the name of the realm, can be nil, which will cause only the name to be matched.

Return value

iterator which returns frames

Usage

for frame in PitBull4:IterateFramesForName("Someguy") do
    doSomethingWith(frame)
end


PitBull4:IterateFramesForUnitID(unit, also_hidden, dont_include_wacky)

Iterate over all frames with the given unit ID This iterates over only shown frames unless also_hidden is passed in.

Parameters

unit
the UnitID of the unit in question
also_hidden
also return frames that are hidden
dont_include_wacky
don't include wacky frames that are the same unit

Return value

iterator which returns frames

Usage

for frame in PitBull4:IterateFramesForUnitID("player") do
    doSomethingWith(frame)
end
for frame in PitBull4:IterateFramesForUnitID("party1", true) do
    doSomethingWith(frame)
end
for frame in PitBull4:IterateFramesForUnitID("party1", false, true) do
    doSomethingWith(frame)
end


PitBull4:IterateFramesForUnitIDs(...)

Iterate over all shown frames with the given UnitIDs.
To iterate over hidden frames as well, pass in true as the last argument.

Parameters

...
a tuple of UnitIDs.

Return value

iterator which returns frames

Usage

for frame in PitBull4:IterateFramesForUnitIDs("player", "target", "pet") do
    somethingAwesome(frame)
end
for frame in PitBull4:IterateFramesForUnitIDs("player", "target", "pet", true) do
    somethingAwesome(frame)
end


PitBull4:IterateHeaders(also_unused)

Iterate over all headers.

Parameters

also_unused
also return headers unused by the current profile.

Return value

iterator which returns headers

Usage

for header in PitBull4:IterateHeaders()
    doSomethingWith(header)
end


PitBull4:IterateHeadersForLayout(layout, also_hidden)

Iterate over all headers with the given layout.

Parameters

layout
the layout to check
also_hidden

Return value

iterator which returns headers

Usage

for header in PitBull4:IterateHeadersForLayout("Normal") do
    header:RefreshLayout()
end


PitBull4:IterateHeadersForName(name)

Iterate over all headers with the given name.

Parameters

name
the name to check

Return value

iterator which returns zero or one header

Usage

for header in PitBull4:IterateHeadersForName("Party pets")
    doSomethingWith(header)
end


PitBull4:IterateHeadersForSuperUnitGroup(super_unit_group)

Iterate over all headers with the given super-classification.

Parameters

super_unit_group
the super-unit group to check. This can be "party" or "raid"

Return value

iterator which returns headers

Usage

for header in PitBull4:IterateHeadersForSuperUnitGroup("party")
    doSomethingWith(header)
end


PitBull4:IterateHeadersForUnitGroup(unit_group)

Iterate over all headers with the given classification.

Parameters

unit_group
the unit group to check

Return value

iterator which returns headers

Usage

for header in PitBull4:IterateHeadersForUnitGroup("party")
    doSomethingWith(header)
end


PitBull4:IterateLoadOnDemandModules()

Return a iterator of addon ID, addon name that are modules that PitBull4 can load.
module_name is the same as name without the "PitBull4_" prefix.

Return value

an iterator which returns id, name, module_name

Usage

for i, name, module_name in PitBull4:IterateLoadOnDemandModules() do
	    print(i, name, module_name)
	end


PitBull4:IterateMemberFrames(also_hidden)

Iterate over all member frames.
This iterates over only shown frames unless also_hidden is passed in.

Parameters

also_hidden
also return frames that are hidden

Return value

iterator which returns frames

Usage

for frame in PitBull4:IterateNonWackyFrames() do
    doSomethingWith(frame)
end
for frame in PitBull4:IterateNonWackyFrames(true) do
    doSomethingWith(frame)
end


PitBull4:IterateNonWackyFrames(also_hidden, only_non_wacky)

Iterate over all non-wacky frames.
This iterates over only shown frames unless also_hidden is passed in.

Parameters

also_hidden
also return frames that are hidden
only_non_wacky

Return value

iterator which returns frames

Usage

for frame in PitBull4:IterateNonWackyFrames() do
    doSomethingWith(frame)
end
for frame in PitBull4:IterateNonWackyFrames(true) do
    doSomethingWith(frame)
end


PitBull4:IterateSingletonFrames(also_hidden)

Iterate over all singleton frames.
This iterates over only shown frames unless also_hidden is passed in.

Parameters

also_hidden
also return frames that are hidden

Return value

iterator which returns frames

Usage

for frame in PitBull4:IterateSingletonFrames() do
    doSomethingWith(frame)
end
for frame in PitBull4:IterateSingletonFrames(true) do
    doSomethingWith(frame)
end


PitBull4:IterateWackyFrames(also_hidden)

Iterate over all wacky frames.
This iterates over only shown frames unless also_hidden is passed in.

Parameters

also_hidden
also return frames that are hidden

Return value

iterator which returns frames

Usage

for frame in PitBull4:IterateWackyFrames() do
    doSomethingWith(frame)
end
for frame in PitBull4:IterateWackyFrames(true) do
    doSomethingWith(frame)
end


PitBull4:LoadAndEnableModule(id)

Load the module with the given id and enable it

Parameters

id


PitBull4:LoadModules()

Load Load-on-demand modules if they are enabled and exist.

Usage

PitBull4:LoadModules()


PitBull4:OutOfCombatWrapper(func)

Wrap the given function so that any call to it will be piped through PitBull4:RunOnLeaveCombat.

Parameters

func
function to call

Return value

the wrapped function

Usage

myFunc = PitBull4:OutOfCombatWrapper(func)
MyNamespace.MyMethod = PitBull4:OutOfCombatWrapper(MyNamespace.MyMethod)


PitBull4:RunOnLeaveCombat(func, ...)

Call a function if out of combat or schedule to run once combat ends.
If current out of combat, the function provided will be called without delay.

Parameters

func
function to call
...
arguments to pass into func

Usage

PitBull4:RunOnLeaveCombat(someSecureFunction)
PitBull4:RunOnLeaveCombat(someSecureFunction, "player")
PitBull4:RunOnLeaveCombat(frame.SetAttribute, frame, "key", "value")


PitBull4:UpdateForLayout(layout)

call :Update() on all frames with the given layout

Parameters

layout
the layout to check

Usage

PitBull4:UpdateForLayout("Normal")



Comments

Posts Quoted:
Reply
Clear All Quotes