Error trying to open options via minimap button
keflatbn opened this issue ยท 4 comments
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 =
}
}
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. ๐
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
- Reference the return values for
AddToBlizOptions
: https://www.wowace.com/projects/ace3/pages/api/ace-config-dialog-3-0 - The
InterfaceOptionsFrame_OpenToCategory
function became deprecated in 10.0.0: https://github.com/Gethe/wow-ui-source/blob/10.0.0/Interface/SharedXML/Settings/Blizzard_Deprecated.lua#L23
Hope this helps, thanks!
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 ๐