mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-12 16:40:00 +00:00
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:
@@ -166,8 +166,8 @@ pfUI:RegisterModule("superwow", function ()
|
||||
end
|
||||
|
||||
-- Add slash command for clickthrough toggle
|
||||
SLASH_PFCLICKTHROUGH1 = "/clickthrough"
|
||||
SLASH_PFCLICKTHROUGH2 = "/ct"
|
||||
_G.SLASH_PFCLICKTHROUGH1 = "/clickthrough"
|
||||
_G.SLASH_PFCLICKTHROUGH2 = "/ct"
|
||||
SlashCmdList["PFCLICKTHROUGH"] = function()
|
||||
local enabled = pfUI.api.ToggleClickthrough()
|
||||
DEFAULT_CHAT_FRAME:AddMessage("|cff33ffccpfUI|r: Clickthrough mode " .. (enabled and "|cff00ff00enabled|r" or "|cffff0000disabled|r"))
|
||||
|
||||
Reference in New Issue
Block a user