Files
Fayz d6cd5cec9b Settings rebuild, Designer, per-template settings, and casts without SuperWoW
Settings window
- New layout with tabs down the side, the portrait, and a resize grip (right-click the grip to reset the size)
- Tabs: General, one tab for each template (Grey Tank, Grey DPS, Neon Tank, Neon DPS), Casts/Tanks/Notes, and Share
- Each template tab has the Designer pinned at the top and its settings scrolling underneath
- Clicking a piece in the Designer scrolls to that piece's settings and briefly highlights the section

Per-template settings
- Every setting is now saved per template, so tank and DPS plates can look and behave completely differently
- Existing settings are copied into all four templates on first load, so nothing is lost
- Old share strings still import and apply to every template

Designer
- Drag pieces on a sample plate: name, level, health text, spell name, cast bar, spell icon, raid icon, elite star, debuffs, class icon, mob note, threat line, aggro holder name, threat wheel, and tanked icon
- Arrow buttons nudge the selected piece, and right-click puts a piece back where it started
- The threat line and the aggro holder name now move separately
- The sample shows the full threat line so it's easier to center
- Boxes hide when their piece is turned off or has no text

Size and Style
- Width, height, and text size for enemy plates, friendly plates, and cast bars
- Debuff icon size, font, health text alignment, aggro holder name size
- Custom colors for health text, names, cast bars, and the target box
- Back to Theme Sizes button

Cast bars
- Cast bars work without SuperWoW, read from the combat log with cast times for over 1,200 spells (table from ShaguTweaks, MIT License)
- Unknown spells learn their cast time once they land
- Option to hide cast bars
- Neon's spell icon backing is now its own piece

Debuffs
- Your own debuffs are always shown first
- Hide debuffs option and a debuff timers toggle

Plates
- Option to hide unit levels
- "Show critters" is now "Hide critters", and without SuperWoW critters are learned by name
- The elite star can be moved

Other addons
- ShaguTweaks nameplate tweaks are switched off while SHPlates runs (can be turned off on the General tab)

Removed
- Separate Threat line section and its setting
- Short Debuffs and Debuff Tracker checkboxes (replaced by Hide debuffs)

README rewritten with an Installation section and a client mod comparison table
2026-10-27 16:25:41 -05:00

63 lines
2.7 KiB
Lua

-------------------------------------------------------------------------------
-- SHPlates: critters by name (for plates without a SuperWoW GUID)
--
-- Without SuperWoW a plate can't be asked for its creature type, but your
-- target and your mouseover can. Every critter you target or mouse over is
-- remembered by name (shared by all characters), and from then on its plates
-- count as critters. A name that turns out to be something else is marked as
-- not a critter, which also overrides the starter list below.
--
-- The starter list only has names that are always critters. Names that real
-- mobs also use (Spider, Scorpion, Snake, Turtle...) are left to learning.
-------------------------------------------------------------------------------
local Critters = {}
SHPlates.Critters = Critters
local TYPES = { ["Critter"] = true, ["Kleintier"] = true, ["Bestiole"] = true, ["Alimaña"] = true,
["Animale"] = true, ["Bicho"] = true, ["Существо"] = true }
Critters.TYPES = TYPES
local STARTER = {}
for _, n in ipairs({
"Rabbit", "Hare", "Squirrel", "Prairie Dog", "Brown Prairie Dog", "Toad", "Jungle Toad",
"Huge Toad", "Biletoad", "Frog", "Chicken", "Fawn", "Deer", "Gazelle", "Sheep", "Cow",
"Rat", "Black Rat", "Deeprun Rat", "Enthralled Deeprun Rat", "Core Rat", "Plagued Rat",
"Tainted Rat", "Mouse", "Roach", "Tainted Cockroach", "Beetle", "Fire Beetle", "Maggot",
"Plagued Maggot", "Larva", "Plagued Insect", "Plagueland Termite", "Infected Deer",
"Infected Squirrel", "Sickly Deer", "Sickly Gazelle", "Cured Deer", "Cured Gazelle",
"Adder", "Moccasin", "Parrot", "Belfry Bat", "Lava Crab",
}) do STARTER[n] = true end
local function Learned()
if type(SHPlatesLearned) ~= "table" then SHPlatesLearned = {} end
if type(SHPlatesLearned.critters) ~= "table" then SHPlatesLearned.critters = {} end
return SHPlatesLearned.critters
end
function Critters.IsCritterName(name)
if not name then return false end
local known = Learned()[name]
if known ~= nil then return known end
return STARTER[name] or false
end
local function Learn(unit)
if not UnitExists(unit) or UnitIsPlayer(unit) then return end
local name, kind = UnitName(unit), UnitCreatureType(unit)
if not name or not kind then return end
local isCritter = TYPES[kind] and true or false
local known = Critters.IsCritterName(name)
if known ~= isCritter then
Learned()[name] = isCritter
if SHPlates.ForceUpdate then SHPlates:ForceUpdate() end
end
end
local frame = CreateFrame("Frame")
frame:RegisterEvent("PLAYER_TARGET_CHANGED")
frame:RegisterEvent("UPDATE_MOUSEOVER_UNIT")
frame:SetScript("OnEvent", function()
if SHPlates.disabled then return end
if event == "PLAYER_TARGET_CHANGED" then Learn("target") else Learn("mouseover") end
end)