Add files via upload

This commit is contained in:
Mquadrat
2026-09-06 19:31:19 +02:00
committed by GitHub
parent 23d3e45d0f
commit 254071d1f5
+47 -40
View File
@@ -5426,8 +5426,8 @@ SlashCmdList["FBHEALPREDICT"] = function(msg)
for k, ic in ipairs(FBHealBox1.buffIcons) do for k, ic in ipairs(FBHealBox1.buffIcons) do
DEFAULT_CHAT_FRAME:AddMessage("|cFF00FFFF[FBP]|r icon "..k..": shown="..tostring(ic:IsShown() and true or false) DEFAULT_CHAT_FRAME:AddMessage("|cFF00FFFF[FBP]|r icon "..k..": shown="..tostring(ic:IsShown() and true or false)
.." name="..tostring(ic.buffName).." left="..tostring(ic.buffLeft and math.floor(ic.buffLeft)) .." name="..tostring(ic.buffName).." left="..tostring(ic.buffLeft and math.floor(ic.buffLeft))
.." grey="..tostring(ic.greyCount).." q1shown="..tostring(ic.q[1]:IsShown() and true or false) .." grey="..tostring(ic.greyCount).." q1shown="..tostring(ic.qTex and ic.qTex:IsShown() and true or false)
.." desat="..tostring(ic.q[1].fbDesat)); .." desat="..tostring(ic.qTex and ic.qTex.fbDesat));
end end
end end
local i = 1; local i = 1;
@@ -5597,13 +5597,7 @@ end
-- (fremder Cast): Icon ohne Uhr. Der Name macht Platz. -- (fremder Cast): Icon ohne Uhr. Der Name macht Platz.
-- ========================================================================== -- ==========================================================================
-- Quadranten der Uhr im Uhrzeigersinn ab 12 Uhr: Ecke, Texturausschnitt FBBUFFICON_STEPS = 32;
FBBUFFICON_QUADS = {
{ corner = "TOPRIGHT", u1 = 0.50, u2 = 0.93, v1 = 0.07, v2 = 0.50 },
{ corner = "BOTTOMRIGHT", u1 = 0.50, u2 = 0.93, v1 = 0.50, v2 = 0.93 },
{ corner = "BOTTOMLEFT", u1 = 0.07, u2 = 0.50, v1 = 0.50, v2 = 0.93 },
{ corner = "TOPLEFT", u1 = 0.07, u2 = 0.50, v1 = 0.07, v2 = 0.50 },
};
-- Icon Nr. k anlegen, aussen links neben der Plakette, in Zweierstapeln: -- Icon Nr. k anlegen, aussen links neben der Plakette, in Zweierstapeln:
-- Icon 1 oben an der Kante, Icon 2 darunter, Icon 3 oben in der naechsten -- Icon 1 oben an der Kante, Icon 2 darunter, Icon 3 oben in der naechsten
@@ -5631,28 +5625,23 @@ function FBHealBox_GetBuffIcon(frame, k, size, rows)
-- Reihenfolge, Textur-Layer innerhalb eines Frames nicht in jedem Fall. -- Reihenfolge, Textur-Layer innerhalb eines Frames nicht in jedem Fall.
ic.grey = CreateFrame("Frame", nil, ic); ic.grey = CreateFrame("Frame", nil, ic);
ic.grey:SetAllPoints(ic); ic.grey:SetAllPoints(ic);
if (ic.grey.SetFrameLevel and ic.GetFrameLevel) then ic.grey:SetFrameLevel((ic:GetFrameLevel() or 0) + 1); end if (ic.grey.SetFrameLevel and frame.GetFrameLevel) then ic.grey:SetFrameLevel((ic:GetFrameLevel() or 0) + 1); end
ic.q = {};
ic.w = {}; -- Schwarz-weißes Icon-Overlay (wächst von oben nach unten)
local half = size / 2; ic.qTex = ic.grey:CreateTexture(nil, "ARTWORK");
for i, qd in ipairs(FBBUFFICON_QUADS) do ic.qTex:SetPoint("TOPLEFT", ic, "TOPLEFT", 0, 0);
-- schwarz-weisser Ausschnitt des Icons ... ic.qTex:SetPoint("TOPRIGHT", ic, "TOPRIGHT", 0, 0);
local t = ic.grey:CreateTexture(nil, "ARTWORK"); ic.qTex:SetHeight(0);
t:SetWidth(half); ic.qTex:Hide();
t:SetHeight(half);
t:SetPoint(qd.corner, ic, qd.corner, 0, 0); -- Dunkle Schattierung über dem abgelaufenen Bereich
t:SetTexCoord(qd.u1, qd.u2, qd.v1, qd.v2); ic.wTex = ic.grey:CreateTexture(nil, "OVERLAY");
t:Hide(); ic.wTex:SetPoint("TOPLEFT", ic, "TOPLEFT", 0, 0);
ic.q[i] = t; ic.wTex:SetPoint("TOPRIGHT", ic, "TOPRIGHT", 0, 0);
-- ... plus dunkle Waesche darueber, damit der Unterschied auf jedem Client sichtbar ist ic.wTex:SetTexture(FBBUFFICON_WASH[1], FBBUFFICON_WASH[2], FBBUFFICON_WASH[3], FBBUFFICON_WASH[4]);
local wsh = ic.grey:CreateTexture(nil, "OVERLAY"); ic.wTex:SetHeight(0);
wsh:SetWidth(half); ic.wTex:Hide();
wsh:SetHeight(half);
wsh:SetPoint(qd.corner, ic, qd.corner, 0, 0);
wsh:SetTexture(FBBUFFICON_WASH[1], FBBUFFICON_WASH[2], FBBUFFICON_WASH[3], FBBUFFICON_WASH[4]);
wsh:Hide();
ic.w[i] = wsh;
end
-- Tooltip: Buffname und Restzeit (auch zur Diagnose) -- Tooltip: Buffname und Restzeit (auch zur Diagnose)
ic:EnableMouse(true); ic:EnableMouse(true);
ic:SetScript("OnEnter", function() ic:SetScript("OnEnter", function()
@@ -5686,19 +5675,37 @@ function FBHealBox_GreyTexture(t)
end end
end end
-- Uhrstand setzen: remaining = Restanteil 0..1, nil = unbekannt (alles farbig)
function FBHealBox_SetBuffIconProgress(ic, remaining) function FBHealBox_SetBuffIconProgress(ic, remaining)
local grey = 0; local grey = 0;
if (remaining) then if (remaining) then
if (remaining < 0) then remaining = 0; end if (remaining < 0) then remaining = 0; end
if (remaining > 1) then remaining = 1; end if (remaining > 1) then remaining = 1; end
grey = math.floor((1 - remaining) * 4 + 0.5); -- 0..4 Quadranten grau, ab 12 Uhr im Uhrzeigersinn grey = math.floor((1 - remaining) * FBBUFFICON_STEPS + 0.5);
if (grey > 4) then grey = 4; end if (grey > FBBUFFICON_STEPS) then grey = FBBUFFICON_STEPS; end
end end
if (ic.greyCount == grey) then return; end if (ic.greyCount == grey) then return; end
ic.greyCount = grey; ic.greyCount = grey;
for i = 1, 4 do
if (i <= grey) then ic.q[i]:Show(); ic.w[i]:Show(); else ic.q[i]:Hide(); ic.w[i]:Hide(); end if (grey == 0) then
if (ic.qTex) then ic.qTex:Hide(); end
if (ic.wTex) then ic.wTex:Hide(); end
else
local size = ic:GetHeight() or FBBUFFICON_SIZE;
local frac = grey / FBBUFFICON_STEPS;
local h = size * frac;
if (ic.qTex) then
ic.qTex:SetHeight(h);
-- Standard-Icon-Beschnitt (0.07 bis 0.93) anteilig anpassen:
local vBottom = 0.07 + (0.93 - 0.07) * frac;
ic.qTex:SetTexCoord(0.07, 0.93, 0.07, vBottom);
ic.qTex:Show();
end
if (ic.wTex) then
ic.wTex:SetHeight(h);
ic.wTex:Show();
end
end end
end end
@@ -5757,13 +5764,13 @@ function FBHealBox_UpdateBuffIcons(frame, unitName, g, size, rows, maxIcons)
if (ic.lastTex ~= b.tex) then if (ic.lastTex ~= b.tex) then
ic.lastTex = b.tex; ic.lastTex = b.tex;
ic.tex:SetTexture(b.tex); ic.tex:SetTexture(b.tex);
for i = 1, 4 do if (ic.qTex) then
ic.q[i]:SetTexture(b.tex); ic.qTex:SetTexture(b.tex);
FBHealBox_GreyTexture(ic.q[i]); FBHealBox_GreyTexture(ic.qTex);
end end
ic.greyCount = nil; ic.greyCount = nil;
end end
-- Uhr: Restanteil bekannt -> Quadranten; unbekannt -> alles farbig
local remaining = nil; local remaining = nil;
ic.buffName = b.name; ic.buffName = b.name;
ic.buffLeft = nil; ic.buffLeft = nil;