From a6c5a91823b71112ea9260e6d2852526f54fe225 Mon Sep 17 00:00:00 2001 From: shagu Date: Fri, 23 Dec 2016 22:30:47 +0100 Subject: [PATCH] performance: load settings only once --- pfUI.lua | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/pfUI.lua b/pfUI.lua index f686dc91..97d0bc5d 100644 --- a/pfUI.lua +++ b/pfUI.lua @@ -36,31 +36,31 @@ pfLocaleSpellEvents = {} pfLocaleSpellInterrupts = {} pfUI:SetScript("OnEvent", function() - if not pfUI_init then - pfUI_init = {} - end - - if not pfUI_profiles then - pfUI_profiles = {} - end - - pfUI:LoadConfig() - - -- reload environment - pfUI.environment:UpdateFonts() - pfUI.environment:UpdateColors() - - -- fill the cache - pfUI.cache["locale"] = GetLocale() - if pfUI.cache["locale"] ~= "enUS" and - pfUI.cache["locale"] ~= "frFR" and - pfUI.cache["locale"] ~= "deDE" and - pfUI.cache["locale"] ~= "zhCN" and - pfUI.cache["locale"] ~= "ruRU" then - pfUI.cache["locale"] = "enUS" - end - if arg1 == "pfUI" then + if not pfUI_init then + pfUI_init = {} + end + + if not pfUI_profiles then + pfUI_profiles = {} + end + + pfUI:LoadConfig() + + -- reload environment + pfUI.environment:UpdateFonts() + pfUI.environment:UpdateColors() + + -- fill the cache + pfUI.cache["locale"] = GetLocale() + if pfUI.cache["locale"] ~= "enUS" and + pfUI.cache["locale"] ~= "frFR" and + pfUI.cache["locale"] ~= "deDE" and + pfUI.cache["locale"] ~= "zhCN" and + pfUI.cache["locale"] ~= "ruRU" then + pfUI.cache["locale"] = "enUS" + end + for i,m in pairs(this.modules) do -- do not load disabled modules if pfUI_config["disabled"] and pfUI_config["disabled"][m] == "1" then