Battle Pet Completionist

Battle Pet Completionist

115k Downloads

Error trying to open options via minimap button

keflatbn opened this issue ยท 4 comments

commented

First time trying out this addon, looks promising! :)

Addon Version: 11.0.0-20240725-2 Jul 25, 2024
Wow version: 11.0.0 (55824)

Got this error first with another addon, then I disabled that one and got the same error but conflicting with an new addon:

1x ...ttlePetCompletionist/Modules/Broker/BrokerModule.lua:181: attempt to call global 'InterfaceOptionsFrame_OpenToCategory' (a nil value)
[string "@BattlePetCompletionist/Modules/Broker/BrokerModule.lua"]:181: in function OnClick' [string "@BattlePetCompletionist/Modules/Broker/BrokerModule.lua"]:76: in function OnClick'
[string "@SilverDragon/lib/LibDBIcon-1.0-54/LibDBIcon-1.0.lua"]:179: in function <...Ons/SilverDragon/lib/LibDBIcon-1.0/LibDBIcon-1.0.lua:177>

Locals:
self =

{
modules =
{
}
defaultModuleLibraries =
{
}
name = "BattlePetCompletionist_BrokerModule"
orderedModules =
{
}
mapID = 2112
dataSource =
{
}
baseName = "BattlePetCompletionist"
enabledState = true
defaultModuleState = true
moduleName = "BrokerModule"
}
button = "LeftButton"
(*temporary) = nil
(*temporary) = Frame {
obj =
{
}
name = "Battle Pet Completionist"
}
(*temporary) = "attempt to call global 'InterfaceOptionsFrame_OpenToCategory' (a nil value)"
ConfigModule =
{
baseName = "BattlePetCompletionist"
modules =
{
}
defaultModuleLibraries =
{
}
OptionsFrame = Frame {
}
enabledState = true
moduleName = "ConfigModule"
defaultModuleState = true
name = "BattlePetCompletionist_ConfigModule"
orderedModules =
{
}
}

commented

Thank you, I'll take a look at it later today or tomorrow.
Until then, as a workaround, you can use the Options button in the normal menu, and then find the addon in there. ๐Ÿ™‚

commented

Hey there, the fixes for this issue are in two files (let the addon developers confirm though):

File 1: /Modules/Config/ConfigModule.lua
Lines 392-401 should become:

function ConfigModule:OnInitialize()
    AceConfig:RegisterOptionsTable("BattlePetCompletionist_options", options)
    ConfigModule.OptionsFrame, ConfigModule.CategoryId = AceConfigDialog:AddToBlizOptions("BattlePetCompletionist_options", "Battle Pet Completionist")

    ConfigModule:RegisterChatCommand("bpcom", "ChatCommandOptions")
end

function ConfigModule:ChatCommandOptions(msg)
    Settings.OpenToCategory(ConfigModule.CategoryId)
end

File 2: /Modules/Broker/BrokerModule.lua
Lines 178-185 should become:

function BrokerModule:OnClick(button)
    if button == "LeftButton" then
        -- TODO: show new window
        Settings.OpenToCategory(ConfigModule.CategoryId)
    elseif button == "RightButton" then
        Settings.OpenToCategory(ConfigModule.CategoryId)
    end
end

Hope this helps, thanks!

commented

Hey, thanks, that is the function calls I have changed it to.
The next release with the fix for this should be coming out shortly ๐Ÿš€

commented

Great! I ran into this myself, and I wasn't aware of the categoryId return value on AddToBlizOptions which is what I had to set in order for my settings window to open directly to my addon. Anyhow, take care!