WeaponSwingTimer SixxFix

WeaponSwingTimer SixxFix

3M Downloads

[Cata Classic] Options panel errors after 4.4.1

Road-block opened this issue ยท 8 comments

commented

Fix(es)

  1. 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)

  1. 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)

commented

This would probably also fix similar errors in 1.15.4.

commented

Probably not since there's no 'interfaceoptions' anywhere in Options.lua.

commented

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.

commented

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.

commented

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.

commented

Actually, the latest version as it stands does work for Classic Era.

commented

wow I was looking for that, amazing THANKS so much !

commented

Last push seems to have a applied a similar fix.