[Cata Classic] Options error after 4.4.1
Road-block opened this issue ยท 1 comments
Fix(es)
Replace last section in ItemTooltipProfessionConfigFrame.lua with
frame.okay = SaveAndQuit
frame:SetScript( "OnShow", RefreshWidgets )
frame:SetScript( "OnEvent", InitVariables )
frame:RegisterEvent( "ADDON_LOADED" )
frame.OnCommit = frame.okay
if _G.InterfaceOptions_AddCategory then
InterfaceOptions_AddCategory( frame )
elseif Settings and Settings.RegisterCanvasLayoutCategory then
local cat = Settings.RegisterCanvasLayoutCategory(frame, frame.name)
ItemProfConstants.optionsCategory = cat
Settings.RegisterAddOnCategory(cat)
end
Replace the first lines in the same file with
local addonName, ItemProfConstants = ...
local frame = CreateFrame( "Frame" )
frame.name = addonName
Finally replace the InitVariables function with
local function InitVariables(_,event,...)
if ... == addonName then
frame:UnregisterEvent( "ADDON_LOADED" )
local configRealm = ItemProfConstants.configTooltipIconsRealm
local configChar = ItemProfConstants.configTooltipIconsChar
if not ItemTooltipIconsConfig then
ItemTooltipIconsConfig = {}
end
if not ItemTooltipIconsConfig[ configRealm ] then
ItemTooltipIconsConfig[ configRealm ] = {}
end
if not ItemTooltipIconsConfig[ configRealm ][ configChar ] then
ItemTooltipIconsConfig[ configRealm ][ configChar ] = {}
end
userVariables = ItemTooltipIconsConfig[ configRealm ][ configChar ]
if userVariables.showProfs == nil then
userVariables.showProfs = configDefaultShowProfs
end
if userVariables.showQuests == nil then
userVariables.showQuests = configDefaultShowQuests
end
if userVariables.profFlags == nil then
userVariables.profFlags = configDefaultProfFlags
end
if userVariables.questFlags == nil then
userVariables.questFlags = configDefaultQuestFlags
end
if userVariables.includeVendor == nil then
userVariables.includeVendor = configDefaultIncludeVendor
end
if userVariables.iconSize == nil then
userVariables.iconSize = configDefaultIconSize
end
if userVariables.showDMF == nil then
userVariables.showDMF = configDefaultShowDMF
end
RefreshWidgets()
ItemProfConstants:ConfigChanged()
end
end
VARIABLES_LOADED
is not the addon variables loaded event since 2007 or something ๐
These updates will also probably fix #8