mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-22 07:36:56 +00:00
710be52f35
Drop the now-vestigial expansion plumbing.
- Delete modules/thirdparty-tbc.lua + its xml Include
- Strip 10 tbc-tagged CreateConfig calls in modules/gui.lua
- Drop the expansion arg from CreateConfig() signature + the disabled-
entry rendering path that depended on it
- Drop the showdisabled GUI toggle + its default
- Simplify pfUI:RegisterModule / pfUI:RegisterSkin to (name, func) only
- Strip the leading version arg ("vanilla:tbc", etc.) from all 114
Register call sites
- Delete the pfUI.expansion variable
48 lines
1.8 KiB
Lua
48 lines
1.8 KiB
Lua
pfUI:RegisterModule("autoshift", function ()
|
|
pfUI.autoshift = CreateFrame("Frame")
|
|
pfUI.autoshift:RegisterEvent("UI_ERROR_MESSAGE")
|
|
|
|
pfUI.autoshift.scanString = string.gsub(SPELL_FAILED_ONLY_SHAPESHIFT, "%%s", "(.+)")
|
|
|
|
pfUI.autoshift.errors = { SPELL_FAILED_NOT_MOUNTED, ERR_ATTACK_MOUNTED, ERR_TAXIPLAYERALREADYMOUNTED,
|
|
SPELL_FAILED_NOT_SHAPESHIFT, SPELL_FAILED_NO_ITEMS_WHILE_SHAPESHIFTED, SPELL_NOT_SHAPESHIFTED,
|
|
SPELL_NOT_SHAPESHIFTED_NOSPACE, ERR_CANT_INTERACT_SHAPESHIFTED, ERR_NOT_WHILE_SHAPESHIFTED,
|
|
ERR_NO_ITEMS_WHILE_SHAPESHIFTED, ERR_TAXIPLAYERSHAPESHIFTED,ERR_MOUNT_SHAPESHIFTED,
|
|
ERR_EMBLEMERROR_NOTABARDGEOSET }
|
|
|
|
pfUI.autoshift:SetScript("OnEvent", function()
|
|
-- switch stance if required
|
|
for stances in string.gfind(arg1, pfUI.autoshift.scanString) do
|
|
for _, stance in pairs({ strsplit(",", stances)}) do
|
|
CastSpellByName(string.gsub(stance,"^%s*(.-)%s*$", "%1"))
|
|
end
|
|
end
|
|
|
|
-- check if we need to stand up
|
|
if arg1 == SPELL_FAILED_NOT_STANDING then
|
|
SitOrStand()
|
|
return
|
|
end
|
|
|
|
-- scan through buffs and cancel shapeshift/mount
|
|
for id, errorstring in pairs(pfUI.autoshift.errors) do
|
|
if arg1 == errorstring then
|
|
-- don't cancel form when clicking on npcs while in combat
|
|
if arg1 == ERR_CANT_INTERACT_SHAPESHIFTED and UnitAffectingCombat("player") then
|
|
return
|
|
end
|
|
|
|
-- Mounts take priority over shapeshifts (the two can't coexist in
|
|
-- vanilla, but the error list covers mount-only states too). Both
|
|
-- helpers do their own engine-side aura scan and send the cancel
|
|
-- packet directly, so no buff iteration or bid lookup is needed.
|
|
if IsMounted() then
|
|
Dismount()
|
|
elseif GetShapeshiftFormID() ~= 0 then
|
|
CancelShapeshiftForm()
|
|
end
|
|
end
|
|
end
|
|
end)
|
|
end)
|