[Cata Classic] Options panel errors after 4.4.1
Road-block opened this issue ยท 7 comments
Fix(es)
- Replace instances of
InterfaceOptionsFrame_OpenToCategory("WeaponSwingTimer")
InterfaceOptionsFrame_OpenToCategory("WeaponSwingTimer")
with
if _G.InterfaceOptionsFrame_OpenToCategory then
InterfaceOptionsFrame_OpenToCategory("WeaponSwingTimer")
InterfaceOptionsFrame_OpenToCategory("WeaponSwingTimer")
elseif Settings and Settings.OpenToCategory then
Settings.OpenToCategory(addon_data.options_category.ID)
end
(one in the slash handler)
- Replace instances of
InterfaceOptions_AddCategory(<blah>)
with respectively (main category, melee, hunter)
if _G.InterfaceOptions_AddCategory then
InterfaceOptions_AddCategory(panel)
elseif Settings and Settings.RegisterCanvasLayoutCategory then
panel.OnDefault = panel.default
local cat = Settings.RegisterCanvasLayoutCategory(panel, panel.name)
cat.ID = panel.name
Settings.RegisterAddOnCategory(cat)
addon_data.options_category = cat
end
if _G.InterfaceOptions_AddCategory then
InterfaceOptions_AddCategory(panel.config_melee_panel)
elseif Settings and Settings.RegisterCanvasLayoutSubcategory then
panel.config_melee_panel.OnDefault = panel.default
local subCat = Settings.RegisterCanvasLayoutSubcategory(addon_data.options_category, panel.config_melee_panel, panel.config_melee_panel.name)
end
if _G.InterfaceOptions_AddCategory then
InterfaceOptions_AddCategory(panel.config_hunter_panel)
elseif Settings and Settings.RegisterCanvasLayoutSubcategory then
panel.config_hunter_panel.OnDefault = panel.default
local subCat = Settings.RegisterCanvasLayoutSubcategory(addon_data.options_category, panel.config_hunter_panel, panel.config_hunter_panel.name)
end
(three places in _Config.lua)
Probably not since there's no 'interfaceoptions' anywhere in Options.lua.
I don't think you understand the code.
The conditionals ensure that InterfaceOptions methods are only used if they exist on the client.
If they don't the modern Settings API is used.
The very first line states to replace:
InterfaceOptionsFrame_OpenToCategory("WeaponSwingTimer")
InterfaceOptionsFrame_OpenToCategory("WeaponSwingTimer")
If those two lines don't exist in Classic Era's Config.lua, what will I be replacing instead?
UPDATE:
Oh I get it, nm, lol.
For folks that are not comfortable doing source edits, here's a test package.
WeaponSwingTimer-test-fix.zip
I know it works in Cata Classic, haven't tested Vanilla flavors but if the errors are options related it will likely work there as well.