Drop named-unit frames and the pfValidUnits global

CreateUnitFrame and CreateCastbar could take a character name instead of
a unit token, but every caller passes a token, so that mode and the
empty-label guards around it were dead. The OnClick TargetByName branch
could never run anyway: label was always a string, and "" is truthy.

With that gone, the aggro scan was the only reader of pfValidUnits, so
its unit list now lives in unitframes.lua and is built once at load.

/focusname resolves the name with UnitTokenFromName (exact first, then
prefix) instead of swapping the target and muting UIErrorsFrame.
This commit is contained in:
Brues
2026-10-29 14:00:54 -05:00
parent 6c76a88467
commit 0890905eb6
4 changed files with 62 additions and 110 deletions
-35
View File
@@ -13,38 +13,3 @@ pfGridmath = {
[11] = {{11,1},{1,11}},
[12] = {{12,1},{6,2},{4,3},{3,4},{2,6},{1,12}}
}
-- list of valid unitstrings
pfValidUnits = {}
pfValidUnits["pet"] = true
pfValidUnits["player"] = true
pfValidUnits["target"] = true
pfValidUnits["mouseover"] = true
pfValidUnits["focus"] = true
pfValidUnits["focustarget"] = true
pfValidUnits["focustargettarget"] = true
pfValidUnits["pettarget"] = true
pfValidUnits["playertarget"] = true
pfValidUnits["targettarget"] = true
pfValidUnits["mouseovertarget"] = true
pfValidUnits["targettargettarget"] = true
for i=1,4 do
pfValidUnits["party" .. i] = true
pfValidUnits["party" .. i .. "target"] = true
pfValidUnits["partypet" .. i] = true
pfValidUnits["partypet" .. i .. "target"] = true
end
for i=1,40 do
pfValidUnits["raid" .. i] = true
pfValidUnits["raid" .. i .. "target"] = true
pfValidUnits["raidpet" .. i] = true
pfValidUnits["raidpet" .. i .. "target"] = true
pfValidUnits["nameplate" .. i] = true
pfValidUnits["nameplate" .. i .. "target"] = true
end