Kayakflo / wow-dialogkey-sl

Adjusted version of the original wow-dialog key addon to work with WoW Shadowlands
GNU General Public License v3.0
9 stars 3 forks source link

error #2

Closed jisamcom closed 3 years ago

jisamcom commented 3 years ago

1st and 2nd were not completed quest return, and 3rd one is completed, and i got this error.

2x DialogKey\main.lua:245: attempt to index field '?' (a nil value) [string "@DialogKey\main.lua"]:245: in functionClickButtons' [string "@DialogKey\main.lua"]:195: in function <DialogKey\main.lua:134>

Locals: self =

{ SetDefaultModuleLibraries = defined @Ace3\AceAddon-3.0\AceAddon-3.0.lua:367 DisableQuestScrolling = defined @DialogKey\main.lua:465 EnableModule = defined @Ace3\AceAddon-3.0\AceAddon-3.0.lua:332 modules =
{ } CancelTimer = defined @Ace3\AceTimer-3.0\AceTimer-3.0.lua:147 ClickFrameName = defined @DialogKey\main.lua:329 keybindIndex = 0 recentlyPressed = false Printf = defined @Ace3\AceConsole-3.0\AceConsole-3.0.lua:69 SetDefaultModulePrototype = defined @Ace3\AceAddon-3.0\AceAddon-3.0.lua:409 HandleScroll = defined @DialogKey\main.lua:479 defaultModuleState = true IsEnabled = defined @Ace3\AceAddon-3.0\AceAddon-3.0.lua:451 ScheduleTimer = defined @Ace3\AceTimer-3.0\AceTimer-3.0.lua:94 DisableModule = defined @Ace3\AceAddon-3.0\AceAddon-3.0.lua:350 Glow = defined @DialogKey\main.lua:413 RegisterMessage = defined @Ace3\CallbackHandler-1.0\CallbackHandler-1.0.lua:90 UnregisterMessage = defined @Ace3\CallbackHandler-1.0\CallbackHandler-1.0.lua:153 ClickFrame = defined @DialogKey\main.lua:271 scrollFrames =
{ } db =
{ } GlowQuestIndex = defined @DialogKey\main.lua:434 SetEnabledState = defined @Ace3\AceAddon-3.0\AceAddon-3.0.lua:424 enabledState = true RegisterEvent = defined @Ace3\CallbackHandler-1.0\CallbackHandler-1.0.lua:90 IterateModules = defined @Ace3\AceAddon-3.0\AceAddon-3.0.lua:437 ClickButtons = defined @DialogKey\main.lua:212 frame = DialogKeyFrame { } RemoveMouseFocus = defined @DialogKey\main.lua:72 AddMouseFocus = defined @DialogKey\main.lua:2 debug_dialog = defined @DialogKey\main.lua:502 OnInitialize = defined @DialogKey\core.lua:67 NewModule = defined @Ace3\AceAddon-3.0\AceAddon-3.0.lua:235 glowFrame = DialogKeyGlow { } GetModule = defined @Ace3\AceAddon-3.0\AceAddon-3.0.lua:210 round = defined @DialogKey\core.lua:216 FindPathTo = defined @DialogKey\main.lua:21 options = { } UnregisterChatCommand = defined @Ace3\AceConsole-3.0\AceConsole-3.0.lua:111 ValueToString = defined @DialogKey\options.lua:483 ScheduleRepeatingTimer = defined @Ace3\AceTimer-3.0\AceTimer-3.0.lua:129 CancelAllTimers = defined @Ace3\AceTimer-3.0\AceTimer-3.0.lua:160 keybindMode = false UnwatchFrame = defined @DialogKey\main.lua:110 GetName = defined @Ace3\AceAddon-3.0\AceAddon-3.0.lua:279 EnumerateGossips_Quest = defined @DialogKey\main.lua:375 baseName = "DialogKey" UpdateBlacklist = defined @DialogKey\options.lua:476 name = "DialogKey" SaveBlacklist = defined @DialogKey\options.lua:460 UpdateAdditionalFrames = defined @DialogKey\options.lua:453 ShowOldKeybindWarning = defined @DialogKey\core.lua:142 IterateEmbeds = defined @Ace3\AceAddon-3.0\AceAddon-3.0.lua:442 Disable = defined @Ace3\AceAddon-3.0\AceAddon-3.0.lua:314 GetFrameByName = defined @DialogKey\main.lua:56 builtinDialogBlacklist =
{ } HandleKeybind = defined @DialogKey\option`

jisamcom commented 3 years ago

fixed myself.. actually...

due to change of gossipframe

https://github.com/tomrus88/BlizzardInterfaceCode/blob/master/Interface/FrameXML/GossipFrame.lua

changed to line 246 ~ 258

            for i=1,9 do
                if GossipFrame_GetTitleButton(i) then
                    if GossipFrame_GetTitleButton(i).Icon:IsVisible() and (
                        GossipFrame_GetTitleButton(i).Icon:GetTexture() == "Interface/GossipFrame/ActiveQuestIcon" or
                        GossipFrame_GetTitleButton(i).Icon:GetTexture() == "Interface/GossipFrame/ActiveLegendaryQuestIcon") then

                        return DialogKey:ClickFrame(GossipFrame_GetTitleButton(i))
                    end
                end
            end

            -- If none were found, just click the first one
            return DialogKey:ClickFrame(GossipFrame_GetTitleButton(1))
Kayakflo commented 3 years ago

Thank you @jisamcom not only for the report but also for the follow up fix! I have merged your suggestion and created a new release.