mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-07 06:00:00 +00:00
api: use local variable space for pfUI modules
This commit is contained in:
@@ -81,6 +81,15 @@ pfUI:SetScript("OnEvent", function()
|
||||
if pfUI_config["disabled"] and pfUI_config["disabled"][m] == "1" then
|
||||
-- message("DEBUG: module " .. m .. " has been disabled")
|
||||
else
|
||||
local env_pfui = {}
|
||||
local env_global = getfenv(0)
|
||||
setmetatable(env_pfui, {__index = env_global})
|
||||
setfenv(1, env_pfui)
|
||||
env_pfui._G = getfenv(0)
|
||||
env_pfui._C = pfUI_config
|
||||
env_pfui._A = pfUI.api
|
||||
|
||||
setfenv(pfUI.module[m], env_pfui)
|
||||
pfUI.module[m]()
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user