mirror of
https://github.com/QbiXibQ/FBHealBox.git
synced 2026-10-05 21:50:01 +00:00
Add files via upload
This commit is contained in:
+44
-3
@@ -1,6 +1,47 @@
|
||||
# Changelog
|
||||
|
||||
## 1.4.3 (unreleased)
|
||||
## 1.4.4 (unreleased)
|
||||
|
||||
Performance pass. No feature was added or changed; every visible behaviour is meant to be identical. A simulated five-second raid fight (40 players, aura and health events, mana changes, combat log, 60 frames per second) went from about 63,900 API and widget calls to about 14,450, a reduction of 77 %.
|
||||
|
||||
### English
|
||||
|
||||
**Changed (internals)**
|
||||
|
||||
- **Button states centralised.** The up to 260 heal buttons (10 plates x 10, 40 raid cells x 4) no longer carry their own `SPELL_UPDATE_USABLE` / `SPELL_UPDATE_COOLDOWN` handlers. One pass over the *visible* buttons queries usability and cooldown once per spell id and range once per button, and sets colours and cooldown sweeps only when the state changes. Several such events within one frame are merged into one pass.
|
||||
- **Display caches.** Health text, bar maxima, bar values, bar colour and mana strip visibility are only written when they change. Dispellable debuffs are searched on `UNIT_AURA` only; `UNIT_HEALTH` and the prediction tick reuse the last result.
|
||||
- **Aura scans shared.** A unit's buff textures are read once per frame and shared between the heal prediction and the buff watch. Buff names resolved through tooltip scans are remembered per texture, so a unit missing the watched buff no longer costs up to 32 tooltip scans per aura event. Raid units are only scanned when something depends on them (own cast pending, tracked HoT or shield, or a visible cell).
|
||||
- **Cheaper ticks.** Spell timers use precomputed base spell names instead of string parsing per button per tick and skip units without tracked HoTs or shields. Buff icons reuse their work tables, iterate a presorted list instead of sorting per tick, and update on change or once a second instead of five times a second. The attacked-member check skips entirely while there is no hostile target and nothing is marked, and compares names before calling `UnitIsUnit`.
|
||||
- **Event bursts coalesced.** `PARTY_MEMBERS_CHANGED`, `UNIT_PET` and `RAID_ROSTER_UPDATE` set a flag that is processed once in the next frame instead of rebuilding plates and grid for every event of a burst.
|
||||
- **Mana ticker.** Enabled/mana/full checks moved from every frame to mana events and option changes; the spark is re-anchored only when it has moved at least half a pixel; sizes and visibility are cached.
|
||||
- **Combat log.** Heal patterns run only for buff events, the absorb pattern only for hit events that contain the word absorbed. Smart Damage parses damage lines only while enabled and while there is a target being measured or an own cast waiting; its live target line is refreshed only while the options window is open.
|
||||
- Raid test ghost animation frame is hidden outside the raid test instead of running an empty update every frame.
|
||||
- **Client API compatibility.** `IsSpellInRange` and `IsUsableSpell` do not exist in the 1.12 client (they came with 2.0). All range and usability checks now go through wrappers that use them when a client offers them and otherwise fall back to 1.12 means: spell range from the tooltip against `UnitXP("distanceBetween")` where available, else `CheckInteractDistance` (28 m, beyond that undecided rather than red); mana cost from the tooltip against your current mana. Because clients differ (2.0 style `(id, "spell", unit)` versus the Turtle client's `(name, unit)`), the addon probes both signatures once at login with `pcall` and uses the one the client understands; a function that keeps throwing is switched off in favour of the fallback. `/fbp` reports the detected form. Without this the new central button pass crashed at login.
|
||||
|
||||
**Fixed**
|
||||
|
||||
- The old per-button event handler declared `this`, `event` and `arg1` as parameters, which shadowed the 1.12 globals; range colouring and cooldown sweeps on the buttons never worked in the game. They do now.
|
||||
|
||||
### Deutsch
|
||||
|
||||
**Geaendert (intern)**
|
||||
|
||||
- **Button-Zustaende zentral.** Die bis zu 260 Heil-Buttons (10 Plaketten x 10, 40 Raid-Zellen x 4) tragen keine eigenen `SPELL_UPDATE_USABLE`/`SPELL_UPDATE_COOLDOWN`-Handler mehr. Ein Durchgang ueber die *sichtbaren* Buttons fragt Nutzbarkeit und Cooldown je Zauber-ID einmal und die Reichweite je Button ab und setzt Farben und Cooldown-Uhren nur bei Zustandswechsel. Mehrere solche Events in einem Frame werden zu einem Durchgang zusammengefasst.
|
||||
- **Anzeige-Zwischenspeicher.** Lebenstext, Balkenmaxima, Balkenwerte, Balkenfarbe und Sichtbarkeit des Manastreifens werden nur geschrieben, wenn sie sich aendern. Entfernbare Debuffs werden nur bei `UNIT_AURA` gesucht; `UNIT_HEALTH` und der Vorhersage-Tick nutzen den letzten Befund.
|
||||
- **Aura-Scans gemeinsam.** Die Buff-Texturen einer Einheit werden je Frame einmal gelesen und von Heilvorhersage und Buff-Wache geteilt. Per Tooltip ermittelte Buffnamen werden je Textur gemerkt, sodass eine Einheit ohne den ueberwachten Buff nicht mehr bis zu 32 Tooltip-Scans je Aura-Event kostet. Raid-Einheiten werden nur gescannt, wenn etwas davon abhaengt (eigener Cast wartet, HoT oder Schild verfolgt, sichtbare Zelle).
|
||||
- **Guenstigere Ticks.** Zauber-Timer nutzen vorberechnete Basisnamen statt String-Parsing je Button und Tick und ueberspringen Einheiten ohne verfolgten HoT oder Schild. Buff-Icons verwenden ihre Arbeitstabellen wieder, laufen ueber eine vorsortierte Liste statt je Tick zu sortieren und aktualisieren bei Aenderung oder einmal je Sekunde statt fuenfmal. Der Angegriffenen-Abgleich entfaellt ganz, solange kein feindliches Ziel besteht und nichts markiert ist, und vergleicht Namen, bevor `UnitIsUnit` gerufen wird.
|
||||
- **Event-Salven zusammengefasst.** `PARTY_MEMBERS_CHANGED`, `UNIT_PET` und `RAID_ROSTER_UPDATE` setzen ein Kennzeichen, das im naechsten Frame einmal abgearbeitet wird, statt Plaketten und Raster bei jedem Event einer Salve neu aufzubauen.
|
||||
- **Mana-Ticker.** Die Pruefungen an/Mana/voll laufen bei Mana-Events und Optionswechseln statt jeden Frame; der Funke wird nur neu verankert, wenn er sich mindestens einen halben Pixel bewegt hat; Groessen und Sichtbarkeit sind zwischengespeichert.
|
||||
- **Combatlog.** Heilmuster laufen nur bei Buff-Events, das Absorb-Muster nur bei Treffer-Events, die das Wort absorbed enthalten. Smart Damage liest Schadenszeilen nur, solange es an ist und ein Ziel vermessen wird oder ein eigener Cast wartet; die Live-Zielzeile wird nur bei offenem Optionsfenster aktualisiert.
|
||||
- Der Animationsframe der Raid-Testgeister ist ausserhalb des Raid-Tests ausgeblendet, statt jeden Frame leer zu laufen.
|
||||
- **Client-API-Kompatibilitaet.** `IsSpellInRange` und `IsUsableSpell` gibt es im 1.12-Client nicht (sie kamen mit 2.0). Alle Reichweiten- und Nutzbarkeitspruefungen laufen jetzt ueber Wrapper, die sie nutzen, wenn ein Client sie anbietet, und sonst auf 1.12-Mittel zurueckfallen: Zauberreichweite aus dem Tooltip gegen `UnitXP("distanceBetween")`, wo vorhanden, sonst `CheckInteractDistance` (28 m, jenseits davon unentschieden statt rot); Manapreis aus dem Tooltip gegen das eigene Mana. Weil Clients sich unterscheiden (2.0-Form `(id, "spell", unit)` gegenueber der Turtle-Form `(name, unit)`), probiert das Addon beide Signaturen beim Login einmal per `pcall` aus und nutzt die verstandene; eine Funktion, die weiter Fehler wirft, wird zugunsten des Rueckfalls abgeschaltet. `/fbp` meldet die erkannte Form. Ohne das brach der neue zentrale Button-Durchgang beim Login ab.
|
||||
|
||||
**Behoben**
|
||||
|
||||
- Der alte Button-Handler deklarierte `this`, `event` und `arg1` als Parameter und verdeckte damit die 1.12-Globals; Reichweitenfaerbung und Cooldown-Uhr auf den Buttons haben im Spiel nie gearbeitet. Jetzt tun sie es.
|
||||
|
||||
|
||||
## 1.4.3 (2026-09-05)
|
||||
|
||||
### English
|
||||
|
||||
@@ -18,7 +59,7 @@
|
||||
|
||||
**Fixed**
|
||||
|
||||
- Own buffs were only read at login and on group changes: Vanilla fires `PLAYER_AURAS_CHANGED` for the player instead of `UNIT_AURA`. The addon now listens to it and re-reads your remaining time on every change, so recasting a buff on yourself resets its clock and cancelling it removes the icon. Also fixes confirmation of your own HoTs and shields on yourself.
|
||||
- Own buffs were only read at login and on group changes: Vanilla fires `PLAYER_AURAS_CHANGED` for the player instead of `UNIT_AURA`. The addon now listens to it and re-reads your remaining time on every change, and once a second in between (a refresh of a running buff fires no aura event at all), so recasting a buff on yourself resets its clock and cancelling it removes the icon. Refreshing a buff on someone else through a HealBox button is confirmed by the completed cast. Also fixes confirmation of your own HoTs and shields on yourself.
|
||||
- Raid cell names and percentages were hidden behind the health bar since the bar levels became relative; the texts now live on their own layer above the bars.
|
||||
- Buff icons stack two high left of the plate; elapsed clock quadrants are drawn dark on a layer above the icon so the split shows on every client. Raid cells use a 3 by 4 grid of 6 px icons (twelve slots); the new raid option *Show buffs* removes icons and strip together. `/fbp buffs` reports the grey count per icon.
|
||||
- Test modes extended: party ghost Brynn is dead, pet Bramble carries a disease, Dorn carries six and raid ghost 12 twelve buffs, raid ghost 27 a disease. Up to six buff icons per plate.
|
||||
@@ -48,7 +89,7 @@
|
||||
|
||||
**Behoben**
|
||||
|
||||
- Eigene Buffs wurden nur beim Login und bei Gruppenwechseln gelesen: Vanilla feuert fuer den Spieler `PLAYER_AURAS_CHANGED` statt `UNIT_AURA`. Das Addon hoert jetzt darauf und liest die eigene Restzeit bei jeder Aenderung neu, sodass ein Neucast auf dich selbst die Uhr zuruecksetzt und ein Wegklicken das Icon entfernt. Behebt auch die Bestaetigung eigener HoTs und Schilde auf dir selbst.
|
||||
- Eigene Buffs wurden nur beim Login und bei Gruppenwechseln gelesen: Vanilla feuert fuer den Spieler `PLAYER_AURAS_CHANGED` statt `UNIT_AURA`. Das Addon hoert jetzt darauf und liest die eigene Restzeit bei jeder Aenderung neu, und dazwischen einmal je Sekunde (ein Refresh eines laufenden Buffs feuert gar kein Aura-Event), sodass ein Neucast auf dich selbst die Uhr zuruecksetzt und ein Wegklicken das Icon entfernt. Ein Refresh auf jemand anderen ueber einen HealBox-Button gilt mit dem abgeschlossenen Cast als bestaetigt. Behebt auch die Bestaetigung eigener HoTs und Schilde auf dir selbst.
|
||||
- Namen und Prozente der Raid-Zellen lagen seit den relativen Balken-Ebenen hinter dem Lebensbalken; die Texte liegen jetzt auf einer eigenen Ebene ueber den Balken.
|
||||
- Buff-Icons stapeln sich zu zweit links neben der Plakette; abgelaufene Uhr-Quadranten werden dunkel auf einer Ebene ueber dem Icon gezeichnet, damit die Teilung auf jedem Client sichtbar ist. Raid-Zellen nutzen ein 3-mal-4-Raster aus 6-px-Icons (zwoelf Plaetze); die neue Raid-Option *Buffs anzeigen* entfernt Icons und Streifen gemeinsam. `/fbp buffs` nennt je Icon die Zahl grauer Quadranten.
|
||||
- Testmodi erweitert: Partygeist Brynn ist tot, Pet Bramble traegt eine Krankheit, Dorn traegt sechs und Raid-Geist 12 zwoelf Buffs, Raid-Geist 27 eine Krankheit. Bis zu sechs Buff-Icons je Plakette.
|
||||
|
||||
+595
-151
File diff suppressed because it is too large
Load Diff
+2
-2
@@ -1,9 +1,9 @@
|
||||
## Interface: 11200
|
||||
## Title: Heal Box Vanilla |cFFFFFF00v1.4.3|r
|
||||
## Title: Heal Box Vanilla |cFFFFFF00v1.4.4|r
|
||||
## Notes: Party, pet and self heal display with quick-cast buttons for healers. Ported to client 1.12.1 (optional SuperWoW). Up to 10 buttons per row, mana bar inside the health bar, class colours, buff watch, range fading, adjustable spacing, test mode with ghost players, optional raid mode for 20 and 40 players, mana ticker with five-second rule, smart damage ranking for attack spells. Heal prediction for direct heals, HoT ticks and absorb shields, self-correcting from the combat log. HealComm sync with Puppeteer, pfUI and others. German/English. Original by Dourd, ported to Vanilla and extended 09/2026 by Mquadrat.
|
||||
## Notes-deDE: Party-, Begleiter- und Selbst-Heilanzeige mit Schnellzugriff-Buttons fuer Heiler. Portiert fuer Client 1.12.1 (optional SuperWoW). Bis zu 10 Buttons pro Reihe, Manabalken im Lebensbalken, Klassenfarben, Buff-Wache, Reichweiten-Fading, einstellbare Abstaende, Testmodus mit Geisterspielern, optionaler Raidmodus fuer 20 und 40 Spieler, Mana-Ticker mit Fuenf-Sekunden-Regel, Smart Damage fuer Angriffszauber. Heal-Prediction fuer Direktheilung, HoT-Ticks und Absorb-Schilde, selbstkorrigierend ueber den Combatlog. HealComm-Sync mit Puppeteer, pfUI und Co. Deutsch/Englisch. Original von Dourd, Vanilla-Portierung und Erweiterung 09/2026 von Mquadrat.
|
||||
## Author: Dourd (Argent Dawn EU) | Vanilla-Port & Erweiterung 09/2026: Mquadrat
|
||||
## Version: 1.4.3
|
||||
## Version: 1.4.4
|
||||
## SavedVariablesPerCharacter: HealBox
|
||||
## OptionalDeps: SuperWoW
|
||||
|
||||
|
||||
+14
-1
@@ -338,6 +338,10 @@ function FBDmg_ParseLine(msg)
|
||||
end
|
||||
|
||||
function FBDmg_OnCombatLog(msg)
|
||||
-- Nur arbeiten, wenn Smart Damage an ist und es etwas zu lernen gibt
|
||||
-- (Prozentziel wird vermessen oder ein eigener Cast wartet auf Treffer).
|
||||
if (FBDmg_Cfg().Enabled ~= 1) then return; end
|
||||
if (not FBDmgTargetName) and (not FBDmgLastCast) then return; end
|
||||
local victim, amount, spell, who = FBDmg_ParseLine(msg);
|
||||
if (not victim) then return; end
|
||||
FBDmg_NoteDamage(victim, amount);
|
||||
@@ -494,7 +498,10 @@ function FBDmg_SourceText()
|
||||
end
|
||||
|
||||
function FBDmg_UpdateSourceText()
|
||||
if (FBDmgSourceText) then FBDmgSourceText:SetText(format(FBT("DMG_SRC"), FBDmg_SourceText())); end
|
||||
-- nur, wenn das Optionsfenster offen ist (sonst je UNIT_HEALTH des Ziels umsonst)
|
||||
if (FBDmgSourceText and panel and panel:IsVisible()) then
|
||||
FBDmgSourceText:SetText(format(FBT("DMG_SRC"), FBDmg_SourceText()));
|
||||
end
|
||||
end
|
||||
|
||||
function FBDmg_UpdateSpellText()
|
||||
@@ -562,6 +569,12 @@ function FBDmg_BuildOptions()
|
||||
FBDmg_UpdateSourceText();
|
||||
FBDmg_UpdateSpellText();
|
||||
FBDmg_SyncOptions();
|
||||
-- beim Oeffnen des Fensters die Zielzeile auffrischen (Vor-Hook auf OnShow)
|
||||
local prevShow = panel:GetScript("OnShow");
|
||||
panel:SetScript("OnShow", function()
|
||||
if (prevShow) then prevShow(); end
|
||||
FBDmg_UpdateSourceText();
|
||||
end);
|
||||
end
|
||||
|
||||
function FBDmg_SyncOptions()
|
||||
|
||||
+115
-45
@@ -725,6 +725,7 @@ end
|
||||
-- ==========================================================================
|
||||
|
||||
function FBRaid_UpdateRoster()
|
||||
FBRaidRosterDirty = false;
|
||||
local cfg = FBRaid_Cfg();
|
||||
FBRaidUnitCell = {};
|
||||
FBRaidMembers = 0;
|
||||
@@ -737,6 +738,8 @@ function FBRaid_UpdateRoster()
|
||||
if (FBRaidCells[g] and FBRaidCells[g][pos]) then
|
||||
local c = FBRaidCells[g][pos];
|
||||
c.unit = nil; c.name = nil; c.ghost = nil; c.index = nil;
|
||||
c.dispelKnown = nil; c.lastText = nil; c.lastMax = nil; c.colorKey = nil; c.manaShown = nil; c.lastMpMax = nil;
|
||||
c.vHp = nil; c.vShield = nil; c.vInc = nil; c.vMp = nil;
|
||||
c:Hide();
|
||||
end
|
||||
end
|
||||
@@ -897,7 +900,35 @@ end
|
||||
-- [ Zelleninhalt ]
|
||||
-- ==========================================================================
|
||||
|
||||
function FBRaid_UpdateCell(c)
|
||||
-- Zellenfarbe / Maxima / Text nur bei Aenderung setzen
|
||||
function FBRaid_SetColor(c, key, r, g, b, a)
|
||||
if (c.colorKey == key) then return; end
|
||||
c.colorKey = key;
|
||||
c.HealthBar:SetStatusBarColor(r, g, b, a);
|
||||
end
|
||||
|
||||
function FBRaid_SetValues(c, hp, shieldTop, incTop)
|
||||
if (c.vHp ~= hp) then c.vHp = hp; c.HealthBar:SetValue(hp); end
|
||||
if (c.vShield ~= shieldTop) then c.vShield = shieldTop; c.ShieldBar:SetValue(shieldTop); end
|
||||
if (c.vInc ~= incTop) then c.vInc = incTop; c.IncHealBar:SetValue(incTop); end
|
||||
end
|
||||
|
||||
function FBRaid_SetMax(c, hpMax)
|
||||
if (c.lastMax == hpMax) then return; end
|
||||
c.lastMax = hpMax;
|
||||
c.HealthBar:SetMinMaxValues(0, hpMax);
|
||||
c.ShieldBar:SetMinMaxValues(0, hpMax);
|
||||
c.IncHealBar:SetMinMaxValues(0, hpMax);
|
||||
end
|
||||
|
||||
function FBRaid_SetText(c, text)
|
||||
if (c.lastText == text) then return; end
|
||||
c.lastText = text;
|
||||
if (text == false) then c.HPText:Hide(); else c.HPText:SetText(text); c.HPText:Show(); end
|
||||
end
|
||||
|
||||
-- auraChanged: true bei UNIT_AURA, nur dann wird der Debuff neu gesucht
|
||||
function FBRaid_UpdateCell(c, auraChanged)
|
||||
if (not c) or (not c.unit) or (not c:IsShown()) then return; end
|
||||
local cfg = FBRaid_Cfg();
|
||||
local hp, hpMax = FBRaid_Health(c);
|
||||
@@ -908,60 +939,59 @@ function FBRaid_UpdateCell(c)
|
||||
local key = "STATE_DEAD";
|
||||
if (state == "ghost") then key = "STATE_GHOST"; end
|
||||
if (state == "offline") then key = "STATE_OFFLINE"; end
|
||||
c.HPText:SetText(FBT(key));
|
||||
c.HPText:Show();
|
||||
c.HealthBar:SetMinMaxValues(0, hpMax); c.HealthBar:SetValue(0);
|
||||
c.HealthBar:SetStatusBarColor(0.5, 0.5, 0.5, 1);
|
||||
c.ShieldBar:SetMinMaxValues(0, hpMax); c.ShieldBar:SetValue(0);
|
||||
c.IncHealBar:SetMinMaxValues(0, hpMax); c.IncHealBar:SetValue(0);
|
||||
c.ManaBar:Hide();
|
||||
FBRaid_SetText(c, FBT(key));
|
||||
FBRaid_SetMax(c, hpMax);
|
||||
FBRaid_SetValues(c, 0, 0, 0);
|
||||
FBRaid_SetColor(c, "state", 0.5, 0.5, 0.5, 1);
|
||||
if (c.manaShown ~= false) then c.manaShown = false; c.ManaBar:Hide(); end
|
||||
return;
|
||||
end
|
||||
|
||||
-- Leben und Schichten
|
||||
c.HealthBar:SetMinMaxValues(0, hpMax);
|
||||
c.HealthBar:SetValue(hp);
|
||||
FBRaid_SetMax(c, hpMax);
|
||||
local inc, shield = FBRaid_Incoming(c);
|
||||
local shieldTop = math.min(hpMax, hp + shield);
|
||||
c.ShieldBar:SetMinMaxValues(0, hpMax);
|
||||
c.ShieldBar:SetValue(shieldTop);
|
||||
c.IncHealBar:SetMinMaxValues(0, hpMax);
|
||||
c.IncHealBar:SetValue(math.min(hpMax, shieldTop + inc));
|
||||
local shieldTop = hp + shield;
|
||||
if (shieldTop > hpMax) then shieldTop = hpMax; end
|
||||
local incTop = shieldTop + inc;
|
||||
if (incTop > hpMax) then incTop = hpMax; end
|
||||
FBRaid_SetValues(c, hp, shieldTop, incTop);
|
||||
|
||||
-- HP-Text
|
||||
if (cfg.HPText == "percent") then
|
||||
c.HPText:SetText(format("%d%%", math.floor(hp / hpMax * 100)));
|
||||
c.HPText:Show();
|
||||
FBRaid_SetText(c, math.floor(hp / hpMax * 100).."%");
|
||||
elseif (cfg.HPText == "deficit") then
|
||||
local def = hpMax - hp;
|
||||
if (def > 0) then c.HPText:SetText("-"..def); else c.HPText:SetText(""); end
|
||||
c.HPText:Show();
|
||||
if (def > 0) then FBRaid_SetText(c, "-"..def); else FBRaid_SetText(c, ""); end
|
||||
else
|
||||
c.HPText:Hide();
|
||||
FBRaid_SetText(c, false);
|
||||
end
|
||||
|
||||
-- Mana
|
||||
local mp, mpMax, hasMana = FBRaid_Mana(c);
|
||||
if (cfg.ManaBar == 1 and hasMana and mpMax > 0) then
|
||||
c.ManaBar:SetMinMaxValues(0, mpMax);
|
||||
c.ManaBar:SetValue(mp);
|
||||
c.ManaBar:Show();
|
||||
else
|
||||
c.ManaBar:Hide();
|
||||
if (c.lastMpMax ~= mpMax) then c.lastMpMax = mpMax; c.ManaBar:SetMinMaxValues(0, mpMax); end
|
||||
if (c.vMp ~= mp) then c.vMp = mp; c.ManaBar:SetValue(mp); end
|
||||
if (c.manaShown ~= true) then c.manaShown = true; c.ManaBar:Show(); end
|
||||
elseif (c.manaShown ~= false) then
|
||||
c.manaShown = false; c.ManaBar:Hide();
|
||||
end
|
||||
|
||||
-- Farbe: Dispel schlaegt HP-Stand
|
||||
-- Farbe: Dispel schlaegt HP-Stand (Debuff nur bei Aura-Aenderung neu suchen)
|
||||
if (auraChanged or (not c.dispelKnown) or c.ghost) then
|
||||
c.dispelType = FBRaid_Dispel(c);
|
||||
c.dispelKnown = true;
|
||||
end
|
||||
local frac = hp / hpMax;
|
||||
local dtype = FBRaid_Dispel(c);
|
||||
local dtype = c.dispelType;
|
||||
if (dtype and FBDispelColors[dtype]) then
|
||||
local col = FBDispelColors[dtype];
|
||||
c.HealthBar:SetStatusBarColor(col[1], col[2], col[3], col[4]);
|
||||
FBRaid_SetColor(c, dtype, col[1], col[2], col[3], col[4]);
|
||||
elseif (frac > LowHP) then
|
||||
c.HealthBar:SetStatusBarColor(0, 1, 0, 1);
|
||||
FBRaid_SetColor(c, "green", 0, 1, 0, 1);
|
||||
elseif (frac > VeryLowHP) then
|
||||
c.HealthBar:SetStatusBarColor(1, 0.9, 0, 1);
|
||||
FBRaid_SetColor(c, "yellow", 1, 0.9, 0, 1);
|
||||
else
|
||||
c.HealthBar:SetStatusBarColor(1, 0, 0, 1);
|
||||
FBRaid_SetColor(c, "red", 1, 0, 0, 1);
|
||||
end
|
||||
end
|
||||
|
||||
@@ -987,7 +1017,8 @@ end
|
||||
|
||||
-- Wer wird angegriffen (Hook "Aggro" des Kerns, tt = "targettarget" oder nil)
|
||||
function FBRaid_CheckAggro(tt)
|
||||
if (not FBRaid_IsActive()) then return; end
|
||||
if (not FBRaid_IsActive()) then return false; end
|
||||
local any = false;
|
||||
for g = 1, FBRAID_GROUPS do
|
||||
if (FBRaidCells[g]) then
|
||||
for pos = 1, FBRAID_PER_GROUP do
|
||||
@@ -996,16 +1027,18 @@ function FBRaid_CheckAggro(tt)
|
||||
local flag = false;
|
||||
if (HealBox.AggroMark == 1 and c:IsShown()) then
|
||||
if (c.ghost) then flag = (c.ghost.aggro == true);
|
||||
elseif (tt) then flag = FBHealBox_UnitIsAggro(c.unit, tt); end
|
||||
elseif (tt) then flag = FBHealBox_UnitIsAggroFast(c.unit, c.name, tt); end
|
||||
end
|
||||
if (c.underAttack ~= flag) then
|
||||
c.underAttack = flag;
|
||||
FBRaid_ApplyBorder(c);
|
||||
end
|
||||
if (flag) then any = true; end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
return any;
|
||||
end
|
||||
|
||||
-- Platz links neben jeder Zelle fuer die Buff-Icons (aussen links)
|
||||
@@ -1042,13 +1075,17 @@ function FBRaid_UpdateSpellTimers(now)
|
||||
for pos = 1, FBRAID_PER_GROUP do
|
||||
local c = FBRaidCells[g][pos];
|
||||
if (c) then
|
||||
local shown = on and c.unit and c:IsShown();
|
||||
-- ohne verfolgten HoT/Schild auf der Einheit nur einmal ausblenden
|
||||
local shown = on and c.unit and c:IsShown() and (c.ghost or FBHoTs[c.name] or FBShields[c.name]);
|
||||
if (not shown and not c.timersShown) then shown = nil; end
|
||||
c.timersShown = shown and true or false;
|
||||
if (shown == nil) then shown = false; end
|
||||
for i = 1, FBRAID_MAX_BUTTONS do
|
||||
local b = c.buttons[i];
|
||||
if (shown and b:IsShown()) then
|
||||
local text, color = FBHealBox_SpellTimerFor(b.spellName, c.name, now, c.ghost, i);
|
||||
if (not text and b.spellNameR) then
|
||||
text, color = FBHealBox_SpellTimerFor(b.spellNameR, c.name, now, nil, i);
|
||||
local text, color = FBHealBox_SpellTimerFor(b.spellBase, c.name, now, c.ghost, i);
|
||||
if (not text and b.spellBaseR) then
|
||||
text, color = FBHealBox_SpellTimerFor(b.spellBaseR, c.name, now, nil, i);
|
||||
end
|
||||
FBHealBox_SetButtonTimer(b, text, color);
|
||||
else
|
||||
@@ -1067,7 +1104,27 @@ function FBRaid_UpdateCooldowns()
|
||||
for pos = 1, FBRAID_PER_GROUP do
|
||||
local c = FBRaidCells[g][pos];
|
||||
if (c) then
|
||||
for i = 1, FBRAID_MAX_BUTTONS do FBHealBox_UpdateButtonCooldown(c.buttons[i]); end
|
||||
for i = 1, FBRAID_MAX_BUTTONS do
|
||||
local b = c.buttons[i];
|
||||
b.cdKey = nil;
|
||||
FBHealBox_UpdateButtonState(b, "SPELL_UPDATE_COOLDOWN");
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Button-Zustaende der sichtbaren Zellen (Hook "ButtonStates")
|
||||
function FBRaid_UpdateButtonStates(event)
|
||||
if (not FBRaid_IsActive()) then return; end
|
||||
local nBtn = FBRaid_Cfg().Buttons or 0;
|
||||
for g = 1, FBRAID_GROUPS do
|
||||
if (FBRaidCells[g]) then
|
||||
for pos = 1, FBRAID_PER_GROUP do
|
||||
local c = FBRaidCells[g][pos];
|
||||
if (c and c.unit and c:IsShown()) then
|
||||
for i = 1, nBtn do FBHealBox_UpdateButtonState(c.buttons[i], event); end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1130,7 +1187,10 @@ function FBRaid_SyncButtons()
|
||||
b.subIcon:Hide();
|
||||
end
|
||||
end
|
||||
FBHealBox_UpdateButtonCooldown(b);
|
||||
b.cdKey = nil;
|
||||
b.colorState = nil;
|
||||
if (b.spellName) then b.spellBase = FBPredict_SplitCast(b.spellName); else b.spellBase = nil; end
|
||||
if (b.spellNameR) then b.spellBaseR = FBPredict_SplitCast(b.spellNameR); else b.spellBaseR = nil; end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1179,21 +1239,28 @@ FBRaidEventFrame:RegisterEvent("UNIT_MAXMANA");
|
||||
FBRaidEventFrame:RegisterEvent("UNIT_DISPLAYPOWER");
|
||||
FBRaidEventFrame:RegisterEvent("UNIT_AURA");
|
||||
|
||||
FBRaidRosterDirty = false;
|
||||
|
||||
FBRaidEventFrame:SetScript("OnEvent", function()
|
||||
if (event == "RAID_ROSTER_UPDATE" or event == "PARTY_MEMBERS_CHANGED" or event == "PLAYER_ENTERING_WORLD") then
|
||||
FBRaid_UpdateRoster();
|
||||
FBRaid_SyncButtons();
|
||||
FBRaid_RefreshBuffBorders();
|
||||
-- Salven (mehrere Roster-Events je Frame beim Zonen) auf einen
|
||||
-- Durchlauf im naechsten Frame zusammenfassen
|
||||
FBRaidRosterDirty = true;
|
||||
return;
|
||||
end
|
||||
if (FBRaidTestMode > 0) then return; end
|
||||
local c = FBRaidUnitCell[arg1];
|
||||
if (not c) then return; end
|
||||
FBRaid_UpdateCell(c);
|
||||
FBRaid_UpdateCell(c, (event == "UNIT_AURA"));
|
||||
if (event == "UNIT_AURA") then FBRaid_UpdateBuffBorder(c); end
|
||||
end);
|
||||
|
||||
FBRaidEventFrame:SetScript("OnUpdate", function()
|
||||
if (FBRaidRosterDirty) then
|
||||
FBRaidRosterDirty = false;
|
||||
FBRaid_UpdateRoster();
|
||||
FBRaid_RefreshBuffBorders();
|
||||
end
|
||||
FBRaidTickAccum = FBRaidTickAccum + (arg1 or 0);
|
||||
if (FBRaidTickAccum < FBRAID_TICK) then return; end
|
||||
FBRaidTickAccum = 0;
|
||||
@@ -1204,8 +1271,8 @@ end);
|
||||
-- fuer den Raid-Test haengen wir uns an denselben Takt und fordern ihn an.
|
||||
FBRaidGhostAccum = 0;
|
||||
FBRaidEventFrame.ghostTicker = CreateFrame("Frame", nil, UIParent);
|
||||
FBRaidEventFrame.ghostTicker:Hide(); -- laeuft nur im Raid-Test (siehe FBRaid_SetTest)
|
||||
FBRaidEventFrame.ghostTicker:SetScript("OnUpdate", function()
|
||||
if (FBRaidTestMode == 0) then return; end
|
||||
FBRaidGhostAccum = FBRaidGhostAccum + (arg1 or 0);
|
||||
if (FBRaidGhostAccum < 0.2) then return; end
|
||||
FBRaidGhostAccum = 0;
|
||||
@@ -1223,6 +1290,8 @@ function FBRaid_SetTest(mode)
|
||||
mode = tonumber(mode) or 0;
|
||||
if (mode ~= 20 and mode ~= 40) then mode = 0; end
|
||||
FBRaidTestMode = mode;
|
||||
-- Geister-Atmung nur im Test rechnen lassen
|
||||
if (mode > 0) then FBRaidEventFrame.ghostTicker:Show(); else FBRaidEventFrame.ghostTicker:Hide(); end
|
||||
if (mode > 0) then
|
||||
FBRaid_BuildTestGhosts(mode);
|
||||
if (HealBox.Active ~= 1) then HealBox.Active = 1; end
|
||||
@@ -1476,9 +1545,10 @@ FBHealBox_RegisterHook("ButtonsChanged", function()
|
||||
FBRaid_SyncButtons();
|
||||
return true;
|
||||
end);
|
||||
FBHealBox_RegisterHook("Aggro", function(tt) FBRaid_CheckAggro(tt); return true; end);
|
||||
FBHealBox_RegisterHook("Aggro", function(tt) return FBRaid_CheckAggro(tt); end);
|
||||
FBHealBox_RegisterHook("SpellTimers", function(now) FBRaid_UpdateSpellTimers(now); return true; end);
|
||||
FBHealBox_RegisterHook("Cooldowns", function() FBRaid_UpdateCooldowns(); return true; end);
|
||||
FBHealBox_RegisterHook("ButtonStates", function(ev) FBRaid_UpdateButtonStates(ev); return true; end);
|
||||
FBHealBox_RegisterHook("BuffIcons", function() FBRaid_UpdateBuffIcons(); return true; end);
|
||||
FBHealBox_RegisterHook("Status", function()
|
||||
local cfg = FBRaid_Cfg();
|
||||
|
||||
+38
-23
@@ -317,6 +317,8 @@ end
|
||||
|
||||
-- Balken einsammeln: eigene Plakette und, falls vorhanden, eigene Raid-Zelle
|
||||
function FBTicker_CollectBars()
|
||||
-- alte Funken verstecken, Zwischenspeicher neu
|
||||
FBTicker_HideAll();
|
||||
FBTicker.sparks = {};
|
||||
if (FBHealBox1 and FBHealBox1.ManaBar) then
|
||||
table.insert(FBTicker.sparks, { bar = FBHealBox1.ManaBar, spark = FBTicker_SparkFor(FBHealBox1.ManaBar) });
|
||||
@@ -333,21 +335,22 @@ end
|
||||
|
||||
function FBTicker_HideAll()
|
||||
for _, e in ipairs(FBTicker.sparks) do
|
||||
if (e.spark) then e.spark:Hide(); end
|
||||
if (e.spark and e.shown ~= false) then e.shown = false; e.spark:Hide(); end
|
||||
end
|
||||
end
|
||||
|
||||
function FBTicker_Draw()
|
||||
-- Torwaechter fuer das Zeichnen: wird nur bei Events und Optionswechseln
|
||||
-- neu bewertet (Mana-Events, Gestaltwechsel, Schalter), nicht jeden Frame.
|
||||
FBTicker.gate = false;
|
||||
function FBTicker_UpdateGate()
|
||||
local cfg = FBTicker_Cfg();
|
||||
if (cfg.Enabled ~= 1) or (HealBox.Active ~= 1) or (not FBTicker_PlayerHasMana()) then
|
||||
FBTicker_HideAll();
|
||||
return;
|
||||
end
|
||||
-- Volles Mana: nichts zu regenerieren, Funke aus
|
||||
if (FBTicker_ManaFull()) then
|
||||
FBTicker_HideAll();
|
||||
return;
|
||||
end
|
||||
FBTicker.gate = (cfg.Enabled == 1) and (HealBox.Active == 1)
|
||||
and FBTicker_PlayerHasMana() and (not FBTicker_ManaFull());
|
||||
if (not FBTicker.gate) then FBTicker_HideAll(); end
|
||||
end
|
||||
|
||||
function FBTicker_Draw()
|
||||
if (not FBTicker.gate) then return; end
|
||||
local frac, mode = FBTicker_Progress(GetTime());
|
||||
if (not frac) then
|
||||
FBTicker_HideAll();
|
||||
@@ -355,7 +358,7 @@ function FBTicker_Draw()
|
||||
end
|
||||
local col = FBTICK_COLOR_TICK;
|
||||
if (mode == "fsr") then col = FBTICK_COLOR_FSR; end
|
||||
local w = cfg.SparkW or 2;
|
||||
local w = FBTicker_Cfg().SparkW or 2;
|
||||
|
||||
for _, e in ipairs(FBTicker.sparks) do
|
||||
local bar, s = e.bar, e.spark;
|
||||
@@ -364,20 +367,29 @@ function FBTicker_Draw()
|
||||
local bw = bar:GetWidth() or 0;
|
||||
local bh = bar:GetHeight() or 0;
|
||||
if (bw > w and bh > 0) then
|
||||
s:SetWidth(w);
|
||||
s:SetHeight(bh);
|
||||
if (e.w ~= w or e.h ~= bh) then
|
||||
e.w = w; e.h = bh;
|
||||
s:SetWidth(w);
|
||||
s:SetHeight(bh);
|
||||
end
|
||||
if (e.mode ~= mode) then
|
||||
e.mode = mode;
|
||||
s:SetTexture(col[1], col[2], col[3], col[4]);
|
||||
end
|
||||
s:ClearAllPoints();
|
||||
s:SetPoint("LEFT", bar, "LEFT", frac * (bw - w), 0);
|
||||
s:Show();
|
||||
-- Anker nur setzen, wenn der Funke mindestens einen halben
|
||||
-- Pixel weitergewandert ist
|
||||
local x = frac * (bw - w);
|
||||
if (not e.x) or (math.abs(x - e.x) >= 0.5) then
|
||||
e.x = x;
|
||||
s:ClearAllPoints();
|
||||
s:SetPoint("LEFT", bar, "LEFT", x, 0);
|
||||
end
|
||||
if (not e.shown) then e.shown = true; s:Show(); end
|
||||
else
|
||||
s:Hide();
|
||||
if (e.shown) then e.shown = false; s:Hide(); end
|
||||
end
|
||||
else
|
||||
s:Hide();
|
||||
elseif (e.shown) then
|
||||
e.shown = false; s:Hide();
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -396,17 +408,18 @@ FBTickerFrame:SetScript("OnEvent", function()
|
||||
if (event == "PLAYER_ENTERING_WORLD") then
|
||||
FBTicker_Reset();
|
||||
FBTicker_CollectBars();
|
||||
FBTicker_UpdateGate();
|
||||
return;
|
||||
end
|
||||
if (arg1 ~= "player") then return; end
|
||||
if (event == "UNIT_MANA") then
|
||||
FBTicker_OnManaChanged();
|
||||
if (FBTicker_ManaFull()) then FBTicker_HideAll(); end
|
||||
elseif (event == "UNIT_DISPLAYPOWER") then
|
||||
FBTicker_Reset();
|
||||
else
|
||||
FBTicker.lastMana = UnitMana("player");
|
||||
end
|
||||
FBTicker_UpdateGate();
|
||||
end);
|
||||
FBTickerFrame:SetScript("OnUpdate", function()
|
||||
FBTicker_Draw();
|
||||
@@ -463,6 +476,7 @@ function FBTicker_BuildOptions()
|
||||
|
||||
FBTickerEnabledCheck = FBHealBox_CreateCheck("FBHealBoxTickerEnabledCheck", tab, 40, y, "TICK_ENABLED", "TICK_ENABLED_TIP", function()
|
||||
FBTicker_Cfg().Enabled = FBTickerEnabledCheck:GetChecked() and 1 or 0;
|
||||
FBTicker_UpdateGate();
|
||||
FBTicker_Draw();
|
||||
end);
|
||||
FBTickerFSRCheck = FBHealBox_CreateCheck("FBHealBoxTickerFSRCheck", tab, 250, y, "TICK_FSR", "TICK_FSR_TIP", function()
|
||||
@@ -514,8 +528,8 @@ end);
|
||||
FBHealBox_RegisterHook("Defaults", function() return FBTicker_ApplyDefaults(); end);
|
||||
FBHealBox_RegisterHook("SyncOptions", function() return FBTicker_SyncOptions(); end);
|
||||
FBHealBox_RegisterHook("ApplyLocale", function() return FBTicker_ApplyLocale(); end);
|
||||
FBHealBox_RegisterHook("UpdateNames", function() FBTicker_CollectBars(); return true; end);
|
||||
FBHealBox_RegisterHook("ActiveToggle", function() FBTicker_Draw(); return true; end);
|
||||
FBHealBox_RegisterHook("UpdateNames", function() FBTicker_CollectBars(); FBTicker_UpdateGate(); return true; end);
|
||||
FBHealBox_RegisterHook("ActiveToggle", function() FBTicker_UpdateGate(); FBTicker_Draw(); return true; end);
|
||||
FBHealBox_RegisterHook("Status", function()
|
||||
local state = FBT("TICK_UNSYNCED");
|
||||
local nextIn = 0;
|
||||
@@ -535,6 +549,7 @@ FBHealBox_RegisterHook("Slash", function(msg)
|
||||
local cfg = FBTicker_Cfg();
|
||||
if (cfg.Enabled == 1) then cfg.Enabled = 0; else cfg.Enabled = 1; end
|
||||
FBTicker_SyncOptions();
|
||||
FBTicker_UpdateGate();
|
||||
FBTicker_Draw();
|
||||
local key = "TICK_OFF";
|
||||
if (cfg.Enabled == 1) then key = "TICK_ON"; end
|
||||
|
||||
Reference in New Issue
Block a user