Peterodox / YUI-Dialogue

World of Warcraft Dialogue UI Add-On
https://www.curseforge.com/wow/addons/dialogueui
24 stars 7 forks source link

[Cata Classic] Quest Item popup failing due to missing API (4.4.0) #69

Closed Road-block closed 1 month ago

Road-block commented 1 month ago

Error

1x DialogueUI/API.lua:833: attempt to call field 'GetLogIndexForQuestID' (a nil value)
[string "@DialogueUI/API.lua"]:833: in function `GetQuestLogProgress'
[string "@DialogueUI/Code/DialogueUI.lua"]:1533: in function `?'
[string "@DialogueUI/Code/DialogueUI.lua"]:2064: in function `ShowUI'
[string "@DialogueUI/Code/Core.lua"]:153: in function <DialogueUI/Code/Core.lua:93>

Locals:
questID = 29509
(*temporary) = nil
(*temporary) = 29509
(*temporary) = "attempt to call field 'GetLogIndexForQuestID' (a nil value)"
C_QuestLog = <table> {
 IsQuestFlaggedCompleted = <function> defined =[C]:-1
 SetMapForQuestPOIs = <function> defined =[C]:-1
 IsOnQuest = <function> defined =[C]:-1
 GetQuestObjectives = <function> defined =[C]:-1
 GetMaxNumQuestsCanAccept = <function> defined =[C]:-1
 ShouldShowQuestRewards = <function> defined =[C]:-1
 GetMaxNumQuests = <function> defined =[C]:-1
 GetQuestInfo = <function> defined =[C]:-1
 GetQuestsOnMap = <function> defined =[C]:-1
 GetMapForQuestPOIs = <function> defined =[C]:-1
}
GetNumQuestLeaderBoards = <function> defined =[C]:-1
GetQuestLogLeaderBoard = <function> defined =[C]:-1

[One possible] fix

local function GetLogIndexForQuestID(...)
    if _G.GetQuestLogIndexByID then
        return _G.GetQuestLogIndexByID(...)
    elseif C_QuestLog and C_QuestLog.GetLogIndexForQuestID then
        return C_QuestLog.GetLogIndexForQuestID(...)
    end
end
API.GetLogIndexForQuestID = GetLogIndexForQuestID

added, then

    local function GetQuestLogProgress(questID)
        local questLogIndex = API.GetLogIndexForQuestID(questID);
        -- <snipped>

to use the shim

Road-block commented 1 month ago

Is the intended functionality to have the popup be clickable to use the item or just as a notification?

Peterodox commented 1 month ago

Hi! Thanks for the report.

They are two separate issues.

The first missing API issue will be fixed in our next update.

If you mean the "Click to read" button is responsive. It's likely a Blizzard issue. During The War Within Beta, they removed MacroText support meaning you cannot click a custom button to perform slash commands like /use. This change was reverted partially due to the addon community's backlash. It's likely an error that this change made it to Cata Live, because it currently works fine on Cata PTR 4.4.1 and Retail. CTR