nampower: pass slash arg to DisenchantAll, default to "greens"

Bare DisenchantAll() errored — the DLL requires an arg. Forward the
slash message through and default to "greens" when empty. Per
nampower's player_scripts.cpp, quality is a STRING keyword ("greens",
"blues", "purples", pipe-combined); numbers are interpreted as item
IDs, not quality levels. tonumber() lets users pass numeric item IDs
unquoted.
This commit is contained in:
Brues
2026-06-22 14:31:20 -05:00
parent 66c8e5a0b1
commit 0f67ae195a
+9 -3
View File
@@ -152,9 +152,15 @@ pfUI:RegisterModule("nampower", function ()
if DisenchantAll then
_G.SLASH_PFDISENCHANTALL1 = "/disenchantall"
_G.SLASH_PFDISENCHANTALL2 = "/dea"
SlashCmdList["PFDISENCHANTALL"] = function()
DisenchantAll()
DEFAULT_CHAT_FRAME:AddMessage("|cff33ffccpfUI|r: Disenchanting all eligible items...")
SlashCmdList["PFDISENCHANTALL"] = function(msg)
-- DisenchantAll(itemIdOrName | quality, [includeSoulbound]).
-- Quality is a string keyword ("greens", "blues", "purples", or pipe-
-- combined). Numbers are interpreted as item IDs, not quality levels.
-- Default to "greens" — the typical disenchant-farming target.
local arg = (msg and msg ~= "") and msg or "greens"
local target = tonumber(arg) or arg
DisenchantAll(target)
DEFAULT_CHAT_FRAME:AddMessage("|cff33ffccpfUI|r: DisenchantAll(" .. tostring(target) .. ")")
end
end