WoW:API CollapseTrainerSkillLine: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
m (Move page script moved page API CollapseTrainerSkillLine to API CollapseTrainerSkillLine without leaving a redirect) |
||
(3 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{ | {{wowapi}} | ||
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 [[API_GetTrainerServiceTypeFilter|GetTrainerServiceTypeFilter]] and [[API_SetTrainerServiceTypeFilter|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 |
Latest revision as of 04:45, 15 August 2023
← WoW API < CollapseTrainerSkillLine
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