Add disable-checks for BCC

This commit is contained in:
robin 2021-05-25 15:29:35 +02:00
parent 772d883ada
commit 07687e1b03
5 changed files with 34 additions and 13 deletions

View File

@ -167,14 +167,19 @@ function modul:Delete(id, typ)
self['db'][id] = nil
end
end
local skipClassic = {
['PLAYERREAGENTBANKSLOTS_CHANGED'] = true
local skip = {
[WOW_PROJECT_CLASSIC] = {
['PLAYERREAGENTBANKSLOTS_CHANGED'] = true
},
[WOW_PROJECT_BURNING_CRUSADE_CLASSIC] = {
['PLAYERREAGENTBANKSLOTS_CHANGED'] = true
}
}
function modul:Enable()
self['status'] = true
local list = {}
for event,func in pairs(events) do
if(not child:IsClassic() or (child:IsClassic() and not skipClassic[event])) then
if(not skip[WOW_PROJECT_ID] or not skip[WOW_PROJECT_ID][event]) then
list[#list+1] = event
end
end

View File

@ -129,7 +129,7 @@ function events:CURRENCY_DISPLAY_UPDATE(event)
if(playerID) then
modul['db'][playerID] = modul['db'][playerID] or {}
local tab = modul['db'][playerID]
for index=1, GetCurrencyListSize() do
for index = 1, GetCurrencyListSize() do
local curInfo
if(C_CurrencyInfo and C_CurrencyInfo.GetCurrencyListInfo) then
curInfo = GetCurrencyListInfo(index)
@ -167,15 +167,20 @@ function modul:Delete(id, typ)
self['db'][id] = nil
end
end
local skipClassic = {
['CURRENCY_DISPLAY_UPDATE'] = true
local skip = {
[WOW_PROJECT_CLASSIC] = {
['CURRENCY_DISPLAY_UPDATE'] = true
},
[WOW_PROJECT_BURNING_CRUSADE_CLASSIC] = {
['CURRENCY_DISPLAY_UPDATE'] = true
}
}
function modul:Enable()
if(not child:IsClassic()) then
if(child:IsRetail()) then
self.status = true
local list = {}
for event, func in pairs(events) do
if(not child:IsClassic() or (child:IsClassic() and not skipClassic[event])) then
if(not skip[WOW_PROJECT_ID] or not skip[WOW_PROJECT_ID][event]) then
list[#list+1] = event
end
end
@ -200,6 +205,7 @@ function modul:Disable()
end
end
child:IgnoreClassic(modulname)
child:IgnoreBCC(modulname)
local init = {
Setup = function(self)
modul.db, modul.status = child:RegisterModul(modul, modulname)

View File

@ -177,7 +177,7 @@ function modul:Delete(id, typ)
end
end
function modul:Enable()
if(not child:IsClassic()) then
if(child:IsRetail()) then
self.status = true
local list = {}
for event, func in pairs(events) do
@ -207,6 +207,7 @@ function modul:Disable()
end
end
child:IgnoreClassic(modulname)
child:IgnoreBCC(modulname)
local init = {
Setup = function(self)
db = child['db']

View File

@ -124,6 +124,7 @@ function modul:Disable()
end
end
child:IgnoreClassic(modulname)
child:IgnoreBCC(modulname)
local init = {
Setup = function(self)
db = child['db']

View File

@ -4,7 +4,10 @@ local child = addon[childName]
child['moduls'] = {}
local moduls = child['moduls']
local db
local skipClassic = {}
local skip = {
[WOW_PROJECT_CLASSIC] = {},
[WOW_PROJECT_BURNING_CRUSADE_CLASSIC] = {}
}
function child:GetModul(modName)
for k,modul in pairs(moduls) do
if(modul.name==modName) then
@ -13,12 +16,17 @@ function child:GetModul(modName)
end
end
function child:IgnoreClassic(ign)
skipClassic[ign] = true
skip[WOW_PROJECT_CLASSIC][ign] = true
end
function child:IgnoreBCC(ign)
skip[WOW_PROJECT_BURNING_CRUSADE_CLASSIC][ign] = true
end
function child:RegisterModul(modul, namespace)
moduls[#moduls+1] = modul
if(not skipClassic[namespace] or not child:IsClassic()) then
if(not skip[WOW_PROJECT_ID] or not skip[WOW_PROJECT_ID][namespace]) then
child:AddToConfig(namespace)
else
child['db'][namespace.."Toggle"] = nil
end
return self:GetNamespace(namespace), child['db'][namespace.."Toggle"]
end
@ -27,7 +35,7 @@ function child:output(b)
for _, modul in pairs(moduls) do
if(type(modul.Output)=='function') then
if(child['db'][format('%sTooltip', modul.name)]) then
input,sum = modul.Output(input,sum,b)
input, sum = modul.Output(input,sum,b)
end
end
end