WoW:API GetQuestLogTitle: Difference between revisions

(format, example)
Line 1: Line 1:
{{wowapi}} __NOTOC__
{{wowapi}} __NOTOC__
Returns information about a quest in your quest log.
Returns information about a quest in your quest log.
  questTitle, level, questTag, isHeader, isCollapsed, isComplete = GetQuestLogTitle(questID);
  questTitle, level, questTag, suggestedGroup, isHeader, isCollapsed, isComplete = GetQuestLogTitle(questID);


==Parameters==
==Parameters==
Line 8: Line 8:


===Returns===
===Returns===
:;questTitle : String - The title of the quest  
:;questTitle : String - The title of the quest, or nil if the index is out of range.
:;level : Integer - The level of the quest
:;level : Integer - The level of the quest
:;questTag : String - Should be "Elite", "Dungeon", "PVP", "Raid", or nil  (return value is localized!).
:;questTag : String - Should be "Elite", "Dungeon", "PVP", "Raid", or nil  (return value is localized!).
:;suggestedGroup : ? - ? (added in 2.0.3)
:;isHeader : Boolean - 1 if the entry is a header, nil otherwise.
:;isHeader : Boolean - 1 if the entry is a header, nil otherwise.
:;isCollapsed : Boolean - 1 if the entry is a collapsed header, nil otherwise.
:;isCollapsed : Boolean - 1 if the entry is a collapsed header, nil otherwise.
Line 19: Line 20:
  while (GetQuestLogTitle(i+1) ~= nil) do
  while (GetQuestLogTitle(i+1) ~= nil) do
   i = i + 1;
   i = i + 1;
   local questTitle, level, tag, header, collapsed = GetQuestLogTitle(i);
   local questTitle, level, tag, suggestedGroup, header, collapsed = GetQuestLogTitle(i);
   if (not header) then
   if (not header) then
   DEFAULT_CHAT_FRAME:AddMessage(questTitle .. " [" .. level .. "]");
   DEFAULT_CHAT_FRAME:AddMessage(questTitle .. " [" .. level .. "]");
   return;
   return;
  elseif (collapsed) then
  ExpandQuestHeader(i);
   end
   end
  end
  end
===Result===
===Result===
Prints the name and level of the first quest in your quest log (expands collapsed headers to achieve this).
Prints the name and the level of all quests in your quest log.
Anonymous user