WoWInterface SVN RuneWatch

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk
    from Rev 15 to Rev 16
    Reverse comparison

Rev 15 → Rev 16

RuneWatch.lua
14,7 → 14,7
iconTextures[RUNETYPE_FROST] = "Interface\\PlayerFrame\\UI-PlayerFrame-Deathknight-Frost";
iconTextures[RUNETYPE_CHROMATIC] = "Interface\\PlayerFrame\\UI-PlayerFrame-Deathknight-Death";
 
local barWidth = 280;
local barWidth = 300;
 
local rpBarCol = { r = 0.2, g = 0.2, b = 0.6 }
local rpBarColMax = { r = 0.4, g = 0.4, b = 0.9 }
109,28 → 109,36
local bar = self.Gui.Art.Bar;
 
local rpPerc = rp / UnitManaMax("player");
local rpPercN = 1 - rp;
local newWid = barWidth * rpPerc;
local rpPc = rpPerc * (1 - (2 * 0.02734)) + 0.02734;
local newWid = barWidth * rpPc;
 
if (rp == 0) then
bar:Hide();
else
bar:Show();
bar:SetWidth(newWid);
bar:SetTexCoord(0,rpPerc,0,1);
bar:SetTexCoord(0,rpPc,0,1);
end
 
local rpCol = {};
rpCol.r = rpBarColMax.r; --* rpPercN + rpBarColMax.r * rpPerc;
rpCol.g = rpBarColMax.g; --* rpPercN + rpBarColMax.g * rpPerc;
rpCol.b = rpBarColMax.b; --* rpPercN + rpBarColMax.b * rpPerc;
 
local rpCol = self:BlendColors(rpBarCol, rpBarColMax, rpPerc);
rpCol.a = (rpPerc * 0.6) + 0.6;
 
bar:SetVertexColor(rpCol.r, rpCol.g, rpCol.b, rpCol.a);
end
end
 
function RuneWatch:BlendColors(col1, col2, perc)
local invPerc = 1 - perc;
 
local newc = { r = 0, g = 0, b = 0 }
 
newc.r = col1.r * perc + col2.r * invPerc;
newc.g = col1.g * perc + col2.g * invPerc;
newc.b = col1.b * perc + col2.b * invPerc;
 
return newc;
end
 
function RuneWatch:InitGui()
self.Gui = { Runes = {} }
 
250,9 → 258,9
 
local bar = frame:CreateTexture("$parent_Bar", "BORDER");
bar:SetTexture(artTextures.Bar);
bar:SetPoint("LEFT", self.Gui.Art.Base, "LEFT", 10, -19);
bar:SetWidth(280);
bar:SetHeight(140);
bar:SetPoint("LEFT", self.Gui.Art.Base, "LEFT", 0, 0);
bar:SetWidth(300);
bar:SetHeight(150);
bar:Show();
 
self.Gui.Art.Bar = bar;
Artwork/UI-RuneWatch-Bar.tga Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream
Artwork/UI-RuneWatch-Frame.tga Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream