WoWInterface SVN Glamour

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk
    from Rev 1 to Rev 2
    Reverse comparison

Rev 1 → Rev 2

Glamour.xml New file
0,0 → 1,414
<Ui xmlns="http://www.blizzard.com/wow/ui/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\..\FrameXML\UI.xsd">
<Script file="Glamour.lua"/>
 
<Frame name="Glamour" parent="UIParent">
<Scripts>
<OnLoad>
Glamour_OnLoad(self);
</OnLoad>
 
<OnEvent>
Glamour_OnEvent(self, event, ...);
</OnEvent>
</Scripts>
</Frame>
 
<Frame name="GlamourAnchor" enableMouse="true" movable="true" hidden="true">
<Scripts>
<OnMouseDown>
if button == "LeftButton" and not self.isMoving then
self:StartMoving();
self.isMoving = true;
end
if button == "RightButton" and not self.isMoving then
self:Hide();
end
</OnMouseDown>
<OnMouseUp>
if button == "LeftButton" and self.isMoving then
self:StopMovingOrSizing();
self.isMoving = false;
end
</OnMouseUp>
<!--
<OnHide>
if ( this.isMoving ) then
this:StopMovingOrSizing();
this.isMoving = false;
end
</OnHide>
-->
</Scripts>
<!-- Tags below add a visual element to the frame. -->
<Layers>
<Layer level="ARTWORK">
<Texture setAllPoints="true">
<Color r="0.7" g="0.7" b="0.7" a="0.8" />
</Texture>
<FontString name="GlamourAnchorTitle" inherits="GameFontNormal" text="Glamour Anchor" parent="GlamourAnchor">
<Anchors>
<Anchor point="TOP" relativeto="GlamourAnchor">
</Anchor>
</Anchors>
</FontString>
<FontString name="GlamourAnchorText1" inherits="GameFontBlackTiny" text="left-click to drag." parent="GlamourAnchorTitle">
<Anchors>
<Anchor point="BOTTOM" relativeto="GlamourAnchorTitle">
<Offset y="-8"/>
</Anchor>
</Anchors>
</FontString>
<FontString name="GlamourAnchorText2" inherits="GameFontBlackTiny" text="right-click to hide." parent="GlamourAnchorTitle">
<Anchors>
<Anchor point="BOTTOM" relativeto="GlamourAnchorTitle">
<Offset y="-18"/>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Size x="140" y="32" />
<Anchors><Anchor point="CENTER" relativeTo="UIParent"/></Anchors>
</Frame>
 
 
<Button name="GlamourAlertFrameTemplate" hidden="true" frameStrata="TOOLTIP" virtual="true" inherits="AlertFrameTemplate">
<Size>
<AbsDimension x="300" y="88"/>
</Size>
<Anchors>
<Anchor point="CENTER" relativePoint="BOTTOM" relativeTo="GlamourAnchor">
<Offset>
<AbsDimension x="0" y="-128"/>
</Offset>
</Anchor>
</Anchors>
<Animations>
<AnimationGroup name="$parentAnimIn" parentKey="animIn">
<Alpha change="-1" duration="0" order="1"/>
<Alpha change="1" duration="0.2" order="2"/>
</AnimationGroup>
<AnimationGroup name="$parentWaitAndAnimOut" parentKey="waitAndAnimOut">
<Alpha startDelay="6.05" change="-1" duration="1.5" parentKey="animOut">
<Scripts>
<OnFinished>
self:GetRegionParent():Hide();
</OnFinished>
</Scripts>
</Alpha>
</AnimationGroup>
</Animations>
<Layers>
<Layer level="BACKGROUND">
<Texture name="$parentBackground" file="Interface\AchievementFrame\UI-Achievement-Alert-Background">
<Anchors>
<Anchor point="TOPLEFT"/>
<Anchor point="BOTTOMRIGHT"/>
</Anchors>
<TexCoords left="0" right=".605" top="0" bottom=".703"/>
</Texture>
<FontString name="$parentUnlocked" inherits="GameFontBlackTiny" text="" parentKey="unlocked">
<Size x="200" y="12"/>
<Anchors>
<Anchor point="TOP">
<Offset x="7" y="-23"/>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentName" inherits="GameFontHighlight" text="For the Alliance!">
<Anchors>
<Anchor point="BOTTOMLEFT">
<Offset x="72" y="36"/>
</Anchor>
<Anchor point="BOTTOMRIGHT">
<Offset x="-60" y="36"/>
</Anchor>
</Anchors>
<Size x="240" y="16"/>
</FontString>
<FontString name="$parentGuildName" inherits="GameFontNormal" hidden="true">
<Anchors>
<Anchor point="TOPLEFT">
<Offset x="50" y="-10"/>
</Anchor>
<Anchor point="TOPRIGHT">
<Offset x="-50" y="-10"/>
</Anchor>
</Anchors>
<Size x="0" y="16"/>
</FontString>
</Layer>
<Layer level="BACKGROUND" textureSubLevel="1">
<Texture name="$parentGuildBanner" file="Interface\AchievementFrame\UI-Achievement-Guild" hidden="true">
<Size x="64" y="64"/>
<Anchors>
<Anchor point="TOPRIGHT" x="-13" y="-29"/>
</Anchors>
<TexCoords left="0.76171875" right="0.88671875" top="0.00195313" bottom="0.12695313"/>
</Texture>
</Layer>
<Layer level="BORDER">
<Texture name="$parentGuildBorder" file="Interface\AchievementFrame\UI-Achievement-Guild" hidden="true">
<Size x="64" y="64"/>
<Anchors>
<Anchor point="TOPRIGHT" x="-13" y="-29"/>
</Anchors>
<TexCoords left="0.63281250" right="0.75781250" top="0.00195313" bottom="0.12695313"/>
</Texture>
</Layer>
<Layer level="OVERLAY">
<Texture name="$parentGlow" file="Interface\AchievementFrame\UI-Achievement-Alert-Glow" alphaMode="ADD" alpha="0" parentKey="glow">
<Size>
<AbsDimension x="400" y="171"/>
</Size>
<Anchors>
<Anchor point="CENTER">
<Offset x="0" y="0"/>
</Anchor>
</Anchors>
<Animations>
<AnimationGroup name="$parentAnimIn" parentKey="animIn">
<Alpha change="1" duration="0.2" order="1"/>
<Alpha change="-1" duration="0.5" order="2"/>
</AnimationGroup>
</Animations>
<TexCoords left="0" right="0.78125" top="0" bottom="0.66796875"/>
</Texture>
<Texture name="$parentShine" file="Interface\AchievementFrame\UI-Achievement-Alert-Glow" alphaMode="ADD" alpha="0" parentKey="shine">
<Size>
<AbsDimension x="67" y="72"/>
</Size>
<Anchors>
<Anchor point="BOTTOMLEFT">
<Offset x="0" y="8"/>
</Anchor>
</Anchors>
<Animations>
<AnimationGroup name="$parentAnimIn" parentKey="animIn">
<Alpha change="1" duration="0.2" order="1"/>
<Translation offsetX="240" offsetY="0" duration="0.85" order="2"/>
<Alpha startDelay="0.35" change="-1" duration="0.5" order="2"/>
</AnimationGroup>
</Animations>
<TexCoords left="0.78125" right="0.912109375" top="0" bottom="0.28125"/>
</Texture>
</Layer>
</Layers>
<Frames>
<Frame name="$parentIcon">
<Size>
<AbsDimension x="124" y="124"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="-26" y="16"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="BORDER">
<Texture name="$parentBling" file="Interface\AchievementFrame\UI-Achievement-Bling" hidden="true">
<Anchors>
<Anchor point="CENTER">
<Offset>
<AbsDimension x="-1" y="1"/>
</Offset>
</Anchor>
</Anchors>
<Size>
<AbsDimension x="116" y="116"/>
</Size>
</Texture>
</Layer>
<Layer level="ARTWORK">
<Texture name="$parentTextureBG">
<Color r="0" g="0" b="0" a="1.0"/>
<Anchors>
<Anchor point="CENTER">
<Offset>
<AbsDimension x="0" y="3"/>
</Offset>
</Anchor>
</Anchors>
<Size>
<AbsDimension x="50" y="50"/>
</Size>
</Texture>
<Texture name="$parentTexture">
<Anchors>
<Anchor point="CENTER">
<Offset>
<AbsDimension x="0" y="3"/>
</Offset>
</Anchor>
</Anchors>
<Size>
<AbsDimension x="50" y="50"/>
</Size>
</Texture>
</Layer>
<Layer level="OVERLAY">
<Texture name="$parentOverlay" file="Interface\AchievementFrame\UI-Achievement-IconFrame">
<Anchors>
<Anchor point="CENTER">
<Offset>
<AbsDimension x="-1" y="2"/>
</Offset>
</Anchor>
</Anchors>
<Size>
<AbsDimension x="72" y="72"/>
</Size>
<TexCoords left="0" right="0.5625" top="0" bottom="0.5625"/>
</Texture>
<FontString name="$parentNameTop" inherits="GameFontHighlight" text="" parentKey="nametop">
<Anchors>
<Anchor point="TOP" RelativeTo="$ParentOverlay" RelativePoint="TOP">
<Offset x="0" y="-6"/>
</Anchor>
</Anchors>
<Size x="44" y="16"/>
</FontString>
<FontString name="$parentNameBottom" inherits="GameFontHighlight" text="" parentKey="namebottom">
<Anchors>
<Anchor point="BOTTOM" RelativeTo="$ParentOverlay" RelativePoint="BOTTOM">
<Offset x="0" y="6"/>
</Anchor>
</Anchors>
<Size x="44" y="16"/>
</FontString>
</Layer>
</Layers>
</Frame>
<Frame name="$parentShield">
<Size>
<AbsDimension x="64" y="64"/>
</Size>
<Anchors>
<Anchor point="TOPRIGHT">
<Offset>
<AbsDimension x="-10" y="-13"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture name="$parentIcon" file="Interface\AchievementFrame\UI-Achievement-Shields">
<Size>
<AbsDimension x="52" y="48"/>
</Size>
<Anchors>
<Anchor point="TOPRIGHT">
<Offset>
<AbsDimension x="1" y="-6"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0" right=".5" top="0" bottom=".45"/>
</Texture>
</Layer>
<Layer level="OVERLAY">
<FontString name="$parentPoints" inherits="GameFontNormal">
<Anchors>
<Anchor point="CENTER">
<Offset>
<AbsDimension x="7" y="2"/>
</Offset>
</Anchor>
</Anchors>
<Size>
<AbsDimension x="64" y="64"/>
</Size>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnLoad>
GlamourAchievementShield_OnLoad(self);
</OnLoad>
</Scripts>
</Frame>
</Frames>
<Scripts>
<OnMouseDown>
GlamourAlertFrame_OnClick(self, button, down);
</OnMouseDown>
<OnHide function="GlamourAlertFrame_OnHide"/>
</Scripts>
</Button>
 
<Frame name="GlamourGUIFrame">
<Layers>
<Layer level="ARTWORK">
<FontString name="$parent_Head" inherits="GameFontNormalLarge" text="Glamour">
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="15" y="-15" />
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
 
<Frames>
<CheckButton name="$parent_CHECK0" inherits="UICheckButtonTemplate">
<Size>
<AbsDimension x="32" y="32"/>
</Size>
 
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parent_Head">
<Offset>
<AbsDimension x="25" y="-40"/>
</Offset>
</Anchor>
</Anchors>
</CheckButton>
 
<CheckButton name="$parent_CHECK1" inherits="UICheckButtonTemplate">
<Size>
<AbsDimension x="32" y="32"/>
</Size>
 
<Anchors>
<Anchor point="BOTTOMLEFT" relativeTo="$parent_CHECK0">
<Offset>
<AbsDimension x="0" y="-40"/>
</Offset>
</Anchor>
</Anchors>
</CheckButton>
 
<Button name="$parent_BUTTON0" inherits="OptionsButtonTemplate" text="Show Anchor">
<Size>
<AbsDimension x="150" y="32"/>
</Size>
<Anchors>
<Anchor point="BOTTOMLEFT" relativeTo="$parent_CHECK1">
<Offset>
<AbsDimension x="0" y="-40"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick> GlamourAnchor:Show(); </OnClick>
</Scripts>
</Button>
 
</Frames>
 
<Scripts>
<OnLoad>
GlamourPanel_OnLoad(self);
</OnLoad>
</Scripts>
</Frame>
 
</Ui>
 
Glamour.lua New file
0,0 → 1,493
-- globals
Glamour_NAME = "Glamour";
Glamour_VERSION = GetAddOnMetadata("Glamour", "Version") or "UnKnown";
print(Glamour_NAME.." "..Glamour_VERSION.." Loaded!");
GlamourLastFrame = nil;
realm = GetRealmName("player");
player = GetUnitName("player");
 
--
-- GUI Functions
--
 
-- This function is run on pressing the Ok or Close Buttons.
-- Sets the Status of the Saved Variables to the new settings
--
function GlamourPanel_Close()
GlamourConfig[realm.."-"..player].CHECK0 = GlamourGUIFrame_CHECK0:GetChecked();
GlamourConfig[realm.."-"..player].CHECK1 = GlamourGUIFrame_CHECK1:GetChecked();
--ReloadUI();
end
 
 
-- This function is run on pressing the Cancel Button or from the VARIABLES LOADED event function.
-- Sets the status of the Check Boxes to the Values of the Saved Variables.
--
function GlamourPanel_CancelOrLoad()
GlamourGUIFrame_CHECK0:SetChecked(GlamourConfig[realm.."-"..player].CHECK0);
GlamourGUIFrame_CHECK1:SetChecked(GlamourConfig[realm.."-"..player].CHECK1);
end
 
 
-- The GUI OnLoad function.
--
function GlamourPanel_OnLoad(panel)
-- Set the Text for the Check boxes.
--
GlamourGUIFrame_CHECK0Text:SetText("Capture Blizzard Alerts. (Requires ReloadUI)");
GlamourGUIFrame_CHECK1Text:SetText("Reverse Alert Direction. (Requires ReloadUI)");
 
-- Set the name for the Category for the Panel
--
panel.name = Glamour_NAME.." v"..Glamour_VERSION;
 
-- When the player clicks okay, set the Saved Variables to the current Check Box setting
--
panel.okay = function (self) GlamourPanel_Close(); end;
 
-- When the player clicks cancel, set the Check Box status to the Saved Variables.
panel.cancel = function (self) GlamourPanel_CancelOrLoad(); end;
 
-- Add the panel to the Interface Options
--
InterfaceOptions_AddCategory(panel);
end
 
function Glamour_OnLoad(self)
self:RegisterEvent("VARIABLES_LOADED");
end
 
function Glamour_OnEvent(frame, event, arg1, ...)
if (not GlamourConfig) then
GlamourConfig = {};
end
 
if (not GlamourConfig[realm.."-"..player]) then
GlamourConfig[realm.."-"..player] = {} ;
GlamourConfig[realm.."-"..player].CHECK0 = 1;
GlamourConfig[realm.."-"..player].CHECK1 = 0;
GlamourAnchor:Show();
end
GlamourPanel_CancelOrLoad();
end
 
function GlamourAlertSample(FrameStyle)
 
local MyData = {};
MyData.Text = "General Text";
MyData.Title = "Title";
MyData.bTitle = "bTitle";
MyData.Icon = "Interface\\Icons\\INV_Misc_QuestionMark";
MyData.tText = "tText";
MyData.bText = "bText";
MyData.FrameStyle = FrameStyle;
MyData.ShieldHide = false;
MyData.ShieldIcon = false;
MyData.ShieldText = "shieldText";
MyData.HideGlow = false;
MyData.HideShine = false;
MyData.ShowBanner = true;
MyData.BannerColor = {r=.2,g=.2,b=.8};
local green = {r=0,g=1,b=0};
local red = {r=1,g=0,b=0 };
 
GlamourShowAlert(1, MyData, nil, nil);
GlamourShowAlert(1, MyData, red, green);
--
GlamourShowAlert(0, MyData, nil, nil);
GlamourShowAlert(0, MyData, red, green);
--
GlamourShowAlert(400, MyData, green, red);
GlamourShowAlert(200, MyData, red, green);
--
GlamourShowAlert(1, MyData, nil, nil);
GlamourShowAlert(1, MyData, red, green);
--
end
 
function GlamourResetAlertFrame()
 
local MyData = {};
MyData.Text = "";
MyData.Title = "";
MyData.bTitle = "";
MyData.Icon = "";
MyData.tText = "";
MyData.bText = "";
MyData.FrameStyle = nil;
MyData.ShieldHide = false;
MyData.ShieldIcon = false;
MyData.ShieldText = "";
MyData.HideGlow = false;
MyData.HideShine = false;
MyData.ShowBanner = true;
MyData.BannerColor = {r=.8,g=.8,b=.8};
MyData.Reset = 1;
 
GlamourShowAlert(1, MyData, nil, nil);
end
 
function GlamourShowAlert(size, data, glow, shine)
-- size: numeric
-- width of the alert frame with the following predefinded values
-- 0 : Shows just the Icon and IconFrame along with ttext and bttext from the data fields. This mode also hides the shine effect.
-- 1 : Default size (width 300);
-- * : any other number will be used as a specific size to resize the width too. 300 is the default size, use this as a starting point.
-- data: keytable:
-- Text = Text to display
-- Title = Title to display
-- bTitle = text to display on the border of the guild alert frame.
-- Icon = icon path to display
-- tText = text to display at the top of the icon
-- bText = text to display at the bottom of the icon
-- Points = numeric value to display ontop of the shield icon (0 for nothing)
-- ShieldHide = Boolean (true or false ) hides the shield icon on the right of the frame. (This does not Hide shieldPoints).
-- ShieldIcon = String containing the path to a custom Icon/Texture to use in place of the regular shield.
-- FrameStyle = String to identify the type of frame to use for your alert.
-- nil: Use the default Blizzard Achievement style.
-- GuildAchievement: Use the Blizzard Guild Achievement style.
-- Notice: A small alert that handles a single line/short sentence of text.
-- HideBanner = Boolean (true or false ) hides the banner and banner border textures when useGuildAch is active
-- BannerColor = keytable: {r,g,b} or nil for default - the rgb values to use for the banner color when useGuildAch is active.
-- HideGlow = Boolean (true or false) hides the glow effect on the alert window.
-- HideShine = Boolean (true or false) hides the shine effect on the alert window.
-- glow: keytable: {r,g,b} or nil for default - the rgb values to use for the glow animation
-- shine: keytable: {r,g,b} or nil for default - the rgb values to use for the shine animation
 
local frame = GlamourAlertFrame_GetAlertFrame();
 
if ( not frame ) then
-- We ran out of frames! Bail!
print("bailed!");
return;
end
 
local frameName = frame:GetName();
local displayName = _G[frameName.."Name"];
local displayNameTop = _G[frameName.."IconNameTop"];
local displayNameBottom = _G[frameName.."IconNameBottom"];
local shieldPoints = _G[frameName.."ShieldPoints"];
local shieldIcon = _G[frameName.."ShieldIcon"];
local BackGround = _G[frameName.."Background"];
local Unlocked = _G[frameName.."Unlocked"];
local guildName = _G[frameName.."GuildName"];
local guildBorder = _G[frameName.."GuildBorder"];
local guildBanner = _G[frameName.."GuildBanner"];
local frameIcon = _G[frameName.."IconTexture"];
 
displayName:SetText(data.Text);
displayNameTop:SetText(data.tText);
displayNameBottom:SetText(data.bText);
guildName:SetText(data.bTitle);
 
BackGround:Show();
Unlocked:Show();
displayName:Show();
shieldPoints:Show();
shieldIcon:Show();
guildName:Show();
guildBorder:Show();
guildBanner:Show();
 
if(data.Points) then
data.ShieldText = data.Points;
elseif(not data.ShieldText) then
data.ShieldText = "";
end
 
if(data.ShieldIcon) then
shieldIcon:SetTexture(data.ShieldIcon);
shieldIcon:SetTexCoord(0,1,0,1);
else
if ( data.points == 0 ) then
shieldIcon:SetTexture([[Interface\AchievementFrame\UI-Achievement-Shields-NoPoints]]);
else
shieldIcon:SetTexture([[Interface\AchievementFrame\UI-Achievement-Shields]]);
end
if (data.FrameStyle == "GuildAchievement") then
shieldIcon:SetTexCoord(0, 0.5, 0.5, 1);
else
shieldIcon:SetTexCoord(0, 0.5, 0, 0.45);
end
end
 
if ( data.func ) then
frame.func = data.fun;
else
frame.func = nil;
end
 
if ( data.FrameStyle ) then
if ( data.FrameStyle == "GuildAchievement" ) then
frame:SetHeight(104);
local background = _G[frameName.."Background"];
background:SetTexture("Interface\\AchievementFrame\\UI-Achievement-Guild");
background:SetTexCoord(0.00195313, 0.62890625, 0.00195313, 0.19140625);
background:SetPoint("TOPLEFT", -2, 2);
background:SetPoint("BOTTOMRIGHT", 8, 8);
_G[frameName.."IconOverlay"]:Show();
local iconBorder = _G[frameName.."IconOverlay"];
iconBorder:SetTexture("Interface\\AchievementFrame\\UI-Achievement-Guild");
iconBorder:SetTexCoord(0.25976563,0.40820313,0.50000000,0.64453125);
iconBorder:SetPoint("CENTER", 0, 1);
_G[frameName.."Icon"]:SetPoint("TOPLEFT", -26, 2);
displayName:SetPoint("BOTTOMLEFT", 79, 37);
displayName:SetPoint("BOTTOMRIGHT", -79, 37);
displayNameTop:Show();
displayNameBottom:Show();
_G[frameName.."Shield"]:SetPoint("TOPRIGHT", -15, -28);
frameIcon:Show();
_G[frameName.."IconTextureBG"]:Show();
_G[frameName.."IconOverlay"]:Show();
shieldPoints:SetPoint("CENTER", 7, 5);
shieldPoints:SetVertexColor(0, 1, 0);
shieldPoints:Show();
shieldIcon:Show();
local unlocked = _G[frameName.."Unlocked"];
unlocked:SetPoint("TOP", -1, -36);
unlocked:Show();
guildName:Show();
guildBanner:Show();
guildBorder:Show();
frame.glow:SetTexture("Interface\\AchievementFrame\\UI-Achievement-Guild");
frame.glow:SetTexCoord(0.00195313, 0.74804688, 0.19531250, 0.49609375);
frame.shine:SetTexture("Interface\\AchievementFrame\\UI-Achievement-Guild");
frame.shine:SetTexCoord(0.75195313, 0.91601563, 0.19531250, 0.35937500);
frame.shine:SetPoint("BOTTOMLEFT", 0, 16);
frame.shine:Show();
if(data.HideBanner) then
guildBanner:Show();
guildBorder:Show();
elseif(data.BannerColor) then
local BannerColor = data.BannerColor;
guildBanner:SetVertexColor(BannerColor.r,BannerColor.g,BannerColor.b);
end
elseif ( data.FrameStyle == "Notice" ) then
frame:SetHeight(20);
local background = _G[frameName.."Background"];
background:SetTexture("Interface\\AchievementFrame\\UI-Achievement-Parchment-Horizontal-Desaturated");
background:SetTexCoord(0, 1, 0, 1);
background:SetPoint("TOPLEFT", 0, 0);
background:SetPoint("BOTTOMRIGHT", 0, 0);
_G[frameName.."IconOverlay"]:Hide();
displayName:SetPoint("BOTTOMLEFT", 0, 3);
displayName:SetPoint("BOTTOMRIGHT", 0, 3);
displayNameTop:Hide();
displayNameBottom:Hide();
shieldPoints:Hide();
shieldIcon:Hide();
frameIcon:Hide();
_G[frameName.."Unlocked"]:Hide();
_G[frameName.."GuildName"]:Hide();
_G[frameName.."GuildBorder"]:Hide();
_G[frameName.."GuildBanner"]:Hide();
_G[frameName.."IconTexture"]:Hide();
_G[frameName.."IconTextureBG"]:Hide();
_G[frameName.."IconOverlay"]:Hide();
frame.glow:SetTexture("Interface\\AchievementFrame\\UI-Achievement-Alert-Glow");
frame.glow:SetTexCoord(0, 0.78125, 0, 0.66796875);
else
print(_G["RED_FONT_COLOR_CODE"],"[ERROR] Glamour Alert called with invalid FrameStyle: ", data.FrameStyle, _G["FONT_COLOR_CODE_CLOSE"]);
data.FrameStyle = nil;
end
end
 
if (not data.FrameStyle ) then
frame:SetHeight(88);
local background = _G[frameName.."Background"];
background:SetTexture("Interface\\AchievementFrame\\UI-Achievement-Alert-Background");
background:SetTexCoord(0, 0.605, 0, 0.703);
background:SetPoint("TOPLEFT", 0, 0);
background:SetPoint("BOTTOMRIGHT", 0, 0);
local iconBorder = _G[frameName.."IconOverlay"];
iconBorder:SetTexture("Interface\\AchievementFrame\\UI-Achievement-IconFrame");
iconBorder:SetTexCoord(0, 0.5625, 0, 0.5625);
iconBorder:SetPoint("CENTER", -1, 2);
_G[frameName.."Icon"]:SetPoint("TOPLEFT", -26, 16);
displayName:SetPoint("BOTTOMLEFT", 72, 36);
displayName:SetPoint("BOTTOMRIGHT", -60, 36);
displayNameTop:Show();
displayNameBottom:Show();
_G[frameName.."Shield"]:SetPoint("TOPRIGHT", -10, -13);
shieldPoints:SetPoint("CENTER", 7, 2);
shieldPoints:SetVertexColor(1, 1, 1);
shieldPoints:Show();
shieldIcon:Show();
local unlocked = _G[frameName.."Unlocked"];
unlocked:SetPoint("TOP", 7, -23);
unlocked:Show();
_G[frameName.."GuildName"]:Hide();
_G[frameName.."GuildBorder"]:Hide();
_G[frameName.."GuildBanner"]:Hide();
frameIcon:Show();
_G[frameName.."IconTextureBG"]:Hide();
_G[frameName.."IconOverlay"]:Show();
frame.glow:SetTexture("Interface\\AchievementFrame\\UI-Achievement-Alert-Glow");
frame.glow:SetTexCoord(0, 0.78125, 0, 0.66796875);
frame.shine:SetTexture("Interface\\AchievementFrame\\UI-Achievement-Alert-Glow");
frame.shine:SetTexCoord(0.78125, 0.912109375, 0, 0.28125);
frame.shine:SetPoint("BOTTOMLEFT", 0, 8);
frame.shine:Show();
end
 
if (size == 0) then
frame:SetWidth(44);
BackGround:Hide();
Unlocked:Hide();
displayName:Hide();
shieldPoints:Hide();
shieldIcon:Hide();
guildName:Hide();
guildBorder:Hide();
guildBanner:Hide();
frame.glow:SetPoint("TOPLEFT", frameIcon,"TOPLEFT", -25, 75)
frame.glow:SetPoint("BOTTOMRIGHT", frameIcon ,"BOTTOMRIGHT", 25, -75)
frame.shine:Hide();
elseif (size == 1) then
frame:SetWidth(300);
frame.glow:SetPoint("TOPLEFT", frame ,"TOPLEFT", -50, 0)
frame.glow:SetPoint("BOTTOMRIGHT", frame ,"BOTTOMRIGHT", 50, 0)
frame.shine:SetPoint("TOPLEFT", frame ,"TOPLEFT", -50, 0)
--frame.shine:SetPoint("BOTTOMRIGHT", frame ,"BOTTOMRIGHT", 50, 0)
 
else
frame:SetWidth(size);
frame.glow:SetPoint("TOPLEFT", frame ,"TOPLEFT", -50, 0)
frame.glow:SetPoint("BOTTOMRIGHT", frame ,"BOTTOMRIGHT", 50, 0)
frame.shine:SetPoint("TOPLEFT", frame ,"TOPLEFT", -50, 0)
--frame.shine:SetPoint("BOTTOMRIGHT", frame ,"BOTTOMRIGHT", 50, 0)
end
 
if(data.ShieldHide) then
shieldIcon:Hide();
end
 
GlamourAchievementShield_SetPoints(data.ShieldText, shieldPoints, GameFontNormal, GameFontNormalSmall);
frame.unlocked:SetText(data.Title);
frameIcon:SetTexture(data.Icon);
 
if(data.HideGlow) then
frame.glow:Hide();
end
if(data.HideShine) then
frame.shine:Hide();
end
 
if (glow) then
frame.glow:SetVertexColor(glow.r,glow.g,glow.b);
else
frame.glow:SetVertexColor(1,1,1);
end
 
if (shine) then
frame.shine:SetVertexColor(shine.r,shine.g,shine.b);
else
frame.shine:SetVertexColor(1,1,1);
end
 
if(not data.Reset) then
GlamourAlertFrame_AnimateIn(frame);
end
return frameName;
end
 
 
function GlamourAlertFrame_GetAlertFrame()
local name, frame, previousFrame;
for i=1, 24 do
name = "GlamourAlertFrame"..i;
frame = _G[name];
if ( frame ) then
if ( not frame:IsShown() ) then
GlamourLastFrame = frame;
return frame;
end
else
frame = CreateFrame("Button", name, UIParent, "GlamourAlertFrameTemplate");
if ( not previousFrame or i == 13 ) then
frame:SetPoint("CENTER", GlamourAnchor, "BOTTOM", 0, 0);
else
if (GlamourConfig[realm.."-"..player].CHECK1) then
frame:SetPoint("BOTTOM", previousFrame, "TOP", 0, 0);
else
frame:SetPoint("TOP", previousFrame, "BOTTOM", 0, 0);
end
end
GlamourLastFrame = frame;
return frame;
end
previousFrame = frame;
end
return nil;
end
 
Blizzard_AchievementAlertFrame_GetAlertFrame = AchievementAlertFrame_GetAlertFrame;
Blizzard_AchievementAlertFrame_ShowAlert = AchievementAlertFrame_ShowAlert;
 
function AchievementAlertFrame_GetAlertFrame()
if (GlamourConfig[realm.."-"..player].CHECK0) then
return GlamourAlertFrame_GetAlertFrame();
else
return Blizzard_AchievementAlertFrame_GetAlertFrame();
end
end
 
function AchievementAlertFrame_ShowAlert(achievementID)
if (GlamourConfig[realm.."-"..player].CHECK0) then
GlamourResetAlertFrame(GlamourAlertFrame_GetAlertFrame());
end
Blizzard_AchievementAlertFrame_ShowAlert(achievementID);
end
 
function GlamourAlertFrame_OnClick (self, button)
if ( button == "RightButton" ) then
self:Hide();
return;
end
 
local id = self.id;
if ( not id ) then
self:Hide();
return;
end
 
ShowUIPanel(AchievementFrame);
 
local _, _, _, achCompleted = GetAchievementInfo(id);
if ( achCompleted and (ACHIEVEMENTUI_SELECTEDFILTER == AchievementFrameFilters[ACHIEVEMENT_FILTER_INCOMPLETE].func) ) then
AchievementFrame_SetFilter(ACHIEVEMENT_FILTER_ALL);
elseif ( (not achCompleted) and (ACHIEVEMENTUI_SELECTEDFILTER == AchievementFrameFilters[ACHIEVEMENT_FILTER_COMPLETE].func) ) then
AchievementFrame_SetFilter(ACHIEVEMENT_FILTER_ALL);
end
 
AchievementFrame_SelectAchievement(id)
end
 
function GlamourAchievementShield_OnLoad (self)
self.Desaturate = AchievementShield_Desaturate;
self.Saturate = AchievementShield_Saturate;
end
 
function GlamourAchievementShield_SetPoints(points, pointString, normalFont, smallFont)
if ( strlen(points) > 3) then
pointString:SetFontObject(normalFont);
else
pointString:SetFontObject(smallFont);
end
pointString:SetText(points);
end
 
function GlamourAlertFrame_AnimateIn(frame)
frame:Show();
frame.animIn:Play();
frame.glow.animIn:Play();
frame.shine.animIn:Play();
frame.waitAndAnimOut:Stop(); --Just in case it's already animating out, but we want to reinstate it.
if ( frame:IsMouseOver() ) then
frame.waitAndAnimOut.animOut:SetStartDelay(1);
else
frame.waitAndAnimOut.animOut:SetStartDelay(4.05);
frame.waitAndAnimOut:Play();
end
end
 
Glamour.toc New file
0,0 → 1,8
## Title: Glamour
## Authors: PapaSol
## Notes: An interface for announcing customized alert styled after Blizzard's achievement alerts.
## Version: 1.3.0
## Interface: 40000
## X-Category: Interface Enhancements Notifications Announcements Achievements
## SavedVariables: GlamourConfig
Glamour.xml