WoW:API GetQuestLogTitle: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
(format, example)
Line 1: Line 1:
{{wowapi}}
{{wowapi}} __NOTOC__
Returns the string and other information which is associated with the specific QuestLog Title in the game.
Returns information about a quest in your quest log.
questTitle, level, questTag, isHeader, isCollapsed, isComplete = GetQuestLogTitle(questID);


GetQuestLogTitle(questID);
==Parameters==
===Arguments===
:;questID : Integer - The index of the quest you wish to get information about.


----
===Returns===
;''Arguments''
:;questTitle : String - The title of the quest
:;level : Integer - The level of the quest
:;questTag : String - Should be "Elite", "Dungeon", "PVP", "Raid", or nil  (return value is localized!).
:;isHeader : Boolean - 1 if the entry is a header, nil otherwise.
:;isCollapsed : Boolean - 1 if the entry is a collapsed header, nil otherwise.
:;isComplete : Integer - -1 if quest is (FAILED), +1 if quest is (COMPLETED), nil otherwise.


:(Number questID)
==Example==
 
local i=0;
:;questID : The quest number to get the title of
while (GetQuestLogTitle(i+1) ~= nil) do
 
  i = i + 1;
----
  local questTitle, level, tag, header, collapsed = GetQuestLogTitle(i);
;''Returns''
  if (not header) then
 
  DEFAULT_CHAT_FRAME:AddMessage(questTitle .. " [" .. level .. "]");
:;questTitle(String) : The title of the quest
  return;
:;level(Number) : The level of the quest
  elseif (collapsed) then
:;questTag(String) : Should be "Elite", "Dungeon", "PVP", "Raid", or nil.  (Localized, of course.)
  ExpandQuestHeader(i);
:;isHeader(boolean) : True if this quest is a header.
  end
:;isCollapsed(boolean) : True if this quest is a header and is collapsed.
  end
:;isComplete(number) : -1 if quest is (FAILED), +1 if quest is (COMPLETED), nil otherwise.
===Result===
 
Prints the name and level of the first quest in your quest log (expands collapsed headers to achieve this).
----
;''Example''
local questTitle = GetQuestLogTitle(1);
 
;''Result''
  "Leprechaun Assault"
 
;''Example from QuestLogFrame.lua''
local questLogTitleText, level, questTag, isHeader, isCollapsed, isComplete = GetQuestLogTitle(questIndex);
 
----
;''Description''
 
: Returns the string which is associated with the specific QuestLog Title in the game. Also returns other information about a given quest such as what it's level is, completion status, whether it's a header and if so if it is collapsed.

Revision as of 13:12, 3 January 2007

WoW API < GetQuestLogTitle

Returns information about a quest in your quest log.

questTitle, level, questTag, isHeader, isCollapsed, isComplete = GetQuestLogTitle(questID);

Parameters

Arguments

questID
Integer - The index of the quest you wish to get information about.

Returns

questTitle
String - The title of the quest
level
Integer - The level of the quest
questTag
String - Should be "Elite", "Dungeon", "PVP", "Raid", or nil (return value is localized!).
isHeader
Boolean - 1 if the entry is a header, nil otherwise.
isCollapsed
Boolean - 1 if the entry is a collapsed header, nil otherwise.
isComplete
Integer - -1 if quest is (FAILED), +1 if quest is (COMPLETED), nil otherwise.

Example

local i=0;
while (GetQuestLogTitle(i+1) ~= nil) do
 i = i + 1;
 local questTitle, level, tag, header, collapsed = GetQuestLogTitle(i);
 if (not header) then
  DEFAULT_CHAT_FRAME:AddMessage(questTitle .. " [" .. level .. "]");
  return;
 elseif (collapsed) then
  ExpandQuestHeader(i);
 end
end

Result

Prints the name and level of the first quest in your quest log (expands collapsed headers to achieve this).