AnySCT 0.3.0

This commit is contained in:
2026-10-15 14:49:24 +02:00
parent 521342f1b6
commit 4600cc0719
8 changed files with 405 additions and 67 deletions
+24 -8
View File
@@ -36,6 +36,10 @@ if CreateFrame then
"Print the healer's name under the heal number." },
{ "colourize", "Colour coding",
"Off: everything is orange like Blizzard's pet text. On: crit yellow, miss / dodge / parry red, block blue, absorb / resist / immune purple. A per-targetSCT colour (Colours tab) overrides this." },
{ "mergeHits", "Merge identical hits",
"Identical attacks (same source, victim and ability, normal hit or crit) that arrive within the merge window become ONE line whose number is the running sum, updated in place. Tames Fire Strike style tick storms. Misses, dodges and the like are not summed; identical words collapse to one line. On by default." },
{ "mergeCount", "Show hit count",
"Append the number of merged hits to a merged line, e.g. 12 x5. Off by default." },
{ "markGlancing", "Mark glancing / crushing",
"Add the word glancing or crushing after the number (Blizzard style). Off: shown as a plain number." },
{ "showSpells", "Show special attacks",
@@ -68,8 +72,8 @@ if CreateFrame then
local CYCLES = {
{ "placement", "Placement",
{ { "clamp", "Nameplate, clamp" }, { "anchorOff", "Nameplate, else anchor" },
{ "anchor", "Always anchor" } },
"Where the text appears. Over the nameplate needs enemy nameplates on (V). Clamp keeps text along the screen edge when the plate is off screen." },
{ "anchor", "Always anchor" }, { "both", "Nameplate + anchor" } },
"Where the text appears. Over the nameplate needs enemy nameplates on (V). Clamp keeps text along the screen edge when the plate is off screen. 'Nameplate + anchor' shows every line and the GO / WAIT label over the plate AND at the fixed anchor (separate line limits); without a plate it shows once at the anchor." },
{ "noPlate", "No nameplate",
{ { "anchor", "Anchor" }, { "hide", "Hide" } },
"What to do when the targetSCT's target has no visible nameplate." },
@@ -94,6 +98,8 @@ if CreateFrame then
{ "wordFactor", "Word size", 0.5, 3, 0.05, "%.2f", "Size factor of Miss / Dodge / Parry / ..." },
{ "riseHeight", "Rise (px)", 0, 300, 5, nil,
"How far a normal text rises (crits stay in place). The engine rises 2 yards; the screen distance depends on the camera." },
{ "mergeWindow", "Merge window (s)", 0.1, 1.5, 0.05, "%.2f",
"How long a line keeps absorbing identical hits, counted from its first hit. Short: more, smaller lines. Long: fewer lines that update longer. Only used with Merge identical hits." },
{ "jitter", "Jitter (px)", 0, 40, 1, nil, "Random horizontal offset per line. 0 like the engine; lines stack instead." },
{ "maxLines", "Max lines", 3, 100, 1, nil, "Maximum number of lines on screen over all mobs; when it is reached the oldest line is recycled." },
{ "maxLinesPerTarget", "Max lines per mob", 1, 30, 1, nil, "Maximum number of lines over one mob. Lines live 1.5 s, so 16 shows every hit of a burst of about 10 per second; lower values recycle the oldest line early." },
@@ -114,8 +120,8 @@ if CreateFrame then
local function getVal(key)
if key == "threatGoLead" then return C.PosFromLead(C.Opt(key) or 1500) end
if key == "posX" then return (C.Opt("pos") or {}).x or 0 end
if key == "posY" then return (C.Opt("pos") or {}).y or 0 end
if key == "posX" then return math.floor(((C.Opt("pos") or {}).x or 0) + 0.5) end
if key == "posY" then return math.floor(((C.Opt("pos") or {}).y or 0) + 0.5) end
return C.Opt(key) or 0
end
@@ -202,6 +208,15 @@ if CreateFrame then
local sl = sliders[i]
local v = getVal(sl.asctKey)
sl.asctBusy = true
if (sl.asctKey == "posX" or sl.asctKey == "posY") and AnySCT_SCT and AnySCT_SCT.ScreenRect then
local hw, hh = C.ScreenHalfRange(AnySCT_SCT.ScreenRect())
local lim = sl.asctKey == "posX" and hw or hh
-- never clamp a stored position: widen the range to hold it
if math.abs(v) > lim then lim = math.ceil(math.abs(v) / 5) * 5 end
sl:SetMinMaxValues(-lim, lim)
getglobal(sl:GetName() .. "Low"):SetText(tostring(-lim))
getglobal(sl:GetName() .. "High"):SetText(tostring(lim))
end
sl:SetValue(v)
sl.asctBusy = false
local txt = sl.asctFmt and string.format(sl.asctFmt, v) or tostring(v)
@@ -237,7 +252,7 @@ if CreateFrame then
O.refresh = refresh
-- Fixed panel geometry (UI scale 1): 520 x 460, four tabs hanging below the bottom edge, 16 px margins.
local PANEL_W, PANEL_H = 520, 460
local PANEL_W, PANEL_H = 520, 540
local COLA, COLB = 20, 270 -- two content columns, 230-240 wide each
local TOP = -48 -- first content row, below the title
@@ -424,6 +439,7 @@ if CreateFrame then
if d[8] then getglobal(name .. "High"):SetText("7500") end
sl:SetScript("OnValueChanged", function()
if this.asctBusy then return end
if AnySCT_SCT and AnySCT_SCT.IsDragging and AnySCT_SCT.IsDragging() then return end
local v = math.floor(this:GetValue() / this.asctStep + 0.5) * this.asctStep
local txt = this.asctFmt and string.format(this.asctFmt, v) or tostring(v)
if this.asctFmt then v = tonumber(txt) end
@@ -656,7 +672,7 @@ if CreateFrame then
y2 = y2 - 30
makeCycle(p2, "mobNameMode", COLA, y2)
y2 = y2 - 30
local CONTENT = { "showSpellName", "healShowHealer", "markGlancing" }
local CONTENT = { "showSpellName", "healShowHealer", "markGlancing", "mergeHits", "mergeCount" }
for i = 1, table.getn(CONTENT) do
makeCheck(p2, CONTENT[i], COLA, y2)
y2 = y2 - 21
@@ -668,7 +684,7 @@ if CreateFrame then
y2 = y2 - 30
makeCycle(p2, "direction", COLA, y2)
y2 = y2 - 48
local LOOK = { "sizeFactor", "wordFactor", "riseHeight", "jitter", "maxLines", "maxLinesPerTarget" }
local LOOK = { "sizeFactor", "wordFactor", "riseHeight", "jitter", "maxLines", "maxLinesPerTarget", "mergeWindow" }
for i = 1, table.getn(LOOK) do
local col = COLA + 10
if math.mod(i, 2) == 0 then col = COLB + 10 end
@@ -738,7 +754,7 @@ if CreateFrame then
end)
ax = ax + bPos:GetWidth() + 6
makeButton(p4, "AnySCTOptionsDemo", "Demo", nil, ax, y4, "Demo",
"Play hit, hit, crit, miss, dodge, parry, block at your target's nameplate (fixed anchor without a target) to compare with your own numbers.",
"Plays a 2.5 s burst of your first targetSCT's class skills (a shaman demo tank without one) on your target's nameplate (fixed anchor without a target), using all your display settings. Fills the per-mob tower and previews the GO / WAIT threat label; click again to restart.",
function() if AnySCT_SCT then AnySCT_SCT.Demo() end end)
y4 = y4 - 28
makeCheck(p4, "showLabel", COLA, y4)