slash: write SLASH_* keys to _G inside module bodies

pfUI module bodies run under pfUI.env (setfenv in LoadModule), which
proxies reads to _G via __index but has no __newindex. Bare
"SLASH_FOO = ..." assignments therefore land on pfUI.env, not on _G,
and WoW's slash dispatcher reads _G.SLASH_* directly — so the slash
command never registered. SlashCmdList[KEY] assignments happened to
work because the table is read first (falls through), then the key
write hits the real global table.

/pfunitxp, /clickthrough, /ct, /disenchantall, /dea — all silently
broken until now. Fixed by prefixing SLASH_* writes with _G.
This commit is contained in:
Brues
2026-06-22 14:27:20 -05:00
parent 2b140da5d4
commit 66c8e5a0b1
3 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -352,7 +352,7 @@ pfUI:RegisterModule("unitxp", function ()
end
-- Debug command to test UnitXP indicators
SLASH_PFUNITXP1 = "/pfunitxp"
_G.SLASH_PFUNITXP1 = "/pfunitxp"
SlashCmdList["PFUNITXP"] = function()
local chat = DEFAULT_CHAT_FRAME
chat:AddMessage("|cff33ffccpfUI|r: UnitXP Indicator Debug")