X-Git-Url: https://www.aleksib.fi/git/wowui.git/blobdiff_plain/c39801df4486661ba42940fa59d24536e27131a1..35c82f135359357cf4046c3f3252c93a1d20219d:/kehys/frame.lua diff --git a/kehys/frame.lua b/kehys/frame.lua index 535899c..44bc149 100644 --- a/kehys/frame.lua +++ b/kehys/frame.lua @@ -24,14 +24,15 @@ function addon.NewRaidFrame(parent, width, height, unit, attributes, assert(type(width) == "number", "Frame creation missing width!"); assert(type(height) == "number", "Frame creation missing height!"); assert(type(unit) == "string", "Frame creation missing unit!"); - assert(type(attributes) == "table", - "Frame creation missing attributes table!"); assert(type(update) == "function", "Frame creation missing update function!"); assert(type(event) == "function", "Frame creation missing event function!"); assert(type(onshow) == "function", "Frame creation missing onshow function!"); + if type(attributes) ~= "table" then + attributes = {}; + end local f = CreateFrame( "Button", @@ -50,6 +51,18 @@ function addon.NewRaidFrame(parent, width, height, unit, attributes, f.vehicle = unit == "player" and "vehicle" or format("%spet", unit); f.prev = {} -- values stored from previous update f.alert = {}; -- alerting auras + f.heal = {}; -- high healing auras + f.tankcd = {}; -- tank CD auras + f.stacks = {}; -- stacking aura tracking + f.hits = {}; -- hits aura tracking + f.stagger = {}; -- Monk Stagger tracking + f.buff1 = {}; -- custom buff indicator 1 + f.buff2 = {}; -- custom buff indicator 2 + f.incoming = {}; -- incoming ability indicator + f.rolename = nil; -- TANK, HEALER, DAMAGER, NONE + f.classname = nil; -- DK Death Strike and Monk Stagger tracker + f.raid = true; + f.rounds = 0; -- set up periodic updates updaters[f] = function() if f.updating then @@ -88,7 +101,11 @@ function addon.NewRaidFrame(parent, width, height, unit, attributes, f.base:SetAllPoints(); f.base:SetColorTexture(1, 1, 1); f.base:SetVertexColor(unpack(addon.Colors.Base)); - f.background = f:CreateTexture(nil, "BACKGROUND", nil, 1); + f.glow = f:CreateTexture(nil, "BACKGROUND", nil, 1); + f.glow:SetAllPoints(); + f.glow:SetColorTexture(1, 1, 1); + f.glow:SetVertexColor(unpack(addon.Colors.Glow)); + f.background = f:CreateTexture(nil, "BACKGROUND", nil, 2); f.background:SetPoint("TOPLEFT", f, "TOPLEFT", 1, -1); f.background:SetPoint("BOTTOMRIGHT", f, "BOTTOMRIGHT", -1, 1); f.background:SetColorTexture(0.7, 0.7, 0.7); @@ -124,6 +141,11 @@ function addon.NewRaidFrame(parent, width, height, unit, attributes, f.overlay:SetPoint("BOTTOMRIGHT", f.background, "BOTTOMRIGHT"); f.overlay:SetColorTexture(1, 1, 1); f.overlay:Hide(); + f.bottomwarn = f:CreateTexture(nil, "ARTWORK", nil, 1); + f.bottomwarn:SetPoint("TOPLEFT", f.background, "BOTTOMLEFT", 16, 5); + f.bottomwarn:SetPoint("BOTTOMRIGHT", f.background, "BOTTOMRIGHT", -16, 1); + f.bottomwarn:SetColorTexture(1, 0.3, 0.1, 0.66); + f.bottomwarn:Hide(); f.role = f:CreateTexture(nil, "ARTWORK", nil, 2); f.role:SetPoint("BOTTOMRIGHT", f, "BOTTOMRIGHT", -3, 3); f.role:SetPoint("TOPLEFT", f, "BOTTOMRIGHT", -15, 15); @@ -135,10 +157,31 @@ function addon.NewRaidFrame(parent, width, height, unit, attributes, f.text:SetPoint("CENTER", f, "CENTER", 0, -1); f.text:SetFont(STANDARD_TEXT_FONT, 13); f.text:Hide(); + f.stack = f:CreateFontString(nil, "OVERLAY", "GameFontHighlightSmall"); + f.stack:SetPoint("BOTTOMLEFT", f.background, "BOTTOMLEFT"); + f.stack:Hide(); f.ready = f:CreateTexture(nil, "OVERLAY"); f.ready:SetPoint("TOPLEFT", f, "BOTTOMLEFT", 1, 15); f.ready:SetPoint("BOTTOMRIGHT", f, "BOTTOMLEFT", 15, 1); f.ready:Hide(); + f.buffind1 = f:CreateTexture(nil, "OVERLAY"); + f.buffind1:SetPoint("TOPRIGHT", f.background, "TOPRIGHT", -1, -1); + f.buffind1:SetWidth(6); + f.buffind1:SetHeight(6); + f.buffind1:SetColorTexture(0.8, 0.1, 0.1); + f.buffind1:Hide(); + f.buffind2 = f:CreateTexture(nil, "OVERLAY"); + f.buffind2:SetPoint("TOPLEFT", f.background, "TOPLEFT", 1, -1); + f.buffind2:SetWidth(4); + f.buffind2:SetHeight(4); + f.buffind2:SetColorTexture(0.8, 0.7, 0.1); + f.buffind2:Hide(); + f.defensive = f:CreateTexture(nil, "OVERLAY", nil, 1); + f.defensive:SetPoint("TOPLEFT", f.background, "TOPLEFT", 1, -1); + f.defensive:SetWidth(6); + f.defensive:SetHeight(6); + f.defensive:SetColorTexture(1, 0.3, 0); + f.defensive:Hide(); f.targeticon = f:CreateTexture(nil, "OVERLAY"); f.targeticon:SetPoint("CENTER", f, "TOP", 0, -1); f.targeticon:SetWidth(12);