Fixes for QuestUtil usage in Classic
This commit is contained in:
parent
d269a24967
commit
14d9f35361
60
TurnIn.lua
60
TurnIn.lua
@ -202,6 +202,7 @@ function TI_LoadEvents()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function TI_ResetPointers()
|
function TI_ResetPointers()
|
||||||
|
TI_debug("resetting pointers")
|
||||||
TI_activenumber = 1;
|
TI_activenumber = 1;
|
||||||
TI_availnumber = 1;
|
TI_availnumber = 1;
|
||||||
TI_specnum = 0;
|
TI_specnum = 0;
|
||||||
@ -318,7 +319,7 @@ function TI_OnEvent(self, event, ...)
|
|||||||
TI_LoadEvents();
|
TI_LoadEvents();
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if(TI_status.state and not IsShiftKeyDown()) then
|
if(TI_status.state and not IsShiftKeyDown()) then
|
||||||
if(event == "QUEST_GREETING") then
|
if(event == "QUEST_GREETING") then
|
||||||
TI_debug("Quest Greeting");
|
TI_debug("Quest Greeting");
|
||||||
TI_lastquestframe = "greeting";
|
TI_lastquestframe = "greeting";
|
||||||
@ -420,6 +421,7 @@ function TI_CompleteQuest()
|
|||||||
TI_ResetPointers();
|
TI_ResetPointers();
|
||||||
else
|
else
|
||||||
TI_debug("quest is not completable, declining");
|
TI_debug("quest is not completable, declining");
|
||||||
|
TI_availnumber = TI_availnumber + 1;
|
||||||
QuestDetailDeclineButton_OnClick();
|
QuestDetailDeclineButton_OnClick();
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -526,6 +528,7 @@ function TI_HandleGossipWindow(gorq)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if(TI_availnumber > TotalOptions or TI_activenumber > TotalOptions) then
|
if(TI_availnumber > TotalOptions or TI_activenumber > TotalOptions) then
|
||||||
|
TI_debug("Out of available/active quests, giving up ");
|
||||||
TI_ResetPointers();
|
TI_ResetPointers();
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
@ -585,7 +588,6 @@ function TI_HandleGossipWindow(gorq)
|
|||||||
if(current.type == "availquest" and #AvailableQuests > 0 and TI_availnumber <= #AvailableQuests) then
|
if(current.type == "availquest" and #AvailableQuests > 0 and TI_availnumber <= #AvailableQuests) then
|
||||||
SAvQ(AvailableQuests[TI_availnumber].questID);
|
SAvQ(AvailableQuests[TI_availnumber].questID);
|
||||||
TI_debug("Selecting Available Quest ".. TI_availnumber);
|
TI_debug("Selecting Available Quest ".. TI_availnumber);
|
||||||
TI_ResetPointers();
|
|
||||||
return;
|
return;
|
||||||
elseif(current.type == "activequest" and #ActiveQuests > 0 and TI_activenumber <= #ActiveQuests) then
|
elseif(current.type == "activequest" and #ActiveQuests > 0 and TI_activenumber <= #ActiveQuests) then
|
||||||
while TI_activenumber <= #ActiveQuests do
|
while TI_activenumber <= #ActiveQuests do
|
||||||
@ -729,58 +731,46 @@ function TI_TabulateGossipUIInfo_Retail(guis)
|
|||||||
return x;
|
return x;
|
||||||
end
|
end
|
||||||
|
|
||||||
function TI_TabulateGossipAvailableQuests_Classic(...)
|
function TI_TabulateGossipAvailableQuests_Classic(gquis)
|
||||||
local x = {};
|
local x = {};
|
||||||
local idx = 1;
|
|
||||||
|
|
||||||
for i=1, select("#", ...), 7 do
|
for i,gqui in ipairs(gquis) do
|
||||||
local temp = {};
|
local temp = {};
|
||||||
temp.name = select(i, ...);
|
temp.name = gqui.title;
|
||||||
|
|
||||||
local isTrivial = select(i+2, ...);
|
if ( gqui.repeatable ) then
|
||||||
local isDaily = select(i+3, ...);
|
|
||||||
local isRepeatable = select(i+4, ...);
|
|
||||||
local isLegendary = select(i+5, ...);
|
|
||||||
local isIgnored = select(i+6, ...);
|
|
||||||
if ( isDaily ) then
|
|
||||||
temp.icon = "Interface\\GossipFrame\\DailyQuestIcon";
|
temp.icon = "Interface\\GossipFrame\\DailyQuestIcon";
|
||||||
elseif ( isRepeatable ) then
|
elseif ( gqui.isLegendary ) then
|
||||||
temp.icon = "Interface\\GossipFrame\\DailyActiveQuestIcon";
|
|
||||||
elseif ( isLegendary ) then
|
|
||||||
temp.icon = "Interface\\GossipFrame\\AvailableLegendaryQuestIcon";
|
temp.icon = "Interface\\GossipFrame\\AvailableLegendaryQuestIcon";
|
||||||
else
|
else
|
||||||
temp.icon = "Interface\\GossipFrame\\AvailableQuestIcon";
|
temp.icon = "Interface\\GossipFrame\\AvailableQuestIcon";
|
||||||
end
|
end
|
||||||
temp.questID = idx;
|
temp.questID = gqui.questID;
|
||||||
|
temp.isComplete = gqui.isComplete;
|
||||||
|
|
||||||
table.insert(x, temp);
|
table.insert(x, temp);
|
||||||
idx = idx + 1;
|
|
||||||
end
|
end
|
||||||
return x;
|
return x;
|
||||||
end
|
end
|
||||||
|
|
||||||
function TI_TabulateGossipActiveQuests_Classic(...)
|
function TI_TabulateGossipActiveQuests_Classic(gquis)
|
||||||
local x = {};
|
local x = {};
|
||||||
local idx = 1;
|
|
||||||
|
|
||||||
for i=1, select("#", ...), 6 do
|
for i,gqui in ipairs(gquis) do
|
||||||
local temp = {};
|
local temp = {};
|
||||||
temp.name = select(i, ...);
|
temp.name = gqui.title;
|
||||||
|
|
||||||
local isComplete = select(i+3, ...);
|
if ( gqui.repeatable ) then
|
||||||
temp.isComplete = isComplete;
|
temp.icon = "Interface\\GossipFrame\\DailyQuestIcon";
|
||||||
local isLegendary = select(i+4, ...);
|
elseif ( gqui.isLegendary ) then
|
||||||
if(isComplete) then
|
temp.icon = "Interface\\GossipFrame\\AvailableLegendaryQuestIcon";
|
||||||
if(isLegendary) then
|
|
||||||
temp.icon = "Interface\\GossipFrame\\ActiveLegendaryQuestIcon";
|
|
||||||
else
|
|
||||||
temp.icon = "Interface\\GossipFrame\\ActiveQuestIcon";
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
temp.icon = "Interface\\GossipFrame\\IncompleteQuestIcon";
|
temp.icon = "Interface\\GossipFrame\\AvailableQuestIcon";
|
||||||
end
|
end
|
||||||
temp.questID = idx;
|
temp.questID = gqui.questID;
|
||||||
|
temp.isComplete = gqui.isComplete;
|
||||||
|
|
||||||
table.insert(x, temp);
|
table.insert(x, temp);
|
||||||
idx = idx + 1;
|
|
||||||
end
|
end
|
||||||
return x;
|
return x;
|
||||||
end
|
end
|
||||||
@ -813,8 +803,8 @@ else
|
|||||||
getavailquests = C_GossipInfo.GetAvailableQuests,
|
getavailquests = C_GossipInfo.GetAvailableQuests,
|
||||||
getactivequests = C_GossipInfo.GetActiveQuests,
|
getactivequests = C_GossipInfo.GetActiveQuests,
|
||||||
getoptions = C_GossipInfo.GetOptions,
|
getoptions = C_GossipInfo.GetOptions,
|
||||||
tabulateAvailable = TI_TabulateGossipQuestUIInfo_Retail,
|
tabulateAvailable = TI_TabulateGossipAvailableQuests_Classic,
|
||||||
tabulateActive = TI_TabulateGossipQuestUIInfo_Retail,
|
tabulateActive = TI_TabulateGossipActiveQuests_Classic,
|
||||||
tabulateOptions = TI_TabulateGossipUIInfo_Retail,
|
tabulateOptions = TI_TabulateGossipUIInfo_Retail,
|
||||||
},
|
},
|
||||||
q = {
|
q = {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user