WoW API: CollapseTrainerSkillLine

From AddOn Studio
Revision as of 17:32, 6 January 2007 by WoWWiki>Hobinbot (upgraded deprecated template)
Jump to navigation Jump to search

WoW API < CollapseTrainerSkillLine

CollapseTrainerSkillLine -Documentation by starlightblunder-

Collapses a header, hiding all spells below it.

CollapseTrainerSkillLine(id);

Arguments
id
Index of the trainer service header to collapse (if the supplied index is not a header, an error is produced). Note that indices are affected by the trainer filter. (See GetTrainerServiceTypeFilter and SetTrainerServiceTypeFilter.)

Example

Collapses all trainer headers.

local i, category;
for i=1,GetNumTrainerServices() do
 _ , _, category = GetTrainerServiceInfo(i);
 if (category == nil) then
  break; -- GetNumTrainerServices() does not check if you're talking to a trainer or not.
 end
 if (category == "header") then
  CollapseTrainerSkillLine(i);
 end
end