core: move expansion checks into module header

This commit is contained in:
shagu
2021-10-10 12:14:46 +02:00
parent 81efaea6a9
commit ebe5d91a3a
27 changed files with 52 additions and 52 deletions
+4 -2
View File
@@ -18,9 +18,11 @@ ShaguTweaks.mods = {}
-- load translation tables
ShaguTweaks.L = (ShaguTweaks_locale[GetLocale()] or ShaguTweaks_locale["enUS"])
ShaguTweaks:RegisterEvent("VARIABLES_LOADED")
ShaguTweaks:SetScript("OnEvent", function()
-- load current expansion
local expansion = ShaguTweaks:GetExpansion()
-- initialize empty config
if not ShaguTweaks_config then ShaguTweaks_config = {} end
@@ -32,7 +34,7 @@ ShaguTweaks:SetScript("OnEvent", function()
end
-- load enabled mods
if ShaguTweaks_config[title] == 1 then
if mod.expansions[expansion] and ShaguTweaks_config[title] == 1 then
mod:enable()
end
end