режим предателя + UI референсы и DragonUI

This commit is contained in:
2026-04-09 02:05:29 +04:00
parent 1109d19bb5
commit e8f1ae4ab9
397 changed files with 202750 additions and 37 deletions
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,10 @@
## Interface: 30300
## Title: Blizzard_AchievementUI
## Notes: Hooray for Achievements! Everybody loves Achievements =D
## Secure: 1
## Author: Blizzard Entertainment
## Version: 1.0
## LoadOnDemand: 1
Blizzard_AchievementUI.lua
Blizzard_AchievementUI.xml
Localization.lua
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,21 @@
-- This file is executed at the end of addon load
function AchievementFrameSummary_LocalizeButton (button)
end
function AchievementButton_LocalizeMiniAchievement (frame)
end
function AchievementButton_LocalizeProgressBar (frame)
end
function AchievementButton_LocalizeMetaAchievement (frame)
end
function AchievementFrame_LocalizeCriteria (frame)
end
@@ -0,0 +1,335 @@
MAX_ARENA_ENEMIES = 5;
function ArenaEnemyFrames_OnLoad(self)
self:RegisterEvent("CVAR_UPDATE");
self:RegisterEvent("VARIABLES_LOADED");
self:RegisterEvent("PLAYER_ENTERING_WORLD");
if ( GetCVarBool("showArenaEnemyFrames") ) then
ArenaEnemyFrames_Enable(self);
else
ArenaEnemyFrames_Disable(self);
end
local showCastbars = GetCVarBool("showArenaEnemyCastbar");
local castFrame;
for i = 1, MAX_ARENA_ENEMIES do
castFrame = _G["ArenaEnemyFrame"..i.."CastingBar"];
castFrame.showCastbar = showCastbars;
CastingBarFrame_UpdateIsShown(castFrame);
end
UpdateArenaEnemyBackground(GetCVarBool("showPartyBackground"));
ArenaEnemyBackground_SetOpacity(tonumber(GetCVar("partyBackgroundOpacity")));
end
function ArenaEnemyFrames_OnEvent(self, event, ...)
local arg1, arg2 = ...;
if ( (event == "CVAR_UPDATE") and (arg1 == "SHOW_ARENA_ENEMY_FRAMES_TEXT") ) then
if ( arg2 == "1" ) then
ArenaEnemyFrames_Enable(self);
else
ArenaEnemyFrames_Disable(self);
end
elseif ( event == "VARIABLES_LOADED" ) then
if ( GetCVarBool("showArenaEnemyFrames") ) then
ArenaEnemyFrames_Enable(self);
else
ArenaEnemyFrames_Disable(self);
end
local showCastbars = GetCVarBool("showArenaEnemyCastbar");
local castFrame;
for i = 1, MAX_ARENA_ENEMIES do
castFrame = _G["ArenaEnemyFrame"..i.."CastingBar"];
castFrame.showCastbar = showCastbars;
CastingBarFrame_UpdateIsShown(castFrame);
end
for i=1, MAX_ARENA_ENEMIES do
ArenaEnemyFrame_UpdatePet(_G["ArenaEnemyFrame"..i], i, true);
end
UpdateArenaEnemyBackground(GetCVarBool("showPartyBackground"));
ArenaEnemyBackground_SetOpacity(tonumber(GetCVar("partyBackgroundOpacity")));
elseif ( event == "PLAYER_ENTERING_WORLD" ) then
ArenaEnemyFrames_UpdateVisible();
end
end
function ArenaEnemyFrames_OnShow(self)
--Set it up to hide stuff we don't want shown in an arena.
ArenaEnemyFrames_UpdateWatchFrame();
DurabilityFrame_SetAlerts();
UIParent_ManageFramePositions();
end
function ArenaEnemyFrames_UpdateWatchFrame()
local ArenaEnemyFrames = ArenaEnemyFrames;
if ( not WatchFrame:IsUserPlaced() ) then
if ( ArenaEnemyFrames:IsShown() ) then
if ( WatchFrame_RemoveObjectiveHandler(WatchFrame_DisplayTrackedQuests) ) then
ArenaEnemyFrames.hidWatchedQuests = true;
end
else
if ( ArenaEnemyFrames.hidWatchedQuests ) then
WatchFrame_AddObjectiveHandler(WatchFrame_DisplayTrackedQuests);
ArenaEnemyFrames.hidWatchedQuests = false;
end
end
WatchFrame_ClearDisplay();
WatchFrame_Update();
elseif ( ArenaEnemyFrames.hidWatchedQuests ) then
WatchFrame_AddObjectiveHandler(WatchFrame_DisplayTrackedQuests);
ArenaEnemyFrames.hidWatchedQuests = false;
WatchFrame_ClearDisplay();
WatchFrame_Update();
end
end
function ArenaEnemyFrames_OnHide(self)
--Make the stuff that needs to be shown shown again.
ArenaEnemyFrames_UpdateWatchFrame();
DurabilityFrame_SetAlerts();
UIParent_ManageFramePositions();
end
function ArenaEnemyFrames_Enable(self)
self.show = true;
ArenaEnemyFrames_UpdateVisible();
end
function ArenaEnemyFrames_Disable(self)
self.show = false;
ArenaEnemyFrames_UpdateVisible();
end
function ArenaEnemyFrames_UpdateVisible()
local _, instanceType = IsInInstance();
if ( ArenaEnemyFrames.show and (instanceType == "arena")) then
ArenaEnemyFrames:Show();
else
ArenaEnemyFrames:Hide();
end
end
function ArenaEnemyFrame_OnLoad(self)
self.statusCounter = 0;
self.statusSign = -1;
self.unitHPPercent = 1;
self.classPortrait = _G[self:GetName().."ClassPortrait"];
ArenaEnemyFrame_UpdatePlayer(self, true);
self:RegisterEvent("UNIT_PET");
self:RegisterEvent("ARENA_OPPONENT_UPDATE");
self:RegisterEvent("UNIT_NAME_UPDATE");
UIDropDownMenu_Initialize(self.DropDown, ArenaEnemyDropDown_Initialize, "MENU");
local setfocus = function()
FocusUnit("arena"..self:GetID());
end
SecureUnitButton_OnLoad(self, "arena"..self:GetID(), setfocus);
local id = self:GetID();
if ( UnitClass("arena"..id) and (not UnitExists("arena"..id))) then --It is possible for the unit itself to no longer exist on the client, but some of the information to remain (after reloading the UI)
self:Show();
ArenaEnemyFrame_Lock(self);
elseif ( UnitExists("arenapet"..id) and ( not UnitClass("arena"..id) ) ) then --We use UnitClass because even if the unit doesn't exist on the client, we may still have enough info to populate the frame.
ArenaEnemyFrame_SetMysteryPlayer(self);
end
end
function ArenaEnemyFrame_UpdatePlayer(self, useCVars)--At some points, we need to use CVars instead of UVars even though UVars are faster.
local id = self:GetID();
if ( UnitGUID(self.unit) ) then --Use UnitGUID instead of UnitExists in case the unit is a remote update.
self:Show();
UnitFrame_Update(self);
end
local _, class = UnitClass(self.unit);
if( class ) then
self.classPortrait:SetTexture("Interface\\TargetingFrame\\UI-Classes-Circles");
self.classPortrait:SetTexCoord(unpack(CLASS_ICON_TCOORDS[class]));
end
ArenaEnemyFrames_UpdateVisible();
end
function ArenaEnemyFrame_Lock(self)
self.healthbar:SetStatusBarColor(0.5, 0.5, 0.5);
self.healthbar.lockColor = true;
self.manabar:SetStatusBarColor(0.5, 0.5, 0.5);
self.manabar.lockColor = true;
self.hideStatusOnTooltip = true;
end
function ArenaEnemyFrame_Unlock(self)
self.healthbar.lockColor = false;
self.healthbar.forceHideText = false;
self.manabar.lockColor = false;
self.manabar.forceHideText = false;
self.hideStatusOnTooltip = false;
end
function ArenaEnemyFrame_SetMysteryPlayer(self)
self.healthbar:SetMinMaxValues(0,100);
self.healthbar:SetValue(100);
self.healthbar.forceHideText = true;
self.manabar:SetMinMaxValues(0,100);
self.manabar:SetValue(100);
self.manabar.forceHideText = true;
self.classPortrait:SetTexture("Interface\\CharacterFrame\\TempPortrait");
self.classPortrait:SetTexCoord(0, 1, 0, 1);
self.name:SetText("");
ArenaEnemyFrame_Lock(self);
self:Show();
end
function ArenaEnemyFrame_OnEvent(self, event, arg1, arg2)
if ( event == "ARENA_OPPONENT_UPDATE" and arg1 == self.unit ) then
if ( arg2 == "seen" or arg2 == "destroyed") then
ArenaEnemyFrame_Unlock(self);
ArenaEnemyFrame_UpdatePlayer(self);
if ( self.healthbar.frequentUpdates and GetCVarBool("predictedHealth") ) then
self.healthbar:SetScript("OnUpdate", UnitFrameHealthBar_OnUpdate);
self.healthbar:UnregisterEvent("UNIT_HEALTH");
end
if ( self.manabar.frequentUpdates and GetCVarBool("predictedPower") ) then
self.manabar:SetScript("OnUpdate", UnitFrameManaBar_OnUpdate);
UnitFrameManaBar_UnregisterDefaultEvents(self.manabar);
end
UpdateArenaEnemyBackground();
UIParent_ManageFramePositions();
elseif ( arg2 == "unseen" ) then
ArenaEnemyFrame_Lock(self);
self.healthbar:RegisterEvent("UNIT_HEALTH");
self.healthbar:SetScript("OnUpdate", nil);
UnitFrameManaBar_RegisterDefaultEvents(self.manabar);
self.manabar:SetScript("OnUpdate", nil);
elseif ( arg2 == "cleared" ) then
ArenaEnemyFrame_Unlock(self);
self:Hide();
ArenaEnemyFrames_UpdateVisible();
end
elseif ( event == "UNIT_PET" and arg1 == self.unit ) then
ArenaEnemyFrame_UpdatePet(self);
elseif ( event == "UNIT_NAME_UPDATE" and arg1 == self.unit ) then
ArenaEnemyFrame_UpdatePlayer(self);
end
end
function ArenaEnemyFrame_UpdatePet(self, id, useCVars) --At some points, we need to use CVars instead of UVars even though UVars are faster.
if ( not id ) then
id = self:GetID();
end
local unitFrame = _G["ArenaEnemyFrame"..id];
local petFrame = _G["ArenaEnemyFrame"..id.."PetFrame"];
local showArenaEnemyPets = (SHOW_ARENA_ENEMY_PETS == "1");
if ( useCVars ) then
showArenaEnemyPets = GetCVarBool("showArenaEnemyPets");
end
if ( UnitGUID(petFrame.unit) and showArenaEnemyPets) then
petFrame:Show();
else
petFrame:Hide();
end
UnitFrame_Update(petFrame);
end
function ArenaEnemyPetFrame_OnLoad(self)
local id = self:GetParent():GetID();
local prefix = "ArenaEnemyFrame"..id.."PetFrame";
local unit = "arenapet"..id;
UnitFrame_Initialize(self, unit, _G[prefix.."Name"], _G[prefix.."Portrait"],
_G[prefix.."HealthBar"], _G[prefix.."HealthBarText"], _G[prefix.."ManaBar"], _G[prefix.."ManaBarText"]);
SetTextStatusBarTextZeroText(_G[prefix.."HealthBar"], DEAD);
_G[prefix.."Name"]:Hide();
SecureUnitButton_OnLoad(self, unit);
self:SetID(id);
self:SetParent(ArenaEnemyFrames);
ArenaEnemyFrame_UpdatePet(self, id, true);
self:RegisterEvent("ARENA_OPPONENT_UPDATE");
self:RegisterEvent("UNIT_CLASSIFICATION_CHANGED");
UIDropDownMenu_Initialize(self.DropDown, ArenaEnemyPetDropDown_Initialize, "MENU");
local setfocus = function()
FocusUnit("arenapet"..self:GetID());
end
SecureUnitButton_OnLoad(self, "arenapet"..self:GetID(), setfocus);
end
function ArenaEnemyPetFrame_OnEvent(self, event, ...)
local arg1, arg2 = ...;
if ( event == "ARENA_OPPONENT_UPDATE" and arg1 == self.unit ) then
if ( arg2 == "seen" or arg2 == "destroyed") then
ArenaEnemyFrame_Unlock(self);
ArenaEnemyFrame_UpdatePet(self);
UpdateArenaEnemyBackground();
local ownerFrame = _G["ArenaEnemyFrame"..self:GetID()];
if ( not ownerFrame:IsShown() ) then
ArenaEnemyFrame_SetMysteryPlayer(ownerFrame);
ownerFrame:Show();
end
if ( self.healthbar.frequentUpdates and GetCVarBool("predictedHealth") ) then
self.healthbar:SetScript("OnUpdate", UnitFrameHealthBar_OnUpdate);
self.healthbar:UnregisterEvent("UNIT_HEALTH");
end
if ( self.manabar.frequentUpdates and GetCVarBool("predictedPower") ) then
self.manabar:SetScript("OnUpdate", UnitFrameManaBar_OnUpdate);
UnitFrameManaBar_UnregisterDefaultEvents(self.manabar);
end
elseif ( arg2 == "unseen" ) then
ArenaEnemyFrame_Lock(self);
self.healthbar:RegisterEvent("UNIT_HEALTH");
self.healthbar:SetScript("OnUpdate", nil);
UnitFrameManaBar_RegisterDefaultEvents(self.manabar);
self.manabar:SetScript("OnUpdate", nil);
elseif ( arg2 == "cleared" ) then
ArenaEnemyFrame_Unlock(self);
self:Hide()
end
elseif ( event == "UNIT_CLASSIFICATION_CHANGED" and arg1 == self.unit ) then
UnitFrame_Update(self);
end
UnitFrame_OnEvent(self, event, ...);
end
function ArenaEnemyDropDown_Initialize(self)
UnitPopup_ShowMenu(self, "ARENAENEMY", "arena"..self:GetParent():GetID());
end
function ArenaEnemyPetDropDown_Initialize(self)
UnitPopup_ShowMenu(self, "ARENAENEMY", "arenapet"..self:GetParent():GetID());
end
function UpdateArenaEnemyBackground(force)
if ( (SHOW_PARTY_BACKGROUND == "1") or force ) then
ArenaEnemyBackground:Show();
local numOpps = GetNumArenaOpponents();
if ( numOpps > 0 ) then
ArenaEnemyBackground:SetPoint("BOTTOMLEFT", "ArenaEnemyFrame"..numOpps.."PetFrame", "BOTTOMLEFT", -15, -10);
else
ArenaEnemyBackground:Hide();
end
else
ArenaEnemyBackground:Hide();
end
end
function ArenaEnemyBackground_SetOpacity(opacity)
local alpha;
if ( not opacity ) then
alpha = 1.0 - OpacityFrameSlider:GetValue();
else
alpha = 1.0 - opacity;
end
ArenaEnemyBackground:SetAlpha(alpha);
end
@@ -0,0 +1,6 @@
## Interface: 30300
## Title: Blizzard Arena UI
## Secure: 1
## LoadOnDemand: 1
Blizzard_ArenaUI.xml
Localization.lua
@@ -0,0 +1,577 @@
<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="Blizzard_ArenaUI.lua"/>
<StatusBar name="ArenaCastingBarFrameTemplate" drawLayer="BORDER" virtual="true" hidden="true">
<Size>
<AbsDimension x="80" y="14"/>
</Size>
<Layers>
<Layer level="BACKGROUND">
<Texture setAllPoints="true">
<Color r="0" g="0" b="0" a="0.5"/>
</Texture>
</Layer>
<Layer level="ARTWORK">
<Texture name="$parentBorderShield" file="Interface\CastingBar\UI-CastingBar-Arena-Shield" hidden="true">
<Size>
<AbsDimension x="42" y="42"/>
</Size>
<Anchors>
<Anchor point="LEFT">
<Offset>
<AbsDimension x="-25" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<FontString name="$parentText" inherits="GameFontHighlightSmall">
<Size>
<AbsDimension x="80" y="16"/>
</Size>
<Anchors>
<Anchor point="TOP">
<Offset>
<AbsDimension x="0" y="2"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<Texture name="$parentIcon" hidden="true">
<Size>
<AbsDimension x="16" y="16"/>
</Size>
<Anchors>
<Anchor point="RIGHT" relativeTo="$parent" relativePoint="LEFT">
<Offset>
<AbsDimension x="-5" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
</Layer>
<Layer level="OVERLAY">
<Texture name="$parentSpark" file="Interface\CastingBar\UI-CastingBar-Spark" alphaMode="ADD">
<Size>
<AbsDimension x="32" y="32"/>
</Size>
<Anchors>
<Anchor point="CENTER"/>
</Anchors>
</Texture>
<Texture name="$parentFlash" file="" alphaMode="ADD">
<Size>
<AbsDimension x="256" y="64"/>
</Size>
<Anchors>
<Anchor point="TOP">
<Offset>
<AbsDimension x="0" y="28"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnLoad>
CastingBarFrame_OnLoad(self, "arena"..self:GetParent():GetID(), false, true);
_G[self:GetName().."Icon"]:Show();
</OnLoad>
<OnEvent>
CastingBarFrame_OnEvent(self, event, ...);
</OnEvent>
<OnUpdate>
CastingBarFrame_OnUpdate(self, elapsed);
</OnUpdate>
<OnShow>
CastingBarFrame_OnShow(self);
</OnShow>
</Scripts>
<BarTexture file="Interface\TargetingFrame\UI-StatusBar"/>
<BarColor r="1.0" g="0.7" b="0.0"/>
</StatusBar>
<Button name="ArenaEnemyPetFrameTemplate" frameStrata="LOW" toplevel="true" inherits="SecureUnitButtonTemplate" virtual="true" hidden="true">
<Size>
<AbsDimension x="77" y="31"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="15" y="-25"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="ARTWORK">
<Texture name="$parentFlash" file="Interface\TargetingFrame\UI-PartyFrame-Flash" hidden="true">
<Size>
<AbsDimension x="64" y="32"/>
</Size>
<Anchors>
<Anchor point="TOPRIGHT">
<Offset>
<AbsDimension x="1" y="1"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<Texture name="$parentPortrait">
<Size>
<AbsDimension x="22" y="22"/>
</Size>
<Anchors>
<Anchor point="TOPRIGHT">
<Offset>
<AbsDimension x="-3" y="-3"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
</Layer>
</Layers>
<Frames>
<Frame setAllPoints="true">
<Frames>
<Frame setAllPoints="true">
<Layers>
<Layer level="ARTWORK">
<Texture name="$parentTexture" file="Interface\TargetingFrame\UI-PartyFrame">
<Size>
<AbsDimension x="77" y="39"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="0" y="9"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="1.0" right="0" top="1.0" bottom="0.0"/>
</Texture>
<FontString name="$parentName" inherits="GameFontNormalSmall">
<Anchors>
<Anchor point="BOTTOMRIGHT">
<Offset>
<AbsDimension x="-25" y="21"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
</Frame>
</Frames>
</Frame>
<StatusBar name="$parentHealthBar" inherits="TextStatusBar">
<Size>
<AbsDimension x="42" y="4"/>
</Size>
<Anchors>
<Anchor point="TOPRIGHT">
<Offset>
<AbsDimension x="-28" y="-14"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnValueChanged>
UnitFrameHealthBar_OnValueChanged(self, value);
</OnValueChanged>
<OnMouseUp>
self:GetParent():Click(button);
</OnMouseUp>
</Scripts>
<BarTexture file="Interface\TargetingFrame\UI-StatusBar"/>
</StatusBar>
<StatusBar name="$parentManaBar" inherits="TextStatusBar">
<Size>
<AbsDimension x="42" y="4"/>
</Size>
<Anchors>
<Anchor point="TOPRIGHT">
<Offset>
<AbsDimension x="-28" y="-20"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnMouseUp>
self:GetParent():Click(button);
</OnMouseUp>
</Scripts>
<BarTexture file="Interface\TargetingFrame\UI-StatusBar"/>
</StatusBar>
<Frame name="$parentDropDown" inherits="UIDropDownMenuTemplate" id="1" hidden="true" parentKey="DropDown">
<Size>
<AbsDimension x="10" y="10"/>
</Size>
<Anchors>
<Anchor point="TOP">
<Offset>
<AbsDimension x="-20" y="-10"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
</Frames>
<Scripts>
<OnLoad>
ArenaEnemyPetFrame_OnLoad(self);
</OnLoad>
<OnShow>
UnitFrame_Update(self);
</OnShow>
<OnEvent>
ArenaEnemyPetFrame_OnEvent(self, event, ...);
</OnEvent>
<OnEnter>
UnitFrame_OnEnter(self, motion);
</OnEnter>
<OnLeave>
UnitFrame_OnLeave(self, motion);
</OnLeave>
</Scripts>
</Button>
<Button name="ArenaEnemyFrameTemplate" frameStrata="LOW" toplevel="true" movable="true" hidden="true" inherits="SecureUnitButtonTemplate" virtual="true">
<Size>
<AbsDimension x="102" y="32"/>
</Size>
<Layers>
<Layer level="BACKGROUND">
<Texture name="$parentFlash" file="Interface\TargetingFrame\UI-PartyFrame-Flash" hidden="true">
<Size>
<AbsDimension x="128" y="64"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="-3" y="2"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<Texture name="$parentClassPortrait" file="Interface\TargetingFrame\UI-Classes-Circles">
<Size>
<AbsDimension x="30" y="30"/>
</Size>
<Anchors>
<Anchor point="TOPRIGHT">
<Offset>
<AbsDimension x="-1" y="-4"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<Texture name="$parentBackground">
<Size>
<AbsDimension x="72" y="17"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="2" y="-10"/>
</Offset>
</Anchor>
</Anchors>
<Color r="0" g="0" b="0" a="0.5"/>
</Texture>
</Layer>
</Layers>
<Frames>
<Frame name="$parentDropDown" inherits="UIDropDownMenuTemplate" id="1" hidden="true" parentKey="DropDown">
<Size>
<AbsDimension x="10" y="10"/>
</Size>
<Anchors>
<Anchor point="TOP">
<Offset>
<AbsDimension x="-20" y="-10"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame setAllPoints="true">
<Frames>
<Frame setAllPoints="true">
<Layers>
<Layer level="BACKGROUND">
<Texture name="$parentTexture" file="Interface\ArenaEnemyFrame\UI-ArenaTargetingFrame">
<Size>
<AbsDimension x="102" y="32"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="0" y="-2"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0.0" right="0.796" top="0.0" bottom="0.5"/>
</Texture>
<FontString name="$parentName" inherits="GameFontNormalSmall" justifyH="LEFT" parentKey="name">
<Anchors>
<Anchor point="BOTTOMLEFT">
<Offset>
<AbsDimension x="3" y="24"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentHealthBarText" inherits="TextStatusBarText">
<Anchors>
<Anchor point="CENTER">
<Offset>
<AbsDimension x="-20" y="3"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentManaBarText" inherits="TextStatusBarText">
<Anchors>
<Anchor point="CENTER">
<Offset>
<AbsDimension x="-20" y="-6"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
<Layer level="ARTWORK">
<Texture name="$parentStatus" file="Interface\Buttons\UI-Debuff-Overlays" hidden="true">
<Size>
<AbsDimension x="36" y="36"/>
</Size>
<Anchors>
<Anchor point="CENTER" relativeTo="$parentPortrait">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0.0" right="0.2734375" top="0.0" bottom="0.5625"/>
</Texture>
</Layer>
<Layer level="OVERLAY">
<Texture name="$parentDisconnect" file="Interface\CharacterFrame\Disconnect-Icon" hidden="true">
<Size>
<AbsDimension x="64" y="64"/>
</Size>
<Anchors>
<Anchor point="LEFT">
<Offset>
<AbsDimension x="-7" y="-1"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
</Layer>
</Layers>
</Frame>
</Frames>
</Frame>
<StatusBar name="$parentHealthBar" inherits="TextStatusBar">
<Size>
<AbsDimension x="70" y="8"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="2" y="-12"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
TextStatusBar_Initialize(self);
self.textLockable = 1;
self.cvar = "partyStatusText";
self.cvarLabel = "STATUS_TEXT_PARTY";
</OnLoad>
<OnMouseUp>
self:GetParent():Click(button);
</OnMouseUp>
<OnValueChanged>
UnitFrameHealthBar_OnValueChanged(self, value);
</OnValueChanged>
</Scripts>
<BarTexture file="Interface\TargetingFrame\UI-StatusBar"/>
</StatusBar>
<StatusBar name="$parentManaBar" inherits="TextStatusBar">
<Size>
<AbsDimension x="70" y="8"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="2" y="-20"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
TextStatusBar_Initialize(self);
self.textLockable = 1;
self.cvar = "partyStatusText";
self.cvarLabel = "STATUS_TEXT_PARTY";
</OnLoad>
<OnMouseUp>
self:GetParent():Click(button);
</OnMouseUp>
</Scripts>
<BarTexture file="Interface\TargetingFrame\UI-StatusBar"/>
<BarColor r="0" g="0" b="1.0"/>
</StatusBar>
<Button name="$parentPetFrame" inherits="ArenaEnemyPetFrameTemplate" parentKey="petFrame"/>
<StatusBar name="$parentCastingBar" inherits="ArenaCastingBarFrameTemplate">
<Anchors>
<Anchor point="RIGHT" relativePoint="LEFT">
<Offset>
<AbsDimension x="-15" y="-3"/>
</Offset>
</Anchor>
</Anchors>
</StatusBar>
</Frames>
<Scripts>
<OnLoad>
local id = self:GetID();
self.debuffCountdown = 0;
self.numDebuffs = 0;
self.noTextPrefix = 1;
local prefix = "ArenaEnemyFrame"..id;
UnitFrame_Initialize(self, "arena"..id, _G[prefix.."Name"], nil,
_G[prefix.."HealthBar"], _G[prefix.."HealthBarText"],
_G[prefix.."ManaBar"], _G[prefix.."ManaBarText"],
_G[prefix.."Flash"]);
SetTextStatusBarTextZeroText(_G[prefix.."HealthBar"], DEAD);
ArenaEnemyFrame_OnLoad(self);
</OnLoad>
<OnShow>
self:SetFrameLevel(2);
</OnShow>
<OnEvent>
ArenaEnemyFrame_OnEvent(self, event, ...);
</OnEvent>
<OnEnter>
UnitFrame_OnEnter(self);
</OnEnter>
<OnLeave>
UnitFrame_OnLeave(self);
</OnLeave>
</Scripts>
</Button>
<Frame name="ArenaEnemyFrames" hidden="true" parent="UIParent">
<Size>
<AbsDimension x="1" y="1"/>
</Size>
<Anchors>
<Anchor point="TOPRIGHT" relativeTo="MinimapCluster" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="-100" y="-25"/>
</Offset>
</Anchor>
</Anchors>
<Frames>
<Button name="ArenaEnemyFrame1" inherits="ArenaEnemyFrameTemplate" id="1">
<Anchors>
<Anchor point="TOPRIGHT">
<Offset>
<AbsDimension x="-2" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="ArenaEnemyFrame2" inherits="ArenaEnemyFrameTemplate" id="2">
<Anchors>
<Anchor point="TOP" relativeTo="ArenaEnemyFrame1" relativePoint="BOTTOM">
<Offset>
<AbsDimension x="0" y="-20"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="ArenaEnemyFrame3" inherits="ArenaEnemyFrameTemplate" id="3">
<Anchors>
<Anchor point="TOP" relativeTo="ArenaEnemyFrame2" relativePoint="BOTTOM">
<Offset>
<AbsDimension x="0" y="-20"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="ArenaEnemyFrame4" inherits="ArenaEnemyFrameTemplate" id="4">
<Anchors>
<Anchor point="TOP" relativeTo="ArenaEnemyFrame3" relativePoint="BOTTOM">
<Offset>
<AbsDimension x="0" y="-20"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="ArenaEnemyFrame5" inherits="ArenaEnemyFrameTemplate" id="5">
<Anchors>
<Anchor point="TOP" relativeTo="ArenaEnemyFrame4" relativePoint="BOTTOM">
<Offset>
<AbsDimension x="0" y="-20"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Frame name="ArenaEnemyBackground" frameStrata="LOW" enableMouse="true" hidden="true">
<Size>
<AbsDimension x="125" y="10"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="ArenaEnemyFrame1">
<Offset>
<AbsDimension x="-15" y="6"/>
</Offset>
</Anchor>
<Anchor point="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Backdrop bgFile="Interface\CharacterFrame\UI-Party-Background" edgeFile="Interface\ArenaEnemyFrame\UI-Arena-Border" tile="true">
<BackgroundInsets>
<AbsInset left="32" right="32" top="32" bottom="32"/>
</BackgroundInsets>
<TileSize>
<AbsValue val="32"/>
</TileSize>
<EdgeSize>
<AbsValue val="32"/>
</EdgeSize>
</Backdrop>
<Scripts>
<OnLoad>
self:RegisterEvent("VARIABLES_LOADED");
UpdateArenaEnemyBackground();
</OnLoad>
<OnShow>
self:SetFrameLevel(1);
</OnShow>
<OnEvent>
if ( event == "VARIABLES_LOADED" ) then
UpdateArenaEnemyBackground();
OpacityFrameSlider:SetValue(tonumber(GetCVar("partyBackgroundOpacity")));
ArenaEnemyBackground_SetOpacity();
end
</OnEvent>
<OnMouseUp>
if ( button == "RightButton" ) then
PartyMemberBackground_ToggleOpacity(self);
end
</OnMouseUp>
</Scripts>
</Frame>
</Frames>
<Scripts>
<OnLoad function="ArenaEnemyFrames_OnLoad"/>
<OnEvent function="ArenaEnemyFrames_OnEvent"/>
<OnShow function="ArenaEnemyFrames_OnShow"/>
<OnHide function="ArenaEnemyFrames_OnHide"/>
</Scripts>
</Frame>
</Ui>
@@ -0,0 +1 @@
-- This file is executed at the end of addon load
@@ -0,0 +1,35 @@
local DressUpItemLink_orig = DressUpItemLink;
function DressUpItemLink(link)
if ( not link ) then
return;
end
if ( AuctionFrame:IsShown() ) then
if ( not AuctionDressUpFrame:IsShown() ) then
ShowUIPanel(AuctionDressUpFrame);
AuctionDressUpModel:SetUnit("player");
end
AuctionDressUpModel:TryOn(link);
else
DressUpItemLink_orig(link);
end
end
function SetAuctionDressUpBackground()
local texture = DressUpTexturePath();
AuctionDressUpBackgroundTop:SetTexture(texture..1);
AuctionDressUpBackgroundBot:SetTexture(texture..3);
end
function AuctionDressUpFrame_OnShow()
UIPanelWindows["AuctionFrame"].width = 1020;
UpdateUIPanelPositions(AuctionFrame);
PlaySound("igCharacterInfoOpen");
end
function AuctionDressUpFrame_OnHide()
UIPanelWindows["AuctionFrame"].width = 840;
UpdateUIPanelPositions();
PlaySound("igCharacterInfoClose");
end
@@ -0,0 +1,175 @@
<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="Blizzard_AuctionDressUp.lua"/>
<Frame name="AuctionDressUpFrame" toplevel="true" parent="UIParent" enableMouse="true" hidden="true">
<Size>
<AbsDimension x="187" y="389"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="AuctionFrame" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="-2" y="-28"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture name="AuctionDressUpFrameTop" file="Interface\AuctionFrame\AuctionHouseDressUpFrame-Top">
<Size>
<AbsDimension x="256" y="256"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT"/>
</Anchors>
</Texture>
<Texture file="Interface\AuctionFrame\AuctionHouseDressUpFrame-Bottom">
<Size>
<AbsDimension x="256" y="256"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="AuctionDressUpFrameTop" relativePoint="BOTTOMLEFT"/>
</Anchors>
</Texture>
</Layer>
<Layer level="ARTWORK">
<Texture name="AuctionDressUpBackgroundTop">
<Size>
<AbsDimension x="171" y="282"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="5" y="-14"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0" right="0.61" top="0" bottom="1.0"/>
</Texture>
<Texture name="AuctionDressUpBackgroundBot">
<Size>
<AbsDimension x="171" y="83"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="AuctionDressUpBackgroundTop" relativePoint="BOTTOMLEFT"/>
</Anchors>
<TexCoords left="0" right="0.61" top="0" bottom="0.588"/>
</Texture>
</Layer>
</Layers>
<Frames>
<DressUpModel name="AuctionDressUpModel" scale="1.0">
<Size>
<AbsDimension x="172" y="400"/>
</Size>
<Anchors>
<Anchor point="BOTTOM">
<Offset>
<AbsDimension x="-3" y="-20"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad function="Model_OnLoad"/>
<OnUpdate function="Model_OnUpdate"/>
</Scripts>
<Frames>
<Button name="AuctionDressUpModelRotateLeftButton">
<Size>
<AbsDimension x="35" y="35"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="AuctionDressUpFrame">
<Offset>
<AbsDimension x="3" y="-15"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
self:RegisterForClicks("LeftButtonDown", "LeftButtonUp");
</OnLoad>
<OnClick>
Model_RotateLeft(self:GetParent());
</OnClick>
</Scripts>
<NormalTexture file="Interface\Buttons\UI-RotationLeft-Button-Up"/>
<PushedTexture file="Interface\Buttons\UI-RotationLeft-Button-Down"/>
<HighlightTexture file="Interface\Buttons\ButtonHilight-Round" alphaMode="ADD"/>
</Button>
<Button name="AuctionDressUpModelRotateRightButton">
<Size>
<AbsDimension x="35" y="35"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="AuctionDressUpModelRotateLeftButton" relativePoint="TOPRIGHT"/>
</Anchors>
<Scripts>
<OnLoad>
self:RegisterForClicks("LeftButtonDown", "LeftButtonUp");
</OnLoad>
<OnClick>
Model_RotateRight(self:GetParent());
</OnClick>
</Scripts>
<NormalTexture file="Interface\Buttons\UI-RotationRight-Button-Up"/>
<PushedTexture file="Interface\Buttons\UI-RotationRight-Button-Down"/>
<HighlightTexture file="Interface\Buttons\ButtonHilight-Round" alphaMode="ADD"/>
</Button>
<Button name="AuctionDressUpFrameResetButton" inherits="UIPanelButtonTemplate" text="RESET">
<Size>
<AbsDimension x="80" y="22"/>
</Size>
<Anchors>
<Anchor point="BOTTOM">
<Offset>
<AbsDimension x="0" y="40"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
AuctionDressUpModel:Dress();
PlaySound("gsTitleOptionOK");
</OnClick>
</Scripts>
</Button>
<Button name="AuctionDressUpFrameCloseButton" inherits="UIPanelCloseButton">
<Anchors>
<Anchor point="CENTER" relativeTo="AuctionDressUpFrame" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="-15" y="-16"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture file="Interface\AuctionFrame\AuctionHouseDressUpFrame-Corner">
<Size>
<AbsDimension x="32" y="32"/>
</Size>
<Anchors>
<Anchor point="TOPRIGHT" relativeTo="AuctionDressUpFrame">
<Offset>
<AbsDimension x="-5" y="-5"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnClick>
HideUIPanel(self:GetParent():GetParent());
</OnClick>
</Scripts>
</Button>
</Frames>
</DressUpModel>
</Frames>
<Scripts>
<OnLoad function="SetAuctionDressUpBackground"/>
<OnShow function="AuctionDressUpFrame_OnShow"/>
<OnHide function="AuctionDressUpFrame_OnHide"/>
</Scripts>
</Frame>
</Ui>
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,7 @@
## Interface: 30300
## Title: Blizzard Auction UI
## Secure: 1
## LoadOnDemand: 1
Blizzard_AuctionUI.xml
Blizzard_AuctionDressUp.xml
Localization.lua
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,977 @@
<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">
<Button name="AuctionClassButtonTemplate" virtual="true">
<Size>
<AbsDimension x="136" y="20"/>
</Size>
<Layers>
<Layer level="BACKGROUND">
<Texture name="$parentLines" file="Interface\AuctionFrame\UI-AuctionFrame-FilterLines">
<Size>
<AbsDimension x="7" y="20"/>
</Size>
<Anchors>
<Anchor point="LEFT">
<Offset>
<AbsDimension x="13" y="0"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0" right="0.4375" top="0" bottom="0.625"/>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnClick>
AuctionFrameFilter_OnClick(self, button, down);
</OnClick>
</Scripts>
<NormalTexture name="$parentNormalTexture" file="Interface\AuctionFrame\UI-AuctionFrame-FilterBg">
<TexCoords left="0" right="0.53125" top="0" bottom="0.625"/>
</NormalTexture>
<HighlightTexture file="Interface\PaperDollInfoFrame\UI-Character-Tab-Highlight" alphaMode="ADD"/>
<ButtonText name="$parentNormalText">
<Size>
<AbsDimension x="115" y="8"/>
</Size>
<Anchors>
<Anchor point="LEFT">
<Offset>
<AbsDimension x="4" y="0"/>
</Offset>
</Anchor>
</Anchors>
</ButtonText>
<NormalFont style="GameFontNormalSmallLeft"/>
<HighlightFont style="GameFontHighlightSmallLeft"/>
</Button>
<Button name="AuctionSortButtonTemplate" virtual="true">
<Layers>
<Layer level="BACKGROUND">
<Texture name="$parentLeft" file="Interface\FriendsFrame\WhoFrame-ColumnTabs">
<Size>
<AbsDimension x="5" y="19"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT"/>
</Anchors>
<TexCoords left="0" right="0.078125" top="0" bottom="0.59375"/>
</Texture>
<Texture name="$parentRight" file="Interface\FriendsFrame\WhoFrame-ColumnTabs">
<Size>
<AbsDimension x="4" y="19"/>
</Size>
<Anchors>
<Anchor point="TOPRIGHT"/>
</Anchors>
<TexCoords left="0.90625" right="0.96875" top="0" bottom="0.59375"/>
</Texture>
<Texture name="$parentMiddle" file="Interface\FriendsFrame\WhoFrame-ColumnTabs">
<Size>
<AbsDimension x="10" y="19"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativeTo="$parentLeft" relativePoint="RIGHT"/>
<Anchor point="RIGHT" relativeTo="$parentRight" relativePoint="LEFT"/>
</Anchors>
<TexCoords left="0.078125" right="0.90625" top="0" bottom="0.59375"/>
</Texture>
</Layer>
</Layers>
<ButtonText name="$parentText">
<Anchors>
<Anchor point="LEFT">
<Offset>
<AbsDimension x="8" y="0"/>
</Offset>
</Anchor>
</Anchors>
</ButtonText>
<NormalFont style="GameFontHighlightSmall"/>
<NormalTexture name="$parentArrow" file="Interface\Buttons\UI-SortArrow">
<Size>
<AbsDimension x="9" y="8"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativeTo="$parentText" relativePoint="RIGHT">
<Offset>
<AbsDimension x="3" y="-2"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0" right="0.5625" top="0" bottom="1.0"/>
</NormalTexture>
<HighlightTexture file="Interface\PaperDollInfoFrame\UI-Character-Tab-Highlight" alphaMode="ADD">
<Size>
<AbsDimension x="5" y="24"/>
</Size>
<Anchors>
<Anchor point="LEFT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
<Anchor point="RIGHT">
<Offset>
<AbsDimension x="4" y="0"/>
</Offset>
</Anchor>
</Anchors>
</HighlightTexture>
</Button>
<Button name="BrowseButtonTemplate" hidden="false" virtual="true">
<Size>
<AbsDimension x="597" y="37"/>
</Size>
<Layers>
<Layer level="BACKGROUND">
<FontString name="$parentName" inherits="GameFontNormal" justifyH="LEFT">
<Size>
<AbsDimension x="167" y="32"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="43" y="0"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentLevel" inherits="GameFontHighlightSmall">
<Size>
<AbsDimension x="52" y="32"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="205" y="0"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentHighBidder" inherits="GameFontHighlightSmall">
<Size>
<AbsDimension x="78" y="32"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="345" y="0"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<Texture name="$parentLeft" file="Interface\AuctionFrame\UI-AuctionItemNameFrame">
<Size>
<AbsDimension x="10" y="32"/>
</Size>
<Anchors>
<Anchor point="LEFT">
<Offset>
<AbsDimension x="34" y="2"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0" right="0.078125" top="0" bottom="1.0"/>
</Texture>
<Texture name="$parentRight" file="Interface\AuctionFrame\UI-AuctionItemNameFrame">
<Size>
<AbsDimension x="10" y="32"/>
</Size>
<Anchors>
<Anchor point="RIGHT">
<Offset>
<AbsDimension x="0" y="2"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0.75" right="0.828125" top="0" bottom="1.0"/>
</Texture>
<Texture file="Interface\AuctionFrame\UI-AuctionItemNameFrame">
<Size>
<AbsDimension x="10" y="32"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativeTo="$parentLeft" relativePoint="RIGHT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
<Anchor point="RIGHT" relativeTo="$parentRight" relativePoint="LEFT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0.078125" right="0.75" top="0" bottom="1.0"/>
</Texture>
</Layer>
</Layers>
<Frames>
<Button name="$parentItem">
<Size>
<AbsDimension x="32" y="32"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="BORDER">
<Texture name="$parentIconTexture"/>
<FontString name="$parentCount" inherits="NumberFontNormal" justifyH="RIGHT" hidden="true">
<Anchors>
<Anchor point="BOTTOMRIGHT">
<Offset>
<AbsDimension x="-5" y="2"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentStock" inherits="NumberFontNormalYellow" justifyH="LEFT" hidden="true">
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="0" y="-2"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnEnter>
self:GetParent():LockHighlight();
AuctionFrameItem_OnEnter(self, "list", self:GetParent():GetID() + FauxScrollFrame_GetOffset(BrowseScrollFrame));
</OnEnter>
<OnLeave>
local selected = GetSelectedAuctionItem("list");
if ( selected and ( selected == self:GetParent():GetID() + FauxScrollFrame_GetOffset(BrowseScrollFrame) ) ) then
<!-- Do nothing -->
else
self:GetParent():UnlockHighlight();
end
GameTooltip:Hide();
ResetCursor();
</OnLeave>
<OnClick>
if ( IsModifiedClick() ) then
HandleModifiedItemClick(GetAuctionItemLink("list", self:GetParent():GetID() + FauxScrollFrame_GetOffset(BrowseScrollFrame)));
else
BrowseButton_OnClick(self:GetParent());
end
</OnClick>
<OnUpdate>
if ( GameTooltip:IsOwned(self) ) then
AuctionFrameItem_OnEnter(self, "list", self:GetParent():GetID() + FauxScrollFrame_GetOffset(BrowseScrollFrame));
end
</OnUpdate>
</Scripts>
<NormalTexture name="$parentNormalTexture" file="Interface\Buttons\UI-Quickslot2">
<Size>
<AbsDimension x="60" y="60"/>
</Size>
<Anchors>
<Anchor point="CENTER">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</NormalTexture>
<PushedTexture file="Interface\Buttons\UI-Quickslot-Depress"/>
<HighlightTexture file="Interface\Buttons\ButtonHilight-Square" alphaMode="ADD"/>
</Button>
<Frame name="$parentClosingTime" enableMouse="true">
<Size>
<AbsDimension x="65" y="32"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="267" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<FontString name="$parentText" inherits="GameFontHighlightSmall">
<Size>
<AbsDimension x="65" y="32"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT"/>
</Anchors>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnEnter>
self:GetParent():LockHighlight();
GameTooltip:SetOwner(self);
GameTooltip:SetText(self.tooltip);
</OnEnter>
<OnLeave>
local selected = GetSelectedAuctionItem("list");
if ( selected and ( selected == self:GetParent():GetID() + FauxScrollFrame_GetOffset(BrowseScrollFrame) ) ) then
<!-- Do nothing -->
else
self:GetParent():UnlockHighlight();
end
GameTooltip:Hide();
</OnLeave>
</Scripts>
</Frame>
<Frame name="$parentMoneyFrame" inherits="SmallMoneyFrameTemplate">
<Anchors>
<Anchor point="RIGHT">
<Offset>
<AbsDimension x="10" y="3"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
SmallMoneyFrame_OnLoad(self);
MoneyFrame_SetType(self, "AUCTION");
</OnLoad>
</Scripts>
</Frame>
<Button name="$parentYourBidText" hidden="true">
<Size>
<AbsDimension x="10" y="11"/>
</Size>
<Anchors>
<Anchor point="RIGHT" relativeTo="$parentMoneyFrame" relativePoint="LEFT">
<Offset>
<AbsDimension x="-5" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<FontString inherits="GameFontNormalSmall" text="YOUR_BID" justifyH="RIGHT"/>
</Layer>
</Layers>
</Button>
<Frame name="$parentBuyoutFrame">
<!-- width is meaningless here, see anchors -->
<Size x="1" y="13"/>
<Anchors>
<Anchor point="LEFT" relativeTo="BrowseCurrentBidSort">
<Offset x="4" y="0"/>
</Anchor>
<Anchor point="TOPRIGHT" relativeTo="$parentMoneyFrame" relativePoint="BOTTOMRIGHT">
<Offset x="0" y="-1"/>
</Anchor>
</Anchors>
<Frames>
<Frame name="$parentMoney" inherits="SmallMoneyFrameTemplate">
<Anchors>
<Anchor point="RIGHT"/>
</Anchors>
<Scripts>
<OnLoad>
SmallMoneyFrame_OnLoad(self);
MoneyFrame_SetType(self, "AUCTION");
SetMoneyFrameColor(self:GetName(), "yellow")
</OnLoad>
</Scripts>
</Frame>
<Frame name="$parentText">
<!-- NOTE: this size is here to get the FontString to show up -->
<Size x="1" y="1"/>
<Anchors>
<Anchor point="TOPLEFT"/>
<Anchor point="BOTTOMRIGHT" relativeTo="$parentMoney" relativePoint="BOTTOMLEFT">
<Offset x="-2" y="0"/>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<FontString inherits="GameFontNormalSmallLeft" setAllPoints="true" text="BUYOUT_COST"/>
</Layer>
</Layers>
</Frame>
</Frames>
</Frame>
</Frames>
<Scripts>
<OnClick>
if ( IsModifiedClick() ) then
HandleModifiedItemClick(GetAuctionItemLink("list", self:GetID() + FauxScrollFrame_GetOffset(BrowseScrollFrame)));
else
BrowseButton_OnClick(self);
end
</OnClick>
</Scripts>
<HighlightTexture name="$parentHighlight" file="Interface\HelpFrame\HelpFrameButton-Highlight" alphaMode="ADD">
<Size>
<AbsDimension x="523" y="32"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="33" y="0"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0" right="1.0" top="0" bottom="0.578125"/>
</HighlightTexture>
</Button>
<Button name="BidButtonTemplate" hidden="false" virtual="true">
<Size>
<AbsDimension x="793" y="37"/>
</Size>
<Layers>
<Layer level="BACKGROUND">
<FontString name="$parentName" inherits="GameFontNormal" justifyH="LEFT">
<Size>
<AbsDimension x="187" y="32"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="41" y="0"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentLevel" inherits="GameFontHighlightSmall">
<Size>
<AbsDimension x="32" y="32"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="250" y="0"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentBidStatus" inherits="GameFontHighlightSmall">
<Size>
<AbsDimension x="75" y="32"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="543" y="0"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<Texture name="$parentLeft" file="Interface\AuctionFrame\UI-AuctionItemNameFrame">
<Size>
<AbsDimension x="10" y="32"/>
</Size>
<Anchors>
<Anchor point="LEFT">
<Offset>
<AbsDimension x="34" y="2"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0" right="0.078125" top="0" bottom="1.0"/>
</Texture>
<Texture name="$parentRight" file="Interface\AuctionFrame\UI-AuctionItemNameFrame">
<Size>
<AbsDimension x="10" y="32"/>
</Size>
<Anchors>
<Anchor point="RIGHT">
<Offset>
<AbsDimension x="0" y="2"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0.75" right="0.828125" top="0" bottom="1.0"/>
</Texture>
<Texture file="Interface\AuctionFrame\UI-AuctionItemNameFrame">
<Size>
<AbsDimension x="10" y="32"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativeTo="$parentLeft" relativePoint="RIGHT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
<Anchor point="RIGHT" relativeTo="$parentRight" relativePoint="LEFT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0.078125" right="0.75" top="0" bottom="1.0"/>
</Texture>
</Layer>
</Layers>
<Frames>
<Button name="$parentItem">
<Size>
<AbsDimension x="32" y="32"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="BORDER">
<Texture name="$parentIconTexture"/>
<FontString name="$parentCount" inherits="NumberFontNormal" justifyH="RIGHT" hidden="true">
<Anchors>
<Anchor point="BOTTOMRIGHT">
<Offset>
<AbsDimension x="-5" y="2"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentStock" inherits="NumberFontNormalYellow" justifyH="LEFT" hidden="true">
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="0" y="-2"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnEnter>
self:GetParent():LockHighlight();
AuctionFrameItem_OnEnter(self, "bidder", self:GetParent():GetID() + FauxScrollFrame_GetOffset(BidScrollFrame));
</OnEnter>
<OnLeave>
local selected = GetSelectedAuctionItem("bidder");
if ( selected and ( selected == self:GetParent():GetID() + FauxScrollFrame_GetOffset(BidScrollFrame) ) ) then
<!-- Do nothing -->
else
self:GetParent():UnlockHighlight();
end
GameTooltip:Hide();
ResetCursor();
</OnLeave>
<OnClick>
if ( IsModifiedClick() ) then
HandleModifiedItemClick(GetAuctionItemLink("bidder", self:GetParent():GetID() + FauxScrollFrame_GetOffset(BidScrollFrame)));
else
BidButton_OnClick(self:GetParent());
end
</OnClick>
<OnUpdate>
if ( GameTooltip:IsOwned(self) ) then
AuctionFrameItem_OnEnter(self, "bidder", self:GetParent():GetID() + FauxScrollFrame_GetOffset(BidScrollFrame));
end
</OnUpdate>
</Scripts>
<NormalTexture name="$parentNormalTexture" file="Interface\Buttons\UI-Quickslot2">
<Size>
<AbsDimension x="60" y="60"/>
</Size>
<Anchors>
<Anchor point="CENTER">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</NormalTexture>
<PushedTexture file="Interface\Buttons\UI-Quickslot-Depress"/>
<HighlightTexture file="Interface\Buttons\ButtonHilight-Square" alphaMode="ADD"/>
</Button>
<Frame name="$parentClosingTime" enableMouse="true">
<Size>
<AbsDimension x="75" y="32"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="295" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<FontString name="$parentText" inherits="GameFontHighlightSmall">
<Size>
<AbsDimension x="75" y="32"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT"/>
</Anchors>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnEnter>
self:GetParent():LockHighlight();
GameTooltip:SetOwner(self);
GameTooltip:SetText(self.tooltip);
</OnEnter>
<OnLeave>
local selected = GetSelectedAuctionItem("bidder");
if ( selected and ( selected == self:GetParent():GetID() + FauxScrollFrame_GetOffset(BidScrollFrame) ) ) then
<!-- Do nothing -->
else
self:GetParent():UnlockHighlight();
end
GameTooltip:Hide();
</OnLeave>
</Scripts>
</Frame>
<Frame name="$parentBuyoutMoneyFrame" inherits="SmallMoneyFrameTemplate">
<Anchors>
<Anchor point="RIGHT" relativePoint="LEFT">
<Offset>
<AbsDimension x="535" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
SmallMoneyFrame_OnLoad(self);
MoneyFrame_SetType(self, "AUCTION");
</OnLoad>
</Scripts>
</Frame>
<Frame name="$parentCurrentBidMoneyFrame" inherits="SmallMoneyFrameTemplate">
<Anchors>
<Anchor point="RIGHT">
<Offset>
<AbsDimension x="2" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
SmallMoneyFrame_OnLoad(self);
MoneyFrame_SetType(self, "AUCTION");
</OnLoad>
</Scripts>
</Frame>
</Frames>
<Scripts>
<OnClick>
if ( IsModifiedClick() ) then
HandleModifiedItemClick(GetAuctionItemLink("bidder", self:GetID() + FauxScrollFrame_GetOffset(BidScrollFrame)));
else
BidButton_OnClick(self);
end
</OnClick>
</Scripts>
<HighlightTexture name="$parentHighlight" file="Interface\HelpFrame\HelpFrameButton-Highlight" alphaMode="ADD">
<Size>
<AbsDimension x="670" y="32"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="33" y="0"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0" right="1.0" top="0" bottom="0.578125"/>
</HighlightTexture>
</Button>
<Button name="AuctionsButtonTemplate" hidden="false" virtual="true">
<Size>
<AbsDimension x="576" y="37"/>
</Size>
<Layers>
<Layer level="BACKGROUND">
<FontString name="$parentName" inherits="GameFontNormal" justifyH="LEFT">
<Size>
<AbsDimension x="142" y="28"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="43" y="0"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentHighBidder" inherits="GameFontHighlightSmall">
<Size>
<AbsDimension x="104" y="28"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="279" y="0"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<Texture name="$parentLeft" file="Interface\AuctionFrame\UI-AuctionItemNameFrame">
<Size>
<AbsDimension x="10" y="32"/>
</Size>
<Anchors>
<Anchor point="LEFT">
<Offset>
<AbsDimension x="34" y="2"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0" right="0.078125" top="0" bottom="1.0"/>
</Texture>
<Texture name="$parentRight" file="Interface\AuctionFrame\UI-AuctionItemNameFrame">
<Size>
<AbsDimension x="10" y="32"/>
</Size>
<Anchors>
<Anchor point="RIGHT">
<Offset>
<AbsDimension x="0" y="2"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0.75" right="0.828125" top="0" bottom="1.0"/>
</Texture>
<Texture file="Interface\AuctionFrame\UI-AuctionItemNameFrame">
<Size>
<AbsDimension x="10" y="32"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativeTo="$parentLeft" relativePoint="RIGHT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
<Anchor point="RIGHT" relativeTo="$parentRight" relativePoint="LEFT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0.078125" right="0.75" top="0" bottom="1.0"/>
</Texture>
</Layer>
</Layers>
<Frames>
<Button name="$parentItem">
<Size>
<AbsDimension x="32" y="32"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="BORDER">
<Texture name="$parentIconTexture"/>
<FontString name="$parentCount" inherits="NumberFontNormal" justifyH="RIGHT" hidden="true">
<Anchors>
<Anchor point="BOTTOMRIGHT">
<Offset>
<AbsDimension x="-5" y="2"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentStock" inherits="NumberFontNormalYellow" justifyH="LEFT" hidden="true">
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="0" y="-2"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnEnter>
self:GetParent():LockHighlight();
AuctionFrameItem_OnEnter(self, "owner", self:GetParent():GetID() + FauxScrollFrame_GetOffset(AuctionsScrollFrame));
</OnEnter>
<OnLeave>
local selected = GetSelectedAuctionItem("owner");
if ( selected and ( selected == ( self:GetParent():GetID() + FauxScrollFrame_GetOffset(AuctionsScrollFrame) ) ) ) then
<!-- Do nothing -->
else
self:GetParent():UnlockHighlight();
end
GameTooltip:Hide();
ResetCursor();
</OnLeave>
<OnClick>
if ( IsModifiedClick() ) then
HandleModifiedItemClick(GetAuctionItemLink("owner", self:GetParent():GetID() + FauxScrollFrame_GetOffset(AuctionsScrollFrame)));
else
AuctionsButton_OnClick(self:GetParent());
end
</OnClick>
<OnUpdate>
if ( GameTooltip:IsOwned(self) ) then
AuctionFrameItem_OnEnter(self, "owner", self:GetParent():GetID() + FauxScrollFrame_GetOffset(AuctionsScrollFrame));
end
</OnUpdate>
</Scripts>
<NormalTexture name="$parentNormalTexture" file="Interface\Buttons\UI-Quickslot2">
<Size>
<AbsDimension x="60" y="60"/>
</Size>
<Anchors>
<Anchor point="CENTER">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</NormalTexture>
<PushedTexture file="Interface\Buttons\UI-Quickslot-Depress"/>
<HighlightTexture file="Interface\Buttons\ButtonHilight-Square" alphaMode="ADD"/>
</Button>
<Frame name="$parentClosingTime" enableMouse="true">
<Size>
<AbsDimension x="65" y="28"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="191" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<FontString name="$parentText" inherits="GameFontHighlightSmall">
<Size>
<AbsDimension x="65" y="28"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT"/>
</Anchors>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnEnter>
self:GetParent():LockHighlight();
GameTooltip:SetOwner(self);
GameTooltip:SetText(self.tooltip);
</OnEnter>
<OnLeave>
local selected = GetSelectedAuctionItem("owner");
if ( selected and ( selected == ( self:GetParent():GetID() + FauxScrollFrame_GetOffset(AuctionsScrollFrame) ) ) ) then
<!-- Do nothing -->
else
self:GetParent():UnlockHighlight();
end
GameTooltip:Hide();
</OnLeave>
</Scripts>
</Frame>
<Frame name="$parentMoneyFrame" inherits="SmallMoneyFrameTemplate">
<Anchors>
<Anchor point="RIGHT">
<Offset>
<AbsDimension x="10" y="3"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<FontString name="$parentLabel" inherits="GameFontNormalSmall" text="AUCTION_ITEM_INCOMING_AMOUNT" hidden="true">
<Size x="0" y="12"/>
<Anchors>
<Anchor point="BOTTOMRIGHT" relativePoint="TOPRIGHT">
<Offset x="-14" y="3"/>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnLoad>
SmallMoneyFrame_OnLoad(self);
MoneyFrame_SetType(self, "AUCTION");
</OnLoad>
</Scripts>
</Frame>
<Frame name="$parentBuyoutFrame" hidden="true">
<!-- width is meaningless here, see anchors -->
<Size x="1" y="13"/>
<Anchors>
<Anchor point="LEFT" relativeTo="AuctionsBidSort">
<Offset x="2" y="0"/>
</Anchor>
<Anchor point="TOPRIGHT" relativeTo="$parentMoneyFrame" relativePoint="BOTTOMRIGHT">
<Offset x="0" y="-1"/>
</Anchor>
</Anchors>
<Frames>
<Frame name="$parentMoney" inherits="SmallMoneyFrameTemplate">
<Anchors>
<Anchor point="RIGHT"/>
</Anchors>
<Scripts>
<OnLoad>
SmallMoneyFrame_OnLoad(self);
MoneyFrame_SetType(self, "AUCTION");
</OnLoad>
</Scripts>
</Frame>
<Frame name="$parentText">
<!-- NOTE: this size is here to get the FontString to show up -->
<Size x="1" y="1"/>
<Anchors>
<Anchor point="TOPLEFT"/>
<Anchor point="BOTTOMRIGHT" relativeTo="$parentMoney" relativePoint="BOTTOMLEFT">
<Offset x="-2" y="0"/>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<FontString inherits="GameFontNormalSmallLeft" text="BUYOUT" setAllPoints="true"/>
</Layer>
</Layers>
</Frame>
</Frames>
</Frame>
</Frames>
<Scripts>
<OnClick>
if ( IsModifiedClick() ) then
HandleModifiedItemClick(GetAuctionItemLink("owner", self:GetID() + FauxScrollFrame_GetOffset(AuctionsScrollFrame)));
else
AuctionsButton_OnClick(self);
end
</OnClick>
</Scripts>
<HighlightTexture name="$parentHighlight" file="Interface\HelpFrame\HelpFrameButton-Highlight" alphaMode="ADD">
<Size>
<AbsDimension x="540" y="32"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="33" y="0"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0" right="1.0" top="0" bottom="0.578125"/>
</HighlightTexture>
</Button>
<Button name="AuctionTabTemplate" inherits="CharacterFrameTabButtonTemplate" virtual="true">
<Scripts>
<OnClick>
AuctionFrameTab_OnClick(self, button, down);
</OnClick>
</Scripts>
</Button>
</Ui>
@@ -0,0 +1 @@
-- This file is executed at the end of addon load
@@ -0,0 +1,111 @@
function BarberShop_OnLoad(self)
BarberShop_UpdateHairCustomization();
BarberShop_UpdateFacialHairCustomization();
self:RegisterEvent("BARBER_SHOP_APPEARANCE_APPLIED");
self:RegisterEvent("BARBER_SHOP_SUCCESS");
if ( CanAlterSkin() ) then
BarberShop_ToFourAttributeFormat();
end
end
function BarberShop_OnShow(self)
CloseAllBags();
BarberShop_ResetLabelColors();
BarberShop_UpdateCost();
if ( BarberShopBannerFrame ) then
BarberShopBannerFrame:Show();
BarberShopBannerFrame.caption:SetText(BARBERSHOP);
end
self:ClearAllPoints();
self:SetPoint("RIGHT", min(-50, -CONTAINER_OFFSET_X), -50);
PlaySound("BarberShop_Sit");
WatchFrame:Hide();
--load the texture
BarberShopFrameBackground:SetTexture("Interface\\Barbershop\\UI-Barbershop");
end
function BarberShop_OnHide(self)
BarberShopBannerFrame:Hide();
WatchFrame:Show();
--unload the texture to save memory
BarberShopFrameBackground:SetTexture(nil);
end
function BarberShop_OnEvent(self, event, ...)
if(event == "BARBER_SHOP_SUCCESS") then
PlaySound("Barbershop_Haircut");
end
BarberShop_Update(self);
end
function BarberShop_UpdateCost()
MoneyFrame_Update(BarberShopFrameMoneyFrame:GetName(), GetBarberShopTotalCost());
-- The 4th return from GetBarberShopStyleInfo is whether the selected style is the active character style
if ( select(4, GetBarberShopStyleInfo(1)) and select(4, GetBarberShopStyleInfo(2)) and select(4, GetBarberShopStyleInfo(3)) and ( not BarberShopFrameSelector4:IsShown() or select(4, GetBarberShopStyleInfo(4)) ) ) then
BarberShopFrameOkayButton:Disable();
BarberShopFrameResetButton:Disable();
else
BarberShopFrameOkayButton:Enable();
BarberShopFrameResetButton:Enable();
end
end
function BarberShop_UpdateBanner(name)
if ( name ) then
BarberShopBannerFrameCaption:SetText(name);
end
end
function BarberShop_Update(self)
BarberShop_UpdateCost();
BarberShop_UpdateSelector(BarberShopFrameSelector4);
BarberShop_UpdateSelector(BarberShopFrameSelector3);
BarberShop_UpdateSelector(BarberShopFrameSelector2);
BarberShop_UpdateSelector(BarberShopFrameSelector1);
end
function BarberShop_UpdateSelector(self)
local name, _, _, isCurrent = GetBarberShopStyleInfo(self:GetID());
BarberShop_UpdateBanner(name);
local frameName = self:GetName();
BarberShop_SetLabelColor(_G[frameName.."Category"], isCurrent);
end
function BarberShop_UpdateHairCustomization()
local hairCustomization = GetHairCustomization();
BarberShopFrameSelector1Category:SetText(_G["HAIR_"..hairCustomization.."_STYLE"]);
BarberShopFrameSelector2Category:SetText(_G["HAIR_"..hairCustomization.."_COLOR"]);
end
function BarberShop_UpdateFacialHairCustomization()
BarberShopFrameSelector3Category:SetText(_G["FACIAL_HAIR_"..GetFacialHairCustomization()]);
end
function BarberShop_SetLabelColor(label, isCurrent)
if ( isCurrent ) then
label:SetTextColor(HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b);
else
label:SetTextColor(NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b);
end
end
function BarberShop_ResetLabelColors()
BarberShop_SetLabelColor(BarberShopFrameSelector1Category, 1);
BarberShop_SetLabelColor(BarberShopFrameSelector2Category, 1);
BarberShop_SetLabelColor(BarberShopFrameSelector3Category, 1);
BarberShop_SetLabelColor(BarberShopFrameSelector4Category, 1);
end
function BarberShop_ToFourAttributeFormat()
BarberShopFrameSelector2:SetPoint("TOPLEFT", BarberShopFrameSelector1, "BOTTOMLEFT", 0, 3);
BarberShopFrameSelector3:SetPoint("TOPLEFT", BarberShopFrameSelector2, "BOTTOMLEFT", 0, 3);
BarberShopFrameSelector4:Show();
BarberShopFrameMoneyFrame:SetPoint("TOP", BarberShopFrameSelector4, "BOTTOM", 7, -7);
BarberShopFrameOkayButton:SetPoint("RIGHT", BarberShopFrameSelector4, "BOTTOM", -2, -36);
end
@@ -0,0 +1,10 @@
## Interface: 30300
## Title: Blizzard Barber Shop UI
## Notes: The barber's blade went snicker-snack! Have you seen my Jabberwocky?
## Secure: 1
## Author: Blizzard Entertainment
## Version: 1.0
## LoadOnDemand: 1
Blizzard_BarberShopUI.lua
Blizzard_BarberShopUI.xml
Localization.lua
@@ -0,0 +1,277 @@
<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">
<Frame name="BarberShopSelectorTemplate" virtual="true">
<Size>
<AbsDimension x="175" y="32"/>
</Size>
<Layers>
<Layer level="BACKGROUND">
<FontString name="$parentCategory" inherits="GameFontNormal" text="Hair Style">
<Size>
<AbsDimension x="90" y="14"/>
</Size>
</FontString>
</Layer>
</Layers>
<Frames>
<Button name="$parentPrev" virtual="true">
<Size>
<AbsDimension x="32" y="32"/>
</Size>
<Anchors>
<Anchor point="RIGHT" relativeTo="$parentCategory" relativePoint="LEFT">
<Offset>
<AbsDimension x="-5" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
local parent = self:GetParent();
SetNextBarberShopStyle(parent:GetID(), 1);
PlaySound("UChatScrollButton");
BarberShop_UpdateCost();
BarberShop_UpdateSelector(parent);
</OnClick>
</Scripts>
<NormalTexture file="Interface\Buttons\UI-SpellbookIcon-PrevPage-Up"/>
<PushedTexture file="Interface\Buttons\UI-SpellbookIcon-PrevPage-Down"/>
<DisabledTexture file="Interface\Buttons\UI-SpellbookIcon-PrevPage-Disabled"/>
<HighlightTexture file="Interface\Buttons\UI-Common-MouseHilight" alphaMode="ADD"/>
</Button>
<Button name="$parentNext" virtual="true">
<Size>
<AbsDimension x="32" y="32"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativeTo="$parentCategory" relativePoint="RIGHT">
<Offset>
<AbsDimension x="5" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
local parent = self:GetParent();
SetNextBarberShopStyle(parent:GetID());
PlaySound("UChatScrollButton");
BarberShop_UpdateCost();
BarberShop_UpdateSelector(parent);
</OnClick>
</Scripts>
<NormalTexture file="Interface\Buttons\UI-SpellbookIcon-NextPage-Up"/>
<PushedTexture file="Interface\Buttons\UI-SpellbookIcon-NextPage-Down"/>
<DisabledTexture file="Interface\Buttons\UI-SpellbookIcon-NextPage-Disabled"/>
<HighlightTexture file="Interface\Buttons\UI-Common-MouseHilight" alphaMode="ADD"/>
</Button>
</Frames>
</Frame>
<Frame name="BarberShopFrame" parent="UIParent" toplevel="true" hidden="true" enableMouse="true">
<Size>
<AbsDimension x="265" y="319"/>
</Size>
<Anchors>
<Anchor point="RIGHT" relativeTo="UIParent" relativePoint="RIGHT">
<Offset x="-18" y="-54"/>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture name="$parentBackground" setAllPoints="true">
<TexCoords left="0" right="0.517578" top="0" bottom="0.623047"/>
</Texture>
</Layer>
</Layers>
<Frames>
<Frame name="$parentSelector1" inherits="BarberShopSelectorTemplate" id="1">
<Anchors>
<Anchor point="TOP" relativeTo="$parent">
<Offset>
<AbsDimension x="2" y="-74"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
_G[self:GetName().."Category"]:SetText("Hair Style");
</OnLoad>
</Scripts>
</Frame>
<Frame name="$parentSelector2" inherits="BarberShopSelectorTemplate" id="2">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parentSelector1" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-1"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
_G[self:GetName().."Category"]:SetText("Hair Color");
</OnLoad>
</Scripts>
</Frame>
<Frame name="$parentSelector3" inherits="BarberShopSelectorTemplate" id="3">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parentSelector2" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-1"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
_G[self:GetName().."Category"]:SetText("Facial Style");
</OnLoad>
</Scripts>
</Frame>
<Frame name="$parentSelector4" inherits="BarberShopSelectorTemplate" id="4" hidden="true">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parentSelector3" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="3"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
_G[self:GetName().."Category"]:SetText(SKIN_COLOR);
</OnLoad>
</Scripts>
</Frame>
<Frame name="$parentMoneyFrame" inherits="SmallMoneyFrameTemplate">
<Anchors>
<Anchor point="TOP" relativeTo="$parentSelector3" relativePoint="BOTTOM">
<Offset>
<AbsDimension x="7" y="-10"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture file="Interface\MoneyFrame\UI-MoneyFrame-Border">
<Size>
<AbsDimension x="128" y="32"/>
</Size>
<Anchors>
<Anchor point="CENTER">
<Offset>
<AbsDimension x="-8" y="-6"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnLoad>
SmallMoneyFrame_OnLoad(self);
MoneyFrame_SetType(self, "GUILD_REPAIR");
</OnLoad>
</Scripts>
</Frame>
<Button name="$parentOkayButton" inherits="UIPanelButtonTemplate" text="OKAY">
<Size>
<AbsDimension x="80" y="24"/>
</Size>
<Anchors>
<Anchor point="RIGHT" relativeTo="$parentSelector3" relativePoint="BOTTOM">
<Offset>
<AbsDimension x="-2" y="-48"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick function="ApplyBarberShopStyle"/>
</Scripts>
</Button>
<Button name="$parentCancelButton" inherits="UIPanelButtonTemplate" text="COINPICKUP_CANCEL">
<Size>
<AbsDimension x="80" y="24"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativeTo="$parentOkayButton" relativePoint="RIGHT">
<Offset>
<AbsDimension x="5" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
CancelBarberShop();
PlaySound("igCharacterInfoClose");
</OnClick>
</Scripts>
</Button>
<Button name="$parentResetButton" inherits="UIPanelButtonTemplate" text="RESET">
<Size>
<AbsDimension x="80" y="24"/>
</Size>
<Anchors>
<Anchor point="BOTTOM">
<Offset>
<AbsDimension x="2" y="50"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
BarberShopReset();
BarberShop_ResetLabelColors();
BarberShop_UpdateCost();
BarberShop_UpdateBanner(GetBarberShopStyleInfo(1));
PlaySound("igCharacterInfoClose");
</OnClick>
</Scripts>
</Button>
</Frames>
<Scripts>
<OnLoad function="BarberShop_OnLoad"/>
<OnShow function="BarberShop_OnShow"/>
<OnHide function="BarberShop_OnHide"/>
<OnEvent function="BarberShop_OnEvent"/>
</Scripts>
</Frame>
<Frame name="BarberShopBannerFrame" toplevel="true" parent="UIParent">
<Size>
<AbsDimension x="381" y="210"/>
</Size>
<Anchors>
<Anchor point="TOP" relativeTo="UIParent" relativePoint="TOP">
<Offset x="2" y="5"/>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture name="$parentBGTexture" setAllPoints="true">
<TexCoords left="0" right="0.744141" top="0" bottom="0.820313"/>
</Texture>
</Layer>
<Layer level="OVERLAY">
<FontString name="$parentCaption" inherits="GameFontNormalLarge" text="BARBERSHOP">
<Size>
<AbsDimension x="350" y="30"/>
</Size>
<Anchors>
<Anchor point="TOP" relativeTo="BarberShopBannerFrame" relativePoint="TOP">
<Offset x="0" y="-94"/>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnLoad>
self.caption = _G[self:GetName() .. "Caption"];
</OnLoad>
<OnShow>
UIErrorsFrame:SetPoint("TOP", self, "BOTTOM", 0, 0);
BarberShopBannerFrameBGTexture:SetTexture("Interface\\Barbershop\\UI-Barbershop-Banner");
</OnShow>
<OnHide>
UIErrorsFrame:SetPoint("TOP", UIParent, "TOP", 0, -122);
BarberShopBannerFrameBGTexture:SetTexture(nil);
</OnHide>
</Scripts>
</Frame>
</Ui>
@@ -0,0 +1 @@
-- This file is executed at the end of addon load
@@ -0,0 +1,596 @@
BATTLEFIELD_TAB_SHOW_DELAY = 0.2;
BATTLEFIELD_TAB_FADE_TIME = 0.15;
DEFAULT_BATTLEFIELD_TAB_ALPHA = 0.75;
DEFAULT_POI_ICON_SIZE = 12;
BATTLEFIELD_MINIMAP_UPDATE_RATE = 0.1;
NUM_BATTLEFIELDMAP_POIS = 0;
NUM_BATTLEFIELDMAP_OVERLAYS = 0;
local BattlefieldMinimapDefaults = {
opacity = 0.7,
locked = true,
showPlayers = true,
};
BG_VEHICLES = {};
function BattlefieldMinimap_Toggle()
if ( BattlefieldMinimap:IsShown() ) then
SetCVar("showBattlefieldMinimap", "0");
BattlefieldMinimap:Hide();
WorldMapZoneMinimapDropDown_Update();
else
local _, instanceType = IsInInstance();
if ( instanceType == "pvp" ) then
SetCVar("showBattlefieldMinimap", "1");
BattlefieldMinimap:Show();
WorldMapZoneMinimapDropDown_Update();
elseif ( instanceType ~= "arena" ) then
SetCVar("showBattlefieldMinimap", "2");
BattlefieldMinimap:Show();
WorldMapZoneMinimapDropDown_Update();
end
end
end
function BattlefieldMinimap_OnLoad (self)
self:RegisterEvent("ADDON_LOADED");
self:RegisterEvent("PLAYER_ENTERING_WORLD");
self:RegisterEvent("ZONE_CHANGED");
self:RegisterEvent("ZONE_CHANGED_NEW_AREA");
self:RegisterEvent("PLAYER_LOGOUT");
self:RegisterEvent("WORLD_MAP_UPDATE");
self:RegisterEvent("ZONE_CHANGED_NEW_AREA");
self:RegisterEvent("PARTY_MEMBERS_CHANGED");
self:RegisterEvent("RAID_ROSTER_UPDATE");
CreateMiniWorldMapArrowFrame(BattlefieldMinimap);
BattlefieldMinimap.updateTimer = 0;
-- PlayerMiniArrowEffectFrame is created in code: CWorldMap::CreateMiniPlayerArrowFrame()
PlayerMiniArrowEffectFrame:SetFrameLevel(WorldMapParty1:GetFrameLevel() + 1);
PlayerMiniArrowEffectFrame:SetAlpha(0.65);
end
function BattlefieldMinimap_OnShow(self)
SetMapToCurrentZone();
BattlefieldMinimap_Update();
BattlefieldMinimap_UpdateOpacity(BattlefieldMinimapOptions.opacity);
BattlefieldMinimapTab:Show();
WorldMapFrame_UpdateUnits("BattlefieldMinimapRaid", "BattlefieldMinimapParty");
end
function BattlefieldMinimap_OnHide(self)
BattlefieldMinimapTab:Hide();
BattlefieldMinimap_ClearTextures();
end
function BattlefieldMinimap_OnEvent(self, event, ...)
if ( event == "ADDON_LOADED" ) then
local arg1 = ...;
if ( arg1 == "Blizzard_BattlefieldMinimap" ) then
if ( not BattlefieldMinimapOptions ) then
BattlefieldMinimapOptions = BattlefieldMinimapDefaults;
end
if ( BattlefieldMinimapOptions.position ) then
BattlefieldMinimapTab:SetPoint("CENTER", "UIParent", "BOTTOMLEFT", BattlefieldMinimapOptions.position.x, BattlefieldMinimapOptions.position.y);
BattlefieldMinimapTab:SetUserPlaced(true);
else
BattlefieldMinimapTab:SetPoint("BOTTOMLEFT", "UIParent", "BOTTOMRIGHT", -225-CONTAINER_OFFSET_X, BATTLEFIELD_TAB_OFFSET_Y);
end
UIDropDownMenu_Initialize(BattlefieldMinimapTabDropDown, BattlefieldMinimapTabDropDown_Initialize, "MENU");
OpacityFrameSlider:SetValue(BattlefieldMinimapOptions.opacity);
BattlefieldMinimap_UpdateOpacity();
end
elseif ( event == "PLAYER_ENTERING_WORLD" or event == "ZONE_CHANGED" or event == "ZONE_CHANGED_NEW_AREA") then
if ( BattlefieldMinimap:IsShown() ) then
SetMapToCurrentZone();
BattlefieldMinimap_Update();
end
elseif ( event == "PLAYER_LOGOUT" ) then
if ( BattlefieldMinimapTab:IsUserPlaced() ) then
if ( not BattlefieldMinimapOptions.position ) then
BattlefieldMinimapOptions.position = {};
end
BattlefieldMinimapOptions.position.x, BattlefieldMinimapOptions.position.y = BattlefieldMinimapTab:GetCenter();
BattlefieldMinimapTab:SetUserPlaced(false);
else
BattlefieldMinimapOptions.position = nil;
end
elseif ( event == "WORLD_MAP_UPDATE" ) then
if ( BattlefieldMinimap:IsVisible() ) then
BattlefieldMinimap_Update();
end
elseif ( event == "PARTY_MEMBERS_CHANGED" or event == "RAID_ROSTER_UPDATE" ) then
if ( self:IsShown() ) then
WorldMapFrame_UpdateUnits("BattlefieldMinimapRaid", "BattlefieldMinimapParty");
end
end
end
function BattlefieldMinimap_Update()
-- Fill in map tiles
local mapFileName, textureHeight = GetMapInfo();
if ( not mapFileName ) then
return;
end
local texName;
local dungeonLevel = GetCurrentMapDungeonLevel();
local completeMapFileName;
if ( dungeonLevel > 0 ) then
completeMapFileName = mapFileName..dungeonLevel.."_";
else
completeMapFileName = mapFileName;
end
for i=1, NUM_WORLDMAP_DETAIL_TILES do
texName = "Interface\\WorldMap\\"..mapFileName.."\\"..completeMapFileName..i;
_G["BattlefieldMinimap"..i]:SetTexture(texName);
end
-- Setup the POI's
local iconSize = DEFAULT_POI_ICON_SIZE * GetBattlefieldMapIconScale();
local numPOIs = GetNumMapLandmarks();
if ( NUM_BATTLEFIELDMAP_POIS < numPOIs ) then
for i=NUM_BATTLEFIELDMAP_POIS+1, numPOIs do
BattlefieldMinimap_CreatePOI(i);
end
NUM_BATTLEFIELDMAP_POIS = numPOIs;
end
for i=1, NUM_BATTLEFIELDMAP_POIS do
local battlefieldPOIName = "BattlefieldMinimapPOI"..i;
local battlefieldPOI = _G[battlefieldPOIName];
if ( i <= numPOIs ) then
local name, description, textureIndex, x, y, maplinkID, showInBattleMap = GetMapLandmarkInfo(i);
if ( showInBattleMap ) then
local x1, x2, y1, y2 = WorldMap_GetPOITextureCoords(textureIndex);
_G[battlefieldPOIName.."Texture"]:SetTexCoord(x1, x2, y1, y2);
x = x * BattlefieldMinimap:GetWidth();
y = -y * BattlefieldMinimap:GetHeight();
battlefieldPOI:SetPoint("CENTER", "BattlefieldMinimap", "TOPLEFT", x, y );
battlefieldPOI:SetWidth(iconSize);
battlefieldPOI:SetHeight(iconSize);
battlefieldPOI:Show();
else
battlefieldPOI:Hide();
end
else
battlefieldPOI:Hide();
end
end
-- Setup the overlays
local numOverlays = GetNumMapOverlays();
local textureCount = 0;
-- Use this value to scale the texture sizes and offsets
local battlefieldMinimapScale = BattlefieldMinimap1:GetWidth()/256;
for i=1, numOverlays do
local textureName, textureWidth, textureHeight, offsetX, offsetY, mapPointX, mapPointY = GetMapOverlayInfo(i);
if (textureName ~= "" or textureWidth == 0 or textureHeight == 0) then
local numTexturesWide = ceil(textureWidth/256);
local numTexturesTall = ceil(textureHeight/256);
local neededTextures = textureCount + (numTexturesWide * numTexturesTall);
if ( neededTextures > NUM_BATTLEFIELDMAP_OVERLAYS ) then
for j=NUM_BATTLEFIELDMAP_OVERLAYS+1, neededTextures do
BattlefieldMinimap:CreateTexture("BattlefieldMinimapOverlay"..j, "ARTWORK");
end
NUM_BATTLEFIELDMAP_OVERLAYS = neededTextures;
end
local texturePixelWidth, textureFileWidth, texturePixelHeight, textureFileHeight;
for j=1, numTexturesTall do
if ( j < numTexturesTall ) then
texturePixelHeight = 256;
textureFileHeight = 256;
else
texturePixelHeight = mod(textureHeight, 256);
if ( texturePixelHeight == 0 ) then
texturePixelHeight = 256;
end
textureFileHeight = 16;
while(textureFileHeight < texturePixelHeight) do
textureFileHeight = textureFileHeight * 2;
end
end
for k=1, numTexturesWide do
textureCount = textureCount + 1;
local texture = _G["BattlefieldMinimapOverlay"..textureCount];
if ( k < numTexturesWide ) then
texturePixelWidth = 256;
textureFileWidth = 256;
else
texturePixelWidth = mod(textureWidth, 256);
if ( texturePixelWidth == 0 ) then
texturePixelWidth = 256;
end
textureFileWidth = 16;
while(textureFileWidth < texturePixelWidth) do
textureFileWidth = textureFileWidth * 2;
end
end
texture:SetWidth(texturePixelWidth*battlefieldMinimapScale);
texture:SetHeight(texturePixelHeight*battlefieldMinimapScale);
texture:SetTexCoord(0, texturePixelWidth/textureFileWidth, 0, texturePixelHeight/textureFileHeight);
texture:SetPoint("TOPLEFT", "BattlefieldMinimap", "TOPLEFT", (offsetX + (256 * (k-1)))*battlefieldMinimapScale, -((offsetY + (256 * (j - 1)))*battlefieldMinimapScale));
texture:SetTexture(textureName..(((j - 1) * numTexturesWide) + k));
texture:SetAlpha(1 - ( BattlefieldMinimapOptions.opacity or 0 ));
texture:Show();
end
end
end
end
for i=textureCount+1, NUM_BATTLEFIELDMAP_OVERLAYS do
_G["BattlefieldMinimapOverlay"..i]:Hide();
end
end
function BattlefieldMinimap_ClearTextures()
for i=1, NUM_BATTLEFIELDMAP_OVERLAYS do
_G["BattlefieldMinimapOverlay"..i]:SetTexture(nil);
end
for i=1, NUM_WORLDMAP_DETAIL_TILES do
_G["BattlefieldMinimap"..i]:SetTexture(nil);
end
end
function BattlefieldMinimap_CreatePOI(index)
local frame = CreateFrame("Frame", "BattlefieldMinimapPOI"..index, BattlefieldMinimap);
frame:SetWidth(DEFAULT_POI_ICON_SIZE);
frame:SetHeight(DEFAULT_POI_ICON_SIZE);
local texture = frame:CreateTexture(frame:GetName().."Texture", "BACKGROUND");
texture:SetAllPoints(frame);
texture:SetTexture("Interface\\Minimap\\POIIcons");
end
function BattlefieldMinimap_OnUpdate(self, elapsed)
-- Throttle updates
if ( BattlefieldMinimap.updateTimer < 0 ) then
BattlefieldMinimap.updateTimer = BATTLEFIELD_MINIMAP_UPDATE_RATE;
else
BattlefieldMinimap.updateTimer = BattlefieldMinimap.updateTimer - elapsed;
end
--Position player
UpdateWorldMapArrowFrames();
local playerX, playerY = GetPlayerMapPosition("player");
if ( playerX == 0 and playerY == 0 ) then
SetMapToCurrentZone();
playerX, playerY = GetPlayerMapPosition("player");
end
if ( playerX == 0 and playerY == 0 ) then
ShowMiniWorldMapArrowFrame(nil);
else
playerX = playerX * BattlefieldMinimap:GetWidth();
playerY = -playerY * BattlefieldMinimap:GetHeight();
PositionMiniWorldMapArrowFrame("CENTER", "BattlefieldMinimap", "TOPLEFT", playerX, playerY);
ShowMiniWorldMapArrowFrame(1);
end
-- If resizing the frame then scale everything accordingly
if ( BattlefieldMinimap.resizing ) then
local sizeUnit = BattlefieldMinimap:GetWidth()/4;
local mapPiece;
for i=1, NUM_WORLDMAP_DETAIL_TILES do
mapPiece = _G["BattlefieldMinimap"..i];
mapPiece:SetWidth(sizeUnit);
mapPiece:SetHeight(sizeUnit);
end
local numPOIs = GetNumMapLandmarks();
for i=1, NUM_BATTLEFIELDMAP_POIS, 1 do
local battlefieldPOIName = "BattlefieldMinimapPOI"..i;
local battlefieldPOI = _G[battlefieldPOIName];
if ( i <= numPOIs ) then
local name, description, textureIndex, x, y, maplinkID,showInBattleMap = GetMapLandmarkInfo(i);
if ( showInBattleMap ) then
local x1, x2, y1, y2 = WorldMap_GetPOITextureCoords(textureIndex);
_G[battlefieldPOIName.."Texture"]:SetTexCoord(x1, x2, y1, y2);
x = x * BattlefieldMinimap:GetWidth();
y = -y * BattlefieldMinimap:GetHeight();
battlefieldPOI:SetPoint("CENTER", "BattlefieldMinimap", "TOPLEFT", x, y );
battlefieldPOI:Show();
else
battlefieldPOI:Hide();
end
else
battlefieldPOI:Hide();
end
end
end
if ( not BattlefieldMinimapOptions.showPlayers ) then
for i=1, MAX_PARTY_MEMBERS do
_G["BattlefieldMinimapParty"..i]:Hide();
end
for i=1, MAX_RAID_MEMBERS do
_G["BattlefieldMinimapRaid"..i]:Hide();
end
wipe(BG_VEHICLES);
else
--Position groupmates
local playerCount = 0;
if ( GetNumRaidMembers() > 0 ) then
for i=1, MAX_PARTY_MEMBERS do
local partyMemberFrame = _G["BattlefieldMinimapParty"..i];
partyMemberFrame:Hide();
end
for i=1, MAX_RAID_MEMBERS do
local unit = "raid"..i;
local partyX, partyY = GetPlayerMapPosition(unit);
local partyMemberFrame = _G["BattlefieldMinimapRaid"..(playerCount + 1)];
if ( (partyX ~= 0 or partyY ~= 0) and not UnitIsUnit("raid"..i, "player") ) then
partyX = partyX * BattlefieldMinimap:GetWidth();
partyY = -partyY * BattlefieldMinimap:GetHeight();
partyMemberFrame:SetPoint("CENTER", "BattlefieldMinimap", "TOPLEFT", partyX, partyY);
partyMemberFrame.name = nil;
partyMemberFrame.unit = unit;
partyMemberFrame:Show();
playerCount = playerCount + 1;
end
end
else
for i=1, MAX_PARTY_MEMBERS do
local partyX, partyY = GetPlayerMapPosition("party"..i);
local partyMemberFrame = _G["BattlefieldMinimapParty"..i];
if ( partyX == 0 and partyY == 0 ) then
partyMemberFrame:Hide();
else
partyX = partyX * BattlefieldMinimap:GetWidth();
partyY = -partyY * BattlefieldMinimap:GetHeight();
partyMemberFrame:SetPoint("CENTER", "BattlefieldMinimap", "TOPLEFT", partyX, partyY);
partyMemberFrame:Show();
end
end
end
-- Position Team Members
local numTeamMembers = GetNumBattlefieldPositions();
for i=playerCount+1, MAX_RAID_MEMBERS do
local partyX, partyY, name = GetBattlefieldPosition(i - playerCount);
local partyMemberFrame = _G["BattlefieldMinimapRaid"..i];
if ( partyX == 0 and partyY == 0 ) then
partyMemberFrame:Hide();
else
partyX = partyX * BattlefieldMinimap:GetWidth();
partyY = -partyY * BattlefieldMinimap:GetHeight();
partyMemberFrame:SetPoint("CENTER", "BattlefieldMinimap", "TOPLEFT", partyX, partyY);
partyMemberFrame.name = name;
partyMemberFrame.unit = nil;
partyMemberFrame:Show();
end
end
-- Position flags
local numFlags = GetNumBattlefieldFlagPositions();
for i=1, NUM_WORLDMAP_FLAGS do
local flagFrameName = "BattlefieldMinimapFlag"..i;
local flagFrame = _G[flagFrameName];
if ( i <= numFlags ) then
local flagX, flagY, flagToken = GetBattlefieldFlagPosition(i);
local flagTexture = _G[flagFrameName.."Texture"];
if ( flagX == 0 and flagY == 0 ) then
flagFrame:Hide();
else
flagX = flagX * BattlefieldMinimap:GetWidth();
flagY = -flagY * BattlefieldMinimap:GetHeight();
flagFrame:SetPoint("CENTER", "BattlefieldMinimap", "TOPLEFT", flagX, flagY);
local flagTexture = _G[flagFrameName.."Texture"];
flagTexture:SetTexture("Interface\\WorldStateFrame\\"..flagToken);
flagFrame:Show();
end
else
flagFrame:Hide();
end
end
-- position vehicles
local numVehicles = GetNumBattlefieldVehicles();
local totalVehicles = #BG_VEHICLES;
local index = 0;
for i=1, numVehicles do
if (i > totalVehicles) then
local vehicleName = "BattlefieldMinimap"..i;
BG_VEHICLES[i] = CreateFrame("FRAME", vehicleName, BattlefieldMinimap, "WorldMapVehicleTemplate");
BG_VEHICLES[i].texture = _G[vehicleName.."Texture"];
BG_VEHICLES[i]:SetWidth(30 * GetBattlefieldMapIconScale());
BG_VEHICLES[i]:SetHeight(30 * GetBattlefieldMapIconScale());
end
local vehicleX, vehicleY, unitName, isPossessed, vehicleType, orientation, isPlayer = GetBattlefieldVehicleInfo(i);
-- If vehicle has position and isn't the player
if ( vehicleX and not isPlayer) then
vehicleX = vehicleX * BattlefieldMinimap:GetWidth();
vehicleY = -vehicleY * BattlefieldMinimap:GetHeight();
BG_VEHICLES[i].texture:SetTexture(WorldMap_GetVehicleTexture(vehicleType, isPossessed));
BG_VEHICLES[i].texture:SetRotation( orientation );
BG_VEHICLES[i]:SetPoint("CENTER", "BattlefieldMinimap", "TOPLEFT", vehicleX, vehicleY);
BG_VEHICLES[i]:Show();
index = i; -- save for later
else
BG_VEHICLES[i]:Hide();
end
end
if (index < totalVehicles) then
for i=index+1, totalVehicles do
BG_VEHICLES[i]:Hide();
end
end
end
-- Fadein tab if mouse is over
if ( BattlefieldMinimap:IsMouseOver(45, -10, -5, 5) ) then
local xPos, yPos = GetCursorPosition();
-- If mouse is hovering don't show the tab until the elapsed time reaches the tab show delay
if ( BattlefieldMinimap.hover ) then
if ( (BattlefieldMinimap.oldX == xPos and BattlefieldMinimap.oldy == yPos) ) then
BattlefieldMinimap.hoverTime = BattlefieldMinimap.hoverTime + elapsed;
else
BattlefieldMinimap.hoverTime = 0;
BattlefieldMinimap.oldX = xPos;
BattlefieldMinimap.oldy = yPos;
end
if ( BattlefieldMinimap.hoverTime > BATTLEFIELD_TAB_SHOW_DELAY ) then
-- If the battlefieldtab's alpha is less than the current default, then fade it in
if ( not BattlefieldMinimap.hasBeenFaded and (BattlefieldMinimap.oldAlpha and BattlefieldMinimap.oldAlpha < DEFAULT_BATTLEFIELD_TAB_ALPHA) ) then
UIFrameFadeIn(BattlefieldMinimapTab, BATTLEFIELD_TAB_FADE_TIME, BattlefieldMinimap.oldAlpha, DEFAULT_BATTLEFIELD_TAB_ALPHA);
-- Set the fact that the chatFrame has been faded so we don't try to fade it again
BattlefieldMinimap.hasBeenFaded = 1;
end
end
else
-- Start hovering counter
BattlefieldMinimap.hover = 1;
BattlefieldMinimap.hoverTime = 0;
BattlefieldMinimap.hasBeenFaded = nil;
CURSOR_OLD_X, CURSOR_OLD_Y = GetCursorPosition();
-- Remember the oldAlpha so we can return to it later
if ( not BattlefieldMinimap.oldAlpha ) then
BattlefieldMinimap.oldAlpha = BattlefieldMinimapTab:GetAlpha();
end
end
else
-- If the tab's alpha was less than the current default, then fade it back out to the oldAlpha
if ( BattlefieldMinimap.hasBeenFaded and BattlefieldMinimap.oldAlpha and BattlefieldMinimap.oldAlpha < DEFAULT_BATTLEFIELD_TAB_ALPHA ) then
UIFrameFadeOut(BattlefieldMinimapTab, BATTLEFIELD_TAB_FADE_TIME, DEFAULT_BATTLEFIELD_TAB_ALPHA, BattlefieldMinimap.oldAlpha);
BattlefieldMinimap.hover = nil;
BattlefieldMinimap.hasBeenFaded = nil;
end
BattlefieldMinimap.hoverTime = 0;
end
end
function BattlefieldMinimapTab_OnClick(self, button)
PlaySound("UChatScrollButton");
-- If Rightclick bring up the options menu
if ( button == "RightButton" ) then
ToggleDropDownMenu(1, nil, BattlefieldMinimapTabDropDown, self:GetName(), 0, 0);
return;
end
-- Close all dropdowns
CloseDropDownMenus();
-- If frame is not locked then allow the frame to be dragged or dropped
if ( self:GetButtonState() == "PUSHED" ) then
BattlefieldMinimapTab:StopMovingOrSizing();
else
-- If locked don't allow any movement
if ( BattlefieldMinimapOptions.locked ) then
return;
else
BattlefieldMinimapTab:StartMoving();
end
end
ValidateFramePosition(BattlefieldMinimapTab);
end
function BattlefieldMinimapTabDropDown_Initialize()
local checked;
local info = UIDropDownMenu_CreateInfo();
-- Show battlefield players
info.text = SHOW_BATTLEFIELDMINIMAP_PLAYERS;
info.func = BattlefieldMinimapTabDropDown_TogglePlayers;
info.checked = BattlefieldMinimapOptions.showPlayers;
UIDropDownMenu_AddButton(info, UIDROPDOWNMENU_MENU_LEVEL);
-- Battlefield minimap lock
info.text = LOCK_BATTLEFIELDMINIMAP;
info.func = BattlefieldMinimapTabDropDown_ToggleLock;
info.checked = BattlefieldMinimapOptions.locked;
UIDropDownMenu_AddButton(info, UIDROPDOWNMENU_MENU_LEVEL);
-- Opacity
info.text = BATTLEFIELDMINIMAP_OPACITY_LABEL;
info.func = BattlefieldMinimapTabDropDown_ShowOpacity;
info.checked = nil;
UIDropDownMenu_AddButton(info, UIDROPDOWNMENU_MENU_LEVEL);
end
function BattlefieldMinimapTabDropDown_TogglePlayers()
BattlefieldMinimapOptions.showPlayers = not BattlefieldMinimapOptions.showPlayers;
end
function BattlefieldMinimapTabDropDown_ToggleLock()
BattlefieldMinimapOptions.locked = not BattlefieldMinimapOptions.locked;
end
function BattlefieldMinimapTabDropDown_ShowOpacity()
OpacityFrame:ClearAllPoints();
OpacityFrame:SetPoint("TOPRIGHT", "BattlefieldMinimap", "TOPLEFT", 0, 7);
OpacityFrame.opacityFunc = BattlefieldMinimap_UpdateOpacity;
OpacityFrame:Show();
OpacityFrameSlider:SetValue(BattlefieldMinimapOptions.opacity);
end
function BattlefieldMinimap_UpdateOpacity(opacity)
BattlefieldMinimapOptions.opacity = opacity or OpacityFrameSlider:GetValue();
local alpha = 1.0 - BattlefieldMinimapOptions.opacity;
BattlefieldMinimapBackground:SetAlpha(alpha);
for i=1, NUM_WORLDMAP_DETAIL_TILES do
_G["BattlefieldMinimap"..i]:SetAlpha(alpha);
end
if ( alpha >= 0.15 ) then
alpha = alpha - 0.15;
end
for i=1, NUM_BATTLEFIELDMAP_OVERLAYS do
_G["BattlefieldMinimapOverlay"..i]:SetAlpha(alpha);
end
BattlefieldMinimapCloseButton:SetAlpha(alpha);
BattlefieldMinimapCorner:SetAlpha(alpha);
end
function BattlefieldMinimapUnit_OnEnter(self, motion)
-- Adjust the tooltip based on which side the unit button is on
local x, y = self:GetCenter();
local parentX, parentY = self:GetParent():GetCenter();
if ( x > parentX ) then
GameTooltip:SetOwner(self, "ANCHOR_LEFT");
else
GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
end
-- See which POI's are in the same region and include their names in the tooltip
local unitButton;
local newLineString = "";
local tooltipText = "";
-- Check party
for i=1, MAX_PARTY_MEMBERS do
unitButton = _G["BattlefieldMinimapParty"..i];
if ( unitButton:IsVisible() and unitButton:IsMouseOver() ) then
if ( PlayerIsPVPInactive(unitButton.unit) ) then
tooltipText = tooltipText..newLineString..format(PLAYER_IS_PVP_AFK, UnitName(unitButton.unit));
else
tooltipText = tooltipText..newLineString..UnitName(unitButton.unit);
end
newLineString = "\n";
end
end
--Check Raid
for i=1, MAX_RAID_MEMBERS do
unitButton = _G["BattlefieldMinimapRaid"..i];
if ( unitButton:IsVisible() and unitButton:IsMouseOver() ) then
-- Handle players not in your raid or party, but on your team
if ( unitButton.name ) then
if ( PlayerIsPVPInactive(unitButton.name) ) then
tooltipText = tooltipText..newLineString..format(PLAYER_IS_PVP_AFK, unitButton.name);
else
tooltipText = tooltipText..newLineString..unitButton.name;
end
else
if ( PlayerIsPVPInactive(unitButton.unit) ) then
tooltipText = tooltipText..newLineString..format(PLAYER_IS_PVP_AFK, UnitName(unitButton.unit));
else
tooltipText = tooltipText..newLineString..UnitName(unitButton.unit);
end
end
newLineString = "\n";
end
end
GameTooltip:SetText(tooltipText);
GameTooltip:Show();
end
@@ -0,0 +1,7 @@
## Interface: 30300
## Title: Blizzard Battlefield Minimap
## Secure: 1
## LoadOnDemand: 1
## SavedVariablesPerCharacter: BattlefieldMinimapOptions
Blizzard_BattlefieldMinimap.xml
Localization.lua
@@ -0,0 +1,428 @@
<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="Blizzard_BattlefieldMinimap.lua"/>
<Frame name="BattlefieldMinimapUnitTemplate" inherits="WorldMapUnitTemplate" enableMouse="true" virtual="true" hidden="true">
<Size>
<AbsDimension x="12" y="12"/>
</Size>
<Scripts>
<OnEnter>
BattlefieldMinimapUnit_OnEnter(self, motion);
</OnEnter>
<OnLeave>
GameTooltip:Hide();
</OnLeave>
<OnMouseUp>
WorldMapUnit_OnMouseUp(self, button, "BattlefieldMinimapRaid", "BattlefieldMinimapParty");
</OnMouseUp>
</Scripts>
</Frame>
<Frame name="BattlefieldMinimapPartyUnitTemplate" inherits="BattlefieldMinimapUnitTemplate" virtual="true">
<Scripts>
<OnLoad>
WorldMapUnit_OnLoad(self);
self.unit = "party"..self:GetID();
</OnLoad>
</Scripts>
</Frame>
<Frame name="BattlefieldMinimapRaidUnitTemplate" inherits="BattlefieldMinimapUnitTemplate" virtual="true">
<Scripts>
<OnLoad>
WorldMapUnit_OnLoad(self);
self.unit = "raid"..self:GetID();
</OnLoad>
</Scripts>
</Frame>
<Button name="BattlefieldMinimapTab" hidden="true" frameStrata="LOW" parent="UIParent" movable="true">
<Size>
<AbsDimension x="64" y="32"/>
</Size>
<Layers>
<Layer level="BACKGROUND">
<Texture name="$parentLeft" file="Interface\ChatFrame\ChatFrameTab">
<Size>
<AbsDimension x="16" y="32"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT"/>
</Anchors>
<TexCoords left="0.0" right="0.25" top="0.0" bottom="1.0"/>
</Texture>
<Texture name="$parentMiddle" file="Interface\ChatFrame\ChatFrameTab">
<Size>
<AbsDimension x="44" y="32"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativeTo="$parentLeft" relativePoint="RIGHT"/>
</Anchors>
<TexCoords left="0.25" right="0.75" top="0.0" bottom="1.0"/>
</Texture>
<Texture name="$parentRight" file="Interface\ChatFrame\ChatFrameTab">
<Size>
<AbsDimension x="16" y="32"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativeTo="$parentMiddle" relativePoint="RIGHT"/>
</Anchors>
<TexCoords left="0.75" right="1.0" top="0.0" bottom="1.0"/>
</Texture>
</Layer>
</Layers>
<Frames>
<Frame name="$parentFlash" hidden="true">
<Size>
<AbsDimension x="5" y="32"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativeTo="$parentLeft">
<Offset>
<AbsDimension x="0" y="-7"/>
</Offset>
</Anchor>
<Anchor point="RIGHT" relativeTo="$parentRight">
<Offset>
<AbsDimension x="0" y="-7"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture file="Interface\PaperDollInfoFrame\UI-Character-Tab-Highlight" alphaMode="ADD" setAllPoints="true"/>
</Layer>
</Layers>
</Frame>
<Frame name="$parentDropDown" inherits="UIDropDownMenuTemplate" id="1" hidden="true">
<Anchors>
<Anchor point="TOP">
<Offset>
<AbsDimension x="-80" y="-35"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
</Frames>
<Scripts>
<OnLoad>
self:RegisterForClicks("LeftButtonDown", "LeftButtonUp", "RightButtonUp");
self:RegisterForDrag("LeftButton");
BattlefieldMinimapTab:SetAlpha(0);
</OnLoad>
<OnShow>
PanelTemplates_TabResize(self, 0);
</OnShow>
<OnClick>
BattlefieldMinimapTab_OnClick(self, button);
</OnClick>
<OnEnter>
GameTooltip_AddNewbieTip(self, BATTLEFIELDMINIMAP_OPTIONS_LABEL, 1.0, 1.0, 1.0, NEWBIE_TOOLTIP_BATTLEFIELDMINIMAP_OPTIONS, 1);
</OnEnter>
<OnLeave function="GameTooltip_Hide"/>
<OnDragStart>
if ( BattlefieldMinimapOptions.locked ) then
return;
end
BattlefieldMinimapTab:StartMoving();
</OnDragStart>
<OnDragStop>
BattlefieldMinimapTab:StopMovingOrSizing();
ValidateFramePosition(BattlefieldMinimapTab);
</OnDragStop>
</Scripts>
<ButtonText name="$parentText" text="BATTLEFIELD_MINIMAP">
<Size>
<AbsDimension x="0" y="8"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativeTo="$parentLeft" relativePoint="RIGHT">
<Offset>
<AbsDimension x="0" y="-5"/>
</Offset>
</Anchor>
</Anchors>
</ButtonText>
<NormalFont style="GameFontNormalSmall"/>
<HighlightTexture file="Interface\PaperDollInfoFrame\UI-Character-Tab-Highlight" alphaMode="ADD">
<Anchors>
<Anchor point="LEFT" relativeTo="$parentLeft">
<Offset>
<AbsDimension x="0" y="-7"/>
</Offset>
</Anchor>
<Anchor point="RIGHT" relativeTo="$parentRight">
<Offset>
<AbsDimension x="0" y="-7"/>
</Offset>
</Anchor>
</Anchors>
</HighlightTexture>
</Button>
<Frame name="BattlefieldMinimap" parent="UIParent" frameStrata="BACKGROUND" hidden="true">
<Size>
<AbsDimension x="225" y="150"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="BattlefieldMinimapTab" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-5"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture name="BattlefieldMinimap1">
<Size>
<AbsDimension x="56" y="56"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<Texture name="BattlefieldMinimap2">
<Size>
<AbsDimension x="56" y="56"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="BattlefieldMinimap1" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<Texture name="BattlefieldMinimap3">
<Size>
<AbsDimension x="56" y="56"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="BattlefieldMinimap2" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<Texture name="BattlefieldMinimap4">
<Size>
<AbsDimension x="56" y="56"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="BattlefieldMinimap3" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<Texture name="BattlefieldMinimap5">
<Size>
<AbsDimension x="56" y="56"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="BattlefieldMinimap1" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<Texture name="BattlefieldMinimap6">
<Size>
<AbsDimension x="56" y="56"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="BattlefieldMinimap5" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<Texture name="BattlefieldMinimap7">
<Size>
<AbsDimension x="56" y="56"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="BattlefieldMinimap6" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<Texture name="BattlefieldMinimap8">
<Size>
<AbsDimension x="56" y="56"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="BattlefieldMinimap7" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<Texture name="BattlefieldMinimap9">
<Size>
<AbsDimension x="56" y="56"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="BattlefieldMinimap5" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<Texture name="BattlefieldMinimap10">
<Size>
<AbsDimension x="56" y="56"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="BattlefieldMinimap9" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<Texture name="BattlefieldMinimap11">
<Size>
<AbsDimension x="56" y="56"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="BattlefieldMinimap10" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<Texture name="BattlefieldMinimap12">
<Size>
<AbsDimension x="56" y="56"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="BattlefieldMinimap11" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
</Layer>
<Layer level="BORDER">
<Texture name="BattlefieldMinimapCorner" file="Interface\DialogFrame\UI-DialogBox-Corner">
<Size>
<AbsDimension x="32" y="32"/>
</Size>
<Anchors>
<Anchor point="TOPRIGHT">
<Offset>
<AbsDimension x="-2" y="3"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
</Layer>
<Layer level="OVERLAY">
<Texture name="BattlefieldMinimapBackground" file="Interface\BattlefieldFrame\UI-BattlefieldMinimap-Border">
<Size>
<AbsDimension x="256" y="256"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="-12" y="12"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
</Layer>
</Layers>
<Frames>
<Button name="BattlefieldMinimapCloseButton" inherits="UIPanelCloseButton">
<Anchors>
<Anchor point="TOPRIGHT">
<Offset>
<AbsDimension x="2" y="7"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
SetCVar("showBattlefieldMinimap", "0");
HideUIPanel(self:GetParent());
WorldMapZoneMinimapDropDown_Update();
</OnClick>
</Scripts>
</Button>
<Frame name="BattlefieldMinimapParty1" inherits="BattlefieldMinimapPartyUnitTemplate" id="1"/>
<Frame name="BattlefieldMinimapParty2" inherits="BattlefieldMinimapPartyUnitTemplate" id="2"/>
<Frame name="BattlefieldMinimapParty3" inherits="BattlefieldMinimapPartyUnitTemplate" id="3"/>
<Frame name="BattlefieldMinimapParty4" inherits="BattlefieldMinimapPartyUnitTemplate" id="4"/>
<Frame name="BattlefieldMinimapRaid1" inherits="BattlefieldMinimapRaidUnitTemplate" id="1"/>
<Frame name="BattlefieldMinimapRaid2" inherits="BattlefieldMinimapRaidUnitTemplate" id="2"/>
<Frame name="BattlefieldMinimapRaid3" inherits="BattlefieldMinimapRaidUnitTemplate" id="3"/>
<Frame name="BattlefieldMinimapRaid4" inherits="BattlefieldMinimapRaidUnitTemplate" id="4"/>
<Frame name="BattlefieldMinimapRaid5" inherits="BattlefieldMinimapRaidUnitTemplate" id="5"/>
<Frame name="BattlefieldMinimapRaid6" inherits="BattlefieldMinimapRaidUnitTemplate" id="6"/>
<Frame name="BattlefieldMinimapRaid7" inherits="BattlefieldMinimapRaidUnitTemplate" id="7"/>
<Frame name="BattlefieldMinimapRaid8" inherits="BattlefieldMinimapRaidUnitTemplate" id="8"/>
<Frame name="BattlefieldMinimapRaid9" inherits="BattlefieldMinimapRaidUnitTemplate" id="9"/>
<Frame name="BattlefieldMinimapRaid10" inherits="BattlefieldMinimapRaidUnitTemplate" id="10"/>
<Frame name="BattlefieldMinimapRaid11" inherits="BattlefieldMinimapRaidUnitTemplate" id="11"/>
<Frame name="BattlefieldMinimapRaid12" inherits="BattlefieldMinimapRaidUnitTemplate" id="12"/>
<Frame name="BattlefieldMinimapRaid13" inherits="BattlefieldMinimapRaidUnitTemplate" id="13"/>
<Frame name="BattlefieldMinimapRaid14" inherits="BattlefieldMinimapRaidUnitTemplate" id="14"/>
<Frame name="BattlefieldMinimapRaid15" inherits="BattlefieldMinimapRaidUnitTemplate" id="15"/>
<Frame name="BattlefieldMinimapRaid16" inherits="BattlefieldMinimapRaidUnitTemplate" id="16"/>
<Frame name="BattlefieldMinimapRaid17" inherits="BattlefieldMinimapRaidUnitTemplate" id="17"/>
<Frame name="BattlefieldMinimapRaid18" inherits="BattlefieldMinimapRaidUnitTemplate" id="18"/>
<Frame name="BattlefieldMinimapRaid19" inherits="BattlefieldMinimapRaidUnitTemplate" id="19"/>
<Frame name="BattlefieldMinimapRaid20" inherits="BattlefieldMinimapRaidUnitTemplate" id="20"/>
<Frame name="BattlefieldMinimapRaid21" inherits="BattlefieldMinimapRaidUnitTemplate" id="21"/>
<Frame name="BattlefieldMinimapRaid22" inherits="BattlefieldMinimapRaidUnitTemplate" id="22"/>
<Frame name="BattlefieldMinimapRaid23" inherits="BattlefieldMinimapRaidUnitTemplate" id="23"/>
<Frame name="BattlefieldMinimapRaid24" inherits="BattlefieldMinimapRaidUnitTemplate" id="24"/>
<Frame name="BattlefieldMinimapRaid25" inherits="BattlefieldMinimapRaidUnitTemplate" id="25"/>
<Frame name="BattlefieldMinimapRaid26" inherits="BattlefieldMinimapRaidUnitTemplate" id="26"/>
<Frame name="BattlefieldMinimapRaid27" inherits="BattlefieldMinimapRaidUnitTemplate" id="27"/>
<Frame name="BattlefieldMinimapRaid28" inherits="BattlefieldMinimapRaidUnitTemplate" id="28"/>
<Frame name="BattlefieldMinimapRaid29" inherits="BattlefieldMinimapRaidUnitTemplate" id="29"/>
<Frame name="BattlefieldMinimapRaid30" inherits="BattlefieldMinimapRaidUnitTemplate" id="30"/>
<Frame name="BattlefieldMinimapRaid31" inherits="BattlefieldMinimapRaidUnitTemplate" id="31"/>
<Frame name="BattlefieldMinimapRaid32" inherits="BattlefieldMinimapRaidUnitTemplate" id="32"/>
<Frame name="BattlefieldMinimapRaid33" inherits="BattlefieldMinimapRaidUnitTemplate" id="33"/>
<Frame name="BattlefieldMinimapRaid34" inherits="BattlefieldMinimapRaidUnitTemplate" id="34"/>
<Frame name="BattlefieldMinimapRaid35" inherits="BattlefieldMinimapRaidUnitTemplate" id="35"/>
<Frame name="BattlefieldMinimapRaid36" inherits="BattlefieldMinimapRaidUnitTemplate" id="36"/>
<Frame name="BattlefieldMinimapRaid37" inherits="BattlefieldMinimapRaidUnitTemplate" id="37"/>
<Frame name="BattlefieldMinimapRaid38" inherits="BattlefieldMinimapRaidUnitTemplate" id="38"/>
<Frame name="BattlefieldMinimapRaid39" inherits="BattlefieldMinimapRaidUnitTemplate" id="39"/>
<Frame name="BattlefieldMinimapRaid40" inherits="BattlefieldMinimapRaidUnitTemplate" id="40"/>
<Frame name="BattlefieldMinimapCorpse" inherits="WorldMapCorpseTemplate"/>
<Frame name="BattlefieldMinimapFlag1" inherits="WorldMapFlagTemplate" id="1">
<Size>
<AbsDimension x="18" y="18"/>
</Size>
</Frame>
<Frame name="BattlefieldMinimapFlag2" inherits="WorldMapFlagTemplate" id="2">
<Size>
<AbsDimension x="18" y="18"/>
</Size>
</Frame>
</Frames>
<Scripts>
<OnLoad function="BattlefieldMinimap_OnLoad"/>
<OnShow function="BattlefieldMinimap_OnShow"/>
<OnHide function="BattlefieldMinimap_OnHide"/>
<OnEvent function="BattlefieldMinimap_OnEvent"/>
<OnUpdate function="BattlefieldMinimap_OnUpdate"/>
</Scripts>
</Frame>
</Ui>
@@ -0,0 +1 @@
-- This file is executed at the end of addon load
@@ -0,0 +1,354 @@
KEY_BINDINGS_DISPLAYED = 17;
KEY_BINDING_HEIGHT = 25;
DEFAULT_BINDINGS = 0;
ACCOUNT_BINDINGS = 1;
CHARACTER_BINDINGS = 2;
UIPanelWindows["KeyBindingFrame"] = { area = "center", pushable = 0, whileDead = 1 };
StaticPopupDialogs["CONFIRM_DELETING_CHARACTER_SPECIFIC_BINDINGS"] = {
text = CONFIRM_DELETING_CHARACTER_SPECIFIC_BINDINGS,
button1 = OKAY,
button2 = CANCEL,
OnAccept = function(self)
SaveBindings(KeyBindingFrame.which);
KeyBindingFrameOutputText:SetText("");
KeyBindingFrame_SetSelected(nil);
HideUIPanel(KeyBindingFrame);
CONFIRMED_DELETING_CHARACTER_SPECIFIC_BINDINGS = 1;
end,
timeout = 0,
whileDead = 1,
showAlert = 1,
};
StaticPopupDialogs["CONFIRM_LOSE_BINDING_CHANGES"] = {
text = CONFIRM_LOSE_BINDING_CHANGES,
button1 = OKAY,
button2 = CANCEL,
OnAccept = function(self)
KeyBindingFrame_ChangeBindingProfile();
KeyBindingFrame.bindingsChanged = nil;
end,
OnCancel = function(self)
if ( KeyBindingFrameCharacterButton:GetChecked() ) then
KeyBindingFrameCharacterButton:SetChecked();
else
KeyBindingFrameCharacterButton:SetChecked(1);
end
end,
timeout = 0,
whileDead = 1,
showAlert = 1,
};
function KeyBindingFrame_OnLoad(self)
self:RegisterForClicks("AnyUp");
KeyBindingFrame_SetSelected(nil);
end
function KeyBindingFrame_OnShow()
KeyBindingFrame_Update();
-- Update character button
KeyBindingFrameCharacterButton:SetChecked(GetCurrentBindingSet() == 2);
-- Update header text
if ( KeyBindingFrameCharacterButton:GetChecked() ) then
KeyBindingFrameHeaderText:SetFormattedText(CHARACTER_KEY_BINDINGS, UnitName("player"));
else
KeyBindingFrameHeaderText:SetText(KEY_BINDINGS);
end
-- Reset bindingsChanged
KeyBindingFrame.bindingsChanged = nil;
end
function KeyBindingFrame_Update()
local numBindings = GetNumBindings();
local keyOffset;
local keyBindingButton1, keyBindingButton2, commandName, binding1, binding2;
local keyBindingName, keyBindingDescription;
local keyBindingButton1NormalTexture, keyBindingButton1PushedTexture, keyBindingButton2NormalTexture, keyBindingButton2PushedTexture;
for i=1, KEY_BINDINGS_DISPLAYED, 1 do
keyOffset = FauxScrollFrame_GetOffset(KeyBindingFrameScrollFrame) + i;
if ( keyOffset <= numBindings) then
keyBindingButton1 = _G["KeyBindingFrameBinding"..i.."Key1Button"];
keyBindingButton1NormalTexture = _G["KeyBindingFrameBinding"..i.."Key1ButtonNormalTexture"];
keyBindingButton1PushedTexture = _G["KeyBindingFrameBinding"..i.."Key1ButtonPushedTexture"];
keyBindingButton2NormalTexture = _G["KeyBindingFrameBinding"..i.."Key2ButtonNormalTexture"];
keyBindingButton2PushedTexture = _G["KeyBindingFrameBinding"..i.."Key2ButtonPushedTexture"];
keyBindingButton2 = _G["KeyBindingFrameBinding"..i.."Key2Button"];
keyBindingDescription = _G["KeyBindingFrameBinding"..i.."Description"];
-- Set binding text
commandName, binding1, binding2 = GetBinding(keyOffset, KeyBindingFrame.mode);
-- Handle header
local headerText = _G["KeyBindingFrameBinding"..i.."Header"];
if ( strsub(commandName, 1, 6) == "HEADER" ) then
headerText:SetText(_G["BINDING_"..commandName]);
headerText:Show();
keyBindingButton1:Hide();
keyBindingButton2:Hide();
keyBindingDescription:Hide();
else
headerText:Hide();
keyBindingButton1:Show();
keyBindingButton2:Show();
keyBindingDescription:Show();
keyBindingButton1.commandName = commandName;
keyBindingButton2.commandName = commandName;
if ( binding1 ) then
keyBindingButton1:SetText(GetBindingText(binding1, "KEY_"));
keyBindingButton1:SetAlpha(1);
else
keyBindingButton1:SetText(NORMAL_FONT_COLOR_CODE..NOT_BOUND..FONT_COLOR_CODE_CLOSE);
keyBindingButton1:SetAlpha(0.8);
end
if ( binding2 ) then
keyBindingButton2:SetText(GetBindingText(binding2, "KEY_"));
keyBindingButton2:SetAlpha(1);
else
keyBindingButton2:SetText(NORMAL_FONT_COLOR_CODE..NOT_BOUND..FONT_COLOR_CODE_CLOSE);
keyBindingButton2:SetAlpha(0.8);
end
-- Set description
keyBindingDescription:SetText(GetBindingText(commandName, "BINDING_NAME_"));
-- Handle highlight
keyBindingButton1:UnlockHighlight();
keyBindingButton2:UnlockHighlight();
if ( KeyBindingFrame.selected == commandName ) then
if ( KeyBindingFrame.keyID == 1 ) then
keyBindingButton1:LockHighlight();
else
keyBindingButton2:LockHighlight();
end
end
_G["KeyBindingFrameBinding"..i]:Show();
end
else
_G["KeyBindingFrameBinding"..i]:Hide();
end
end
-- Scroll frame stuff
FauxScrollFrame_Update(KeyBindingFrameScrollFrame, numBindings, KEY_BINDINGS_DISPLAYED, KEY_BINDING_HEIGHT );
-- Update Unbindkey button
KeyBindingFrame_UpdateUnbindKey();
end
function KeyBindingFrame_UnbindKey(keyPressed)
local oldAction = GetBindingAction(keyPressed, KeyBindingFrame.mode);
if ( oldAction ~= "" and oldAction ~= KeyBindingFrame.selected ) then
local key1, key2 = GetBindingKey(oldAction, KeyBindingFrame.mode);
if ( (not key1 or key1 == keyPressed) and (not key2 or key2 == keyPressed) ) then
--Error message
KeyBindingFrameOutputText:SetFormattedText(KEY_UNBOUND_ERROR, GetBindingText(oldAction, "BINDING_NAME_"));
end
end
SetBinding(keyPressed, nil, KeyBindingFrame.mode);
end
function KeyBindingFrame_OnKeyDown(self, keyOrButton)
if ( GetBindingFromClick(keyOrButton) == "SCREENSHOT" ) then
RunBinding("SCREENSHOT");
return;
end
if ( KeyBindingFrame.selected ) then
local keyPressed = keyOrButton;
if ( keyPressed == "UNKNOWN" ) then
return;
end
-- Convert the mouse button names
if ( keyPressed == "LeftButton" ) then
keyPressed = "BUTTON1";
elseif ( keyPressed == "RightButton" ) then
keyPressed = "BUTTON2";
elseif ( keyPressed == "MiddleButton" ) then
keyPressed = "BUTTON3";
elseif ( keyPressed == "Button4" ) then
keyPressed = "BUTTON4"
elseif ( keyOrButton == "Button5" ) then
keyPressed = "BUTTON5"
elseif ( keyPressed == "Button6" ) then
keyPressed = "BUTTON6"
elseif ( keyOrButton == "Button7" ) then
keyPressed = "BUTTON7"
elseif ( keyPressed == "Button8" ) then
keyPressed = "BUTTON8"
elseif ( keyOrButton == "Button9" ) then
keyPressed = "BUTTON9"
elseif ( keyPressed == "Button10" ) then
keyPressed = "BUTTON10"
elseif ( keyOrButton == "Button11" ) then
keyPressed = "BUTTON11"
elseif ( keyPressed == "Button12" ) then
keyPressed = "BUTTON12"
elseif ( keyOrButton == "Button13" ) then
keyPressed = "BUTTON13"
elseif ( keyPressed == "Button14" ) then
keyPressed = "BUTTON14"
elseif ( keyOrButton == "Button15" ) then
keyPressed = "BUTTON15"
elseif ( keyPressed == "Button16" ) then
keyPressed = "BUTTON16"
elseif ( keyOrButton == "Button17" ) then
keyPressed = "BUTTON17"
elseif ( keyPressed == "Button18" ) then
keyPressed = "BUTTON18"
elseif ( keyOrButton == "Button19" ) then
keyPressed = "BUTTON19"
elseif ( keyPressed == "Button20" ) then
keyPressed = "BUTTON20"
elseif ( keyOrButton == "Button21" ) then
keyPressed = "BUTTON21"
elseif ( keyPressed == "Button22" ) then
keyPressed = "BUTTON22"
elseif ( keyOrButton == "Button23" ) then
keyPressed = "BUTTON23"
elseif ( keyPressed == "Button24" ) then
keyPressed = "BUTTON24"
elseif ( keyOrButton == "Button25" ) then
keyPressed = "BUTTON25"
elseif ( keyPressed == "Button26" ) then
keyPressed = "BUTTON26"
elseif ( keyOrButton == "Button27" ) then
keyPressed = "BUTTON27"
elseif ( keyPressed == "Button28" ) then
keyPressed = "BUTTON28"
elseif ( keyOrButton == "Button29" ) then
keyPressed = "BUTTON29"
elseif ( keyPressed == "Button30" ) then
keyPressed = "BUTTON30"
elseif ( keyOrButton == "Button31" ) then
keyPressed = "BUTTON31"
end
if ( keyPressed == "BUTTON1" or keyPressed == "BUTTON2" ) then
return;
end
if ( keyPressed == "LSHIFT" or
keyPressed == "RSHIFT" or
keyPressed == "LCTRL" or
keyPressed == "RCTRL" or
keyPressed == "LALT" or
keyPressed == "RALT" ) then
return;
end
if ( IsShiftKeyDown() ) then
keyPressed = "SHIFT-"..keyPressed;
end
if ( IsControlKeyDown() ) then
keyPressed = "CTRL-"..keyPressed;
end
if ( IsAltKeyDown() ) then
keyPressed = "ALT-"..keyPressed;
end
-- Unbind the current action
local key1, key2 = GetBindingKey(KeyBindingFrame.selected, KeyBindingFrame.mode);
if ( key1 ) then
SetBinding(key1, nil, KeyBindingFrame.mode);
end
if ( key2 ) then
SetBinding(key2, nil, KeyBindingFrame.mode);
end
-- Unbind the current key and rebind current action
KeyBindingFrameOutputText:SetText(KEY_BOUND);
KeyBindingFrame_UnbindKey(keyPressed);
if ( KeyBindingFrame.keyID == 1 ) then
KeyBindingFrame_SetBinding(keyPressed, KeyBindingFrame.selected, key1);
if ( key2 ) then
SetBinding(key2, KeyBindingFrame.selected, KeyBindingFrame.mode);
end
else
if ( key1 ) then
KeyBindingFrame_SetBinding(key1, KeyBindingFrame.selected);
end
KeyBindingFrame_SetBinding(keyPressed, KeyBindingFrame.selected, key2);
end
KeyBindingFrame_Update();
-- Button highlighting stuff
KeyBindingFrame_SetSelected(nil);
KeyBindingFrame.buttonPressed:UnlockHighlight();
KeyBindingFrame.bindingsChanged = 1;
elseif ( GetBindingFromClick(keyOrButton) == "TOGGLEGAMEMENU" ) then
LoadBindings(GetCurrentBindingSet());
KeyBindingFrameOutputText:SetText("");
KeyBindingFrame_SetSelected(nil);
HideUIPanel(self);
end
KeyBindingFrame_UpdateUnbindKey();
end
function KeyBindingButton_OnClick(self, button)
if ( KeyBindingFrame.selected ) then
-- Code to be able to deselect or select another key to bind
if ( button == "LeftButton" or button == "RightButton" ) then
-- Deselect button if it was the pressed previously pressed
if (KeyBindingFrame.buttonPressed == self) then
KeyBindingFrame_SetSelected(nil);
KeyBindingFrameOutputText:SetText("");
else
-- Select a different button
KeyBindingFrame.buttonPressed = self;
KeyBindingFrame_SetSelected(self.commandName);
KeyBindingFrame.keyID = self:GetID();
KeyBindingFrameOutputText:SetFormattedText(BIND_KEY_TO_COMMAND, GetBindingText(self.commandName, "BINDING_NAME_"));
end
KeyBindingFrame_Update();
return;
end
KeyBindingFrame_OnKeyDown(self, button);
else
if (KeyBindingFrame.buttonPressed) then
KeyBindingFrame.buttonPressed:UnlockHighlight();
end
KeyBindingFrame.buttonPressed = self;
KeyBindingFrame_SetSelected(self.commandName);
KeyBindingFrame.keyID = self:GetID();
KeyBindingFrameOutputText:SetFormattedText(BIND_KEY_TO_COMMAND, GetBindingText(self.commandName, "BINDING_NAME_"));
KeyBindingFrame_Update();
end
KeyBindingFrame_UpdateUnbindKey();
end
function KeyBindingFrame_SetBinding(key, selectedBinding, oldKey)
if ( SetBinding(key, selectedBinding, KeyBindingFrame.mode) ) then
return;
else
if ( oldKey ) then
SetBinding(oldKey, selectedBinding, KeyBindingFrame.mode);
end
--Error message
KeyBindingFrameOutputText:SetText(KEYBINDINGFRAME_MOUSEWHEEL_ERROR);
end
end
function KeyBindingFrame_UpdateUnbindKey()
if ( KeyBindingFrame.selected ) then
KeyBindingFrameUnbindButton:Enable();
else
KeyBindingFrameUnbindButton:Disable();
end
end
function KeyBindingFrame_ChangeBindingProfile()
if ( KeyBindingFrameCharacterButton:GetChecked() ) then
LoadBindings(CHARACTER_BINDINGS);
KeyBindingFrameHeaderText:SetFormattedText(CHARACTER_KEY_BINDINGS, UnitName("player"));
else
LoadBindings(ACCOUNT_BINDINGS);
KeyBindingFrameHeaderText:SetText(KEY_BINDINGS);
end
KeyBindingFrameOutputText:SetText("");
KeyBindingFrame_SetSelected(nil);
KeyBindingFrame_Update();
end
function KeyBindingFrame_SetSelected(value)
KeyBindingFrame.selected = value;
end
@@ -0,0 +1,6 @@
## Interface: 30300
## Title: Blizzard Key Binding UI
## Secure: 1
## LoadOnDemand: 1
Blizzard_BindingUI.xml
Localization.lua
@@ -0,0 +1,553 @@
<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="Blizzard_BindingUI.lua"/>
<Button name="KeyBindingFrameBindingButtonTemplate" inherits="UIPanelButtonTemplate2" virtual="true">
<Scripts>
<OnClick>
KeyBindingButton_OnClick(self, button, down);
</OnClick>
<OnLoad>
self:RegisterForClicks("AnyUp");
</OnLoad>
</Scripts>
<NormalFont style="GameFontHighlightSmall"/>
<DisabledFont style="GameFontDisable"/>
<HighlightFont style="GameFontHighlightSmall"/>
</Button>
<Frame name="KeyBindingFrameBindingTemplate" virtual="true">
<Size>
<AbsDimension x="560" y="25"/>
</Size>
<Layers>
<Layer level="BACKGROUND">
<FontString name="$parentDescription" inherits="GameFontNormalSmall" justifyH="LEFT">
<Size>
<AbsDimension x="170" y="24"/>
</Size>
<Anchors>
<Anchor point="LEFT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentHeader" inherits="GameFontHighlight">
<Anchors>
<Anchor point="LEFT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Frames>
<Button name="$parentKey1Button" inherits="KeyBindingFrameBindingButtonTemplate" id="1">
<Size>
<AbsDimension x="180" y="22"/>
</Size>
<Anchors>
<Anchor point="LEFT">
<Offset>
<AbsDimension x="175" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="$parentKey2Button" inherits="KeyBindingFrameBindingButtonTemplate" id="2">
<Size>
<AbsDimension x="180" y="22"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativeTo="$parentKey1Button" relativePoint="RIGHT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Button>
</Frames>
</Frame>
<Button name="KeyBindingFrame" toplevel="true" parent="UIParent" frameStrata="DIALOG" movable="true" enableMouse="true" hidden="true" enableKeyboard="true">
<Size>
<AbsDimension x="640" y="512"/>
</Size>
<Anchors>
<Anchor point="TOP">
<Offset>
<AbsDimension x="0" y="-100"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture file="Interface\KeyBindingFrame\UI-KeyBindingFrame-TopLeft">
<Size>
<AbsDimension x="256" y="256"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT"/>
</Anchors>
</Texture>
<Texture file="Interface\KeyBindingFrame\UI-KeyBindingFrame-Top">
<Size>
<AbsDimension x="256" y="256"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="256" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<Texture file="Interface\KeyBindingFrame\UI-KeyBindingFrame-TopRight">
<Size>
<AbsDimension x="128" y="256"/>
</Size>
<Anchors>
<Anchor point="TOPRIGHT"/>
</Anchors>
</Texture>
</Layer>
<Layer level="BACKGROUND">
<Texture file="Interface\KeyBindingFrame\UI-KeyBindingFrame-BotLeft">
<Size>
<AbsDimension x="256" y="256"/>
</Size>
<Anchors>
<Anchor point="BOTTOMLEFT"/>
</Anchors>
</Texture>
<Texture file="Interface\KeyBindingFrame\UI-KeyBindingFrame-Bot">
<Size>
<AbsDimension x="256" y="256"/>
</Size>
<Anchors>
<Anchor point="BOTTOMLEFT">
<Offset>
<AbsDimension x="256" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<Texture file="Interface\KeyBindingFrame\UI-KeyBindingFrame-BotRight">
<Size>
<AbsDimension x="128" y="256"/>
</Size>
<Anchors>
<Anchor point="BOTTOMRIGHT"/>
</Anchors>
</Texture>
<FontString name="KeyBindingFrameCommandLabel" inherits="GameFontNormal" text="COMMAND">
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="26" y="-35"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="KeyBindingFrameKey1Label" inherits="GameFontNormal" text="KEY1">
<Anchors>
<Anchor point="LEFT" relativeTo="KeyBindingFrameCommandLabel" relativePoint="RIGHT">
<Offset>
<AbsDimension x="185" y="0"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="KeyBindingFrameKey2Label" inherits="GameFontNormal" text="KEY2">
<Anchors>
<Anchor point="LEFT" relativeTo="KeyBindingFrameKey1Label" relativePoint="RIGHT">
<Offset>
<AbsDimension x="145" y="0"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="KeyBindingFrameOutputText" inherits="GameFontNormal">
<Anchors>
<Anchor point="BOTTOM">
<Offset>
<AbsDimension x="0" y="52"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
<Layer level="ARTWORK">
<Texture name="KeyBindingFrameHeader" file="Interface\DialogFrame\UI-DialogBox-Header">
<Size>
<AbsDimension x="400" y="64"/>
</Size>
<Anchors>
<Anchor point="TOP">
<Offset>
<AbsDimension x="-30" y="12"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<FontString name="KeyBindingFrameHeaderText" inherits="GameFontNormal" text="KEY_BINDINGS">
<Size>
<AbsDimension x="175" y="13"/>
</Size>
<Anchors>
<Anchor point="TOP" relativeTo="KeyBindingFrameHeader">
<Offset>
<AbsDimension x="0" y="-13"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Frames>
<Frame name="KeyBindingFrameBinding1" inherits="KeyBindingFrameBindingTemplate" id="1">
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="27" y="-53"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="KeyBindingFrameBinding2" inherits="KeyBindingFrameBindingTemplate" id="2">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="KeyBindingFrameBinding1" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="2"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="KeyBindingFrameBinding3" inherits="KeyBindingFrameBindingTemplate" id="3">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="KeyBindingFrameBinding2" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="2"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="KeyBindingFrameBinding4" inherits="KeyBindingFrameBindingTemplate" id="4">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="KeyBindingFrameBinding3" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="2"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="KeyBindingFrameBinding5" inherits="KeyBindingFrameBindingTemplate" id="5">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="KeyBindingFrameBinding4" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="2"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="KeyBindingFrameBinding6" inherits="KeyBindingFrameBindingTemplate" id="6">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="KeyBindingFrameBinding5" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="2"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="KeyBindingFrameBinding7" inherits="KeyBindingFrameBindingTemplate" id="7">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="KeyBindingFrameBinding6" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="2"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="KeyBindingFrameBinding8" inherits="KeyBindingFrameBindingTemplate" id="8">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="KeyBindingFrameBinding7" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="2"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="KeyBindingFrameBinding9" inherits="KeyBindingFrameBindingTemplate" id="9">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="KeyBindingFrameBinding8" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="2"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="KeyBindingFrameBinding10" inherits="KeyBindingFrameBindingTemplate" id="10">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="KeyBindingFrameBinding9" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="2"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="KeyBindingFrameBinding11" inherits="KeyBindingFrameBindingTemplate" id="11">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="KeyBindingFrameBinding10" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="2"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="KeyBindingFrameBinding12" inherits="KeyBindingFrameBindingTemplate" id="12">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="KeyBindingFrameBinding11" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="2"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="KeyBindingFrameBinding13" inherits="KeyBindingFrameBindingTemplate" id="13">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="KeyBindingFrameBinding12" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="2"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="KeyBindingFrameBinding14" inherits="KeyBindingFrameBindingTemplate" id="14">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="KeyBindingFrameBinding13" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="2"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="KeyBindingFrameBinding15" inherits="KeyBindingFrameBindingTemplate" id="15">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="KeyBindingFrameBinding14" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="2"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="KeyBindingFrameBinding16" inherits="KeyBindingFrameBindingTemplate" id="16">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="KeyBindingFrameBinding15" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="2"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="KeyBindingFrameBinding17" inherits="KeyBindingFrameBindingTemplate" id="17">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="KeyBindingFrameBinding16" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="2"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<ScrollFrame name="KeyBindingFrameScrollFrame" inherits="FauxScrollFrameTemplate">
<Size>
<AbsDimension x="560" y="390"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="2" y="-53"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnVerticalScroll>
FauxScrollFrame_OnVerticalScroll(self, offset, KEY_BINDING_HEIGHT, KeyBindingFrame_Update);
</OnVerticalScroll>
<OnMouseWheel>
if ( KeyBindingFrame.selected ) then
if ( delta > 0 ) then
KeyBindingFrame_OnKeyDown(self, "MOUSEWHEELUP");
else
KeyBindingFrame_OnKeyDown(self, "MOUSEWHEELDOWN");
end
else
ScrollFrameTemplate_OnMouseWheel(self, delta);
end
</OnMouseWheel>
</Scripts>
</ScrollFrame>
<CheckButton name="KeyBindingFrameCharacterButton" inherits="UICheckButtonTemplate">
<Size>
<AbsDimension x="20" y="20"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="-245" y="-12"/>
</Offset>
</Anchor>
</Anchors>
<HitRectInsets>
<AbsInset left="0" right="-100" top="0" bottom="0"/>
</HitRectInsets>
<Scripts>
<OnLoad>
KeyBindingFrameCharacterButtonText:SetText(HIGHLIGHT_FONT_COLOR_CODE..CHARACTER_SPECIFIC_KEYBINDINGS..FONT_COLOR_CODE_CLOSE);
</OnLoad>
<OnClick>
if ( KeyBindingFrame.bindingsChanged ) then
StaticPopup_Show("CONFIRM_LOSE_BINDING_CHANGES");
else
KeyBindingFrame_ChangeBindingProfile();
end
</OnClick>
<OnEnter>
GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
GameTooltip:SetText(CHARACTER_SPECIFIC_KEYBINDING_TOOLTIP, nil, nil, nil, nil, 1);
</OnEnter>
<OnLeave function="GameTooltip_Hide"/>
</Scripts>
</CheckButton>
<Button name="KeyBindingFrameDefaultButton" inherits="UIPanelButtonGrayTemplate" text="RESET_TO_DEFAULT">
<Size>
<AbsDimension x="130" y="22"/>
</Size>
<Anchors>
<Anchor point="BOTTOMLEFT">
<Offset>
<AbsDimension x="10" y="21"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
LoadBindings(DEFAULT_BINDINGS);
KeyBindingFrameOutputText:SetText("");
KeyBindingFrame_SetSelected(nil);
KeyBindingFrame_Update();
</OnClick>
</Scripts>
</Button>
<Button name="KeyBindingFrameCancelButton" inherits="UIPanelButtonTemplate" text="CANCEL">
<Size>
<AbsDimension x="130" y="22"/>
</Size>
<Anchors>
<Anchor point="BOTTOMRIGHT">
<Offset>
<AbsDimension x="-50" y="21"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
LoadBindings(GetCurrentBindingSet());
KeyBindingFrameOutputText:SetText("");
KeyBindingFrame_SetSelected(nil);
HideUIPanel(KeyBindingFrame);
</OnClick>
</Scripts>
</Button>
<Button name="KeyBindingFrameOkayButton" inherits="UIPanelButtonTemplate" text="OKAY">
<Size>
<AbsDimension x="130" y="22"/>
</Size>
<Anchors>
<Anchor point="RIGHT" relativeTo="KeyBindingFrameCancelButton" relativePoint="LEFT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
if ( KeyBindingFrameCharacterButton:GetChecked() ) then
KeyBindingFrame.which = CHARACTER_BINDINGS;
else
KeyBindingFrame.which = ACCOUNT_BINDINGS;
if ( GetCurrentBindingSet() == CHARACTER_BINDINGS ) then
if ( not CONFIRMED_DELETING_CHARACTER_SPECIFIC_BINDINGS ) then
StaticPopup_Show("CONFIRM_DELETING_CHARACTER_SPECIFIC_BINDINGS");
return;
end
end
end
SaveBindings(KeyBindingFrame.which);
KeyBindingFrameOutputText:SetText("");
KeyBindingFrame_SetSelected(nil);
HideUIPanel(KeyBindingFrame);
</OnClick>
</Scripts>
</Button>
<Button name="KeyBindingFrameUnbindButton" inherits="UIPanelButtonTemplate" text="UNBIND">
<Size>
<AbsDimension x="130" y="22"/>
</Size>
<Anchors>
<Anchor point="RIGHT" relativeTo="KeyBindingFrameOkayButton" relativePoint="LEFT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
local key1, key2 = GetBindingKey(KeyBindingFrame.selected, KeyBindingFrame.mode);
if ( key1 ) then
SetBinding(key1, nil, KeyBindingFrame.mode);
end
if ( key2 ) then
SetBinding(key2, nil, KeyBindingFrame.mode);
end
if ( key1 and KeyBindingFrame.keyID == 1 ) then
KeyBindingFrame_SetBinding(key1, nil, key1);
if ( key2 ) then
SetBinding(key2, KeyBindingFrame.selected, KeyBindingFrame.mode);
end
else
if ( key1 ) then
KeyBindingFrame_SetBinding(key1, KeyBindingFrame.selected);
end
if ( key2 ) then
KeyBindingFrame_SetBinding(key2, nil, key2);
end
end
KeyBindingFrame_Update();
-- Button highlighting stuff
KeyBindingFrame_SetSelected(nil);
KeyBindingFrame.buttonPressed:UnlockHighlight();
KeyBindingFrame_UpdateUnbindKey();
KeyBindingFrameOutputText:SetText();
</OnClick>
</Scripts>
</Button>
</Frames>
<Scripts>
<OnClick function="KeyBindingFrame_OnKeyDown"/>
<OnKeyDown function="KeyBindingFrame_OnKeyDown"/>
<OnLoad function="KeyBindingFrame_OnLoad"/>
<OnShow>
KeyBindingFrame_OnShow(self);
Disable_BagButtons();
UpdateMicroButtons();
</OnShow>
<OnHide>
KeyBindingFrameOutputText:SetText("");
PlaySound("gsTitleOptionExit");
ShowUIPanel(GameMenuFrame);
UpdateMicroButtons();
</OnHide>
</Scripts>
</Button>
</Ui>
@@ -0,0 +1 @@
-- This file is executed at the end of addon load
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,6 @@
## Interface: 30300
## Title: Blizzard Calendar
## Secure: 1
## LoadOnDemand: 1
Blizzard_Calendar.xml
Localization.lua
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,684 @@
<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">
<!-- Calendar Day Templates -->
<Button name="CalendarDayButtonTemplate" virtual="true">
<Size x="91" y="91"/>
<Anchors>
<Anchor point="TOPLEFT"/>
</Anchors>
<Layers>
<Layer level="BORDER">
<Texture name="$parentEventTexture" hidden="true">
<Size x="91" y="91"/>
<Anchors>
<Anchor point="CENTER"/>
</Anchors>
<TexCoords left="0.0" right="0.7109375" top="0.0" bottom="0.7109375"/>
</Texture>
</Layer>
<Layer level="ARTWORK">
<Texture name="$parentEventBackgroundTexture" file="Interface\Calendar\CalendarEventBackground" hidden="true">
<Size x="91" y="86"/>
<Anchors>
<Anchor point="BOTTOM"/>
</Anchors>
<TexCoords left="0.0" right="0.671875" top="0.0" bottom="0.671875"/>
</Texture>
</Layer>
<Layer level="OVERLAY">
<Texture name="$parentPendingInviteTexture" file="Interface\Calendar\EventNotification" hidden="true">
<Size x="71" y="91"/>
<Anchors>
<Anchor point="CENTER"/>
</Anchors>
<TexCoords left="0.03125" right="0.6484375" top="0.03125" bottom="0.8671875"/>
</Texture>
</Layer>
</Layers>
<Frames>
<Frame name="$parentOverlayFrame" setAllPoints="true" hidden="true">
<Layers>
<Layer level="BACKGROUND">
<Texture name="$parentTexture" setAllPoints="true"/>
</Layer>
</Layers>
</Frame>
<Frame name="$parentDateFrame">
<Size x="23" y="18"/>
<Anchors>
<Anchor point="TOPLEFT">
<Offset x="5" y="-5"/>
</Anchor>
</Anchors>
<Layers>
<Layer level="BORDER">
<Texture name="$parentBackground" file="Interface\Calendar\DateBackgrounds" setAllPoints="true" hidden="true">
<TexCoords left="0.0" right="0.359375" top="0.625" bottom="0.921875"/>
<Color r="1.0" g="1.0" b="1.0" a="0.8"/>
</Texture>
</Layer>
<Layer level="ARTWORK">
<FontString name="$parentDate" inherits="GameFontHighlight" justifyH="LEFT">
<Anchors>
<Anchor point="CENTER"/>
</Anchors>
</FontString>
</Layer>
</Layers>
</Frame>
<Button name="$parentMoreEventsButton" hidden="true">
<Size x="15" y="11"/>
<Anchors>
<Anchor point="TOPRIGHT">
<Offset x="-5" y="-7"/>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
CalendarDayButtonMoreEventsButton_OnLoad(self);
</OnLoad>
<OnEnter>
CalendarDayButtonMoreEventsButton_OnEnter(self, motion);
</OnEnter>
<OnLeave>
CalendarDayButtonMoreEventsButton_OnLeave(self, motion);
</OnLeave>
<OnClick>
CalendarDayButtonMoreEventsButton_OnClick(self, button, down);
</OnClick>
</Scripts>
<NormalTexture file="Interface\Calendar\MoreArrow">
<TexCoords left="0.0" right="0.9375" top="0.0" bottom="0.6875"/>
</NormalTexture>
</Button>
<Frame name="$parentDarkFrame" hidden="true">
<Size x="91" y="91"/>
<Anchors>
<Anchor point="CENTER"/>
</Anchors>
<Layers>
<Layer level="OVERLAY">
<Texture name="$parentTop" file="Interface\Calendar\CalendarShadows">
<Size x="91" y="45"/>
<Anchors>
<Anchor point="TOP"/>
</Anchors>
<Color r="1.0" g="1.0" b="1.0" a="0.9"/>
</Texture>
<Texture name="$parentBottom" file="Interface\Calendar\CalendarShadows">
<Size x="91" y="46"/>
<Anchors>
<Anchor point="BOTTOM"/>
</Anchors>
<Color r="1.0" g="1.0" b="1.0" a="0.9"/>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnLoad>
RaiseFrameLevel(self);
</OnLoad>
</Scripts>
</Frame>
</Frames>
<Scripts>
<OnLoad>
CalendarDayButton_OnLoad(self);
</OnLoad>
<OnEnter>
CalendarDayButton_OnEnter(self, motion);
</OnEnter>
<OnLeave>
CalendarDayButton_OnLeave(self, motion);
</OnLeave>
<OnClick>
CalendarDayButton_OnClick(self, button, down);
</OnClick>
</Scripts>
<NormalTexture file="Interface\Calendar\CalendarBackground"/>
<HighlightTexture file="Interface\Calendar\Highlights" alphaMode="ADD">
<Size x="88" y="88"/>
<Anchors>
<Anchor point="CENTER"/>
</Anchors>
<TexCoords left="0.0" right="0.34375" top="0.0" bottom="0.6875"/>
</HighlightTexture>
</Button>
<Button name="CalendarDayEventButtonTemplate" virtual="true" hidden="true">
<Size x="83" y="24"/>
<Layers>
<Layer level="ARTWORK">
<Texture name="$parentBlack" file="Interface\Calendar\EventHighlight" hidden="true">
<Anchors>
<Anchor point="TOPLEFT">
<Offset x="0" y="1"/>
</Anchor>
<Anchor point="BOTTOMRIGHT">
<Offset x="0" y="-2"/>
</Anchor>
</Anchors>
<TexCoords left="0" right="1" top="0.5" bottom="1"/>
</Texture>
</Layer>
<Layer level="OVERLAY">
<FontString name="$parentText1" inherits="GameFontNormalSmall" justifyH="LEFT">
<Size x="83" y="12"/>
<Anchors>
<Anchor point="TOPLEFT">
<Offset x="0" y="0"/>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentText2" inherits="GameFontHighlightSmall" justifyH="LEFT">
<Size x="0" y="12"/>
<Anchors>
<Anchor point="BOTTOMLEFT">
<Offset x="0" y="0"/>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnLoad>
CalendarDayEventButton_OnLoad(self);
</OnLoad>
<OnEnter>
CalendarDayEventButton_OnEnter(self, motion);
</OnEnter>
<OnLeave>
CalendarDayEventButton_OnLeave(self, motion);
</OnLeave>
<OnClick>
CalendarDayEventButton_OnClick(self, button, down);
</OnClick>
</Scripts>
<HighlightTexture file="Interface\Calendar\EventHighlight" alphaMode="ADD">
<Anchors>
<Anchor point="TOPLEFT">
<Offset x="-2" y="1"/>
</Anchor>
<Anchor point="BOTTOMRIGHT">
<Offset x="2" y="-2"/>
</Anchor>
</Anchors>
<TexCoords left="0" right="1" top="0" bottom="0.5"/>
</HighlightTexture>
</Button>
<!-- Calendar Misc Templates -->
<Frame name="CalendarTitleFrameTemplate" virtual="true">
<Size x="240" y="40"/>
<Anchors>
<Anchor point="TOP">
<Offset x="0" y="12"/>
</Anchor>
</Anchors>
<Layers>
<Layer level="ARTWORK">
<Texture name="$parentBackgroundMiddle" file="Interface\DialogFrame\UI-DialogBox-Header">
<Size x="140" y="40"/>
<Anchors>
<Anchor point="TOP"/>
</Anchors>
<TexCoords left="0.28125" right="0.71484375" top="0.0" bottom="0.625"/>
</Texture>
<Texture name="$parentBackgroundLeft" file="Interface\DialogFrame\UI-DialogBox-Header">
<Size x="14" y="40"/>
<Anchors>
<Anchor point="RIGHT" relativeTo="$parentBackgroundMiddle" relativePoint="LEFT"/>
</Anchors>
<TexCoords left="0.2265625" right="0.28125" top="0.0" bottom="0.625"/>
</Texture>
<Texture name="$parentBackgroundRight" file="Interface\DialogFrame\UI-DialogBox-Header">
<Size x="14" y="40"/>
<Anchors>
<Anchor point="LEFT" relativeTo="$parentBackgroundMiddle" relativePoint="RIGHT"/>
</Anchors>
<TexCoords left="0.71484375" right="0.76953125" top="0.0" bottom="0.625"/>
</Texture>
<FontString name="$parentText" inherits="GameFontNormal">
<Size x="0" y="14"/>
<Anchors>
<Anchor point="TOP" relativeTo="$parentBackgroundMiddle">
<Offset x="0" y="-14"/>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
</Frame>
<Button name="CalendarCloseButtonTemplate" inherits="UIPanelCloseButton" virtual="true">
<Anchors>
<Anchor point="TOPRIGHT">
<Offset x="0" y="0"/>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture file="Interface\DialogFrame\UI-DialogBox-Corner">
<Anchors>
<Anchor point="TOPRIGHT">
<Offset x="-4" y="-4"/>
</Anchor>
</Anchors>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnLoad>
self:SetFrameLevel(self:GetParent():GetFrameLevel() + 6);
</OnLoad>
</Scripts>
</Button>
<!-- Calendar Event Templates -->
<Button name="CalendarEventButtonTemplate" inherits="UIPanelButtonTemplate2" virtual="true">
<Size x="95" y="22"/>
</Button>
<Button name="CalendarEventCloseButtonTemplate" inherits="CalendarCloseButtonTemplate" virtual="true">
<Scripts>
<OnClick>
CalendarEventCloseButton_OnClick(self, button, down);
</OnClick>
</Scripts>
</Button>
<ScrollFrame name="CalendarEventDescriptionScrollFrame" inherits="UIPanelScrollFrameTemplate" virtual="true">
<Anchors>
<Anchor point="TOPLEFT">
<Offset x="4" y="-4"/>
</Anchor>
<Anchor point="BOTTOMRIGHT">
<Offset x="-4" y="4"/>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
CalendarEventDescriptionScrollFrame_OnLoad(self);
</OnLoad>
</Scripts>
</ScrollFrame>
<Button name="CalendarEventInviteSortButtonTemplate" virtual="true">
<Size x="45" y="14"/>
<Layers>
<Layer level="BACKGROUND">
<Texture name="$parentDirection" file="Interface\Calendar\MoreArrow" hidden="true">
<Size x="15" y="11"/>
<Anchors>
<Anchor point="RIGHT"/>
</Anchors>
<TexCoords left="0.0" right="0.9375" top="0.0" bottom="0.6875"/>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnLoad>
CalendarEventInviteSortButton_OnLoad(self);
</OnLoad>
<OnClick>
CalendarEventInviteSortButton_OnClick(self, button, down);
</OnClick>
</Scripts>
<NormalFont style="GameFontHighlightSmall"/>
<HighlightFont style="GameFontNormalSmall"/>
</Button>
<Frame name="CalendarEventInviteListTemplate" virtual="true">
<Size x="294" y="250"/>
<Backdrop bgFile="Interface\Tooltips\UI-Tooltip-Background" edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true">
<EdgeSize>
<AbsValue val="8"/>
</EdgeSize>
<TileSize>
<AbsValue val="8"/>
</TileSize>
<BackgroundInsets>
<AbsInset left="1" right="1" top="1" bottom="1"/>
</BackgroundInsets>
</Backdrop>
<Frames>
<ScrollFrame name="$parentScrollFrame" inherits="HybridScrollFrameTemplate">
<Anchors>
<Anchor point="TOPLEFT">
<Offset x="3" y="-3"/>
</Anchor>
<Anchor point="BOTTOMRIGHT">
<Offset x="-25" y="3"/>
</Anchor>
</Anchors>
<Frames>
<Slider name="$parentScrollBar" inherits="HybridScrollBarTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativePoint="TOPRIGHT">
<Offset x="0" y="-16"/>
</Anchor>
<Anchor point="BOTTOMLEFT" relativePoint="BOTTOMRIGHT">
<Offset x="0" y="14"/>
</Anchor>
</Anchors>
</Slider>
</Frames>
<Scripts>
<OnLoad>
HybridScrollFrame_OnLoad(self);
self:GetParent().scrollFrame = self;
</OnLoad>
</Scripts>
</ScrollFrame>
<Button name="$parentNameSortButton" inherits="CalendarEventInviteSortButtonTemplate">
<Anchors>
<Anchor point="BOTTOM" relativePoint="TOP">
<Offset x="3" y="0"/>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
--[[
if ( self:GetParent().partyMode ) then
self.criterion = "party";
else
self.criterion = "name";
end
--]]
self.criterion = "name";
CalendarEventInviteSortButton_OnClick(self);
</OnClick>
</Scripts>
<ButtonText text="NAME" justifyH="LEFT"/>
</Button>
<Button name="$parentClassSortButton" inherits="CalendarEventInviteSortButtonTemplate">
<Anchors>
<Anchor point="BOTTOM" relativePoint="TOP">
<Offset x="3" y="0"/>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
CalendarEventInviteSortButton_OnLoad(self);
self.criterion = "class";
</OnLoad>
</Scripts>
<ButtonText text="CLASS" justifyH="LEFT"/>
</Button>
<Button name="$parentStatusSortButton" inherits="CalendarEventInviteSortButtonTemplate">
<Anchors>
<Anchor point="BOTTOM" relativePoint="TOP">
<Offset x="-3" y="0"/>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
CalendarEventInviteSortButton_OnLoad(self);
self.criterion = "status";
</OnLoad>
</Scripts>
<ButtonText text="STATUS" justifyH="LEFT"/>
</Button>
</Frames>
<Scripts>
<OnLoad>
CalendarEventInviteList_OnLoad(self);
</OnLoad>
</Scripts>
</Frame>
<Button name="CalendarEventInviteListButtonTemplate" virtual="true">
<Size x="260" y="14"/>
<Layers>
<Layer level="BORDER">
<Texture name="$parentModIcon" hidden="true">
<Size x="14" y="14"/>
<Anchors>
<Anchor point="LEFT"/>
</Anchors>
</Texture>
<Texture name="$parentPartyIcon" file="Interface\RaidFrame\ReadyCheck-Ready" hidden="true">
<Size x="14" y="14"/>
<Anchors>
<Anchor point="LEFT"/>
</Anchors>
</Texture>
<FontString name="$parentName" inherits="GameFontNormalSmall" justifyH="LEFT">
<Size x="110" y="14"/>
<Anchors>
<Anchor point="LEFT" relativeTo="$parentPartyIcon" relativePoint="RIGHT"/>
</Anchors>
</FontString>
<FontString name="$parentStatus" inherits="GameFontNormalSmall" justifyH="RIGHT">
<Size x="77" y="14"/>
<Anchors>
<Anchor point="RIGHT"/>
</Anchors>
</FontString>
<FontString name="$parentClass" inherits="GameFontNormalSmall" justifyH="LEFT">
<Size x="80" y="14"/>
<Anchors>
<Anchor point="CENTER">
<Offset x="20" y="0"/>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnLoad>
self:RegisterForClicks("LeftButtonUp", "RightButtonUp");
</OnLoad>
<OnEnter>
CalendarEventInviteListButton_OnEnter(self, motion);
</OnEnter>
<OnLeave>
GameTooltip:Hide();
</OnLeave>
</Scripts>
<HighlightTexture file="Interface\FriendsFrame\UI-FriendsFrame-HighlightBar" alphaMode="ADD"/>
</Button>
<!-- Calendar View Event Templates -->
<Button name="CalendarViewEventRSVPButtonTemplate" inherits="CalendarEventButtonTemplate" virtual="true">
<Size x="128" y="22"/>
<Layers>
<Layer level="OVERLAY">
<Texture name="$parentFlashTexture" parentKey="flashTexture" alphaMode="ADD" file="Interface\Buttons\UI-Panel-Button-Glow">
<Anchors>
<Anchor point="TOPLEFT">
<Offset x="-11" y="7"/>
</Anchor>
<Anchor point="BOTTOMRIGHT">
<Offset x="11" y="-7"/>
</Anchor>
</Anchors>
<TexCoords left="0.0" right="0.75" top="0.0" bottom="0.609375"/>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnUpdate function="CalendarViewEventRSVPButton_OnUpdate"/>
</Scripts>
</Button>
<Button name="CalendarViewEventInviteListButtonTemplate" inherits="CalendarEventInviteListButtonTemplate" virtual="true">
<Scripts>
<OnClick>
CalendarViewEventInviteListButton_OnClick(self, button, down);
</OnClick>
</Scripts>
</Button>
<!-- Calendar Create Event Templates -->
<Button name="CalendarCreateEventInviteListButtonTemplate" inherits="CalendarEventInviteListButtonTemplate" virtual="true">
<Scripts>
<OnClick>
CalendarCreateEventInviteListButton_OnClick(self, button, down);
</OnClick>
</Scripts>
</Button>
<Button name="CalendarMassInviteArenaButtonTemplate" inherits="CalendarEventButtonTemplate" virtual="true">
<Scripts>
<OnLoad>
CalendarMassInviteArenaButton_OnLoad(self);
</OnLoad>
<OnClick>
CalendarMassInviteArenaButton_OnClick(self, button, down);
</OnClick>
<OnEnter>
CalendarMassInviteArenaButton_OnEnter(self, motion);
</OnEnter>
<OnLeave>
GameTooltip:Hide();
</OnLeave>
</Scripts>
</Button>
<!-- Calendar Modal Dialog Templates -->
<Frame name="CalendarModalDialogTemplate" toplevel="true" enableMouse="true" enableKeyboard="true" frameStrata="DIALOG" virtual="true">
<Scripts>
<OnShow>
CalendarFrame_PushModal(self);
</OnShow>
<OnHide>
CalendarFrame_PopModal(self);
</OnHide>
</Scripts>
</Frame>
<Frame name="CalendarModalEventOverlayTemplate" virtual="true">
<Anchors>
<Anchor point="TOPLEFT">
<Offset x="10" y="-10"/>
</Anchor>
<Anchor point="BOTTOMRIGHT">
<Offset x="-10" y="10"/>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture setAllPoints="true">
<Color r="0" g="0" b="0" a="0.5"/>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnLoad>
self:SetFrameLevel(self:GetParent():GetFrameLevel() + 5);
</OnLoad>
</Scripts>
</Frame>
<!-- Calendar Event Picker Templates -->
<Button name="CalendarEventPickerButtonTemplate" virtual="true">
<Size x="240" y="16"/>
<Anchors>
<Anchor point="RIGHT">
<Offset x="-4" y="0"/>
</Anchor>
</Anchors>
<Layers>
<Layer level="BORDER">
<Texture name="$parentIcon">
<Size x="16" y="16"/>
<Anchors>
<Anchor point="LEFT"/>
</Anchors>
</Texture>
<FontString name="$parentTime" inherits="GameFontHighlight" justifyH="RIGHT">
<Anchors>
<Anchor point="RIGHT"/>
</Anchors>
</FontString>
<FontString name="$parentTitle" inherits="GameFontNormal" justifyH="LEFT">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parentIcon" relativePoint="TOPRIGHT"/>
<Anchor point="BOTTOMRIGHT" relativeTo="$parentTime" relativePoint="BOTTOMLEFT"/>
</Anchors>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnLoad>
CalendarEventPickerButton_OnLoad(self);
</OnLoad>
<OnClick>
CalendarEventPickerButton_OnClick(self, button, down);
</OnClick>
<OnDoubleClick>
CalendarEventPickerCloseButton_OnClick(self, button);
</OnDoubleClick>
</Scripts>
<HighlightTexture file="Interface\FriendsFrame\UI-FriendsFrame-HighlightBar" alphaMode="ADD"/>
</Button>
<!-- Calendar Texture Picker Templates -->
<Button name="CalendarTexturePickerButtonTemplate" virtual="true">
<Size x="240" y="16"/>
<Anchors>
<Anchor point="RIGHT">
<Offset x="-4" y="0"/>
</Anchor>
</Anchors>
<Layers>
<Layer level="BORDER">
<Texture name="$parentIcon">
<Size x="16" y="16"/>
<Anchors>
<Anchor point="LEFT"/>
</Anchors>
<TexCoords left="0.0" right="0.796875" top="0.0" bottom="0.71875"/>
</Texture>
<FontString name="$parentTitle" inherits="GameFontNormal" justifyH="LEFT">
<Size x="224" y="16"/>
<Anchors>
<Anchor point="LEFT" relativeTo="$parentIcon" relativePoint="RIGHT"/>
</Anchors>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnLoad>
CalendarTexturePickerButton_OnLoad(self);
</OnLoad>
<OnClick>
CalendarTexturePickerButton_OnClick(self, button, down);
</OnClick>
<OnDoubleClick>
CalendarTexturePickerButton_OnDoubleClick(self, button);
</OnDoubleClick>
</Scripts>
<HighlightTexture file="Interface\FriendsFrame\UI-FriendsFrame-HighlightBar" alphaMode="ADD"/>
</Button>
<!-- Calendar Class Templates -->
<Button name="CalendarClassButtonTemplate" virtual="true">
<Size x="20" y="20"/>
<Layers>
<Layer level="BACKGROUND">
<Texture file="Interface\SpellBook\SpellBook-SkillLineTab">
<Size x="36" y="36"/>
<Anchors>
<Anchor point="LEFT">
<Offset x="-2" y="0"/>
</Anchor>
</Anchors>
<TexCoords left="0.0" right="0.875" top="0.0" bottom="0.875"/>
</Texture>
</Layer>
<Layer level="OVERLAY">
<FontString name="$parentCount" inherits="NumberFontNormalSmall" justifyH="RIGHT">
<Anchors>
<Anchor point="BOTTOMRIGHT">
<Offset x="2" y="0"/>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnLoad>
CalendarClassButton_OnLoad(self);
</OnLoad>
<OnEnter>
CalendarClassButton_OnEnter(self, motion);
</OnEnter>
<OnLeave>
GameTooltip:Hide();
</OnLeave>
</Scripts>
<NormalTexture file="Interface\Glues\CharacterCreate\UI-CharacterCreate-Classes"/>
</Button>
</Ui>
@@ -0,0 +1 @@
-- This file is executed at the end of addon load
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,7 @@
## Interface: 30300
## Title: Blizzard CombatLog
## Secure: 1
## LoadOnDemand: 1
## SavedVariables: Blizzard_CombatLog_Filters, Blizzard_CombatLog_Filter_Version
Blizzard_CombatLog.xml
Localization.lua
@@ -0,0 +1,106 @@
<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="localization.lua"/>
<Script file="Blizzard_CombatLog.lua"/>
<Frame name="CombatLogDropDown" inherits="UIDropDownMenuTemplate"/>
<Button name="CombatLogQuickButtonTemplate" virtual="true">
<Size>
<AbsDimension x="0" y="20"/>
</Size>
<Scripts>
<OnClick>
Blizzard_CombatLog_QuickButton_OnClick(self:GetID());
</OnClick>
<OnEnter>
if (self.tooltip) then
GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
GameTooltip_AddNewbieTip(self, self.tooltip, 1.0, 1.0, 1.0, nil, 1);
end
</OnEnter>
<OnLeave>
GameTooltip:Hide();
</OnLeave>
</Scripts>
<NormalFont style="GameFontDisable"/>
<HighlightFont style="GameFontHighlight"/>
</Button>
<Frame name="CombatLogQuickButtonFrame_Custom" parent="ChatFrame2" hidden="false">
<Size>
<AbsDimension x="65" y="24"/>
</Size>
<Anchors>
<Anchor point="CENTER" relativeTo="ChatFrame2" relativePoint="CENTER">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture name="$parentTexture" setAllPoints="true">
<Color r="0.0" g="0.0" b="0.0" a="0.7"/>
</Texture>
</Layer>
</Layers>
<Frames>
<StatusBar name="$parentProgressBar" hidden="true">
<Size>
<AbsDimension x="195" y="4"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parent" relativePoint="TOPLEFT">
<Offset>
<AbsDimension x="0" y="2"/>
</Offset>
</Anchor>
<Anchor point="TOPRIGHT" relativeTo="$parent" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="0" y="2"/>
</Offset>
</Anchor>
</Anchors>
<BarTexture file="Interface\TargetingFrame\UI-StatusBar"/>
<BarColor r="0.0" g="1.0" b="0.3"/>
</StatusBar>
<Button name="$parentAdditionalFilterButton">
<Size>
<AbsDimension x="28" y="28"/>
</Size>
<Anchors>
<Anchor point="TOPRIGHT" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<HitRectInsets>
<AbsInset left="6" right="6" top="7" bottom="7"/>
</HitRectInsets>
<Scripts>
<OnLoad>
self:RegisterForClicks("LeftButtonUp", "RightButtonUp");
</OnLoad>
<OnClick>
EasyMenu(Blizzard_CombatLog_CreateFilterMenu(), CombatLogDropDown, "cursor", nil, nil, "MENU");
PlaySound("UChatScrollButton");
</OnClick>
<OnEnter>
GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
GameTooltip_AddNewbieTip(self, ADDITIONAL_FILTERS, 1.0, 1.0, 1.0);
</OnEnter>
<OnLeave function="GameTooltip_Hide"/>
</Scripts>
<NormalTexture file="Interface\MainMenuBar\UI-MainMenu-ScrollDownButton-Up"/>
<PushedTexture file="Interface\MainMenuBar\UI-MainMenu-ScrollDownButton-Down"/>
<DisabledTexture file="Interface\MainMenuBar\UI-MainMenu-ScrollDownButton-Disabled"/>
<HighlightTexture alphaMode="ADD" file="Interface\MainMenuBar\UI-MainMenu-ScrollDownButton-Highlight"/>
</Button>
</Frames>
<Scripts>
<OnShow function="Blizzard_CombatLog_Update_QuickButtons"/>
<OnLoad function="Blizzard_CombatLog_QuickButtonFrame_OnLoad"/>
<OnEvent function="Blizzard_CombatLog_QuickButtonFrame_OnEvent"/>
</Scripts>
</Frame>
</Ui>
@@ -0,0 +1 @@
-- This file is executed at the end of addon load
@@ -0,0 +1,610 @@
NUM_COMBAT_TEXT_LINES = 20;
COMBAT_TEXT_SCROLLSPEED = 1.9;
COMBAT_TEXT_FADEOUT_TIME = 1.3;
COMBAT_TEXT_HEIGHT = 25;
COMBAT_TEXT_CRIT_MAXHEIGHT = 60;
COMBAT_TEXT_CRIT_MINHEIGHT = 30;
COMBAT_TEXT_CRIT_SCALE_TIME = 0.05;
COMBAT_TEXT_CRIT_SHRINKTIME = 0.2;
COMBAT_TEXT_TO_ANIMATE = {};
COMBAT_TEXT_STAGGER_RANGE = 20;
COMBAT_TEXT_SPACING = 10;
COMBAT_TEXT_MAX_OFFSET = 130;
COMBAT_TEXT_LOW_HEALTH_THRESHOLD = 0.2;
COMBAT_TEXT_LOW_MANA_THRESHOLD = 0.2;
COMBAT_TEXT_LOCATIONS = {};
COMBAT_TEXT_X_ADJUSTMENT = 80;
COMBAT_TEXT_Y_SCALE = 1;
COMBAT_TEXT_X_SCALE = 1;
--[[
List of COMBAT_TEXT_TYPE_INFO attributes
======================================================
r, g, b = [floats] -- The floating text color
show = [nil, 1] -- Display this message type in the UI
isStaggered = [nil, 1] -- Randomly stagger these messages from left to right
var = [nil, 1] -- This messageType is shown if this variable resolves to "1"
]]
COMBAT_TEXT_TYPE_INFO = {};
COMBAT_TEXT_TYPE_INFO["INTERRUPT"] = {r = 1, g = 1, b = 1};
COMBAT_TEXT_TYPE_INFO["DAMAGE_CRIT"] = {r = 1, g = 0.1, b = 0.1, show = 1};
COMBAT_TEXT_TYPE_INFO["DAMAGE"] = {r = 1, g = 0.1, b = 0.1, isStaggered = 1, show = 1};
COMBAT_TEXT_TYPE_INFO["MISS"] = {r = 1, g = 0.1, b = 0.1, isStaggered = 1, var = "COMBAT_TEXT_SHOW_DODGE_PARRY_MISS"};
COMBAT_TEXT_TYPE_INFO["DODGE"] = {r = 1, g = 0.1, b = 0.1, isStaggered = 1, var = "COMBAT_TEXT_SHOW_DODGE_PARRY_MISS"};
COMBAT_TEXT_TYPE_INFO["PARRY"] = {r = 1, g = 0.1, b = 0.1, isStaggered = 1, var = "COMBAT_TEXT_SHOW_DODGE_PARRY_MISS"};
COMBAT_TEXT_TYPE_INFO["EVADE"] = {r = 1, g = 0.1, b = 0.1, isStaggered = 1, var = "COMBAT_TEXT_SHOW_DODGE_PARRY_MISS"};
COMBAT_TEXT_TYPE_INFO["IMMUNE"] = {r = 1, g = 0.1, b = 0.1, var = "COMBAT_TEXT_SHOW_DODGE_PARRY_MISS"};
COMBAT_TEXT_TYPE_INFO["DEFLECT"] = {r = 1, g = 0.1, b = 0.1, var = "COMBAT_TEXT_SHOW_DODGE_PARRY_MISS"};
COMBAT_TEXT_TYPE_INFO["REFLECT"] = {r = 1, g = 0.1, b = 0.1, var = "COMBAT_TEXT_SHOW_DODGE_PARRY_MISS"};
COMBAT_TEXT_TYPE_INFO["RESIST"] = {r = 1, g = 0.1, b = 0.1, var = "COMBAT_TEXT_SHOW_RESISTANCES"};
COMBAT_TEXT_TYPE_INFO["BLOCK"] = {r = 1, g = 0.1, b = 0.1, var = "COMBAT_TEXT_SHOW_RESISTANCES"};
COMBAT_TEXT_TYPE_INFO["ABSORB"] = {r = 1, g = 0.1, b = 0.1, var = "COMBAT_TEXT_SHOW_RESISTANCES"};
COMBAT_TEXT_TYPE_INFO["SPELL_DAMAGE_CRIT"] = {r = 0.79, g = 0.3, b = 0.85, show = 1};
COMBAT_TEXT_TYPE_INFO["SPELL_DAMAGE"] = {r = 0.79, g = 0.3, b = 0.85, show = 1};
COMBAT_TEXT_TYPE_INFO["SPELL_MISS"] = {r = 1, g = 1, b = 1, var = "COMBAT_TEXT_SHOW_DODGE_PARRY_MISS"};
COMBAT_TEXT_TYPE_INFO["SPELL_DODGE"] = {r = 1, g = 1, b = 1, var = "COMBAT_TEXT_SHOW_DODGE_PARRY_MISS"};
COMBAT_TEXT_TYPE_INFO["SPELL_PARRY"] = {r = 1, g = 1, b = 1, var = "COMBAT_TEXT_SHOW_DODGE_PARRY_MISS"};
COMBAT_TEXT_TYPE_INFO["SPELL_EVADE"] = {r = 1, g = 1, b = 1, var = "COMBAT_TEXT_SHOW_DODGE_PARRY_MISS"};
COMBAT_TEXT_TYPE_INFO["SPELL_IMMUNE"] = {r = 1, g = 1, b = 1, var = "COMBAT_TEXT_SHOW_DODGE_PARRY_MISS"};
COMBAT_TEXT_TYPE_INFO["SPELL_DEFLECT"] = {r = 1, g = 1, b = 1, var = "COMBAT_TEXT_SHOW_DODGE_PARRY_MISS"};
COMBAT_TEXT_TYPE_INFO["SPELL_REFLECT"] = {r = 1, g = 1, b = 1, var = "COMBAT_TEXT_SHOW_DODGE_PARRY_MISS"};
COMBAT_TEXT_TYPE_INFO["SPELL_RESIST"] = {r = 0.79, g = 0.3, b = 0.85, var = "COMBAT_TEXT_SHOW_RESISTANCES"};
COMBAT_TEXT_TYPE_INFO["SPELL_BLOCK"] = {r = 1, g = 1, b = 1, var = "COMBAT_TEXT_SHOW_RESISTANCES"};
COMBAT_TEXT_TYPE_INFO["SPELL_ABSORB"] = {r = 0.79, g = 0.3, b = 0.85, var = "COMBAT_TEXT_SHOW_RESISTANCES"};
COMBAT_TEXT_TYPE_INFO["PERIODIC_HEAL"] = {r = 0.1, g = 1, b = 0.1, show = 1};
COMBAT_TEXT_TYPE_INFO["ENERGIZE"] = {r = 0.1, g = 0.1, b = 1, var = "COMBAT_TEXT_SHOW_ENERGIZE"};
COMBAT_TEXT_TYPE_INFO["PERIODIC_ENERGIZE"] = {r = 0.1, g = 0.1, b = 1, var = "COMBAT_TEXT_SHOW_PERIODIC_ENERGIZE"};
COMBAT_TEXT_TYPE_INFO["SPELL_CAST"] = {r = 0.1, g = 1, b = 0.1, show = 1};
COMBAT_TEXT_TYPE_INFO["SPELL_AURA_END"] = {r = 0.1, g = 1, b = 0.1, var = "COMBAT_TEXT_SHOW_AURAS"};
COMBAT_TEXT_TYPE_INFO["SPELL_AURA_END_HARMFUL"] = {r = 1, g = 0.1, b = 0.1, var = "COMBAT_TEXT_SHOW_AURAS"};
COMBAT_TEXT_TYPE_INFO["SPELL_AURA_START"] = {r = 0.1, g = 1, b = 0.1, var = "COMBAT_TEXT_SHOW_AURAS"};
COMBAT_TEXT_TYPE_INFO["SPELL_AURA_START_HARMFUL"] = {r = 1, g = 0.1, b = 0.1, var = "COMBAT_TEXT_SHOW_AURAS"};
COMBAT_TEXT_TYPE_INFO["SPELL_ACTIVE"] = {r = 1, g = 0.82, b = 0, var = "COMBAT_TEXT_SHOW_REACTIVES"};
COMBAT_TEXT_TYPE_INFO["FACTION"] = {r = 0.1, g = 0.1, b = 1, var = "COMBAT_TEXT_SHOW_REPUTATION"};
COMBAT_TEXT_TYPE_INFO["HEAL_CRIT"] = {r = 0.1, g = 1, b = 0.1, show = 1};
COMBAT_TEXT_TYPE_INFO["HEAL"] = {r = 0.1, g = 1, b = 0.1, show = 1};
COMBAT_TEXT_TYPE_INFO["DAMAGE_SHIELD"] = {r = 1, g = 1, b = 1};
COMBAT_TEXT_TYPE_INFO["SPELL_DISPELLED"] = {r = 1, g = 1, b = 1};
COMBAT_TEXT_TYPE_INFO["EXTRA_ATTACKS"] = {r = 1, g = 1, b = 1};
COMBAT_TEXT_TYPE_INFO["SPLIT_DAMAGE"] = {r = 1, g = 1, b = 1, show = 1};
COMBAT_TEXT_TYPE_INFO["HONOR_GAINED"] = {r = 0.1, g = 0.1, b = 1, var = "COMBAT_TEXT_SHOW_HONOR_GAINED"};
COMBAT_TEXT_TYPE_INFO["HEALTH_LOW"] = {r = 1, g = 0.1, b = 0.1, var = "COMBAT_TEXT_SHOW_LOW_HEALTH_MANA"};
COMBAT_TEXT_TYPE_INFO["MANA_LOW"] = {r = 1, g = 0.1, b = 0.1, var = "COMBAT_TEXT_SHOW_LOW_HEALTH_MANA"};
COMBAT_TEXT_TYPE_INFO["ENTERING_COMBAT"] = {r = 1, g = 0.1, b = 0.1, var = "COMBAT_TEXT_SHOW_COMBAT_STATE"};
COMBAT_TEXT_TYPE_INFO["LEAVING_COMBAT"] = {r = 1, g = 0.1, b = 0.1, var = "COMBAT_TEXT_SHOW_COMBAT_STATE"};
COMBAT_TEXT_TYPE_INFO["COMBO_POINTS"] = {r = 0.1, g = 0.1, b = 1, var = "COMBAT_TEXT_SHOW_COMBO_POINTS"};
COMBAT_TEXT_TYPE_INFO["RUNE"] = {r = 0.1, g = 0.1, b = 1, var = "COMBAT_TEXT_SHOW_ENERGIZE"};
COMBAT_TEXT_TYPE_INFO["PERIODIC_HEAL_ABSORB"] = {r = 0.1, g = 1, b = 0.1, show = 1};
COMBAT_TEXT_TYPE_INFO["HEAL_CRIT_ABSORB"] = {r = 0.1, g = 1, b = 0.1, show = 1};
COMBAT_TEXT_TYPE_INFO["HEAL_ABSORB"] = {r = 0.1, g = 1, b = 0.1, show = 1};
COMBAT_TEXT_RUNE = {};
COMBAT_TEXT_RUNE[1] = COMBAT_TEXT_RUNE_BLOOD;
COMBAT_TEXT_RUNE[2] = COMBAT_TEXT_RUNE_UNHOLY;
COMBAT_TEXT_RUNE[3] = COMBAT_TEXT_RUNE_FROST;
function CombatText_OnLoad(self)
CombatText_UpdateDisplayedMessages();
CombatText.previousMana = {};
CombatText.xDir = 1;
end
function CombatText_OnEvent(self, event, ...)
if ( not self:IsVisible() ) then
CombatText_ClearAnimationList();
return;
end
local arg1, data, arg3 = ...;
-- Set up the messageType
local messageType, message;
-- Set the message data
local displayType;
if ( event == "UNIT_ENTERED_VEHICLE" ) then
local unit, showVehicle = ...;
if ( unit == "player" ) then
if ( showVehicle ) then
self.unit = "vehicle";
else
self.unit = "player";
end
CombatTextSetActiveUnit(self.unit);
end
return;
elseif ( event == "UNIT_EXITING_VEHICLE" ) then
if ( arg1 == "player" ) then
self.unit = "player";
CombatTextSetActiveUnit(self.unit);
end
return;
elseif ( event == "UNIT_HEALTH" ) then
if ( arg1 == self.unit ) then
if ( UnitHealth(self.unit)/UnitHealthMax(self.unit) <= COMBAT_TEXT_LOW_HEALTH_THRESHOLD ) then
if ( not CombatText.lowHealth ) then
messageType = "HEALTH_LOW";
CombatText.lowHealth = 1;
end
else
CombatText.lowHealth = nil;
end
end
-- Didn't meet any of the criteria so just return
if ( not messageType ) then
return;
end
elseif ( event == "UNIT_MANA" ) then
if ( arg1 == self.unit ) then
local powerType, powerToken = UnitPowerType(self.unit);
if ( powerToken == "MANA" and (UnitPower(self.unit) / UnitPowerMax(self.unit)) <= COMBAT_TEXT_LOW_MANA_THRESHOLD ) then
if ( not CombatText.lowMana ) then
messageType = "MANA_LOW";
CombatText.lowMana = 1;
end
else
CombatText.lowMana = nil;
end
end
-- Didn't meet any of the criteria so just return
if ( not messageType ) then
return;
end
elseif ( event == "PLAYER_REGEN_DISABLED" ) then
messageType = "ENTERING_COMBAT";
elseif ( event == "PLAYER_REGEN_ENABLED" ) then
messageType = "LEAVING_COMBAT";
elseif ( event == "UNIT_COMBO_POINTS" ) then
local unit = ...;
if ( unit == "player" ) then
local comboPoints = GetComboPoints("player", "target");
if ( comboPoints > 0 ) then
messageType = "COMBO_POINTS";
data = comboPoints;
-- Show message as a crit if max combo points
if ( comboPoints == MAX_COMBO_POINTS ) then
displayType = "crit";
end
else
return;
end
else
return;
end
elseif ( event == "COMBAT_TEXT_UPDATE" ) then
messageType = arg1;
elseif ( event == "RUNE_POWER_UPDATE" ) then
messageType = "RUNE";
else
messageType = event;
end
-- Process the messageType and format the message
--Check to see if there's a COMBAT_TEXT_TYPE_INFO associated with this combat message
local info = COMBAT_TEXT_TYPE_INFO[messageType];
if ( not info ) then
info = {r = 1, g =1, b = 1};
end
-- See if we should display the message or not
if ( not info.show ) then
-- When Resists aren't being shown, partial resists should display as Damage
if (info.var == "COMBAT_TEXT_SHOW_RESISTANCES" and arg3) then
messageType = "DAMAGE";
else
return;
end
end
local isStaggered = info.isStaggered;
if ( messageType == "" ) then
elseif ( messageType == "DAMAGE_CRIT" or messageType == "SPELL_DAMAGE_CRIT" ) then
displayType = "crit";
message = "-"..data;
elseif ( messageType == "DAMAGE" or messageType == "SPELL_DAMAGE" ) then
if (data == 0) then
return
end
message = "-"..data;
elseif ( messageType == "SPELL_CAST" ) then
message = "<"..data..">";
elseif ( messageType == "SPELL_AURA_START" ) then
message = "<"..data..">";
elseif ( messageType == "SPELL_AURA_START_HARMFUL" ) then
message = "<"..data..">";
elseif ( messageType == "SPELL_AURA_END" or messageType == "SPELL_AURA_END_HARMFUL" ) then
message = format(AURA_END, data);
elseif ( messageType == "HEAL" or messageType == "PERIODIC_HEAL") then
if ( COMBAT_TEXT_SHOW_FRIENDLY_NAMES == "1" and messageType == "HEAL" and UnitName(self.unit) ~= data ) then
message = "+"..arg3.." ["..data.."]";
else
message = "+"..arg3;
end
elseif ( messageType == "HEAL_ABSORB" or messageType == "PERIODIC_HEAL_ABSORB") then
if ( COMBAT_TEXT_SHOW_FRIENDLY_NAMES == "1" and messageType == "HEAL_ABSORB" and UnitName(self.unit) ~= data ) then
message = "+"..arg3.." ["..data.."] "..format(ABSORB_TRAILER, arg4);
else
message = "+"..arg3.." "..format(ABSORB_TRAILER, arg4);
end
elseif ( messageType == "HEAL_CRIT" ) then
displayType = "crit";
if ( COMBAT_TEXT_SHOW_FRIENDLY_NAMES == "1" and UnitName(self.unit) ~= data ) then
message = "+"..arg3.." ["..data.."]";
else
message = "+"..arg3;
end
elseif ( messageType == "HEAL_CRIT_ABSORB" ) then
displayType = "crit";
if ( COMBAT_TEXT_SHOW_FRIENDLY_NAMES == "1" and UnitName(self.unit) ~= data ) then
message = "+"..arg3.." ["..data.."] "..format(ABSORB_TRAILER, arg4);
else
message = "+"..arg3.." "..format(ABSORB_TRAILER, arg4);
end
elseif ( messageType == "ENERGIZE" or messageType == "PERIODIC_ENERGIZE") then
if ( tonumber(data) > 0 ) then
data = "+"..data;
end
if( arg3 == "MANA"
or arg3 == "RAGE"
or arg3 == "FOCUS"
or arg3 == "ENERGY"
or arg3 == "RUNIC_POWER") then
message = data.." ".._G[arg3];
info = PowerBarColor[arg3];
end
elseif ( messageType == "FACTION" ) then
if ( tonumber(arg3) > 0 ) then
arg3 = "+"..arg3;
end
message = "("..data.." "..arg3..")";
elseif ( messageType == "SPELL_MISS" ) then
message = COMBAT_TEXT_MISS;
elseif ( messageType == "SPELL_DODGE" ) then
message = COMBAT_TEXT_DODGE;
elseif ( messageType == "SPELL_PARRY" ) then
message = COMBAT_TEXT_PARRY;
elseif ( messageType == "SPELL_EVADE" ) then
message = COMBAT_TEXT_EVADE;
elseif ( messageType == "SPELL_IMMUNE" ) then
message = COMBAT_TEXT_IMMUNE;
elseif ( messageType == "SPELL_DEFLECT" ) then
message = COMBAT_TEXT_DEFLECT;
elseif ( messageType == "SPELL_REFLECT" ) then
message = COMBAT_TEXT_REFLECT;
elseif ( messageType == "BLOCK" or messageType == "SPELL_BLOCK" ) then
if ( arg3 ) then
-- Partial block
message = "-"..data.." "..format(BLOCK_TRAILER, arg3);
else
message = COMBAT_TEXT_BLOCK;
end
elseif ( messageType == "ABSORB" or messageType == "SPELL_ABSORB" ) then
if ( arg3 and data > 0 ) then
-- Partial absorb
message = "-"..data.." "..format(ABSORB_TRAILER, arg3);
else
message = COMBAT_TEXT_ABSORB;
end
elseif ( messageType == "RESIST" or messageType == "SPELL_RESIST" ) then
if ( arg3 ) then
-- Partial resist
message = "-"..data.." "..format(RESIST_TRAILER, arg3);
else
message = COMBAT_TEXT_RESIST;
end
elseif ( messageType == "HONOR_GAINED" ) then
if ( tonumber(data) > 0 ) then
data = "+"..data;
end
message = format(COMBAT_TEXT_HONOR_GAINED, data);
elseif ( messageType == "SPELL_ACTIVE" ) then
displayType = "crit";
message = "<"..data..">";
elseif ( messageType == "COMBO_POINTS" ) then
message = format(COMBAT_TEXT_COMBO_POINTS, data);
elseif ( messageType == "RUNE" ) then
if ( data == true ) then
local runeType = GetRuneType(arg1);
message = COMBAT_TEXT_RUNE[runeType];
-- Alex Brazie had me use these values. Feel free to correct them
if( runeType == 1 ) then
info.r = .75;
info.g = 0;
info.b = 0;
elseif( runeType == 2 ) then
info.r = .75;
info.g = 1;
info.b = 0;
elseif (runeType == 3 ) then
info.r = 0;
info.g = 1;
info.b = 1;
end
else
message = nil;
end
else
message = _G["COMBAT_TEXT_"..messageType];
if ( not message ) then
message = _G[messageType];
end
end
-- Add the message
if ( message ) then
CombatText_AddMessage(message, COMBAT_TEXT_SCROLL_FUNCTION, info.r, info.g, info.b, displayType, isStaggered);
end
end
function CombatText_OnUpdate(self, elapsed)
local lowestMessage = COMBAT_TEXT_LOCATIONS.startY;
local alpha, xPos, yPos;
for index, value in pairs(COMBAT_TEXT_TO_ANIMATE) do
if ( value.scrollTime >= COMBAT_TEXT_SCROLLSPEED ) then
CombatText_RemoveMessage(value);
else
value.scrollTime = value.scrollTime + elapsed;
-- Calculate x and y positions
xPos, yPos = value.scrollFunction(value);
-- Record Y position
value.yPos = yPos;
value:SetPoint("TOP", WorldFrame, "BOTTOM", xPos, yPos);
if ( value.scrollTime >= COMBAT_TEXT_FADEOUT_TIME ) then
alpha = 1-((value.scrollTime-COMBAT_TEXT_FADEOUT_TIME)/(COMBAT_TEXT_SCROLLSPEED-COMBAT_TEXT_FADEOUT_TIME));
alpha = max(alpha, 0);
value:SetAlpha(alpha);
end
-- Handle crit
if ( value.isCrit ) then
if ( value.scrollTime <= COMBAT_TEXT_CRIT_SCALE_TIME ) then
value:SetTextHeight(floor(COMBAT_TEXT_CRIT_MINHEIGHT+((COMBAT_TEXT_CRIT_MAXHEIGHT-COMBAT_TEXT_CRIT_MINHEIGHT)*value.scrollTime/COMBAT_TEXT_CRIT_SCALE_TIME)));
elseif ( value.scrollTime <= COMBAT_TEXT_CRIT_SHRINKTIME ) then
value:SetTextHeight(floor(COMBAT_TEXT_CRIT_MAXHEIGHT - ((COMBAT_TEXT_CRIT_MAXHEIGHT-COMBAT_TEXT_CRIT_MINHEIGHT)*(value.scrollTime - COMBAT_TEXT_CRIT_SCALE_TIME)/(COMBAT_TEXT_CRIT_SHRINKTIME - COMBAT_TEXT_CRIT_SCALE_TIME))));
else
value.isCrit = nil;
end
end
end
end
if ( (COMBAT_TEXT_Y_SCALE ~= WorldFrame:GetHeight() / 768) or (COMBAT_TEXT_X_SCALE ~= WorldFrame:GetWidth() / 1024) ) then
CombatText_UpdateDisplayedMessages();
end
end
function CombatText_AddMessage(message, scrollFunction, r, g, b, displayType, isStaggered)
local string, noStringsAvailable = CombatText_GetAvailableString();
if ( noStringsAvailable ) then
return;
end
string:SetText(message);
string:SetTextColor(r, g, b);
string.scrollTime = 0;
if ( displayType == "crit" ) then
string.scrollFunction = CombatText_StandardScroll;
else
string.scrollFunction = scrollFunction;
end
-- See which direction the message should flow
local yDir;
local lowestMessage;
local useXadjustment = 0;
if ( COMBAT_TEXT_LOCATIONS.startY < COMBAT_TEXT_LOCATIONS.endY ) then
-- Flowing up
lowestMessage = string:GetBottom();
-- Find lowest message to anchor to
for index, value in pairs(COMBAT_TEXT_TO_ANIMATE) do
if ( lowestMessage >= value.yPos - 16 - COMBAT_TEXT_SPACING) then
lowestMessage = value.yPos - 16 - COMBAT_TEXT_SPACING;
end
end
if ( lowestMessage < (COMBAT_TEXT_LOCATIONS.startY - COMBAT_TEXT_MAX_OFFSET) ) then
if ( displayType == "crit" ) then
lowestMessage = string:GetBottom();
else
COMBAT_TEXT_X_ADJUSTMENT = COMBAT_TEXT_X_ADJUSTMENT * -1;
useXadjustment = 1;
lowestMessage = COMBAT_TEXT_LOCATIONS.startY - COMBAT_TEXT_MAX_OFFSET;
end
end
else
-- Flowing down
lowestMessage = string:GetTop();
-- Find lowest message to anchor to
for index, value in pairs(COMBAT_TEXT_TO_ANIMATE) do
if ( lowestMessage <= value.yPos + 16 + COMBAT_TEXT_SPACING) then
lowestMessage = value.yPos + 16 + COMBAT_TEXT_SPACING;
end
end
if ( lowestMessage > (COMBAT_TEXT_LOCATIONS.startY + COMBAT_TEXT_MAX_OFFSET) ) then
if ( displayType == "crit" ) then
lowestMessage = string:GetTop();
else
COMBAT_TEXT_X_ADJUSTMENT = COMBAT_TEXT_X_ADJUSTMENT * -1;
useXadjustment = 1;
lowestMessage = COMBAT_TEXT_LOCATIONS.startY + COMBAT_TEXT_MAX_OFFSET;
end
end
end
-- Handle crits
if ( displayType == "crit" ) then
string.endY = COMBAT_TEXT_LOCATIONS.startY;
string.isCrit = 1;
string:SetTextHeight(COMBAT_TEXT_CRIT_MINHEIGHT);
elseif ( displayType == "sticky" ) then
string.endY = COMBAT_TEXT_LOCATIONS.startY;
string:SetTextHeight(COMBAT_TEXT_HEIGHT);
else
string.endY = COMBAT_TEXT_LOCATIONS.endY;
string:SetTextHeight(COMBAT_TEXT_HEIGHT);
end
-- Stagger the text if flagged
local staggerAmount = 0;
if ( isStaggered ) then
staggerAmount = random(0, COMBAT_TEXT_STAGGER_RANGE) - COMBAT_TEXT_STAGGER_RANGE/2;
end
-- Alternate x direction
CombatText.xDir = CombatText.xDir * -1;
if ( useXadjustment == 1 ) then
if ( COMBAT_TEXT_X_ADJUSTMENT > 0 ) then
CombatText.xDir = -1;
else
CombatText.xDir = 1;
end
end
string.xDir = CombatText.xDir;
string.startX = COMBAT_TEXT_LOCATIONS.startX + staggerAmount + (useXadjustment * COMBAT_TEXT_X_ADJUSTMENT);
string.startY = lowestMessage;
string.yPos = lowestMessage;
string:ClearAllPoints();
string:SetPoint("TOP", WorldFrame, "BOTTOM", string.startX, lowestMessage);
string:SetAlpha(1);
string:Show();
tinsert(COMBAT_TEXT_TO_ANIMATE, string);
end
function CombatText_RemoveMessage(string)
for index, value in pairs(COMBAT_TEXT_TO_ANIMATE) do
if ( value == string ) then
tremove(COMBAT_TEXT_TO_ANIMATE, index);
string:SetAlpha(0);
string:Hide();
string:SetPoint("TOP", WorldFrame, "BOTTOM", COMBAT_TEXT_LOCATIONS.startX, COMBAT_TEXT_LOCATIONS.startY);
break;
end
end
end
function CombatText_GetAvailableString()
local string;
for i=1, NUM_COMBAT_TEXT_LINES do
string = _G["CombatText"..i];
if ( not string:IsShown() ) then
return string;
end
end
return CombatText_GetOldestString(), 1;
end
function CombatText_GetOldestString()
local oldestString = COMBAT_TEXT_TO_ANIMATE[1];
CombatText_RemoveMessage(oldestString);
return oldestString;
end
function CombatText_ClearAnimationList()
local string;
for i=1, NUM_COMBAT_TEXT_LINES do
string = _G["CombatText"..i];
string:SetAlpha(0);
string:Hide();
string:SetPoint("TOP", WorldFrame, "BOTTOM", COMBAT_TEXT_LOCATIONS.startX, COMBAT_TEXT_LOCATIONS.startY);
end
end
function CombatText_UpdateDisplayedMessages()
-- Unregister events if combat text is disabled
if ( SHOW_COMBAT_TEXT == "0" ) then
CombatText:UnregisterEvent("COMBAT_TEXT_UPDATE");
CombatText:UnregisterEvent("UNIT_HEALTH");
CombatText:UnregisterEvent("UNIT_MANA");
CombatText:UnregisterEvent("PLAYER_REGEN_DISABLED");
CombatText:UnregisterEvent("PLAYER_REGEN_ENABLED");
CombatText:UnregisterEvent("UNIT_COMBO_POINTS");
CombatText:UnregisterEvent("RUNE_POWER_UPDATE");
CombatText:UnregisterEvent("UNIT_ENTERED_VEHICLE");
CombatText:UnregisterEvent("UNIT_EXITING_VEHICLE");
return;
end
-- set the unit to track
if ( UnitHasVehicleUI("player") ) then
CombatText.unit = "vehicle";
else
CombatText.unit = "player";
end
CombatTextSetActiveUnit(CombatText.unit);
-- register events
CombatText:RegisterEvent("COMBAT_TEXT_UPDATE");
CombatText:RegisterEvent("UNIT_HEALTH");
CombatText:RegisterEvent("UNIT_MANA");
CombatText:RegisterEvent("PLAYER_REGEN_DISABLED");
CombatText:RegisterEvent("PLAYER_REGEN_ENABLED");
CombatText:RegisterEvent("UNIT_COMBO_POINTS");
CombatText:RegisterEvent("RUNE_POWER_UPDATE");
CombatText:RegisterEvent("UNIT_ENTERED_VEHICLE");
CombatText:RegisterEvent("UNIT_EXITING_VEHICLE");
-- Get scale
COMBAT_TEXT_Y_SCALE = WorldFrame:GetHeight() / 768;
COMBAT_TEXT_X_SCALE = WorldFrame:GetWidth() / 1024;
COMBAT_TEXT_SPACING = 10 * COMBAT_TEXT_Y_SCALE;
COMBAT_TEXT_MAX_OFFSET = 130 * COMBAT_TEXT_Y_SCALE;
COMBAT_TEXT_X_ADJUSTMENT = 80 * COMBAT_TEXT_X_SCALE;
-- Update shown messages
for index, value in pairs(COMBAT_TEXT_TYPE_INFO) do
if ( value.var ) then
if ( _G[value.var] == "1" ) then
value.show = 1;
else
value.show = nil;
end
end
end
-- Update scrolldirection
if ( COMBAT_TEXT_FLOAT_MODE == "1" ) then
COMBAT_TEXT_SCROLL_FUNCTION = CombatText_StandardScroll;
COMBAT_TEXT_LOCATIONS = {
startX = 0,
startY = 384 * COMBAT_TEXT_Y_SCALE,
endX = 0,
endY = 609 * COMBAT_TEXT_Y_SCALE
};
elseif ( COMBAT_TEXT_FLOAT_MODE == "2" ) then
COMBAT_TEXT_SCROLL_FUNCTION = CombatText_StandardScroll;
COMBAT_TEXT_LOCATIONS = {
startX = 0,
startY = 384 * COMBAT_TEXT_Y_SCALE,
endX = 0,
endY = 159 * COMBAT_TEXT_Y_SCALE
};
else
COMBAT_TEXT_SCROLL_FUNCTION = CombatText_FountainScroll;
COMBAT_TEXT_LOCATIONS = {
startX = 0,
startY = 384 * COMBAT_TEXT_Y_SCALE,
endX = 0,
endY = 609 * COMBAT_TEXT_Y_SCALE
};
end
CombatText_ClearAnimationList();
end
function CombatText_StandardScroll(value)
-- Calculate x and y positions
local xPos = value.startX+((COMBAT_TEXT_LOCATIONS.endX - COMBAT_TEXT_LOCATIONS.startX)*value.scrollTime/COMBAT_TEXT_SCROLLSPEED);
local yPos = value.startY+((value.endY - COMBAT_TEXT_LOCATIONS.startY)*value.scrollTime/COMBAT_TEXT_SCROLLSPEED);
return xPos, yPos;
end
function CombatText_FountainScroll(value)
-- Calculate x and y positions
local radius = 150;
local xPos = value.startX-value.xDir*(radius*(1-cos(90*value.scrollTime/COMBAT_TEXT_SCROLLSPEED)));
local yPos = value.startY+radius*sin(90*value.scrollTime/COMBAT_TEXT_SCROLLSPEED);
return xPos, yPos;
end
@@ -0,0 +1,6 @@
## Interface: 30300
## Title: Blizzard CombatText
## Secure: 1
## LoadOnDemand: 1
Blizzard_CombatText.xml
Localization.lua
@@ -0,0 +1,54 @@
<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="Blizzard_CombatText.lua"/>
<FontString name="CombatTextTemplate" inherits="CombatTextFont" hidden="true" virtual="true">
<Anchors>
<Anchor point="TOP" relativeTo="WorldFrame" relativePoint="BOTTOM">
<Offset>
<AbsDimension x="0" y="384"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<Frame name="CombatText" toplevel="true" parent="UIParent" hidden="false">
<Size>
<AbsDimension x="10" y="10"/>
</Size>
<Anchors>
<Anchor point="CENTER">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<FontString name="CombatText1" inherits="CombatTextTemplate"/>
<FontString name="CombatText2" inherits="CombatTextTemplate"/>
<FontString name="CombatText3" inherits="CombatTextTemplate"/>
<FontString name="CombatText4" inherits="CombatTextTemplate"/>
<FontString name="CombatText5" inherits="CombatTextTemplate"/>
<FontString name="CombatText6" inherits="CombatTextTemplate"/>
<FontString name="CombatText7" inherits="CombatTextTemplate"/>
<FontString name="CombatText8" inherits="CombatTextTemplate"/>
<FontString name="CombatText9" inherits="CombatTextTemplate"/>
<FontString name="CombatText10" inherits="CombatTextTemplate"/>
<FontString name="CombatText11" inherits="CombatTextTemplate"/>
<FontString name="CombatText12" inherits="CombatTextTemplate"/>
<FontString name="CombatText13" inherits="CombatTextTemplate"/>
<FontString name="CombatText14" inherits="CombatTextTemplate"/>
<FontString name="CombatText15" inherits="CombatTextTemplate"/>
<FontString name="CombatText16" inherits="CombatTextTemplate"/>
<FontString name="CombatText17" inherits="CombatTextTemplate"/>
<FontString name="CombatText18" inherits="CombatTextTemplate"/>
<FontString name="CombatText19" inherits="CombatTextTemplate"/>
<FontString name="CombatText20" inherits="CombatTextTemplate"/>
</Layer>
</Layers>
<Scripts>
<OnLoad function="CombatText_OnLoad"/>
<OnEvent function="CombatText_OnEvent"/>
<OnUpdate function="CombatText_OnUpdate"/>
</Scripts>
</Frame>
</Ui>
@@ -0,0 +1 @@
-- This file is executed at the end of addon load
@@ -0,0 +1,571 @@
EVENT_TRACE_EVENT_HEIGHT = 16;
EVENT_TRACE_MAX_ENTRIES = 1000;
DEBUGLOCALS_LEVEL = 4;
local _normalFontColor = { 1, .82, 0, 1 };
EVENT_TRACE_SYSTEM_TIMES = {};
EVENT_TRACE_SYSTEM_TIMES["System"] = true;
EVENT_TRACE_SYSTEM_TIMES["Elapsed"] = true;
EVENT_TRACE_EVENT_COLORS = {};
EVENT_TRACE_EVENT_COLORS["System"] = _normalFontColor;
EVENT_TRACE_EVENT_COLORS["Elapsed"] = { .6, .6, .6, 1 };
local _EventTraceFrame;
_framesSinceLast = 0;
_timeSinceLast = 0;
local _timer = CreateFrame("FRAME");
_timer:SetScript("OnUpdate", function (self, elapsed) _framesSinceLast = _framesSinceLast + 1; _timeSinceLast = _timeSinceLast + elapsed; end);
function EventTraceFrame_OnLoad (self)
self.buttons = {};
self.events = {};
self.times = {};
self.rawtimes = {};
self.args = { {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {} };
self.ignoredEvents = {};
self.lastIndex = 0;
self.visibleButtons = 0;
_EventTraceFrame = self;
self:SetScript("OnSizeChanged", EventTraceFrame_OnSizeChanged);
EventTraceFrame_OnSizeChanged(self, self:GetWidth(), self:GetHeight());
self:EnableMouse(true);
self:EnableMouseWheel(true);
self:SetScript("OnMouseWheel", EventTraceFrame_OnMouseWheel);
end
local _workTable = {};
function EventTraceFrame_OnEvent (self, event, ...)
if ( not self.ignoredEvents[event] ) then
if ( not self.ignoreElapsed and _framesSinceLast ~= 0 ) then
self.ignoreElapsed = true;
EventTraceFrame_OnEvent(self, "On Update");
self.ignoreElapsed = nil;
end
local nextIndex = self.lastIndex + 1;
if ( nextIndex > EVENT_TRACE_MAX_ENTRIES ) then
local staleIndex = nextIndex - EVENT_TRACE_MAX_ENTRIES;
self.events[staleIndex] = nil;
self.times[staleIndex] = nil;
self.rawtimes[staleIndex] = nil;
for k, v in next, self.args do
self.args[k][staleIndex] = nil;
end
end
if ( string.match(event, "Begin Capture") or string.match(event, "End Capture") ) then
self.times[nextIndex] = "System";
if ( self.eventsToCapture ) then
self.events[nextIndex] = string.format("%s (%s events)", event, tostring(self.eventsToCapture));
else
self.events[nextIndex] = event;
end
elseif ( event == "On Update" ) then
self.times[nextIndex] = "Elapsed";
self.events[nextIndex] = string.format(string.format("%.3f sec", _timeSinceLast) .. " - %d frame(s)", _framesSinceLast);
_timeSinceLast = 0;
_framesSinceLast = 0;
else
self.events[nextIndex] = event;
local seconds = GetTime();
local minutes = math.floor(math.floor(seconds) / 60);
local hours = math.floor(minutes / 60);
seconds = seconds - 60 * minutes;
minutes = minutes - 60 * hours;
hours = hours % 1000;
self.times[nextIndex] = string.format("%.2d:%.2d:%06.3f", hours, minutes, seconds);
local numArgs = select("#", ...);
for i=1, numArgs do
if ( not self.args[i] ) then
self.args[i] = {};
end
self.args[i][nextIndex] = select(i, ...);
end
if ( self.eventsToCapture ) then
self.eventsToCapture = self.eventsToCapture - 1;
end
end
self.rawtimes[nextIndex] = GetTime();
self.lastIndex = nextIndex;
EventTraceFrame_Update ();
if ( self.eventsToCapture and self.eventsToCapture <= 0 ) then
self.eventsToCapture = nil;
EventTraceFrame_StopEventCapture();
end
end
end
function EventTraceFrame_OnUpdate (self, elapsed)
EventTraceFrame_Update();
end
function EventTraceFrame_OnSizeChanged (self, width, height)
local numButtonsToDisplay = math.floor((height - 36)/EVENT_TRACE_EVENT_HEIGHT);
local numButtonsCreated = #self.buttons;
if ( numButtonsCreated < numButtonsToDisplay ) then
for i = numButtonsCreated + 1, numButtonsToDisplay do
local button = CreateFrame("BUTTON", "EventTraceFrameButton" .. i, self, "EventTraceEventTemplate");
button:SetPoint("BOTTOMLEFT", 12, (16 * (i - 1)) + 12);
button:SetPoint("RIGHT", -28, 0);
tinsert(self.buttons, button);
end
for i = self.visibleButtons + 1, numButtonsToDisplay do
self.buttons[i]:Show();
end
self.visibleButtons = numButtonsToDisplay;
EventTraceFrame_Update();
elseif ( self.visibleButtons < numButtonsToDisplay ) then
for i = self.visibleButtons + 1, numButtonsToDisplay do
self.buttons[i]:Show();
end
self.visibleButtons = numButtonsToDisplay;
EventTraceFrame_Update();
elseif ( numButtonsToDisplay < self.visibleButtons ) then
for i = numButtonsToDisplay + 1, self.visibleButtons do
self.buttons[i]:Hide();
end
self.visibleButtons = numButtonsToDisplay;
end
end
function EventTraceFrame_Update ()
local offset = 0;
local scrollBar = _G["EventTraceFrameScroll"];
local scrollBarValue = scrollBar:GetValue();
local minValue, maxValue = scrollBar:GetMinMaxValues();
local firstID = max(1, _EventTraceFrame.lastIndex - EVENT_TRACE_MAX_ENTRIES + 1);
local lastID = _EventTraceFrame.lastIndex or 1;
if ( firstID >= lastID ) then
scrollBar:SetMinMaxValues(firstID-1, lastID);
else
scrollBar:SetMinMaxValues(firstID, lastID);
end
if ( scrollBarValue < firstID ) then
scrollBar:SetValue(firstID);
scrollBarValue = firstID;
end
if ( scrollBarValue < 1 ) then
scrollBarValue = 1;
elseif ( not _EventTraceFrame.selectedEvent ) then
if ( scrollBarValue == maxValue ) then
scrollBar:SetValue(_EventTraceFrame.lastIndex);
end
end
for i = 1, _EventTraceFrame.visibleButtons do
local button = _EventTraceFrame.buttons[i];
if ( button ) then
local index = scrollBarValue - (i - 1);
local event = _EventTraceFrame.events[index];
if ( event ) then
local timeString = _EventTraceFrame.times[index]
button.index = index;
button.time:SetText(timeString);
button.event:SetText(event);
local color = EVENT_TRACE_EVENT_COLORS[event] or EVENT_TRACE_EVENT_COLORS[timeString];
if ( color ) then
button.time:SetTextColor(unpack(color));
button.event:SetTextColor(unpack(color));
else
button.time:SetTextColor(1, 1, 1, 1);
button.event:SetTextColor(1, 1, 1, 1);
end
button:Show();
if ( _EventTraceFrame.selectedEvent ) then
if ( index == _EventTraceFrame.selectedEvent ) then
EventTraceFrameEvent_DisplayTooltip(button);
button:GetHighlightTexture():SetVertexColor(.15, .25, 1, .35);
button:LockHighlight(true);
button.wasSelected = true;
elseif ( button.wasSelected ) then
button.wasSelected = nil;
button:GetHighlightTexture():SetVertexColor(.8, .8, 1, .15);
button:UnlockHighlight();
end
else
if ( button.wasSelected ) then
button.wasSelected = nil;
button:GetHighlightTexture():SetVertexColor(.8, .8, 1, .15);
button:UnlockHighlight();
end
if ( button:IsMouseOver() ) then
EventTraceFrameEvent_OnEnter(button);
end
end
else
button.index = index;
button:Hide();
end
end
end
EventTraceFrame_UpdateKeyboardStatus();
end
function EventTraceFrame_StartEventCapture ()
if ( _EventTraceFrame.started ) then -- Nothing to do?
return;
end
_EventTraceFrame.started = true;
_framesSinceLast = 0;
_timeSinceLast = 0;
_EventTraceFrame:RegisterAllEvents();
EventTraceFrame_OnEvent(_EventTraceFrame, "Begin Capture");
end
function EventTraceFrame_StopEventCapture ()
if ( not _EventTraceFrame.started ) then -- Nothing to do!
return;
end
_EventTraceFrame.started = false;
_framesSinceLast = 0;
_timeSinceLast = 0;
_EventTraceFrame:UnregisterAllEvents();
EventTraceFrame_OnEvent(_EventTraceFrame, "End Capture");
end
function EventTraceFrame_HandleSlashCmd (msg)
msg = strlower(msg);
if ( msg == "start" ) then
EventTraceFrame_StartEventCapture();
elseif ( msg == "stop" ) then
EventTraceFrame_StopEventCapture();
elseif ( tonumber(msg) and tonumber(msg) > 0 ) then
if ( not _EventTraceFrame.started ) then
_EventTraceFrame.eventsToCapture = tonumber(msg);
EventTraceFrame_StartEventCapture();
end
elseif ( msg == "" ) then
if ( not _EventTraceFrame:IsShown() ) then
_EventTraceFrame:Show();
if ( _EventTraceFrame.started == nil ) then
EventTraceFrame_StartEventCapture(); -- If this is the first time we're showing the window, start capturing events immediately.
end
else
_EventTraceFrame:Hide();
end
end
end
function EventTraceFrame_OnMouseWheel (self, delta)
local scrollBar = _G["EventTraceFrameScroll"];
local minVal, maxVal = scrollBar:GetMinMaxValues();
local currentValue = scrollBar:GetValue();
local newValue = currentValue - ( delta * 3 );
newValue = max(newValue, minVal);
newValue = min(newValue, maxVal);
if ( newValue ~= currentValue ) then
scrollBar:SetValue(newValue);
end
end
function EventTraceFrame_UpdateKeyboardStatus ()
if ( _EventTraceFrame.selectedEvent ) then
local focus = GetMouseFocus();
if ( focus == _EventTraceFrame or (focus and focus:GetParent() == _EventTraceFrame) ) then
_EventTraceFrame:EnableKeyboard(true);
return;
end
end
_EventTraceFrame:EnableKeyboard(false);
end
function EventTraceFrame_OnKeyUp (self, key)
if ( key == "ESCAPE" ) then
self.selectedEvent = nil;
EventTraceTooltip:Hide();
EventTraceFrame_Update();
end
end
local TIME_ENTRY_FORMAT = "Time:";
local DETAILS_ENTRY_FORMAT = "Details:";
local ARGUMENT_ENTRY_FORMAT = "arg %d:";
local function EventTrace_FormatArgValue (val)
if ( type(val) == "string" ) then
return string.format('"%s"', val);
elseif ( type(val) == "number" ) then
return tostring(val);
elseif ( type(val) == "bool" ) then
return string.format('|cffaaaaff%s|r', tostring(val));
elseif ( type(val) == "table" or type(val) == "bool" ) then
return string.format('|cffffaaaa%s|r', tostring(val));
end
end
function EventTraceFrameEvent_DisplayTooltip (eventButton)
local index = eventButton.index;
if ( not index ) then
return;
end
local tooltip = _G["EventTraceTooltip"];
tooltip:SetOwner(eventButton, "ANCHOR_NONE");
tooltip:SetPoint("TOPLEFT", eventButton, "TOPRIGHT", 24, 2);
local timeString = _EventTraceFrame.times[index]
if ( EVENT_TRACE_SYSTEM_TIMES[timeString] ) then
tooltip:AddLine(timeString, 1, 1, 1);
tooltip:AddDoubleLine(string.format(TIME_ENTRY_FORMAT), _EventTraceFrame.rawtimes[index], 1, .82, 0, 1, 1, 1);
tooltip:AddDoubleLine(string.format(DETAILS_ENTRY_FORMAT), _EventTraceFrame.events[index], 1, .82, 0, 1, 1, 1);
else
tooltip:AddLine(_EventTraceFrame.events[index], 1, 1, 1);
tooltip:AddDoubleLine(string.format(TIME_ENTRY_FORMAT), _EventTraceFrame.rawtimes[index], 1, .82, 0, 1, 1, 1);
for k, v in ipairs(EventTraceFrame.args) do
if ( v[index] ) then
tooltip:AddDoubleLine(string.format(ARGUMENT_ENTRY_FORMAT, k), EventTrace_FormatArgValue(v[index]), 1, .82, 0, 1, 1, 1);
end
end
end
tooltip:Show();
end
function EventTraceFrameEvent_OnEnter (self)
if ( _EventTraceFrame.selectedEvent ) then
return;
else
EventTraceFrameEvent_DisplayTooltip(self);
end
end
function EventTraceFrameEvent_OnLeave (self)
if ( not _EventTraceFrame.selectedEvent ) then
EventTraceTooltip:Hide();
end
end
function EventTraceFrameEvent_OnClick (self)
if ( _EventTraceFrame.selectedEvent == self.index ) then
_EventTraceFrame.selectedEvent = nil;
else
_EventTraceFrame.selectedEvent = self.index;
end
EventTraceFrame_Update();
end
local ERROR_FORMAT = [[|cffffd200Message:|cffffffff %s
|cffffd200Time:|cffffffff %s
|cffffd200Count:|cffffffff %s
|cffffd200Stack:|cffffffff %s
|cffffd200Locals:|cffffffff %s]];
local INDEX_ORDER_FORMAT = "%d / %d"
local _ScriptErrorsFrame;
function ScriptErrorsFrame_OnLoad (self)
self.title:SetText(LUA_ERROR);
self:RegisterForDrag("LeftButton");
self.seen = {};
self.order = {};
self.count = {};
self.messages = {};
self.times = {};
self.locals = {};
_ScriptErrorsFrame = self;
end
function ScriptErrorsFrame_OnShow (self)
ScriptErrorsFrame_Update();
end
function ScriptErrorsFrame_OnError (message, keepHidden)
local stack = debugstack(DEBUGLOCALS_LEVEL);
local messageStack = message..stack; -- Fix me later
if ( _ScriptErrorsFrame ) then
local index = _ScriptErrorsFrame.seen[messageStack];
if ( index ) then
_ScriptErrorsFrame.count[index] = _ScriptErrorsFrame.count[index] + 1;
_ScriptErrorsFrame.messages[index] = message;
_ScriptErrorsFrame.times[index] = date();
_ScriptErrorsFrame.locals[index] = debuglocals(DEBUGLOCALS_LEVEL);
else
tinsert(_ScriptErrorsFrame.order, stack);
index = #_ScriptErrorsFrame.order;
_ScriptErrorsFrame.count[index] = 1;
_ScriptErrorsFrame.messages[index] = message;
_ScriptErrorsFrame.times[index] = date();
_ScriptErrorsFrame.seen[messageStack] = index;
_ScriptErrorsFrame.locals[index] = debuglocals(DEBUGLOCALS_LEVEL);
end
if ( not _ScriptErrorsFrame:IsShown() and not keepHidden ) then
_ScriptErrorsFrame.index = index;
_ScriptErrorsFrame:Show();
else
ScriptErrorsFrame_Update();
end
end
end
function ScriptErrorsFrame_Update ()
local editBox = ScriptErrorsFrameScrollFrameText;
local index = _ScriptErrorsFrame.index;
if ( not index or not _ScriptErrorsFrame.order[index] ) then
index = #_ScriptErrorsFrame.order;
_ScriptErrorsFrame.index = index;
end
if ( index == 0 ) then
editBox:SetText("");
ScriptErrorsFrame_UpdateButtons();
return;
end
local text = string.format(
ERROR_FORMAT,
_ScriptErrorsFrame.messages[index],
_ScriptErrorsFrame.times[index],
_ScriptErrorsFrame.count[index],
_ScriptErrorsFrame.order[index],
_ScriptErrorsFrame.locals[index]
);
local parent = editBox:GetParent();
local prevText = editBox.text;
editBox.text = text;
if ( prevText ~= text ) then
editBox:SetText(text);
editBox:HighlightText(0);
editBox:SetCursorPosition(0);
else
ScrollingEdit_OnTextChanged(editBox, parent);
end
parent:SetVerticalScroll(0);
ScriptErrorsFrame_UpdateButtons();
end
function ScriptErrorsFrame_UpdateButtons ()
local index = _ScriptErrorsFrame.index;
local numErrors = #_ScriptErrorsFrame.order;
if ( index == 0 ) then
_ScriptErrorsFrame.next:Disable();
_ScriptErrorsFrame.previous:Disable();
else
if ( numErrors == 1 ) then
_ScriptErrorsFrame.next:Disable();
_ScriptErrorsFrame.previous:Disable();
elseif ( index == 1 ) then
_ScriptErrorsFrame.next:Enable();
_ScriptErrorsFrame.previous:Disable();
elseif ( index == numErrors ) then
_ScriptErrorsFrame.next:Disable();
_ScriptErrorsFrame.previous:Enable();
else
_ScriptErrorsFrame.next:Enable();
_ScriptErrorsFrame.previous:Enable();
end
end
_ScriptErrorsFrame.indexLabel:SetText(string.format(INDEX_ORDER_FORMAT, index, numErrors));
end
function ScriptErrorsFrame_DeleteError (index)
if ( _ScriptErrorsFrame.order[index] ) then
_ScriptErrorsFrame.seen[_ScriptErrorsFrame.messages[index] .. _ScriptErrorsFrame.order[index]] = nil;
tremove(_ScriptErrorsFrame.order, index);
tremove(_ScriptErrorsFrame.messages, index);
tremove(_ScriptErrorsFrame.times, index);
tremove(_ScriptErrorsFrame.count, index);
end
end
function ScriptErrorsFrameButton_OnClick (self)
local id = self:GetID();
if ( id == 1 ) then
_ScriptErrorsFrame.index = _ScriptErrorsFrame.index + 1;
else
_ScriptErrorsFrame.index = _ScriptErrorsFrame.index - 1;
end
ScriptErrorsFrame_Update();
end
--[[ function ScriptErrorsFrameDelete_OnClick (self);
local index = _ScriptErrorsFrame.index;
ScriptErrorsFrame_DeleteError(index);
local numErrors = #_ScriptErrorsFrame.order;
if ( numErrors == 0 ) then
_ScriptErrorsFrame.index = 0;
elseif ( index > numErrors ) then
_ScriptErrorsFrame.index = numErrors;
end
ScriptErrorsFrame_Update();
end ]]
function DebugTooltip_OnLoad(self)
self:SetFrameLevel(self:GetFrameLevel() + 2);
self:SetBackdropBorderColor(TOOLTIP_DEFAULT_COLOR.r, TOOLTIP_DEFAULT_COLOR.g, TOOLTIP_DEFAULT_COLOR.b);
self:SetBackdropColor(TOOLTIP_DEFAULT_BACKGROUND_COLOR.r, TOOLTIP_DEFAULT_BACKGROUND_COLOR.g, TOOLTIP_DEFAULT_BACKGROUND_COLOR.b);
self.statusBar2 = getglobal(self:GetName().."StatusBar2");
self.statusBar2Text = getglobal(self:GetName().."StatusBar2Text");
end
function FrameStackTooltip_Toggle (showHidden)
local tooltip = _G["FrameStackTooltip"];
if ( tooltip:IsVisible() ) then
tooltip:Hide();
else
tooltip:SetOwner(UIParent, "ANCHOR_NONE");
tooltip:SetPoint("BOTTOMRIGHT", UIParent, "BOTTOMRIGHT", -CONTAINER_OFFSET_X - 13, CONTAINER_OFFSET_Y);
tooltip.default = 1;
tooltip.showHidden = showHidden;
tooltip:SetFrameStack(showHidden);
end
end
FRAMESTACK_UPDATE_TIME = .1
local _timeSinceLast = 0
function FrameStackTooltip_OnUpdate (self, elapsed)
_timeSinceLast = _timeSinceLast - elapsed;
if ( _timeSinceLast <= 0 ) then
_timeSinceLast = FRAMESTACK_UPDATE_TIME;
self:SetFrameStack(self.showHidden);
end
end
function FrameStackTooltip_OnShow (self)
local parent = self:GetParent() or UIParent;
local ps = parent:GetEffectiveScale();
local px, py = parent:GetCenter();
px, py = px * ps, py * ps;
local x, y = GetCursorPosition();
self:ClearAllPoints();
if (x > px) then
if (y > py) then
self:SetPoint("BOTTOMLEFT", parent, "BOTTOMLEFT", 20, 20);
else
self:SetPoint("TOPLEFT", parent, "TOPLEFT", 20, -20);
end
else
if (y > py) then
self:SetPoint("BOTTOMRIGHT", parent, "BOTTOMRIGHT", -20, 20);
else
self:SetPoint("TOPRIGHT", parent, "TOPRIGHT", -20, -20);
end
end
end
FrameStackTooltip_OnEnter = FrameStackTooltip_OnShow;
@@ -0,0 +1,12 @@
## Interface: 30300
## Title: Blizzard UI Debug Tools
## Notes: Tools for developing addons
## Secure: 1
## Author: Blizzard Entertainment
## Special Thanks: Iriel, Kirov, Esamynn
## Version: 1.0
## LoadOnDemand: 1
Dump.lua
Blizzard_DebugTools.lua
Blizzard_DebugTools.xml
Localization.lua
@@ -0,0 +1,349 @@
<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">
<FontString name="EventTraceTimeFont" font="fonts\arialn.ttf" justifyH="RIGHT" virtual="true">
<FontHeight val="10"/>
<Color r="1" g="1" b="1" a="1"/>
</FontString>
<Button name="EventTraceEventTemplate" virtual="true">
<Size x="0" y="16"/>
<Layers>
<Layer level="ARTWORK">
<FontString parentKey="time" inherits="EventTraceTimeFont">
<Anchors>
<Anchor point="TOPLEFT"/>
<Anchor point="TOPRIGHT" relativePoint="TOPLEFT">
<Offset x="62" y="0"/>
</Anchor>
<Anchor point="BOTTOM"/>
</Anchors>
</FontString>
<FontString parentKey="event" inherits="GameFontHighlightSmallLeft">
<Anchors>
<Anchor point="TOPRIGHT"/>
<Anchor point="TOPLEFT">
<Offset x="70" y="0"/>
</Anchor>
<Anchor point="BOTTOM"/>
</Anchors>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnLoad>
self:GetHighlightTexture():SetAlpha(.15);
</OnLoad>
<OnEnter function="EventTraceFrameEvent_OnEnter"/>
<OnLeave function="EventTraceFrameEvent_OnLeave"/>
<OnClick function="EventTraceFrameEvent_OnClick"/>
</Scripts>
<HighlightTexture setAllPoints="true" alphaMode="ADD">
<Color r=".8" g=".8" b="1" a="1"/>
</HighlightTexture>
</Button>
<Frame name="EventTraceFrame" parent="UIParent" movable="true" clampedToScreen="true" hidden="true" frameStrata="MEDIUM" toplevel="true">
<Size x="306" y="505"/>
<Anchors>
<Anchor point="LEFT">
<Offset x="64" y="0"/>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture name="$parentTitleBG" file="Interface\PaperDollInfoFrame\UI-GearManager-Title-Background">
<Anchors>
<Anchor point="TOPLEFT">
<Offset x="9" y="-6"/>
</Anchor>
<Anchor point="BOTTOMRIGHT" relativePoint="TOPRIGHT">
<Offset x="-28" y="-24"/>
</Anchor>
</Anchors>
</Texture>
<Texture name="$parentDialogBG" file="Interface\Tooltips\UI-Tooltip-Background">
<Anchors>
<Anchor point="TOPLEFT">
<Offset x="8" y="-24"/>
</Anchor>
<Anchor point="BOTTOMRIGHT">
<Offset x="-6" y="8"/>
</Anchor>
</Anchors>
<Color r="0" g="0" b="0" a=".75"/>
</Texture>
</Layer>
<Layer level="BORDER">
<Texture name="$parentTopLeft" file="Interface\PaperDollInfoFrame\UI-GearManager-Border">
<Size x="64" y="64"/>
<Anchors>
<Anchor point="TOPLEFT"/>
</Anchors>
<TexCoords left="0.501953125" right="0.625" top="0" bottom="1"/>
</Texture>
<Texture name="$parentTopRight" file="Interface\PaperDollInfoFrame\UI-GearManager-Border">
<Size x="64" y="64"/>
<Anchors>
<Anchor point="TOPRIGHT"/>
</Anchors>
<TexCoords left="0.625" right="0.75" top="0" bottom="1"/>
</Texture>
<Texture name="$parentTop" file="Interface\PaperDollInfoFrame\UI-GearManager-Border">
<Size x="0" y="64"/>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parentTopLeft" relativePoint="TOPRIGHT"/>
<Anchor point="TOPRIGHT" relativeTo="$parentTopRight" relativePoint="TOPLEFT"/>
</Anchors>
<TexCoords left="0.25" right="0.369140625" top="0" bottom="1"/>
</Texture>
<Texture name="$parentBottomLeft" file="Interface\PaperDollInfoFrame\UI-GearManager-Border">
<Size x="64" y="64"/>
<Anchors>
<Anchor point="BOTTOMLEFT"/>
</Anchors>
<TexCoords left="0.751953125" right="0.875" top="0" bottom="1"/>
</Texture>
<Texture name="$parentBottomRight" file="Interface\PaperDollInfoFrame\UI-GearManager-Border">
<Size x="64" y="64"/>
<Anchors>
<Anchor point="BOTTOMRIGHT"/>
</Anchors>
<TexCoords left="0.875" right="1" top="0" bottom="1"/>
</Texture>
<Texture name="$parentBottom" file="Interface\PaperDollInfoFrame\UI-GearManager-Border">
<Size x="0" y="64"/>
<Anchors>
<Anchor point="BOTTOMLEFT" relativeTo="$parentBottomLeft" relativePoint="BOTTOMRIGHT"/>
<Anchor point="BOTTOMRIGHT" relativeTo="$parentBottomRight" relativePoint="BOTTOMLEFT"/>
</Anchors>
<TexCoords left="0.376953125" right="0.498046875" top="0" bottom="1"/>
</Texture>
<Texture name="$parentLeft" file="Interface\PaperDollInfoFrame\UI-GearManager-Border">
<Size x="64" y="0"/>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parentTopLeft" relativePoint="BOTTOMLEFT"/>
<Anchor point="BOTTOMLEFT" relativeTo="$parentBottomLeft" relativePoint="TOPLEFT"/>
</Anchors>
<TexCoords left="0.001953125" right="0.125" top="0" bottom="1"/>
</Texture>
<Texture name="$parentRight" file="Interface\PaperDollInfoFrame\UI-GearManager-Border">
<Size x="64" y="0"/>
<Anchors>
<Anchor point="TOPRIGHT" relativeTo="$parentTopRight" relativePoint="BOTTOMRIGHT"/>
<Anchor point="BOTTOMRIGHT" relativeTo="$parentBottomRight" relativePoint="TOPRIGHT"/>
</Anchors>
<TexCoords left="0.1171875" right="0.2421875" top="0" bottom="1"/>
</Texture>
</Layer>
<Layer level="OVERLAY">
<FontString name="$parentTitle" inherits="GameFontNormal" text="EVENTS_LABEL">
<Anchors>
<Anchor point="TOPLEFT">
<Offset x="12" y="-8"/>
</Anchor>
<Anchor point="TOPRIGHT">
<Offset x="-32" y="-8"/>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Frames>
<Button name="$parentCloseButton" inherits="UIPanelCloseButton">
<Size>
<AbsDimension x="32" y="32"/>
</Size>
<Anchors>
<Anchor point="TOPRIGHT">
<Offset x="2" y="1"/>
</Anchor>
</Anchors>
</Button>
<Frame name="$parentTitleButton">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parentTitleBG"/>
<Anchor point="BOTTOMRIGHT" relativeTo="$parentTitleBG"/>
</Anchors>
<Frames>
<Frame name="$parentHighlight" setAllPoints="true" hidden="true">
<Layers>
<Layer level="OVERLAY">
<Texture file="Interface\Buttons\UI-ListBox-Highlight" setAllPoints="true">
<Color r="1" g="1" b="1" a="0.4"/>
</Texture>
</Layer>
</Layers>
</Frame>
</Frames>
<Scripts>
<OnLoad>
self:RegisterForDrag("LeftButton");
</OnLoad>
<OnDragStart>
local eventTraceFrame = _G["EventTraceFrame"];
eventTraceFrame.moving = true;
eventTraceFrame:StartMoving();
</OnDragStart>
<OnDragStop>
local eventTraceFrame = _G["EventTraceFrame"];
eventTraceFrame.moving = nil;
eventTraceFrame:StopMovingOrSizing();
</OnDragStop>
</Scripts>
</Frame>
<Slider name="$parentScroll">
<Size x="16" y="0"/>
<Anchors>
<Anchor point="TOPRIGHT">
<Offset x="-7" y="-28"/>
</Anchor>
<Anchor point="BOTTOMRIGHT">
<Offset x="-7" y="10"/>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture name="$parentBG" setAllPoints="true">
<Color r=".8" g=".8" b="1" a="0.1"/>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnLoad>
self:SetFrameLevel(self:GetFrameLevel() + 1);
self:SetValue(0);
self:SetValueStep(1);
</OnLoad>
</Scripts>
<ThumbTexture parentKey="thumb" file="Interface\Buttons\UI-ScrollBar-Knob">
<Size x="16" y="16"/>
<TexCoords left="0.25" right="0.75" top="0.25" bottom="0.75"/>
</ThumbTexture>
</Slider>
</Frames>
<Scripts>
<OnLoad function="EventTraceFrame_OnLoad"/>
<OnEvent function="EventTraceFrame_OnEvent"/>
<OnUpdate function="EventTraceFrame_OnUpdate"/>
<OnKeyUp function="EventTraceFrame_OnKeyUp"/>
<!-- <OnSizeChanged function="EventTraceFrame_OnSizeChanged"/> Set in EventTraceFrame_OnLoad -->
</Scripts>
</Frame>
<Frame name="ScriptErrorsFrame" inherits="UIPanelDialogTemplate" movable="true" clampedToScreen="true" hidden="true" toplevel="true">
<Size x="384" y="260"/>
<Anchors>
<Anchor point="CENTER"/>
</Anchors>
<Layers>
<Layer level="ARTWORK">
<FontString parentKey="indexLabel" font="GameFontNormalCenter">
<Size x="70" y="16"/>
<Anchors>
<Anchor point="BOTTOMLEFT">
<Offset x="208" y="16"/>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Frames>
<Frame name="$parentTitleButton">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parentTitleBG"/>
<Anchor point="BOTTOMRIGHT" relativeTo="$parentTitleBG"/>
</Anchors>
<Scripts>
<OnLoad>
self:RegisterForDrag("LeftButton");
</OnLoad>
<OnDragStart>
local frame = _G["ScriptErrorsFrame"];
frame.moving = true;
frame:StartMoving();
</OnDragStart>
<OnDragStop>
local frame = _G["ScriptErrorsFrame"];
frame.moving = nil;
frame:StopMovingOrSizing();
</OnDragStop>
</Scripts>
</Frame>
<ScrollFrame name="$parentScrollFrame" inherits="UIPanelScrollFrameTemplate">
<Size x="343" y="194"/>
<Anchors>
<Anchor point="TOPLEFT">
<Offset x="12" y="-30"/>
</Anchor>
</Anchors>
<ScrollChild>
<EditBox name="$parentText" multiLine="true" letters="4000" autoFocus="false">
<Size x="343" y="194"/>
<Scripts>
<OnCursorChanged function="ScrollingEdit_OnCursorChanged"/>
<OnUpdate>
ScrollingEdit_OnUpdate(self, elapsed, self:GetParent());
</OnUpdate>
<OnEditFocusGained>
self:HighlightText(0);
</OnEditFocusGained>
<OnEscapePressed function="EditBox_ClearFocus"/>
</Scripts>
<FontString inherits="GameFontHighlightSmall"/>
</EditBox>
</ScrollChild>
</ScrollFrame>
<Button parentKey="previous" inherits="UIPanelButtonTemplate" text="PREVIOUS" id="2">
<Size x="96" y="24"/>
<Anchors>
<Anchor point="BOTTOMLEFT">
<Offset x="12" y="12"/>
</Anchor>
</Anchors>
<Scripts>
<OnClick function="ScriptErrorsFrameButton_OnClick"/>
</Scripts>
</Button>
<Button parentKey="next" inherits="UIPanelButtonTemplate" text="NEXT" id="1">
<Size x="96" y="24"/>
<Anchors>
<Anchor point="BOTTOMLEFT">
<Offset x="112" y="12"/>
</Anchor>
</Anchors>
<Scripts>
<OnClick function="ScriptErrorsFrameButton_OnClick"/>
</Scripts>
</Button>
<Button parentKey="close" inherits="UIPanelButtonTemplate" text="CLOSE">
<Size x="96" y="24"/>
<Anchors>
<Anchor point="BOTTOMRIGHT">
<Offset x="-8" y="12"/>
</Anchor>
</Anchors>
<Scripts>
<OnClick function="HideParentPanel"/>
</Scripts>
</Button>
</Frames>
<Scripts>
<OnLoad function="ScriptErrorsFrame_OnLoad"/>
<OnShow function="ScriptErrorsFrame_OnShow"/>
</Scripts>
</Frame>
<GameTooltip name="FrameStackTooltip" frameStrata="TOOLTIP" hidden="true" parent="WorldFrame" inherits="GameTooltipTemplate">
<Scripts>
<OnLoad function="DebugTooltip_OnLoad"/>
<OnShow function="FrameStackTooltip_OnShow"/>
<OnEnter function="FrameStackTooltip_OnEnter"/>
<OnUpdate function="FrameStackTooltip_OnUpdate"/>
</Scripts>
</GameTooltip>
<GameTooltip name="EventTraceTooltip" frameStrata="TOOLTIP" hidden="true" parent="EventTraceFrame" inherits="GameTooltipTemplate">
<Scripts>
<OnLoad function="DebugTooltip_OnLoad"/>
</Scripts>
</GameTooltip>
</Ui>
@@ -0,0 +1,408 @@
------------------------------------------------------------------------------
-- Dump.lua
--
-- Contributed by Iriel, Esamynn and Kirov from DevTools v1.11
-- /dump Implementation
--
-- Globals: DevTools, SLASH_DEVTOOLSDUMP1, DevTools_Dump, DevTools_RunDump
-- Globals: DEVTOOLS_MAX_ENTRY_CUTOFF, DEVTOOLS_LONG_STRING_CUTOFF
-- Globals: DEVTOOLS_DEPTH_CUTOFF, DEVTOOLS_INDENT
-- Globals: DEVTOOLS_USE_TABLE_CACHE, DEVTOOLS_USE_FUNCTION_CACHE
-- Globals: DEVTOOLS_USE_USERDATA_CACHE
---------------------------------------------------------------------------
local DT = {};
DEVTOOLS_MAX_ENTRY_CUTOFF = 30; -- Maximum table entries shown
DEVTOOLS_LONG_STRING_CUTOFF = 200; -- Maximum string size shown
DEVTOOLS_DEPTH_CUTOFF = 10; -- Maximum table depth
DEVTOOLS_USE_TABLE_CACHE = true; -- Look up table names
DEVTOOLS_USE_FUNCTION_CACHE = true;-- Look up function names
DEVTOOLS_USE_USERDATA_CACHE = true;-- Look up userdata names
DEVTOOLS_INDENT=' '; -- Indentation string
local DEVTOOLS_TYPE_COLOR="|cff88ff88";
local DEVTOOLS_TABLEREF_COLOR="|cffffcc00";
local DEVTOOLS_CUTOFF_COLOR="|cffff0000";
local DEVTOOLS_TABLEKEY_COLOR="|cff88ccff";
local FORMATS = {};
-- prefix type suffix
FORMATS["opaqueTypeVal"] = "%s" .. DEVTOOLS_TYPE_COLOR .. "<%s>|r%s";
-- prefix type name suffix
FORMATS["opaqueTypeValName"] = "%s" .. DEVTOOLS_TYPE_COLOR .. "<%s %s>|r%s";
-- type
FORMATS["opaqueTypeKey"] = "<%s>";
-- type name
FORMATS["opaqueTypeKeyName"] = "<%s %s>";
-- value
FORMATS["bracketTableKey"] = "[%s]";
-- prefix value
FORMATS["tableKeyAssignPrefix"] = DEVTOOLS_TABLEKEY_COLOR .. "%s%s|r=";
-- prefix cutoff
FORMATS["tableEntriesSkipped"] = "%s" .. DEVTOOLS_CUTOFF_COLOR .. "<skipped %s>|r";
-- prefix suffix
FORMATS["tableTooDeep"] = "%s" .. DEVTOOLS_CUTOFF_COLOR .. "<table (too deep)>|r%s";
-- prefix value suffix
FORMATS["simpleValue"] = "%s%s%s";
-- prefix tablename suffix
FORMATS["tableReference"] = "%s" .. DEVTOOLS_TABLEREF_COLOR .. "%s|r%s";
-- Grab a copy various oft-used functions
local rawget = rawget;
local type = type;
local string_len = string.len;
local string_sub = string.sub;
local string_gsub = string.gsub;
local string_format = string.format;
local string_match = string.match;
local function WriteMessage(msg)
DEFAULT_CHAT_FRAME:AddMessage(msg);
end
local function prepSimple(val, context)
local valType = type(val);
if (valType == "nil") then
return "nil";
elseif (valType == "number") then
return val;
elseif (valType == "boolean") then
if (val) then
return "true";
else
return "false";
end
elseif (valType == "string") then
local l = string_len(val);
if ((l > DEVTOOLS_LONG_STRING_CUTOFF) and
(DEVTOOLS_LONG_STRING_CUTOFF > 0)) then
local more = l - DEVTOOLS_LONG_STRING_CUTOFF;
val = string_sub(val, 1, DEVTOOLS_LONG_STRING_CUTOFF);
return string_gsub(string_format("%q...+%s",val,more),"[|]", "||");
else
return string_gsub(string_format("%q",val),"[|]", "||");
end
elseif (valType == "function") then
local fName = context:GetFunctionName(val);
if (fName) then
return string_format(FORMATS.opaqueTypeKeyName, valType, fName);
else
return string_format(FORMATS.opaqueTypeKey, valType);
end
return string_format(FORMATS.opaqueTypeKey, valType);
elseif (valType == "userdata") then
local uName = context:GetUserdataName(val);
if (uName) then
return string_format(FORMATS.opaqueTypeKeyName, valType, uName);
else
return string_format(FORMATS.opaqueTypeKey, valType);
end
elseif (valType == 'table') then
local tName = context:GetTableName(val);
if (tName) then
return string_format(FORMATS.opaqueTypeKeyName, valType, tName);
else
return string_format(FORMATS.opaqueTypeKey, valType);
end
end
error("Bad type '" .. valType .. "' to prepSimple");
end
local function prepSimpleKey(val, context)
local valType = type(val);
if (valType == "string") then
local l = string_len(val);
if ((l <= DEVTOOLS_LONG_STRING_CUTOFF) or
(DEVTOOLS_LONG_STRING_CUTOFF <= 0)) then
if (string_match(val, "^[a-zA-Z_][a-zA-Z0-9_]*$")) then
return val;
end
end
end
return string_format(FORMATS.bracketTableKey, prepSimple(val, context));
end
local function DevTools_InitFunctionCache(context)
local ret = {};
for _,k in ipairs(DT.functionSymbols) do
local v = getglobal(k);
if (type(v) == 'function') then
ret[v] = '[' .. k .. ']';
end
end
for k,v in pairs(getfenv(0)) do
if (type(v) == 'function') then
if (not ret[v]) then
ret[v] = '[' .. k .. ']';
end
end
end
return ret;
end
local function DevTools_InitUserdataCache(context)
local ret = {};
for _,k in ipairs(DT.userdataSymbols) do
local v = getglobal(k);
if (type(v) == 'table') then
local u = rawget(v,0);
if (type(u) == 'userdata') then
ret[u] = k .. '[0]';
end
end
end
for k,v in pairs(getfenv(0)) do
if (type(v) == 'table') then
local u = rawget(v, 0);
if (type(u) == 'userdata') then
if (not ret[u]) then
ret[u] = k .. '[0]';
end
end
end
end
return ret;
end
local function DevTools_Cache_Nil(self, value, newName)
return nil;
end
local function DevTools_Cache_Function(self, value, newName)
if (not self.fCache) then
self.fCache = DevTools_InitFunctionCache(self);
end
local name = self.fCache[value];
if ((not name) and newName) then
self.fCache[value] = newName;
end
return name;
end
local function DevTools_Cache_Userdata(self, value, newName)
if (not self.uCache) then
self.uCache = DevTools_InitUserdataCache(self);
end
local name = self.uCache[value];
if ((not name) and newName) then
self.uCache[value] = newName;
end
return name;
end
local function DevTools_Cache_Table(self, value, newName)
if (not self.tCache) then
self.tCache = {};
end
local name = self.tCache[value];
if ((not name) and newName) then
self.tCache[value] = newName;
end
return name;
end
local function DevTools_Write(self, msg)
DEFAULT_CHAT_FRAME:AddMessage(msg);
end
local DevTools_DumpValue;
local function DevTools_DumpTableContents(val, prefix, firstPrefix, context)
local showCount = 0;
local oldDepth = context.depth;
local oldKey = context.key;
-- Use this to set the cache name
context:GetTableName(val, oldKey or 'value');
local iter = pairs(val);
local nextK, nextV = iter(val, nil);
while (nextK) do
local k,v = nextK, nextV;
nextK, nextV = iter(val, k);
showCount = showCount + 1;
if ((showCount <= DEVTOOLS_MAX_ENTRY_CUTOFF) or
(DEVTOOLS_MAX_ENTRY_CUTOFF <= 0)) then
local prepKey = prepSimpleKey(k, context);
if (oldKey == nil) then
context.key = prepKey;
elseif (string_sub(prepKey, 1, 1) == "[") then
context.key = oldKey .. prepKey
else
context.key = oldKey .. "." .. prepKey
end
context.depth = oldDepth + 1;
local rp = string_format(FORMATS.tableKeyAssignPrefix, firstPrefix,
prepKey);
firstPrefix = prefix;
DevTools_DumpValue(v, prefix, rp,
(nextK and ",") or '',
context);
end
end
local cutoff = showCount - DEVTOOLS_MAX_ENTRY_CUTOFF;
if ((cutoff > 0) and (DEVTOOLS_MAX_ENTRY_CUTOFF > 0)) then
context:Write(string_format(FORMATS.tableEntriesSkipped,firstPrefix,
cutoff));
end
context.key = oldKey;
context.depth = oldDepth;
return (showCount > 0)
end
-- Return the specified value
function DevTools_DumpValue(val, prefix, firstPrefix, suffix, context)
local valType = type(val);
if (valType == "userdata") then
local uName = context:GetUserdataName(val, 'value');
if (uName) then
context:Write(string_format(FORMATS.opaqueTypeValName,
firstPrefix, valType, uName, suffix));
else
context:Write(string_format(FORMATS.opaqueTypeVal,
firstPrefix, valType, suffix));
end
return;
elseif (valType == "function") then
local fName = context:GetFunctionName(val, 'value');
if (fName) then
context:Write(string_format(FORMATS.opaqueTypeValName,
firstPrefix, valType, fName, suffix));
else
context:Write(string_format(FORMATS.opaqueTypeVal,
firstPrefix, valType, suffix));
end
return;
elseif (valType ~= "table") then
context:Write(string_format(FORMATS.simpleValue,
firstPrefix,prepSimple(val, context),
suffix));
return;
end
local cacheName = context:GetTableName(val);
if (cacheName) then
context:Write(string_format(FORMATS.tableReference,
firstPrefix, cacheName, suffix));
return;
end
if ((context.depth >= DEVTOOLS_DEPTH_CUTOFF) and
(DEVTOOLS_DEPTH_CUTOFF > 0)) then
context:Write(string_format(FORMATS.tableTooDeep,
firstPrefix, suffix));
return;
end
firstPrefix = firstPrefix .. "{";
local oldPrefix = prefix;
prefix = prefix .. DEVTOOLS_INDENT;
context:Write(firstPrefix);
firstPrefix = prefix;
local anyContents = DevTools_DumpTableContents(val, prefix, firstPrefix,
context);
context:Write(oldPrefix .. "}" .. suffix);
end
local function Pick_Cache_Function(func, setting)
if (setting) then
return func;
else
return DevTools_Cache_Nil;
end
end
function DevTools_RunDump(value, context)
local prefix = "";
local firstPrefix = prefix;
local valType = type(value);
if (type(value) == 'table') then
local any =
DevTools_DumpTableContents(value, prefix, firstPrefix, context);
if (context.Result) then
return context:Result();
end
if (not any) then
context:Write("empty result");
end
return;
end
DevTools_DumpValue(value, '', '', '', context);
if (context.Result) then
return context:Result();
end
end
-- Dump the specified list of value
function DevTools_Dump(value, startKey)
local context = {
depth = 0,
key = startKey,
};
context.GetTableName = Pick_Cache_Function(DevTools_Cache_Table,
DEVTOOLS_USE_TABLE_CACHE);
context.GetFunctionName = Pick_Cache_Function(DevTools_Cache_Function,
DEVTOOLS_USE_FUNCTION_CACHE);
context.GetUserdataName = Pick_Cache_Function(DevTools_Cache_Userdata,
DEVTOOLS_USE_USERDATA_CACHE);
context.Write = DevTools_Write;
DevTools_RunDump(value, context);
end
function DevTools_DumpCommand(msg, editBox)
forceinsecure();
if (string_match(msg,"^[A-Za-z_][A-Za-z0-9_]*$")) then
WriteMessage("Dump: " .. msg);
local val = _G[msg];
local tmp = {};
if (val == nil) then
local key = string_format(FORMATS.tableKeyAssignPrefix,
'', prepSimpleKey(msg, {}));
WriteMessage(key .. "nil,");
else
tmp[msg] = val;
end
DevTools_Dump(tmp);
return;
end
WriteMessage("Dump: value=" .. msg);
local func,err = loadstring("return " .. msg);
if (not func) then
WriteMessage("Dump: ERROR: " .. err);
else
DevTools_Dump({ func() }, "value");
end
end
DT.functionSymbols = {};
DT.userdataSymbols = {};
local funcSyms = DT.functionSymbols;
local userSyms = DT.userdataSymbols;
for k,v in pairs(getfenv(0)) do
if (type(v) == 'function') then
table.insert(funcSyms, k);
elseif (type(v) == 'table') then
if (type(rawget(v,0)) == 'userdata') then
table.insert(userSyms, k);
end
end
end
@@ -0,0 +1 @@
-- This file is executed at the end of addon load
@@ -0,0 +1,181 @@
local ListOfGMs = {};
function GMChatFrame_IsGM(playerName)
return ListOfGMs[strlower(playerName)];
end
function GMChatFrame_OnLoad(self)
local name = self:GetName();
for index, value in pairs(CHAT_FRAME_TEXTURES) do
local object = _G[name..value];
local objectType = object:GetObjectType();
if ( objectType == "Button" ) then
object:GetNormalTexture():SetVertexColor(0, 0, 0);
object:GetHighlightTexture():SetVertexColor(0, 0, 0);
object:GetPushedTexture():SetVertexColor(0, 0, 0);
elseif ( objectType == "Texture" ) then
_G[name..value]:SetVertexColor(0,0,0);
else
--error("Unhandled object type");
end
object:SetAlpha(0.4);
end
self:RegisterEvent("CHAT_MSG_WHISPER");
self:RegisterEvent("CHAT_MSG_WHISPER_INFORM");
self:RegisterEvent("UPDATE_CHAT_COLOR");
self:RegisterEvent("UPDATE_CHAT_WINDOWS");
self.flashTimer = 0;
self.lastGM = {};
GMChatOpenLog:Enable();
self:SetClampRectInsets(-35, 0, 30, 0);
self:SetFont(DEFAULT_CHAT_FRAME:GetFont());
end
function GMChatFrame_OnEvent(self, event, ...)
local arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8 = ...;
if ( event == "CHAT_MSG_WHISPER" and arg6 == "GM" ) then
local info = ChatTypeInfo["WHISPER"];
local pflag = "|TInterface\\ChatFrame\\UI-ChatIcon-Blizz.blp:0:2:0:-3|t ";
-- Search for icon links and replace them with texture links.
local term;
for tag in string.gmatch(arg1, "%b{}") do
term = strlower(string.gsub(tag, "[{}]", ""));
if ( ICON_TAG_LIST[term] and ICON_LIST[ICON_TAG_LIST[term]] ) then
arg1 = string.gsub(arg1, tag, ICON_LIST[ICON_TAG_LIST[term]] .. "0|t");
end
end
local body = format(CHAT_WHISPER_GET, pflag.."|HplayerGM:"..arg2..":"..arg11.."|h".."["..arg2.."]".."|h")..arg1;
ListOfGMs[strlower(arg2)] = true;
self:AddMessage(body, info.r, info.g, info.b, info.id);
if ( self.lastGMForCVar ~= arg2 and GMChatFrame:IsShown() ) then
SetCVar("lastTalkedToGM", arg2);
end
self.lastGMForCVar = arg2;
if ( not GMChatFrame:IsShown() ) then
GMChatStatusFrame:Show();
GMChatStatusFrame_Pulse();
table.insert(self.lastGM,arg2);
PlaySound("GM_ChatWarning");
DEFAULT_CHAT_FRAME:AddMessage(pflag.."|HGMChat|h["..GM_CHAT_STATUS_READY_DESCRIPTION.."]|h", info.r, info.g, info.b, info.id);
DEFAULT_CHAT_FRAME:SetHyperlinksEnabled(true);
DEFAULT_CHAT_FRAME.overrideHyperlinksEnabled = true;
SetButtonPulse(HelpMicroButton, 3600, 1.0);
SetButtonPulse(GMChatOpenLog, 3600, 1.0);
else
ChatEdit_SetLastTellTarget(arg2);
end
elseif ( event == "CHAT_MSG_WHISPER_INFORM" and GMChatFrame_IsGM(arg2) ) then
local info = ChatTypeInfo["WHISPER_INFORM"];
local pflag = "|TInterface\\ChatFrame\\UI-ChatIcon-Blizz.blp:0:2:0:-3|t ";
-- Search for icon links and replace them with texture links.
local term;
for tag in string.gmatch(arg1, "%b{}") do
term = strlower(string.gsub(tag, "[{}]", ""));
if ( ICON_TAG_LIST[term] and ICON_LIST[ICON_TAG_LIST[term]] ) then
arg1 = string.gsub(arg1, tag, ICON_LIST[ICON_TAG_LIST[term]] .. "0|t");
end
end
local body = format(CHAT_WHISPER_INFORM_GET, pflag.."|HplayerGM:"..arg2..":"..arg11.."|h".."["..arg2.."]".."|h")..arg1;
self:AddMessage(body, info.r, info.g, info.b, info.id);
elseif ( event == "UPDATE_CHAT_COLOR" ) then
local arg1, arg2, arg3, arg4 = ...
local info = ChatTypeInfo[strupper(arg1)];
if ( info ) then
info.r = arg2;
info.g = arg3;
info.b = arg4;
self:UpdateColorByID(info.id, info.r, info.g, info.b);
if ( strupper(arg1) == "WHISPER" ) then
info = ChatTypeInfo["REPLY"];
if ( info ) then
info.r = arg2;
info.g = arg3;
info.b = arg4;
self:UpdateColorByID(info.id, info.r, info.g, info.b);
end
end
end
elseif ( event == "UPDATE_CHAT_WINDOWS" ) then
local _, fontSize= FCF_GetChatWindowInfo(1);
if ( fontSize > 0 ) then
local fontFile, unused, fontFlags = DEFAULT_CHAT_FRAME:GetFont();
self:SetFont(fontFile, fontSize, fontFlags);
end
end
end
function GMChatFrame_OnShow(self)
GMChatStatusFrame:Hide();
GMChatOpenLog:Disable();
for _,gmName in ipairs(self.lastGM) do
ChatEdit_SetLastTellTarget(gmName);
end
table.wipe(self.lastGM);
if ( self.lastGMForCVar ) then
SetCVar("lastTalkedToGM", self.lastGMForCVar);
end
SetButtonPulse(HelpMicroButton, 0, 1); --Stop the buttons from pulsing.
SetButtonPulse(GMChatOpenLog, 0, 1);
self:SetScript("OnUpdate", GMChatFrame_OnUpdate);
end
function GMChatFrame_OnHide(self)
GMChatOpenLog:Enable();
SetCVar("lastTalkedToGM", "");
end
function GMChatFrame_OnUpdate(self, elapsed)
if ( DEFAULT_CHAT_FRAME.isUninteractable ) then
DEFAULT_CHAT_FRAME:SetHyperlinksEnabled(false);
end
DEFAULT_CHAT_FRAME.overrideHyperlinksEnabled = false;
self:SetScript("OnUpdate", nil);
end
function GMChatFrame_Show()
GMChatFrame:Show();
end
function GMChatFrame_Close()
GMChatFrame:Hide();
end
function GMChatStatusFrame_OnClick()
GMChatFrame_Show();
end
local function GMChatStatusFrame_PulseFunc(self, elapsed)
return abs(sin(elapsed*180*450--[[<--Number of times to pulse here]]));
end
local GMChatStatusFrame_PulseTable = {
totalTime = 900,
updateFunc = "SetAlpha",
getPosFunc = GMChatStatusFrame_PulseFunc,
}
function GMChatStatusFrame_Pulse()
local pulse = GMChatStatusFramePulse;
pulse:Show();
pulse:SetAlpha(0);
SetUpAnimation(pulse, GMChatStatusFrame_PulseTable, pulse.Hide);
end
@@ -0,0 +1,7 @@
## Interface: 30300
## Title: Blizzard_GMChatUI
## Secure: 1
## LoadOnDemand: 1
Blizzard_GMChatUI.lua
Blizzard_GMChatUI.xml
Localization.lua
@@ -0,0 +1,263 @@
<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">
<ScrollingMessageFrame name="GMChatFrame" hidden="true" inherits="FloatingChatFrameTemplate" clampedToScreen="true">
<Size>
<AbsDimension x="430" y="120"/>
</Size>
<Anchors>
<Anchor point="BOTTOMLEFT">
<Offset>
<AbsDimension x="32" y="395"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad function="GMChatFrame_OnLoad"/>
<OnEvent function="GMChatFrame_OnEvent"/>
<OnShow function="GMChatFrame_OnShow"/>
<OnHide function="GMChatFrame_OnHide"/>
</Scripts>
</ScrollingMessageFrame>
<Frame name="GMChatTab" frameStrata="LOW" parent="GMChatFrame">
<Anchors>
<Anchor point="BOTTOMLEFT" relativeTo="GMChatFrame" relativePoint="TOPLEFT">
<Offset>
<AbsDimension x="0" y="3"/>
</Offset>
</Anchor>
<Anchor point="TOPRIGHT" relativeTo="GMChatFrame" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="0" y="30"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture name="$parentLeft" file="Interface\Minimap\UI-Minimap-Border">
<Size>
<AbsDimension x="14" y="27"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT"/>
</Anchors>
<TexCoords left="0.3164" right="0.371" top="0.0" bottom="0.07"/>
</Texture>
<Texture name="$parentRight" file="Interface\Minimap\UI-Minimap-Border">
<Size>
<AbsDimension x="14" y="27"/>
</Size>
<Anchors>
<Anchor point="TOPRIGHT"/>
</Anchors>
<TexCoords left="0.371" right="0.3164" top="0.0" bottom="0.07"/>
</Texture>
<Texture name="$parentMiddle" file="Interface\Minimap\UI-Minimap-Border">
<Anchors>
<Anchor point="BOTTOMLEFT" relativeTo="$parentLeft" relativePoint="BOTTOMRIGHT"/>
<Anchor point="TOPRIGHT" relativeTo="$parentRight" relativePoint="TOPLEFT"/>
</Anchors>
<TexCoords left="0.371" right="0.85156" top="0.0" bottom="0.07"/>
</Texture>
</Layer>
<Layer level="ARTWORK">
<FontString name="$parentText" inherits="GameFontNormalSmall" text="GM_CHAT" justifyH="LEFT">
<Size>
<AbsDimension x="200" y="8"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativeTo="$parentLeft" relativePoint="RIGHT">
<Offset>
<AbsDimension x="0" y="-2"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Frames>
<Frame name="$parentFlash" hidden="true">
<Size>
<AbsDimension x="5" y="32"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativeTo="$parentLeft">
<Offset>
<AbsDimension x="0" y="-7"/>
</Offset>
</Anchor>
<Anchor point="RIGHT" relativeTo="$parentRight">
<Offset>
<AbsDimension x="0" y="-7"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture file="Interface\PaperDollInfoFrame\UI-Character-Tab-Highlight" alphaMode="ADD" setAllPoints="true"/>
</Layer>
</Layers>
</Frame>
</Frames>
<Scripts>
<OnLoad>
self:RegisterForDrag("LeftButton");
</OnLoad>
<OnLeave>
GameTooltip:Hide();
</OnLeave>
<OnDragStart>
GMChatFrame:StartMoving();
</OnDragStart>
<OnDragStop>
GMChatFrame:StopMovingOrSizing();
</OnDragStop>
</Scripts>
</Frame>
<Button name="$parentCloseButton" inherits="UIPanelCloseButton" parent="GMChatFrame" frameStrata="MEDIUM">
<Anchors>
<Anchor point="RIGHT" relativeTo="GMChatTab" relativePoint="RIGHT">
<Offset>
<AbsDimension x="-1" y="-2"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
self:SetFrameLevel(self:GetFrameLevel() + 40);
</OnLoad>
</Scripts>
</Button>
<Frame name="GMChatStatusFrame" toplevel="true" parent="UIParent" enableMouse="true" hidden="true" frameStrata="FULLSCREEN">
<Size>
<AbsDimension x="208" y="75"/>
</Size>
<Anchors>
<Anchor point="TOPRIGHT">
<Offset>
<AbsDimension x="-180" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Frames>
<!-- this frame helps us size a backdrop frame according to the size of the title and text
and prevents the backdrop frame from drawing on top of the text-->
<Frame setAllPoints="true">
<Layers>
<Layer level="ARTWORK">
<FontString name="GMChatStatusFrameTitleText" inherits="GameFontNormalSmall" justifyH="LEFT" text="GM_CHAT_STATUS_READY">
<Size x="168" y="0"/>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="10" y="-8"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="GMChatStatusFrameDescription" inherits="GameFontHighlightSmall" justifyH="LEFT" text="GM_CHAT_STATUS_READY_DESCRIPTION">
<Size x="168" y="0"/>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="GMChatStatusFrameTitleText" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-2"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
</Frame>
<Button enableMouse="true">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="GMChatStatusFrameTitleText">
<Offset x="-8" y="8"/>
</Anchor>
<Anchor point="BOTTOMRIGHT" relativeTo="GMChatStatusFrameDescription">
<Offset x="30" y="-8"/> <!-- width added to accomodate the status button -->
</Anchor>
</Anchors>
<Backdrop bgFile="Interface\Tooltips\UI-Tooltip-Background" edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true">
<EdgeSize>
<AbsValue val="16"/>
</EdgeSize>
<TileSize>
<AbsValue val="16"/>
</TileSize>
<BackgroundInsets>
<AbsInset left="5" right="5" top="5" bottom="5"/>
</BackgroundInsets>
</Backdrop>
<Layers>
<Layer level="BACKGROUND">
<Texture name="GMChatStatusFramePulse" file="Interface\GMChatFrame\UI-GMStatusFrame-Pulse" hidden="true">
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="-24" y="18"/>
</Offset>
</Anchor>
<Anchor point="BOTTOMRIGHT">
<Offset>
<AbsDimension x="24" y="-18"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnLoad>
self:SetBackdropBorderColor(TOOLTIP_DEFAULT_COLOR.r, TOOLTIP_DEFAULT_COLOR.g, TOOLTIP_DEFAULT_COLOR.b);
self:SetBackdropColor(TOOLTIP_DEFAULT_BACKGROUND_COLOR.r, TOOLTIP_DEFAULT_BACKGROUND_COLOR.g, TOOLTIP_DEFAULT_BACKGROUND_COLOR.b);
</OnLoad>
<OnClick>
GMChatStatusFrame_OnClick();
</OnClick>
</Scripts>
</Button>
<Button name="$parentButton">
<Size>
<AbsDimension x="32" y="16"/>
</Size>
<Anchors>
<Anchor point="TOPRIGHT">
<Offset>
<AbsDimension x="-5" y="-6"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="ARTWORK">
<Texture file="Interface\ChatFrame\UI-ChatIcon-Blizz">
<Size>
<AbsDimension x="32" y="16"/>
</Size>
<Anchors>
<Anchor point="TOPRIGHT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnClick>
GMChatStatusFrame_OnClick();
</OnClick>
</Scripts>
</Button>
</Frames>
<Scripts>
<OnShow>
GetGMTicket();
TemporaryEnchantFrame:SetPoint("TOPRIGHT", self:GetParent(), "TOPRIGHT", -205, (-self:GetHeight()));
</OnShow>
<OnHide>
GetGMTicket();
TemporaryEnchantFrame:SetPoint("TOPRIGHT", "UIParent", "TOPRIGHT", -180, -13);
</OnHide>
</Scripts>
</Frame>
</Ui>
@@ -0,0 +1 @@
-- This file is executed at the end of addon load
@@ -0,0 +1,225 @@
MAX_RADIO_BUTTONS = 5;
MAX_SURVEY_QUESTIONS = 10;
MAX_SURVEY_ANSWERS = 12;
GMSURVEY_NA_SPACING = 60;
GMSURVEY_NA_SHORT_SPACING = 40;
GMSURVEY_RATING_SPACING = 80;
GMSURVEY_RATING_SHORT_SPACING = 25;
UIPanelWindows["GMSurveyFrame"] = { area = "center", pushable = 0, whileDead = 1 };
function GMSurveyFrame_Update()
GMSurveyFrame.numQuestions = 0;
local surveyQuestion;
local questionFrame, questionFrameText;
for i=1, MAX_SURVEY_QUESTIONS do
surveyQuestion = GMSurveyQuestion(i);
questionFrame = _G["GMSurveyQuestion"..i];
if ( surveyQuestion ) then
GMSurveyFrame.numQuestions = GMSurveyFrame.numQuestions + 1;
questionFrameText = _G["GMSurveyQuestion"..i.."Text"];
questionFrameText:SetText(surveyQuestion);
for j=1, MAX_SURVEY_ANSWERS do
local surveyAnswer = GMSurveyAnswer(i,j);
local answerFrame = _G["GMSurveyQuestion"..i.."RadioButton"..(j-1)];
if ( surveyAnswer ) then
_G["GMSurveyQuestion"..i.."RadioButton"..(j-1).."Score"]:SetText(surveyAnswer);
answerFrame:Show();
else
answerFrame:Hide();
end
end
GMSurveyQuestion_SpaceAnswers(questionFrame, i);
if ( i == 1 ) then
questionFrame:SetHeight(questionFrameText:GetHeight() + 100);
else
questionFrame:SetHeight(questionFrameText:GetHeight() + 55);
end
questionFrame:Show();
else
questionFrame:Hide();
end
end
if ( GMSurveyFrame.numQuestions == 0 ) then
-- Had no questions
return;
end
GMSurveyAdditionalCommentsText:SetPoint("TOPLEFT", "GMSurveyQuestion"..GMSurveyFrame.numQuestions, "BOTTOMLEFT", 10, -10);
end
function GMSurveyScrollFrame_OnLoad(self)
ScrollFrame_OnLoad(self);
self.scrollBarHideable = 1;
self:RegisterEvent("ADDON_LOADED");
self:SetScript("OnEvent", GMSurveyScrollFrame_OnEvent);
end
function GMSurveyScrollFrame_OnEvent(self, event, ...)
if ( event == "ADDON_LOADED" ) then
local addonName = ...;
if ( not addonName or (addonName and addonName ~= "Blizzard_GMSurveyUI") ) then
return;
end
-- expand and contract scroll frame contents depending on scroll bar visibility
local scrollBar = _G[self:GetName().."ScrollBar"];
scrollBar.Show =
function (self)
local scrollFrame = self:GetParent();
local scrollFrameParent = scrollFrame:GetParent();
local scrollBarOffset = scrollFrame.scrollBarWidth;
-- adjust scroll frame width
scrollFrame:SetPoint("BOTTOMRIGHT", scrollFrameParent, "BOTTOMRIGHT", -55 - scrollBarOffset, 48);
scrollFrame:GetScrollChild():SetWidth(scrollFrame:GetWidth());
getmetatable(self).__index.Show(self);
end
scrollBar.Hide =
function (self)
local scrollFrame = self:GetParent();
local scrollFrameParent = scrollFrame:GetParent();
-- adjust scroll frame width
scrollFrame:SetPoint("BOTTOMRIGHT", scrollFrameParent, "BOTTOMRIGHT", -55, 48);
scrollFrame:GetScrollChild():SetWidth(scrollFrame:GetWidth());
getmetatable(self).__index.Hide(self);
end
self.scrollBarWidth = 25; -- looks better than actual scroll bar width
-- force an update
ScrollFrame_OnScrollRangeChanged(self);
-- we don't need this event any more
self:UnregisterEvent(event)
end
end
function GMSurveyQuestion_OnLoad(self)
self:SetBackdropBorderColor(0.5,0.5,0.5);
self:SetBackdropColor(TOOLTIP_DEFAULT_BACKGROUND_COLOR.r, TOOLTIP_DEFAULT_BACKGROUND_COLOR.g, TOOLTIP_DEFAULT_BACKGROUND_COLOR.b);
local name = self:GetName();
self.radioButtons = {
[0] = _G[name.."RadioButton0"],
_G[name.."RadioButton1"],
_G[name.."RadioButton2"],
_G[name.."RadioButton3"],
_G[name.."RadioButton4"],
_G[name.."RadioButton5"],
_G[name.."RadioButton6"],
_G[name.."RadioButton7"],
_G[name.."RadioButton8"],
_G[name.."RadioButton9"],
_G[name.."RadioButton10"],
_G[name.."RadioButton11"],
};
end
function GMSurveyQuestion_SpaceAnswers(self, questionNumber)
local radioButtons = self.radioButtons;
if (questionNumber == 1) then
radioButtons[0]:SetPoint("BOTTOMLEFT", self, "BOTTOMLEFT", 30, 45);
radioButtons[1]:SetPoint("LEFT", radioButtons[0], "RIGHT", GMSURVEY_NA_SHORT_SPACING, 0);
for j=2, MAX_SURVEY_ANSWERS-1 do
radioButtons[j]:SetPoint("LEFT", radioButtons[j-1], "RIGHT", GMSURVEY_RATING_SHORT_SPACING, 0);
end
_G[radioButtons[1]:GetName().."NetPromoterLow"]:Show();
_G[radioButtons[11]:GetName().."NetPromoterHigh"]:Show();
else
radioButtons[0]:SetPoint("BOTTOMLEFT", self, "BOTTOMLEFT", 30, 5);
radioButtons[1]:SetPoint("LEFT", radioButtons[0], "RIGHT", GMSURVEY_NA_SPACING, 0);
for j=2, MAX_SURVEY_ANSWERS -1 do
radioButtons[j]:SetPoint("LEFT", radioButtons[j-1], "RIGHT", GMSURVEY_RATING_SPACING, 0);
end
_G[radioButtons[1]:GetName().."NetPromoterLow"]:Hide();
_G[radioButtons[11]:GetName().."NetPromoterHigh"]:Hide();
end
end
function GMSurveyQuestion_OnShow(self)
GMSurveyRadioButton_OnClick(self.radioButtons[0]);
end
function GMSurveyRadioButton_OnClick(self)
local owner = self:GetParent();
local id = self:GetID();
if ( id == owner.selectedRadioButton ) then
return;
else
owner.selectedRadioButton = id;
end
local radioButtons = owner.radioButtons;
local radioButton;
for i=0, #radioButtons do
radioButton = radioButtons[i];
if ( i == owner.selectedRadioButton ) then
radioButton:SetChecked(1);
radioButton:Disable();
else
radioButton:SetChecked(0);
radioButton:Enable();
end
end
end
function GMSurveyCommentScrollFrame_OnLoad(self)
self.scrollBarHideable = 1;
self:RegisterEvent("ADDON_LOADED");
self:SetScript("OnEvent", GMSurveyCommentScrollFrame_OnEvent);
end
function GMSurveyCommentScrollFrame_OnEvent(self, event, ...)
if ( event == "ADDON_LOADED" ) then
local addonName = ...;
if ( not addonName or (addonName and addonName ~= "Blizzard_GMSurveyUI") ) then
return;
end
-- expand and contract scroll frame contents depending on scroll bar visibility
local scrollBar = _G[self:GetName().."ScrollBar"];
scrollBar.Show =
function (self)
local scrollFrame = self:GetParent();
-- adjust scroll frame width
scrollFrame:SetPoint("BOTTOMRIGHT", scrollFrame:GetParent(), "BOTTOMRIGHT", -10 - self:GetWidth(), 5);
local scrollFrameWidth = scrollFrame:GetWidth();
scrollFrame:GetScrollChild():SetWidth(scrollFrameWidth);
-- adjust content width
GMSurveyFrameComment:SetWidth(scrollFrameWidth);
getmetatable(self).__index.Show(self);
end
scrollBar.Hide =
function (self)
local scrollFrame = self:GetParent();
-- adjust scroll frame width
scrollFrame:SetPoint("BOTTOMRIGHT", scrollFrame:GetParent(), "BOTTOMRIGHT", -10, 5);
local scrollFrameWidth = scrollFrame:GetWidth();
scrollFrame:GetScrollChild():SetWidth(scrollFrameWidth);
-- adjust content width
GMSurveyFrameComment:SetWidth(scrollFrameWidth);
getmetatable(self).__index.Hide(self);
end
-- force an update
ScrollFrame_OnScrollRangeChanged(self);
-- we don't need this event any more
self:UnregisterEvent(event)
end
end
function GMSurveySubmitButton_OnClick()
for i=1, GMSurveyFrame.numQuestions do
GMSurveyAnswerSubmit(i, _G["GMSurveyQuestion"..i].selectedRadioButton, "");
end
GMSurveyCommentSubmit(GMSurveyFrameComment:GetText());
GMSurveySubmit();
TicketStatusFrame.hasGMSurvey = false;
HideUIPanel(GMSurveyFrame);
UIErrorsFrame:AddMessage(GMSURVEY_SUBMITTED, NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b, 1.0);
end
@@ -0,0 +1,6 @@
## Interface: 30300
## Title: Blizzard GM Survey UI
## Secure: 1
## LoadOnDemand: 1
Blizzard_GMSurveyUI.xml
Localization.lua
@@ -0,0 +1,778 @@
<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="Blizzard_GMSurveyUI.lua"/>
<CheckButton name="GMSurveyRadioButtonTemplate" inherits="UIRadioButtonTemplate" virtual="true">
<Layers>
<Layer level="BACKGROUND">
<FontString name="$parentScore" inherits="GameFontHighlightSmall">
<Size>
<AbsDimension x="90" y="0"/>
</Size>
<Anchors>
<Anchor point="BOTTOM" relativePoint="TOP">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnClick>
GMSurveyRadioButton_OnClick(self, button, down);
</OnClick>
</Scripts>
</CheckButton>
<Frame name="GMSurveyQuestionTemplate" virtual="true">
<Size>
<AbsDimension x="568" y="80"/>
</Size>
<Layers>
<Layer level="BACKGROUND">
<FontString name="$parentText" inherits="GameFontNormal" justifyH="LEFT">
<Size x="520" y="0"/>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="10" y="-7"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Backdrop bgFile="Interface\Tooltips\UI-Tooltip-Background" edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true">
<EdgeSize>
<AbsValue val="16"/>
</EdgeSize>
<TileSize>
<AbsValue val="16"/>
</TileSize>
<BackgroundInsets>
<AbsInset left="5" right="5" top="5" bottom="5"/>
</BackgroundInsets>
</Backdrop>
<Frames>
<CheckButton name="$parentRadioButton0" inherits="GMSurveyRadioButtonTemplate" id="0">
<Anchors>
<Anchor point="BOTTOMLEFT">
<Offset>
<AbsDimension x="30" y="5"/>
</Offset>
</Anchor>
</Anchors>
</CheckButton>
<CheckButton name="$parentRadioButton1" inherits="GMSurveyRadioButtonTemplate" id="1">
<Anchors>
<Anchor point="LEFT" relativeTo="$parentRadioButton0" relativePoint="RIGHT">
<Offset>
<AbsDimension x="60" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<FontString name="$parentNetPromoterLow" inherits="GameFontHighlight" text="NET_PROMOTER_LOW" justifyH="LEFT" hidden="true">
<Size>
<AbsDimension x="100" y="40"/>
</Size>
<Anchors>
<Anchor point="LEFT">
<Offset>
<AbsDimension x="-20" y="-20"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
</CheckButton>
<CheckButton name="$parentRadioButton2" inherits="GMSurveyRadioButtonTemplate" id="2">
<Anchors>
<Anchor point="LEFT" relativeTo="$parentRadioButton1" relativePoint="RIGHT">
<Offset>
<AbsDimension x="80" y="0"/>
</Offset>
</Anchor>
</Anchors>
</CheckButton>
<CheckButton name="$parentRadioButton3" inherits="GMSurveyRadioButtonTemplate" id="3">
<Anchors>
<Anchor point="LEFT" relativeTo="$parentRadioButton2" relativePoint="RIGHT">
<Offset>
<AbsDimension x="80" y="0"/>
</Offset>
</Anchor>
</Anchors>
</CheckButton>
<CheckButton name="$parentRadioButton4" inherits="GMSurveyRadioButtonTemplate" id="4">
<Anchors>
<Anchor point="LEFT" relativeTo="$parentRadioButton3" relativePoint="RIGHT">
<Offset>
<AbsDimension x="80" y="0"/>
</Offset>
</Anchor>
</Anchors>
</CheckButton>
<CheckButton name="$parentRadioButton5" inherits="GMSurveyRadioButtonTemplate" id="5">
<Anchors>
<Anchor point="LEFT" relativeTo="$parentRadioButton4" relativePoint="RIGHT">
<Offset>
<AbsDimension x="80" y="0"/>
</Offset>
</Anchor>
</Anchors>
</CheckButton>
<CheckButton name="$parentRadioButton6" inherits="GMSurveyRadioButtonTemplate" id="6">
<Anchors>
<Anchor point="LEFT" relativeTo="$parentRadioButton5" relativePoint="RIGHT">
<Offset>
<AbsDimension x="80" y="0"/>
</Offset>
</Anchor>
</Anchors>
</CheckButton>
<CheckButton name="$parentRadioButton7" inherits="GMSurveyRadioButtonTemplate" id="7">
<Anchors>
<Anchor point="LEFT" relativeTo="$parentRadioButton6" relativePoint="RIGHT">
<Offset>
<AbsDimension x="80" y="0"/>
</Offset>
</Anchor>
</Anchors>
</CheckButton>
<CheckButton name="$parentRadioButton8" inherits="GMSurveyRadioButtonTemplate" id="8">
<Anchors>
<Anchor point="LEFT" relativeTo="$parentRadioButton7" relativePoint="RIGHT">
<Offset>
<AbsDimension x="80" y="0"/>
</Offset>
</Anchor>
</Anchors>
</CheckButton>
<CheckButton name="$parentRadioButton9" inherits="GMSurveyRadioButtonTemplate" id="9">
<Anchors>
<Anchor point="LEFT" relativeTo="$parentRadioButton8" relativePoint="RIGHT">
<Offset>
<AbsDimension x="80" y="0"/>
</Offset>
</Anchor>
</Anchors>
</CheckButton>
<CheckButton name="$parentRadioButton10" inherits="GMSurveyRadioButtonTemplate" id="10">
<Anchors>
<Anchor point="LEFT" relativeTo="$parentRadioButton9" relativePoint="RIGHT">
<Offset>
<AbsDimension x="80" y="0"/>
</Offset>
</Anchor>
</Anchors>
</CheckButton>
<CheckButton name="$parentRadioButton11" inherits="GMSurveyRadioButtonTemplate" id="11">
<Anchors>
<Anchor point="LEFT" relativeTo="$parentRadioButton10" relativePoint="RIGHT">
<Offset>
<AbsDimension x="80" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<FontString name="$parentNetPromoterHigh" inherits="GameFontHighlight" text="NET_PROMOTER_HIGH" justifyH="RIGHT" hidden="true">
<Size>
<AbsDimension x="100" y="40"/>
</Size>
<Anchors>
<Anchor point="RIGHT">
<Offset>
<AbsDimension x="20" y="-20"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
</CheckButton>
</Frames>
<Scripts>
<OnLoad>
GMSurveyQuestion_OnLoad(self);
</OnLoad>
<OnShow>
GMSurveyQuestion_OnShow(self);
</OnShow>
</Scripts>
</Frame>
<Frame name="GMSurveyFrame" toplevel="true" parent="UIParent" hidden="true">
<Size>
<AbsDimension x="645" y="562"/>
</Size>
<Anchors>
<Anchor point="CENTER">
<Offset>
<AbsDimension x="40" y="20"/>
</Offset>
</Anchor>
</Anchors>
<HitRectInsets>
<AbsInset left="0" right="44" top="0" bottom="13"/>
</HitRectInsets>
<Layers>
<Layer level="BACKGROUND">
<Texture name="GMSurveyTopLeft" file="Interface\HelpFrame\HelpFrame-TopLeft">
<Size>
<AbsDimension x="256" y="256"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT"/>
</Anchors>
</Texture>
<Texture name="GMSurveyTop" file="Interface\HelpFrame\HelpFrame-Top">
<Size>
<AbsDimension x="256" y="256"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="GMSurveyTopLeft" relativePoint="TOPRIGHT"/>
</Anchors>
</Texture>
<Texture name="GMSurveyTopRight" file="Interface\HelpFrame\HelpFrame-TopRight">
<Size>
<AbsDimension x="128" y="256"/>
</Size>
<Anchors>
<Anchor point="TOPRIGHT"/>
</Anchors>
</Texture>
<Texture name="GMSurveyTopFiller" file="Interface\HelpFrame\HelpFrame-Top">
<Size>
<AbsDimension x="5" y="256"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="GMSurveyTop" relativePoint="TOPRIGHT"/>
<Anchor point="TOPRIGHT" relativeTo="GMSurveyTopRight" relativePoint="TOPLEFT"/>
</Anchors>
</Texture>
<Texture name="GMSurveyLeft" file="Interface\HelpFrame\HelpFrame-BotLeft">
<Size>
<AbsDimension x="256" y="50"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="GMSurveyTopLeft" relativePoint="BOTTOMLEFT"/>
</Anchors>
<TexCoords left="0" right="1" top="0" bottom="0.1953125"/>
</Texture>
<Texture name="GMSurveyMiddle" file="Interface\HelpFrame\HelpFrame-Bottom">
<Size>
<AbsDimension x="256" y="50"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="GMSurveyLeft" relativePoint="TOPRIGHT"/>
</Anchors>
<TexCoords left="0" right="1" top="0" bottom="0.1953125"/>
</Texture>
<Texture name="GMSurveyRight" file="Interface\HelpFrame\HelpFrame-BotRight">
<Size>
<AbsDimension x="128" y="50"/>
</Size>
<Anchors>
<Anchor point="TOPRIGHT" relativeTo="GMSurveyTopRight" relativePoint="BOTTOMRIGHT"/>
</Anchors>
<TexCoords left="0" right="1" top="0" bottom="0.1953125"/>
</Texture>
<Texture name="GMSurveyMiddleFiller" file="Interface\HelpFrame\HelpFrame-Bottom">
<Size>
<AbsDimension x="5" y="50"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="GMSurveyMiddle" relativePoint="TOPRIGHT"/>
<Anchor point="TOPRIGHT" relativeTo="GMSurveyRight" relativePoint="TOPLEFT"/>
</Anchors>
<TexCoords left="0" right="1" top="0" bottom="0.1953125"/>
</Texture>
<Texture name="GMSurveyBottomLeft" file="Interface\HelpFrame\HelpFrame-BotLeft">
<Size>
<AbsDimension x="256" y="256"/>
</Size>
<Anchors>
<Anchor point="BOTTOMLEFT"/>
</Anchors>
</Texture>
<Texture name="GMSurveyBottom" file="Interface\HelpFrame\HelpFrame-Bottom">
<Size>
<AbsDimension x="256" y="256"/>
</Size>
<Anchors>
<Anchor point="BOTTOMLEFT" relativeTo="GMSurveyBottomLeft" relativePoint="BOTTOMRIGHT"/>
</Anchors>
</Texture>
<Texture name="GMSurveyBottomRight" file="Interface\HelpFrame\HelpFrame-BotRight">
<Size>
<AbsDimension x="128" y="256"/>
</Size>
<Anchors>
<Anchor point="BOTTOMRIGHT"/>
</Anchors>
</Texture>
<Texture name="GMSurveyBottomFiller" file="Interface\HelpFrame\HelpFrame-Bottom">
<Size>
<AbsDimension x="5" y="256"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="GMSurveyBottom" relativePoint="TOPRIGHT"/>
<Anchor point="TOPRIGHT" relativeTo="GMSurveyBottomRight" relativePoint="TOPLEFT"/>
</Anchors>
</Texture>
<FontString inherits="GameFontHighlight" justifyH="CENTER" text="GMSURVEY_REQUEST_TEXT">
<Anchors>
<Anchor point="TOP">
<Offset>
<AbsDimension x="-10" y="-30"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Frames>
<Frame name="GMSurveyHeader">
<Size>
<AbsDimension x="336" y="41"/>
</Size>
<Anchors>
<Anchor point="TOP">
<Offset>
<AbsDimension x="-12" y="12"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="ARTWORK">
<Texture name="GMSurveyHeaderLeft" file="Interface\DialogFrame\UI-DialogBox-Header">
<Size>
<AbsDimension x="32" y="41"/>
</Size>
<Anchors>
<Anchor point="LEFT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0.22265625" right="0.34375" top="0" bottom="0.640625"/>
</Texture>
<Texture name="GMSurveyHeaderRight" file="Interface\DialogFrame\UI-DialogBox-Header">
<Size>
<AbsDimension x="32" y="41"/>
</Size>
<Anchors>
<Anchor point="RIGHT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0.65234375" right="0.77734375" top="0" bottom="0.640625"/>
</Texture>
<Texture name="GMSurveyHeaderCenter" file="Interface\DialogFrame\UI-DialogBox-Header">
<Size>
<AbsDimension x="10" y="41"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativeTo="GMSurveyHeaderLeft" relativePoint="RIGHT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
<Anchor point="RIGHT" relativeTo="GMSurveyHeaderRight" relativePoint="LEFT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0.34375" right="0.65234375" top="0" bottom="0.640625"/>
</Texture>
<FontString name="GMSurveyHeaderText" inherits="GameFontNormal" text="GMSURVEY_TITLE">
<Anchors>
<Anchor point="TOP" relativeTo="GMSurveyHeader">
<Offset>
<AbsDimension x="0" y="-14"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
</Frame>
<ScrollFrame name="GMSurveyScrollFrame" inherits="UIPanelScrollFrameTemplate">
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="20" y="-55"/>
</Offset>
</Anchor>
<Anchor point="BOTTOMRIGHT">
<Offset>
<AbsDimension x="-55" y="48"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="ARTWORK">
<Texture name="$parentTop" file="Interface\PaperDollInfoFrame\UI-Character-ScrollBar">
<Size>
<AbsDimension x="31" y="256"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="-2" y="5"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0" right="0.484375" top="0" bottom="1.0"/>
</Texture>
<Texture name="$parentBottom" file="Interface\PaperDollInfoFrame\UI-Character-ScrollBar">
<Size>
<AbsDimension x="31" y="106"/>
</Size>
<Anchors>
<Anchor point="BOTTOMLEFT" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="-2" y="-2"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0.515625" right="1.0" top="0" bottom="0.4140625"/>
</Texture>
<Texture name="$parentMiddle" file="Interface\PaperDollInfoFrame\UI-Character-ScrollBar">
<Size>
<AbsDimension x="31" y="60"/>
</Size>
<Anchors>
<Anchor point="TOP" relativeTo="$parentTop" relativePoint="BOTTOM">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
<Anchor point="BOTTOM" relativeTo="$parentBottom" relativePoint="TOP">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0" right="0.484375" top=".75" bottom="1.0"/>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnLoad function="GMSurveyScrollFrame_OnLoad"/>
<OnScrollRangeChanged function="ScrollFrame_OnScrollRangeChanged"/>
</Scripts>
<ScrollChild>
<Frame name="GMSurveyScrollChildFrame">
<Size>
<AbsDimension x="541" y="10"/>
</Size>
<Layers>
<Layer level="BACKGROUND">
<FontString name="GMSurveyAdditionalCommentsText" inherits="GameFontHighlight" text="ADDITIONAL_COMMENTS" justifyH="LEFT">
<Size x="541" y="0"/>
<Anchors>
<Anchor point="TOPLEFT"/>
<Anchor point="TOPRIGHT"/>
</Anchors>
</FontString>
</Layer>
</Layers>
<Frames>
<Frame name="GMSurveyQuestion1" inherits="GMSurveyQuestionTemplate">
<Anchors>
<Anchor point="TOPLEFT"/>
<Anchor point="TOPRIGHT"/>
</Anchors>
</Frame>
<Frame name="GMSurveyQuestion2" inherits="GMSurveyQuestionTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="GMSurveyQuestion1" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="4"/>
</Offset>
</Anchor>
<Anchor point="TOPRIGHT" relativeTo="GMSurveyQuestion1" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="0" y="4"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="GMBlock" >
<Size x="541" y="60"/>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="GMSurveyQuestion2" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="10" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<FontString name="GMBlockText" inherits="GameFontHighlight" justifyH="LEFT" text="GMSURVEY_BLOCK_TEXT"/>
</Layer>
</Layers>
</Frame>
<Frame name="GMSurveyQuestion3" inherits="GMSurveyQuestionTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="GMSurveyQuestion2" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-40"/>
</Offset>
</Anchor>
<Anchor point="TOPRIGHT" relativeTo="GMSurveyQuestion2" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="0" y="-40"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="GMSurveyQuestion4" inherits="GMSurveyQuestionTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="GMSurveyQuestion3" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="4"/>
</Offset>
</Anchor>
<Anchor point="TOPRIGHT" relativeTo="GMSurveyQuestion3" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="0" y="4"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="GMSurveyQuestion5" inherits="GMSurveyQuestionTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="GMSurveyQuestion4" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="4"/>
</Offset>
</Anchor>
<Anchor point="TOPRIGHT" relativeTo="GMSurveyQuestion4" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="0" y="4"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="GMSurveyQuestion6" inherits="GMSurveyQuestionTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="GMSurveyQuestion5" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="4"/>
</Offset>
</Anchor>
<Anchor point="TOPRIGHT" relativeTo="GMSurveyQuestion5" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="0" y="4"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="GMSurveyQuestion7" inherits="GMSurveyQuestionTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="GMSurveyQuestion6" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="4"/>
</Offset>
</Anchor>
<Anchor point="TOPRIGHT" relativeTo="GMSurveyQuestion6" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="0" y="4"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="GMSurveyQuestion8" inherits="GMSurveyQuestionTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="GMSurveyQuestion7" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="4"/>
</Offset>
</Anchor>
<Anchor point="TOPRIGHT" relativeTo="GMSurveyQuestion7" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="0" y="4"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="GMSurveyQuestion9" inherits="GMSurveyQuestionTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="GMSurveyQuestion8" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="4"/>
</Offset>
</Anchor>
<Anchor point="TOPRIGHT" relativeTo="GMSurveyQuestion8" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="0" y="4"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="GMSurveyQuestion10" inherits="GMSurveyQuestionTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="GMSurveyQuestion9" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="4"/>
</Offset>
</Anchor>
<Anchor point="TOPRIGHT" relativeTo="GMSurveyQuestion9" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="0" y="4"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="GMSurveyCommentFrame">
<Size>
<AbsDimension x="541" y="85"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="GMSurveyAdditionalCommentsText" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="-10" y="0"/>
</Offset>
</Anchor>
<Anchor point="TOPRIGHT" relativeTo="GMSurveyAdditionalCommentsText" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Backdrop bgFile="Interface\Tooltips\UI-Tooltip-Background" edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true">
<EdgeSize>
<AbsValue val="16"/>
</EdgeSize>
<TileSize>
<AbsValue val="16"/>
</TileSize>
<BackgroundInsets>
<AbsInset left="5" right="5" top="5" bottom="5"/>
</BackgroundInsets>
</Backdrop>
<Frames>
<ScrollFrame name="GMSurveyCommentScrollFrame" inherits="UIPanelScrollFrameTemplate">
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="10" y="-5"/>
</Offset>
</Anchor>
<Anchor point="BOTTOMRIGHT">
<Offset>
<AbsDimension x="-10" y="5"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad function="GMSurveyCommentScrollFrame_OnLoad"/>
<OnMouseDown>
GMSurveyFrameComment:SetFocus();
</OnMouseDown>
<OnMouseUp>
GMSurveyFrameComment:SetFocus();
</OnMouseUp>
</Scripts>
<ScrollChild>
<EditBox name="GMSurveyFrameComment" multiLine="true" letters="500" enableMouse="true" autoFocus="false">
<Size>
<AbsDimension x="530" y="60"/>
</Size>
<Scripts>
<OnEscapePressed function="EditBox_ClearFocus"/>
<OnTextChanged>
ScrollingEdit_OnTextChanged(self, self:GetParent());
</OnTextChanged>
<OnCursorChanged function="ScrollingEdit_OnCursorChanged"/>
<OnUpdate>
ScrollingEdit_OnUpdate(self, 0, self:GetParent());
</OnUpdate>
<OnShow>
GMSurveyFrameComment:SetText("");
</OnShow>
</Scripts>
<FontString inherits="GameFontHighlightSmall"/>
</EditBox>
</ScrollChild>
</ScrollFrame>
</Frames>
<Scripts>
<OnLoad>
self:SetBackdropBorderColor(0.5,0.5,0.5);
self:SetBackdropColor(TOOLTIP_DEFAULT_BACKGROUND_COLOR.r, TOOLTIP_DEFAULT_BACKGROUND_COLOR.g, TOOLTIP_DEFAULT_BACKGROUND_COLOR.b);
</OnLoad>
</Scripts>
</Frame>
</Frames>
</Frame>
</ScrollChild>
</ScrollFrame>
<Button name="GMSurveyCloseButton" inherits="UIPanelCloseButton">
<Anchors>
<Anchor point="TOPRIGHT">
<Offset>
<AbsDimension x="-42" y="-3"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
TicketStatusFrame.hasGMSurvey = false;
TicketStatusFrame:Hide();
HideUIPanel(GMSurveyFrame);
</OnClick>
</Scripts>
</Button>
<Button name="GMSurveyCancelButton" inherits="GameMenuButtonTemplate" text="CANCEL">
<Size>
<AbsDimension x="130" y="22"/>
</Size>
<Anchors>
<Anchor point="BOTTOMLEFT">
<Offset>
<AbsDimension x="10" y="21"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
TicketStatusFrame.hasGMSurvey = false;
TicketStatusFrame:Hide();
HideUIPanel(GMSurveyFrame);
</OnClick>
</Scripts>
</Button>
<Button name="GMSurveySubmitButton" inherits="GameMenuButtonTemplate" text="SUBMIT">
<Anchors>
<Anchor point="BOTTOMRIGHT">
<Offset>
<AbsDimension x="-53" y="21"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick function="GMSurveySubmitButton_OnClick"/>
</Scripts>
</Button>
</Frames>
<Scripts>
<OnLoad>
GMSurveyHeader:SetWidth(GMSurveyHeaderText:GetWidth() + 100);
</OnLoad>
<OnShow>
GMSurveyFrame_Update();
GMSurveyScrollFrame:SetVerticalScroll(0);
</OnShow>
</Scripts>
</Frame>
</Ui>
@@ -0,0 +1 @@
-- This file is executed at the end of addon load
@@ -0,0 +1,421 @@
GLYPHTYPE_MAJOR = 1;
GLYPHTYPE_MINOR = 2;
GLYPH_MINOR = { r = 0, g = 0.25, b = 1};
GLYPH_MAJOR = { r = 1, g = 0.25, b = 0};
GLYPH_SLOTS = {};
-- Empty Texture
GLYPH_SLOTS[0] = { left = 0.78125, right = 0.91015625, top = 0.69921875, bottom = 0.828125 };
-- Major Glyphs
GLYPH_SLOTS[3] = { left = 0.392578125, right = 0.521484375, top = 0.87109375, bottom = 1 };
GLYPH_SLOTS[1] = { left = 0, right = 0.12890625, top = 0.87109375, bottom = 1 };
GLYPH_SLOTS[5] = { left = 0.26171875, right = 0.390625, top = 0.87109375, bottom = 1 };
-- Minor Glyphs
GLYPH_SLOTS[2] = { left = 0.130859375, right = 0.259765625, top = 0.87109375, bottom = 1 };
GLYPH_SLOTS[6] = { left = 0.654296875, right = 0.783203125, top = 0.87109375, bottom = 1 };
GLYPH_SLOTS[4] = { left = 0.5234375, right = 0.65234375, top = 0.87109375, bottom = 1 };
NUM_GLYPH_SLOTS = 6;
local slotAnimations = {};
local TOPLEFT, TOP, TOPRIGHT, BOTTOMRIGHT, BOTTOM, BOTTOMLEFT = 3, 1, 5, 4, 2, 6;
slotAnimations[TOPLEFT] = {["point"] = "CENTER", ["xStart"] = -13, ["xStop"] = -85, ["yStart"] = 17, ["yStop"] = 60};
slotAnimations[TOP] = {["point"] = "CENTER", ["xStart"] = -13, ["xStop"] = -13, ["yStart"] = 17, ["yStop"] = 100};
slotAnimations[TOPRIGHT] = {["point"] = "CENTER", ["xStart"] = -13, ["xStop"] = 59, ["yStart"] = 17, ["yStop"] = 60};
slotAnimations[BOTTOM] = {["point"] = "CENTER", ["xStart"] = -13, ["xStop"] = -13, ["yStart"] = 17, ["yStop"] = -64};
slotAnimations[BOTTOMLEFT] = {["point"] = "CENTER", ["xStart"] = -13, ["xStop"] = -87, ["yStart"] = 18, ["yStop"] = -27};
slotAnimations[BOTTOMRIGHT] = {["point"] = "CENTER", ["xStart"] = -13, ["xStop"] = 61, ["yStart"] = 18, ["yStop"] = -27};
local HIGHLIGHT_BASEALPHA = .4;
function GlyphFrame_Toggle ()
TalentFrame_LoadUI();
if ( PlayerTalentFrame_ToggleGlyphFrame ) then
PlayerTalentFrame_ToggleGlyphFrame(GetActiveTalentGroup());
end
end
function GlyphFrame_Open ()
TalentFrame_LoadUI();
if ( PlayerTalentFrame_OpenGlyphFrame ) then
PlayerTalentFrame_OpenGlyphFrame(GetActiveTalentGroup());
end
end
function GlyphFrameGlyph_OnLoad (self)
local name = self:GetName();
self:RegisterForClicks("LeftButtonUp", "RightButtonUp");
self.glyph = _G[name .. "Glyph"];
self.setting = _G[name .. "Setting"];
self.highlight = _G[name .. "Highlight"];
self.background = _G[name .. "Background"];
self.ring = _G[name .. "Ring"];
self.shine = _G[name .. "Shine"];
self.elapsed = 0;
self.tintElapsed = 0;
self.glyphType = nil;
end
function GlyphFrameGlyph_UpdateSlot (self)
local id = self:GetID();
local talentGroup = PlayerTalentFrame and PlayerTalentFrame.talentGroup;
local enabled, glyphType, glyphSpell, iconFilename = GetGlyphSocketInfo(id, talentGroup);
local isMinor = glyphType == 2;
if ( isMinor ) then
GlyphFrameGlyph_SetGlyphType(self, GLYPHTYPE_MINOR);
else
GlyphFrameGlyph_SetGlyphType(self, GLYPHTYPE_MAJOR);
end
self.elapsed = 0;
self.tintElapsed = 0;
local slotAnimation = slotAnimations[id];
if ( not enabled ) then
slotAnimation.glyph = nil;
if ( slotAnimation.sparkle ) then
slotAnimation.sparkle:StopAnimating();
slotAnimation.sparkle:Hide();
end
self.shine:Hide();
self.background:Hide();
self.glyph:Hide();
self.ring:Hide();
self.setting:SetTexture("Interface\\Spellbook\\UI-GlyphFrame-Locked");
self.setting:SetTexCoord(.1, .9, .1, .9);
elseif ( not glyphSpell ) then
slotAnimation.glyph = nil;
if ( slotAnimation.sparkle ) then
slotAnimation.sparkle:StopAnimating();
slotAnimation.sparkle:Hide();
end
self.spell = nil;
self.shine:Show();
self.background:Show();
self.background:SetTexCoord(GLYPH_SLOTS[0].left, GLYPH_SLOTS[0].right, GLYPH_SLOTS[0].top, GLYPH_SLOTS[0].bottom);
if ( not GlyphMatchesSocket(id) ) then
self.background:SetAlpha(1);
end
self.glyph:Hide();
self.ring:Show();
else
slotAnimation.glyph = true;
self.spell = glyphSpell;
self.shine:Show();
self.background:Show();
self.background:SetAlpha(1);
self.background:SetTexCoord(GLYPH_SLOTS[id].left, GLYPH_SLOTS[id].right, GLYPH_SLOTS[id].top, GLYPH_SLOTS[id].bottom);
self.glyph:Show();
if ( iconFilename ) then
self.glyph:SetTexture(iconFilename);
else
self.glyph:SetTexture("Interface\\Spellbook\\UI-Glyph-Rune1");
end
self.ring:Show();
end
end
function GlyphFrameGlyph_SetGlyphType (glyph, glyphType)
glyph.glyphType = glyphType;
glyph.setting:SetTexture("Interface\\Spellbook\\UI-GlyphFrame");
if ( glyphType == GLYPHTYPE_MAJOR ) then
glyph.glyph:SetVertexColor(GLYPH_MAJOR.r, GLYPH_MAJOR.g, GLYPH_MAJOR.b);
glyph.setting:SetWidth(108);
glyph.setting:SetHeight(108);
glyph.setting:SetTexCoord(0.740234375, 0.953125, 0.484375, 0.697265625);
glyph.highlight:SetWidth(108);
glyph.highlight:SetHeight(108);
glyph.highlight:SetTexCoord(0.740234375, 0.953125, 0.484375, 0.697265625);
glyph.ring:SetWidth(82);
glyph.ring:SetHeight(82);
glyph.ring:SetPoint("CENTER", glyph, "CENTER", 0, -1);
glyph.ring:SetTexCoord(0.767578125, 0.92578125, 0.32421875, 0.482421875);
glyph.shine:SetTexCoord(0.9609375, 1, 0.9609375, 1);
glyph.background:SetWidth(70);
glyph.background:SetHeight(70);
else
glyph.glyph:SetVertexColor(GLYPH_MINOR.r, GLYPH_MINOR.g, GLYPH_MINOR.b);
glyph.setting:SetWidth(86);
glyph.setting:SetHeight(86);
glyph.setting:SetTexCoord(0.765625, 0.927734375, 0.15625, 0.31640625);
glyph.highlight:SetWidth(86);
glyph.highlight:SetHeight(86);
glyph.highlight:SetTexCoord(0.765625, 0.927734375, 0.15625, 0.31640625);
glyph.ring:SetWidth(62);
glyph.ring:SetHeight(62);
glyph.ring:SetPoint("CENTER", glyph, "CENTER", 0, 1);
glyph.ring:SetTexCoord(0.787109375, 0.908203125, 0.033203125, 0.154296875);
glyph.shine:SetTexCoord(0.9609375, 1, 0.921875, 0.9609375);
glyph.background:SetWidth(64);
glyph.background:SetHeight(64);
end
end
function GlyphFrameGlyph_OnUpdate (self, elapsed)
local GLYPHFRAMEGLYPH_FINISHED = 6;
local GLYPHFRAMEGLYPH_START = 2;
local GLYPHFRAMEGLYPH_HOLD = 4;
local hasGlyph = self.glyph:IsShown();
if ( hasGlyph or self.elapsed > 0 ) then
self.elapsed = self.elapsed + elapsed;
elapsed = self.elapsed;
if ( elapsed >= GLYPHFRAMEGLYPH_FINISHED ) then
self.setting:SetAlpha(.6);
self.elapsed = 0;
elseif ( elapsed <= GLYPHFRAMEGLYPH_START ) then
self.setting:SetAlpha(.6 + (.4 * elapsed/GLYPHFRAMEGLYPH_START));
elseif ( elapsed >= GLYPHFRAMEGLYPH_HOLD ) then
self.setting:SetAlpha(1 - (.4 * (elapsed - GLYPHFRAMEGLYPH_HOLD) / (GLYPHFRAMEGLYPH_FINISHED - GLYPHFRAMEGLYPH_HOLD) ) );
end
elseif ( self.background:IsShown() ) then
self.setting:SetAlpha(.6);
else
self.setting:SetAlpha(.6);
end
local TINT_START, TINT_HOLD, TINT_FINISHED = .6, .8, 1.6;
local id = self:GetID();
if ( not hasGlyph and self.background:IsShown() and GlyphMatchesSocket(id) ) then
self.tintElapsed = self.tintElapsed + elapsed;
self.background:SetTexCoord(GLYPH_SLOTS[id].left, GLYPH_SLOTS[id].right, GLYPH_SLOTS[id].top, GLYPH_SLOTS[id].bottom);
local highlight = false;
if ( not self:IsMouseOver() ) then
self.highlight:Show();
highlight = true;
end
local alpha;
elapsed = self.tintElapsed;
if ( elapsed >= TINT_FINISHED ) then
alpha = 1;
self.tintElapsed = 0;
elseif ( elapsed <= TINT_START ) then
alpha = 1 - (.6 * elapsed/TINT_START);
elseif ( elapsed >= TINT_HOLD ) then
alpha = .4 + (.6 * (elapsed - TINT_HOLD) / (TINT_FINISHED - TINT_HOLD));
end
if ( alpha ) then
self.background:SetAlpha(alpha);
if ( highlight ) then
self.highlight:SetAlpha(HIGHLIGHT_BASEALPHA * alpha);
else
self.highlight:SetAlpha(HIGHLIGHT_BASEALPHA);
end
end
elseif ( not hasGlyph ) then
self.background:SetTexCoord(GLYPH_SLOTS[0].left, GLYPH_SLOTS[0].right, GLYPH_SLOTS[0].top, GLYPH_SLOTS[0].bottom);
self.background:SetAlpha(1);
end
if ( self.hasCursor and SpellIsTargeting() ) then
if ( GlyphMatchesSocket(self:GetID()) and self.background:IsShown() ) then
SetCursor("CAST_CURSOR");
else
SetCursor("CAST_ERROR_CURSOR");
end
end
end
function GlyphFrameGlyph_OnClick (self, button)
local id = self:GetID();
local talentGroup = PlayerTalentFrame and PlayerTalentFrame.talentGroup;
if ( IsModifiedClick("CHATLINK") and ChatEdit_GetActiveWindow() ) then
local link = GetGlyphLink(id, talentGroup);
if ( link ) then
ChatEdit_InsertLink(link);
end
elseif ( button == "RightButton" ) then
if ( IsShiftKeyDown() and talentGroup == GetActiveTalentGroup() ) then
local glyphName;
local _, _, glyphSpell = GetGlyphSocketInfo(id, talentGroup);
if ( glyphSpell ) then
glyphName = GetSpellInfo(glyphSpell);
local dialog = StaticPopup_Show("CONFIRM_REMOVE_GLYPH", glyphName);
dialog.data = id;
end
end
elseif ( talentGroup == GetActiveTalentGroup() ) then
if ( self.glyph:IsShown() and GlyphMatchesSocket(id) ) then
local dialog = StaticPopup_Show("CONFIRM_GLYPH_PLACEMENT", id);
dialog.data = id;
else
PlaceGlyphInSocket(id);
end
end
end
function GlyphFrameGlyph_OnEnter (self)
self.hasCursor = true;
if ( self.background:IsShown() ) then
self.highlight:Show();
end
GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
GameTooltip:SetGlyph(self:GetID(), PlayerTalentFrame and PlayerTalentFrame.talentGroup);
GameTooltip:Show();
end
function GlyphFrameGlyph_OnLeave (self)
self.hasCursor = nil;
self.highlight:Hide();
GameTooltip:Hide();
end
local GLYPH_SPARKLE_SIZES = 3;
local GLYPH_DURATION_MODIFIERS = { 1.25, 1.5, 1.8 };
function GlyphFrame_OnUpdate (self, elapsed)
for i = 1, #slotAnimations do
local animation = slotAnimations[i];
if ( animation.glyph and not (animation.sparkle and animation.sparkle.animGroup:IsPlaying()) ) then
local sparkleSize = math.random(GLYPH_SPARKLE_SIZES);
GlyphFrame_StartSlotAnimation(i, sparkleSize * GLYPH_DURATION_MODIFIERS[sparkleSize], sparkleSize);
end
end
end
function GlyphFrame_PulseGlow ()
GlyphFrame.glow:Show();
GlyphFrame.glow.pulse:Play();
end
function GlyphFrame_OnShow (self)
GlyphFrame_Update();
end
function GlyphFrame_OnLoad (self)
local name = self:GetName();
self.background = _G[name .. "Background"];
self.sparkleFrame = SparkleFrame:New(self);
self:RegisterEvent("ADDON_LOADED");
self:RegisterEvent("GLYPH_ADDED");
self:RegisterEvent("GLYPH_REMOVED");
self:RegisterEvent("GLYPH_UPDATED");
self:RegisterEvent("USE_GLYPH");
self:RegisterEvent("PLAYER_LEVEL_UP");
end
function GlyphFrame_OnEnter (self)
if ( SpellIsTargeting() ) then
SetCursor("CAST_ERROR_CURSOR");
end
end
function GlyphFrame_OnLeave (self)
end
function GlyphFrame_OnEvent (self, event, ...)
if ( event == "ADDON_LOADED" ) then
local name = ...;
if ( name == "Blizzard_GlyphUI" and IsAddOnLoaded("Blizzard_TalentUI") or name == "Blizzard_TalentUI" ) then
self:ClearAllPoints();
self:SetParent(PlayerTalentFrame);
self:SetAllPoints();
-- make sure this shows up above the talent UI
local frameLevel = self:GetParent():GetFrameLevel() + 4;
self:SetFrameLevel(frameLevel);
PlayerTalentFrameCloseButton:SetFrameLevel(frameLevel + 1);
end
elseif ( event == "USE_GLYPH" or event == "PLAYER_LEVEL_UP" ) then
GlyphFrame_Update();
elseif ( event == "GLYPH_ADDED" or event == "GLYPH_REMOVED" or event == "GLYPH_UPDATED" ) then
local index = ...;
local glyph = _G["GlyphFrameGlyph" .. index];
if ( glyph and self:IsVisible() ) then
-- update the glyph
GlyphFrameGlyph_UpdateSlot(glyph);
-- play effects based on the event and glyph type
GlyphFrame_PulseGlow();
local glyphType = glyph.glyphType;
if ( event == "GLYPH_ADDED" or event == "GLYPH_UPDATED" ) then
if ( glyphType == GLYPHTYPE_MINOR ) then
PlaySound("Glyph_MinorCreate");
elseif ( glyphType == GLYPHTYPE_MAJOR ) then
PlaySound("Glyph_MajorCreate");
end
elseif ( event == "GLYPH_REMOVED" ) then
GlyphFrame_StopSlotAnimation(index);
if ( glyphType == GLYPHTYPE_MINOR ) then
PlaySound("Glyph_MinorDestroy");
elseif ( glyphType == GLYPHTYPE_MAJOR ) then
PlaySound("Glyph_MajorDestroy");
end
end
end
--Refresh tooltip!
if ( GameTooltip:IsOwned(glyph) ) then
GlyphFrameGlyph_OnEnter(glyph);
end
end
end
function GlyphFrame_Update ()
local isActiveTalentGroup =
PlayerTalentFrame and not PlayerTalentFrame.pet and
PlayerTalentFrame.talentGroup == GetActiveTalentGroup(PlayerTalentFrame.pet);
SetDesaturation(GlyphFrame.background, not isActiveTalentGroup);
for i = 1, NUM_GLYPH_SLOTS do
GlyphFrameGlyph_UpdateSlot(_G["GlyphFrameGlyph"..i]);
end
end
function GlyphFrame_StartSlotAnimation (slotID, duration, size)
local animation = slotAnimations[slotID];
-- init texture to animate
local sparkleName = "GlyphFrameSparkle"..slotID;
local sparkle = _G[sparkleName];
if ( not sparkle ) then
sparkle = GlyphFrame:CreateTexture(sparkleName, "OVERLAY", "GlyphSparkleTexture");
sparkle.slotID = slotID;
end
local template;
if ( size == 1 ) then
template = "SparkleTextureSmall";
elseif ( size == 2 ) then
template = "SparkleTextureKindaSmall";
else
template = "SparkleTextureNormal";
end
local sparkleDim = SparkleDimensions[template];
sparkle:SetHeight(sparkleDim.height);
sparkle:SetWidth(sparkleDim.width);
sparkle:SetPoint("CENTER", GlyphFrame, animation.point, animation.xStart, animation.yStart);
sparkle:Show();
-- init animation
local offsetX, offsetY = animation.xStop - animation.xStart, animation.yStop - animation.yStart;
local animGroupAnim = sparkle.animGroup.translate;
animGroupAnim:SetOffset(offsetX, offsetY);
animGroupAnim:SetDuration(duration);
animGroupAnim:Play();
animation.sparkle = sparkle;
end
function GlyphFrame_StopSlotAnimation (slotID)
local animation = slotAnimations[slotID];
if ( animation.sparkle ) then
animation.sparkle.animGroup:Stop();
animation.sparkle:Hide();
animation.sparkle = nil;
end
end
@@ -0,0 +1,9 @@
## Interface: 30300
## Title: Blizzard Glyph UI
## Notes: Get some cool tats and mod your spells.
## Secure: 1
## Author: Blizzard Entertainment
## Version: 1.0
## LoadOnDemand: 1
Blizzard_GlyphUI.xml
Localization.lua
@@ -0,0 +1,221 @@
<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="Blizzard_GlyphUI.lua"/>
<Button name="GlyphTemplate" virtual="true">
<Size>
<AbsDimension x="72" y="72"/>
</Size>
<Layers>
<Layer level="BACKGROUND">
<Texture name="$parentSetting" file="Interface\Spellbook\UI-GlyphFrame">
<Size x="86" y="86"/>
<Anchors>
<Anchor point="CENTER">
<Offset x="0" y="0"/>
</Anchor>
</Anchors>
<TexCoords left="0.765625" right="0.927734375" top="0.15625" bottom="0.31640625"/>
</Texture>
</Layer>
<Layer level="BORDER">
<Texture name="$parentHighlight" file="Interface\Spellbook\UI-GlyphFrame" hidden="true" alphaMode="ADD">
<Size x="86" y="86"/>
<Anchors>
<Anchor point="CENTER">
<Offset x="0" y="0"/>
</Anchor>
</Anchors>
<TexCoords left="0.765625" right="0.927734375" top="0.15625" bottom="0.31640625"/>
<Color r="1" g="1" b="1" a=".25"/>
</Texture>
<Texture name="$parentBackground" file="Interface\Spellbook\UI-GlyphFrame">
<Size x="64" y="64"/>
<Anchors>
<Anchor point="CENTER">
<Offset x="0" y="0"/>
</Anchor>
</Anchors>
<TexCoords left="0.78125" right="0.91015625" top="0.69921875" bottom="0.828125"/>
</Texture>
</Layer>
<Layer level="ARTWORK">
<Texture name="$parentGlyph" file="Interface\Spellbook\UI-Glyph-Rune1">
<Size x="53" y="53"/>
<Anchors>
<Anchor point="CENTER">
<Offset x="0" y="0"/>
</Anchor>
</Anchors>
</Texture>
</Layer>
<Layer level="OVERLAY">
<Texture name="$parentRing" file="Interface\Spellbook\UI-GlyphFrame">
<Size x="62" y="62"/>
<Anchors>
<Anchor point="CENTER">
<Offset x="0" y="1"/>
</Anchor>
</Anchors>
<TexCoords left="0.787109375" right="0.908203125" top="0.033203125" bottom="0.154296875"/>
</Texture>
<Texture name="$parentShine" file="Interface\Spellbook\UI-GlyphFrame">
<Size x="16" y="16"/>
<Anchors>
<Anchor point="CENTER">
<Offset x="-9" y="12"/>
</Anchor>
</Anchors>
<TexCoords left="0.9609375" right="1" top="0.921875" bottom="0.9609375"/>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnLoad>
GlyphFrameGlyph_OnLoad(self);
</OnLoad>
<OnShow>
GlyphFrameGlyph_UpdateSlot(self);
</OnShow>
<OnClick>
GlyphFrameGlyph_OnClick(self, button, down);
</OnClick>
<OnEnter>
GlyphFrameGlyph_OnEnter(self, motion);
</OnEnter>
<OnLeave>
GlyphFrameGlyph_OnLeave(self, motion);
</OnLeave>
<OnUpdate>
GlyphFrameGlyph_OnUpdate(self, elapsed);
</OnUpdate>
</Scripts>
</Button>
<Texture name="GlyphSparkleTexture" file="Interface\ItemSocketingFrame\UI-ItemSockets" alphaMode="ADD" hidden="true" virtual="true">
<Size x="13" y="13"/>
<Anchors>
<Anchor point="CENTER"/>
</Anchors>
<Animations>
<AnimationGroup name="$parentAnimGroup" parentKey="animGroup">
<Translation name="$parentTranslate" parentKey="translate"/>
</AnimationGroup>
</Animations>
<TexCoords left="0.3984375" right="0.4453125" top="0.40234375" bottom="0.44921875"/>
</Texture>
<Frame name="GlyphFrame" hidden="true">
<Size x="384" y="512"/>
<Anchors>
<Anchor point="TOPLEFT">
<Offset x="0" y="0"/>
</Anchor>
</Anchors>
<HitRectInsets>
<AbsInset left="0" right="30" top="0" bottom="70"/>
</HitRectInsets>
<Layers>
<Layer level="ARTWORK">
<Texture name="$parentBackground" file="Interface\Spellbook\UI-GlyphFrame">
<Size x="352" y="441"/>
<Anchors>
<Anchor point="TOPLEFT"/>
</Anchors>
<TexCoords left="0" right="0.6875" top="0" bottom="0.861328125"/>
</Texture>
<FontString name="$parentTitleText" inherits="GameFontNormal" text="GLYPHS">
<Anchors>
<Anchor point="TOP">
<Offset x="0" y="-18"/>
</Anchor>
</Anchors>
</FontString>
</Layer>
<Layer level="OVERLAY">
<Texture name="$parentGlow" parentKey="glow" file="Interface\Spellbook\UI-GlyphFrame-Glow" hidden="true">
<Size x="352" y="441"/>
<Anchors>
<Anchor point="TOPLEFT">
<Offset x="-9" y="-38"/>
</Anchor>
</Anchors>
<Animations>
<AnimationGroup name="$parentPulse" parentKey="pulse">
<Alpha name="$parentIn" change="1" duration="0.1"/>
<Alpha name="$parentOut" change="-1" duration="1.5"/>
<Scripts>
<OnStop>
self:GetParent():Hide();
</OnStop>
<OnFinished>
self:GetParent():Hide();
</OnFinished>
</Scripts>
</AnimationGroup>
</Animations>
<TexCoords left="0" right="0.6875" top="0" bottom="0.861328125"/>
<Color r="1.0" g="1.0" b="1.0" a="0.0"/>
</Texture>
</Layer>
</Layers>
<Frames>
<Button name="$parentGlyph1" inherits="GlyphTemplate" id="1">
<Size x="90" y="90"/>
<Anchors>
<Anchor point="CENTER">
<Offset x="-15" y="140"/>
</Anchor>
</Anchors>
</Button>
<Button name="$parentGlyph4" inherits="GlyphTemplate" id="4">
<Size x="90" y="90"/>
<Anchors>
<Anchor point="BOTTOMRIGHT">
<Offset x="-56" y="168"/>
</Anchor>
</Anchors>
</Button>
<Button name="$parentGlyph6" inherits="GlyphTemplate" id="6">
<Size x="90" y="90"/>
<Anchors>
<Anchor point="BOTTOMLEFT">
<Offset x="26" y="168"/>
</Anchor>
</Anchors>
</Button>
<Button name="$parentGlyph2" inherits="GlyphTemplate" id="2">
<Size x="90" y="90"/>
<Anchors>
<Anchor point="CENTER">
<Offset x="-14" y="-103"/>
</Anchor>
</Anchors>
</Button>
<Button name="$parentGlyph5" inherits="GlyphTemplate" id="5">
<Size x="90" y="90"/>
<Anchors>
<Anchor point="TOPRIGHT">
<Offset x="-56" y="-133"/>
</Anchor>
</Anchors>
</Button>
<Button name="$parentGlyph3" inherits="GlyphTemplate" id="3">
<Size x="90" y="90"/>
<Anchors>
<Anchor point="TOPLEFT">
<Offset x="28" y="-133"/>
</Anchor>
</Anchors>
</Button>
</Frames>
<Scripts>
<OnLoad function="GlyphFrame_OnLoad"/>
<OnUpdate function="GlyphFrame_OnUpdate"/>
<OnShow function="GlyphFrame_OnShow"/>
<OnEnter function="GlyphFrame_OnEnter"/>
<OnLeave function="GlyphFrame_OnLeave"/>
<OnEvent function="GlyphFrame_OnEvent"/>
</Scripts>
</Frame>
</Ui>
@@ -0,0 +1 @@
-- This file is executed at the end of addon load
@@ -0,0 +1,788 @@
MAX_GUILDBANK_SLOTS_PER_TAB = 98;
NUM_SLOTS_PER_GUILDBANK_GROUP = 14;
NUM_GUILDBANK_ICONS_SHOWN = 0;
NUM_GUILDBANK_ICONS_PER_ROW = 4;
NUM_GUILDBANK_ICON_ROWS = 4;
GUILDBANK_ICON_ROW_HEIGHT = 36;
NUM_GUILDBANK_COLUMNS = 7;
MAX_TRANSACTIONS_SHOWN = 21;
GUILDBANK_TRANSACTION_HEIGHT = 13;
UIPanelWindows["GuildBankFrame"] = { area = "doublewide", pushable = 0, width = 769 };
--REMOVE ME!
TABARDBACKGROUNDUPPER = "Textures\\GuildEmblems\\Background_%s_TU_U";
TABARDBACKGROUNDLOWER = "Textures\\GuildEmblems\\Background_%s_TL_U";
TABARDEMBLEMUPPER = "Textures\\GuildEmblems\\Emblem_%s_15_TU_U";
TABARDEMBLEMLOWER = "Textures\\GuildEmblems\\Emblem_%s_15_TL_U";
TABARDBORDERUPPER = "Textures\\GuildEmblems\\Border_%s_02_TU_U";
TABARDBORDERLOWER = "Textures\\GuildEmblems\\Border_%s_02_TL_U";
TABARDBACKGROUNDID = 1;
TABARDEMBLEMID = 1;
TABARDBORDERID = 1;
GUILD_BANK_LOG_TIME_PREPEND = "|cff009999 ";
function GuildBankFrame_ChangeBackground(id)
if ( id > 50 ) then
id = 1;
elseif ( id < 0 ) then
id = 50;
end
TABARDBACKGROUNDID = id;
GuildBankFrame_UpdateEmblem();
end
function GuildBankFrame_ChangeEmblem(id)
if ( id > 169 ) then
id = 1;
elseif ( id < 0 ) then
id = 169;
end
TABARDEMBLEMID = id;
GuildBankFrame_UpdateEmblem();
end
function GuildBankFrame_ChangeBorder(id)
if ( id > 9 ) then
id = 1;
elseif ( id < 0 ) then
id = 9;
end
TABARDBORDERID = id;
GuildBankFrame_UpdateEmblem();
end
function GuildBankFrame_UpdateEmblem()
local tabardBGID = TABARDBACKGROUNDID;
if ( tabardBGID < 10 ) then
tabardBGID = "0"..tabardBGID;
end
local tabardEmblemID = TABARDEMBLEMID;
if ( tabardEmblemID < 10 ) then
tabardEmblemID = "0"..tabardEmblemID;
end
local tabardBorderID = TABARDBORDERID;
if ( tabardBorderID < 10 ) then
tabardBorderID = "0"..tabardBorderID;
end
GuildBankEmblemBackgroundUL:SetTexture(format(TABARDBACKGROUNDUPPER, tabardBGID));
GuildBankEmblemBackgroundUR:SetTexture(format(TABARDBACKGROUNDUPPER, tabardBGID));
GuildBankEmblemBackgroundBL:SetTexture(format(TABARDBACKGROUNDLOWER, tabardBGID));
GuildBankEmblemBackgroundBR:SetTexture(format(TABARDBACKGROUNDLOWER, tabardBGID));
GuildBankEmblemUL:SetTexture(format(TABARDEMBLEMUPPER, tabardEmblemID));
GuildBankEmblemUR:SetTexture(format(TABARDEMBLEMUPPER, tabardEmblemID));
GuildBankEmblemBL:SetTexture(format(TABARDEMBLEMLOWER, tabardEmblemID));
GuildBankEmblemBR:SetTexture(format(TABARDEMBLEMLOWER, tabardEmblemID));
GuildBankEmblemBorderUL:SetTexture(format(TABARDBORDERUPPER, tabardBorderID));
GuildBankEmblemBorderUR:SetTexture(format(TABARDBORDERUPPER, tabardBorderID));
GuildBankEmblemBorderBL:SetTexture(format(TABARDBORDERLOWER, tabardBorderID));
GuildBankEmblemBorderBR:SetTexture(format(TABARDBORDERLOWER, tabardBorderID));
end
function GuildBankFrame_OnLoad(self)
NUM_GUILDBANK_ICONS_SHOWN = NUM_GUILDBANK_ICONS_PER_ROW * NUM_GUILDBANK_ICON_ROWS;
self:RegisterEvent("GUILDBANKBAGSLOTS_CHANGED");
self:RegisterEvent("GUILDBANK_ITEM_LOCK_CHANGED");
self:RegisterEvent("GUILDBANK_UPDATE_TABS");
self:RegisterEvent("GUILDBANK_UPDATE_MONEY");
self:RegisterEvent("GUILDBANK_UPDATE_WITHDRAWMONEY");
self:RegisterEvent("GUILD_ROSTER_UPDATE");
self:RegisterEvent("GUILDBANKLOG_UPDATE");
self:RegisterEvent("GUILDTABARD_UPDATE");
self:RegisterEvent("GUILDBANK_UPDATE_TEXT");
self:RegisterEvent("GUILDBANK_TEXT_CHANGED");
self:RegisterEvent("PLAYER_MONEY");
-- Set the button id's
local index, column, button;
for i=1, MAX_GUILDBANK_SLOTS_PER_TAB do
index = mod(i, NUM_SLOTS_PER_GUILDBANK_GROUP);
if ( index == 0 ) then
index = NUM_SLOTS_PER_GUILDBANK_GROUP;
end
column = ceil((i-0.5)/NUM_SLOTS_PER_GUILDBANK_GROUP);
button = _G["GuildBankColumn"..column.."Button"..index];
button:SetID(i);
end
GuildBankFrame.mode = "bank";
GuildBankFrame.numTabs = 4;
GuildBankFrame_UpdateTabs();
GuildBankFrame_UpdateTabard();
end
function GuildBankFrame_OnEvent(self, event, ...)
if ( not GuildBankFrame:IsVisible() ) then
return;
end
if ( event == "GUILDBANKBAGSLOTS_CHANGED" or event =="GUILDBANK_ITEM_LOCK_CHANGED" ) then
GuildBankFrame_UpdateTabs();
GuildBankFrame_Update();
elseif ( event == "GUILDBANK_UPDATE_TABS" or event == "GUILD_ROSTER_UPDATE" ) then
if ( event == "GUILD_ROSTER_UPDATE" and not select(1, ...) and GuildBankFrame.noViewableTabs and GuildBankFrame.mode == "bank" ) then
-- if rank changed while at the bank tab and not having any viewable tabs, query for new item data
QueryGuildBankTab(GetCurrentGuildBankTab());
end
GuildBankFrame_SelectAvailableTab();
if ( GuildBankFrameBuyInfo:IsShown() ) then
GuildBankFrame_UpdateTabBuyingInfo();
end
if ( CanEditGuildTabInfo(GetCurrentGuildBankTab()) ) then
GuildBankInfoSaveButton:Show();
else
GuildBankInfoSaveButton:Hide();
end
elseif ( event == "GUILDBANKLOG_UPDATE" ) then
if ( GuildBankFrame.mode == "log" ) then
GuildBankFrame_UpdateLog();
else
GuildBankFrame_UpdateMoneyLog();
end
GuildBankLogScroll();
elseif ( event == "GUILDTABARD_UPDATE" ) then
GuildBankFrame_UpdateTabard();
elseif ( event == "GUILDBANK_UPDATE_MONEY" or event == "GUILDBANK_UPDATE_WITHDRAWMONEY" ) then
GuildBankFrame_UpdateWithdrawMoney();
elseif ( event == "GUILDBANK_UPDATE_TEXT" ) then
GuildBankFrame_UpdateTabInfo(...);
elseif ( event == "GUILDBANK_TEXT_CHANGED" ) then
local arg1 = ...
if ( GetCurrentGuildBankTab() == tonumber(arg1) ) then
QueryGuildBankText(arg1);
end
elseif ( event == "PLAYER_MONEY" ) then
if ( GuildBankFrameBuyInfo:IsShown() ) then
GuildBankFrame_UpdateTabBuyingInfo();
end
end
end
function GuildBankFrame_SelectAvailableTab()
--If the selected tab is notViewable then select the next available one
if ( IsTabViewable(GetCurrentGuildBankTab()) ) then
GuildBankFrame_UpdateTabs();
GuildBankFrame_Update();
else
if ( GuildBankFrame.nextAvailableTab ) then
GuildBankTab_OnClick(_G["GuildBankTab" .. GuildBankFrame.nextAvailableTab], "LeftButton", GuildBankFrame.nextAvailableTab);
else
GuildBankFrame_UpdateTabs();
GuildBankFrame_Update();
end
end
end
function GuildBankFrame_OnShow()
GuildBankFrameTab_OnClick(GuildBankFrameTab1, 1);
GuildBankFrame_UpdateTabard();
GuildBankFrame_SelectAvailableTab();
PlaySound("GuildVaultOpen");
end
function GuildBankFrame_Update()
--Figure out which mode you're in and which tab is selected
if ( GuildBankFrame.mode == "bank" ) then
-- Determine whether its the buy tab or not
GuildBankFrameLog:Hide();
GuildBankInfo:Hide();
local tab = GetCurrentGuildBankTab();
if ( GuildBankFrame.noViewableTabs ) then
GuildBankFrame_HideColumns();
GuildBankFrameBuyInfo:Hide();
GuildBankErrorMessage:SetText(NO_VIEWABLE_GUILDBANK_TABS);
GuildBankErrorMessage:Show();
elseif ( tab > GetNumGuildBankTabs() ) then
if ( IsGuildLeader() ) then
--Show buy screen
GuildBankFrame_HideColumns();
GuildBankFrameBuyInfo:Show();
GuildBankErrorMessage:Hide();
else
GuildBankFrame_HideColumns();
GuildBankFrameBuyInfo:Hide();
GuildBankErrorMessage:SetText(NO_GUILDBANK_TABS);
GuildBankErrorMessage:Show();
end
else
local _, _, _, canDeposit, numWithdrawals = GetGuildBankTabInfo(tab);
if ( not canDeposit and numWithdrawals == 0 ) then
GuildBankFrame_DesaturateColumns(1);
else
GuildBankFrame_DesaturateColumns(nil);
end
GuildBankFrame_ShowColumns()
GuildBankFrameBuyInfo:Hide();
GuildBankErrorMessage:Hide();
end
-- Update the tab items
local button, index, column;
local texture, itemCount, locked;
for i=1, MAX_GUILDBANK_SLOTS_PER_TAB do
index = mod(i, NUM_SLOTS_PER_GUILDBANK_GROUP);
if ( index == 0 ) then
index = NUM_SLOTS_PER_GUILDBANK_GROUP;
end
column = ceil((i-0.5)/NUM_SLOTS_PER_GUILDBANK_GROUP);
button = _G["GuildBankColumn"..column.."Button"..index];
button:SetID(i);
texture, itemCount, locked = GetGuildBankItemInfo(tab, i);
SetItemButtonTexture(button, texture);
SetItemButtonCount(button, itemCount);
SetItemButtonDesaturated(button, locked, 0.5, 0.5, 0.5);
end
MoneyFrame_Update("GuildBankMoneyFrame", GetGuildBankMoney());
if ( CanWithdrawGuildBankMoney() ) then
GuildBankFrameWithdrawButton:Enable();
else
GuildBankFrameWithdrawButton:Disable();
end
elseif ( GuildBankFrame.mode == "log" or GuildBankFrame.mode == "moneylog" ) then
GuildBankFrame_HideColumns();
GuildBankFrameBuyInfo:Hide();
GuildBankInfo:Hide();
if ( GuildBankFrame.noViewableTabs and GuildBankFrame.mode == "log" ) then
GuildBankErrorMessage:SetText(NO_VIEWABLE_GUILDBANK_LOGS);
GuildBankErrorMessage:Show();
GuildBankFrameLog:Hide();
else
GuildBankErrorMessage:Hide();
GuildBankFrameLog:Show();
end
elseif ( GuildBankFrame.mode == "tabinfo" ) then
GuildBankFrame_HideColumns();
GuildBankErrorMessage:Hide();
GuildBankFrameBuyInfo:Hide();
GuildBankFrameLog:Hide();
GuildBankInfo:Show();
end
--Update remaining money
GuildBankFrame_UpdateWithdrawMoney();
end
function GuildBankFrameTab_OnClick(tab, id, doNotUpdate)
PanelTemplates_SetTab(GuildBankFrame, id);
if ( id == 1 ) then
--Bank
GuildBankFrame.mode = "bank";
if ( not doNotUpdate ) then
QueryGuildBankTab(GetCurrentGuildBankTab());
end
elseif ( id == 2 ) then
--Log
GuildBankMessageFrame:Clear();
GuildBankTransactionsScrollFrame:Hide();
GuildBankFrame.mode = "log";
if ( not doNotUpdate ) then
QueryGuildBankLog(GetCurrentGuildBankTab());
end
GuildBankTransactionsScrollFrameScrollBar:SetValue(0);
elseif ( id == 3 ) then
--Money log
GuildBankMessageFrame:Clear();
GuildBankTransactionsScrollFrame:Hide();
GuildBankFrame.mode = "moneylog";
if ( not doNotUpdate ) then
QueryGuildBankLog(MAX_GUILDBANK_TABS + 1);
end
GuildBankTransactionsScrollFrameScrollBar:SetValue(0);
else
--Tab Info
GuildBankFrame.mode = "tabinfo";
if ( not doNotUpdate ) then
QueryGuildBankText(GetCurrentGuildBankTab());
end
end
--Call this to gray out tabs or activate them
GuildBankFrame_UpdateTabs();
if ( not doNotUpdate ) then
GuildBankFrame_Update();
end
PlaySound("igCharacterInfoTab");
end
function GuildBankFrame_UpdateTabBuyingInfo()
local tabCost = GetGuildBankTabCost();
local numTabs = GetNumGuildBankTabs();
GuildBankFrameBuyInfoNumTabsPurchasedText:SetText(format(NUM_GUILDBANK_TABS_PURCHASED, numTabs, MAX_GUILDBANK_TABS));
if ( not tabCost ) then
--You've bought all the tabs
GuildBankTab_OnClick(GuildBankTab1, "LeftButton", 1);
else
if( GetMoney() >= tabCost or (GetMoney() + GetGuildBankMoney()) >= tabCost ) then
SetMoneyFrameColor("GuildBankFrameTabCostMoneyFrame", "white");
GuildBankFramePurchaseButton:Enable();
else
SetMoneyFrameColor("GuildBankFrameTabCostMoneyFrame", "red");
GuildBankFramePurchaseButton:Disable();
end
GuildBankTab_OnClick(_G["GuildBankTab" .. numTabs+1], "LeftButton", numTabs+1);
MoneyFrame_Update("GuildBankFrameTabCostMoneyFrame", tabCost);
end
end
function GuildBankFrame_UpdateTabs()
local tab, iconTexture, tabButton;
local name, icon, isViewable, canDeposit, numWithdrawals, remainingWithdrawals;
local numTabs = GetNumGuildBankTabs();
local currentTab = GetCurrentGuildBankTab();
local tabToBuyIndex = numTabs+1;
local unviewableCount = 0;
local disableAll = nil;
local updateAgain = nil;
local isLocked, titleText;
local withdrawalText, withdrawalStackCount;
-- Disable and gray out all tabs if in the moneyLog since the tab is irrelevant
if ( GuildBankFrame.mode == "moneylog" ) then
disableAll = 1;
end
for i=1, MAX_GUILDBANK_TABS do
tab = _G["GuildBankTab"..i];
tabButton = _G["GuildBankTab"..i.."Button"];
name, icon, isViewable, canDeposit, numWithdrawals, remainingWithdrawals = GetGuildBankTabInfo(i);
iconTexture = _G["GuildBankTab"..i.."ButtonIconTexture"];
if ( not name or name == "" ) then
name = format(GUILDBANK_TAB_NUMBER, i);
end
if ( i == tabToBuyIndex and IsGuildLeader() ) then
iconTexture:SetTexture("Interface\\GuildBankFrame\\UI-GuildBankFrame-NewTab");
tabButton.tooltip = BUY_GUILDBANK_TAB;
tab:Show();
if ( disableAll or GuildBankFrame.mode == "log" or GuildBankFrame.mode == "tabinfo" ) then
tabButton:SetChecked(nil);
SetDesaturation(iconTexture, 1);
tabButton:SetButtonState("NORMAL");
tabButton:Disable();
if ( GuildBankFrame.mode == "log" and i == currentTab and numTabs > 0 ) then
SetCurrentGuildBankTab(1);
updateAgain = 1;
end
else
if ( i == currentTab ) then
tabButton:SetChecked(1);
tabButton:Disable();
SetDesaturation(iconTexture, nil);
titleText = BUY_GUILDBANK_TAB;
else
tabButton:SetChecked(nil);
tabButton:Enable();
SetDesaturation(iconTexture, nil);
end
end
elseif ( i >= tabToBuyIndex ) then
tab:Hide();
else
iconTexture:SetTexture(icon);
tab:Show();
if ( isViewable ) then
tabButton.tooltip = name;
if ( i == currentTab ) then
if ( disableAll ) then
tabButton:SetChecked(nil);
else
tabButton:SetChecked(1);
tabButton:Enable();
end
withdrawalText = name;
titleText = name;
else
tabButton:SetChecked(nil);
tabButton:Enable();
end
if ( disableAll ) then
tabButton:Disable();
SetDesaturation(iconTexture, 1);
else
SetDesaturation(iconTexture, nil);
end
else
unviewableCount = unviewableCount+1;
tabButton:Disable();
SetDesaturation(iconTexture, 1);
tabButton:SetChecked(nil);
end
end
if ( unviewableCount == numTabs and not IsGuildLeader() ) then
--Can't view any tabs so hide everything
GuildBankFrame.noViewableTabs = 1;
else
GuildBankFrame.noViewableTabs = nil;
end
if ( updateAgain ) then
GuildBankFrame_UpdateTabs();
end
end
-- Set Title
if ( GuildBankFrame.mode == "moneylog" ) then
titleText = GUILD_BANK_MONEY_LOG;
withdrawalText = nil;
elseif ( GuildBankFrame.mode == "log" ) then
if ( titleText ) then
titleText = format(GUILDBANK_LOG_TITLE_FORMAT, titleText);
end
elseif ( GuildBankFrame.mode == "tabinfo" ) then
withdrawalText = nil;
if ( titleText ) then
titleText = format(GUILDBANK_INFO_TITLE_FORMAT, titleText);
end
end
--Get selected tab info
name, icon, isViewable, canDeposit, numWithdrawals, remainingWithdrawals = GetGuildBankTabInfo(currentTab);
if ( titleText and (GuildBankFrame.mode ~= "moneylog" and titleText ~= BUY_GUILDBANK_TAB) ) then
local access;
if ( not canDeposit and numWithdrawals == 0 ) then
access = RED_FONT_COLOR_CODE.."("..GUILDBANK_TAB_LOCKED..")"..FONT_COLOR_CODE_CLOSE;
elseif ( not canDeposit ) then
access = RED_FONT_COLOR_CODE.."("..GUILDBANK_TAB_WITHDRAW_ONLY..")"..FONT_COLOR_CODE_CLOSE;
elseif ( numWithdrawals == 0 ) then
access = RED_FONT_COLOR_CODE.."("..GUILDBANK_TAB_DEPOSIT_ONLY..")"..FONT_COLOR_CODE_CLOSE;
else
access = GREEN_FONT_COLOR_CODE.."("..GUILDBANK_TAB_FULL_ACCESS..")"..FONT_COLOR_CODE_CLOSE;
end
titleText = titleText.." "..access;
end
if ( titleText ) then
GuildBankTabTitle:SetText(titleText);
GuildBankTabTitleBackground:SetWidth(GuildBankTabTitle:GetWidth()+20);
GuildBankTabTitle:Show();
GuildBankTabTitleBackground:Show();
GuildBankTabTitleBackgroundLeft:Show();
GuildBankTabTitleBackgroundRight:Show();
else
GuildBankTabTitle:Hide();
GuildBankTabTitleBackground:Hide();
GuildBankTabTitleBackgroundLeft:Hide();
GuildBankTabTitleBackgroundRight:Hide();
end
if ( withdrawalText ) then
local stackString;
if ( remainingWithdrawals > 0 ) then
stackString = format(STACKS, remainingWithdrawals);
elseif ( remainingWithdrawals == 0 ) then
stackString = NONE;
else
stackString = UNLIMITED;
end
GuildBankLimitLabel:SetText(format(GUILDBANK_REMAINING_MONEY, withdrawalText, stackString));
GuildBankTabLimitBackground:SetWidth(GuildBankLimitLabel:GetWidth()+20);
--If the tab name is too long then reanchor the withdraw box so it's not longer centered
if ( GuildBankLimitLabel:GetWidth() > 298 ) then
GuildBankTabLimitBackground:ClearAllPoints();
GuildBankTabLimitBackground:SetPoint("RIGHT", GuildBankFrameWithdrawButton, "LEFT", -14, -1);
else
GuildBankTabLimitBackground:ClearAllPoints();
GuildBankTabLimitBackground:SetPoint("TOP", "GuildBankFrame", "TOP", 6, -388);
end
GuildBankLimitLabel:Show();
GuildBankTabLimitBackground:Show();
GuildBankTabLimitBackgroundLeft:Show();
GuildBankTabLimitBackgroundRight:Show();
else
GuildBankLimitLabel:Hide();
GuildBankTabLimitBackground:Hide();
GuildBankTabLimitBackgroundLeft:Hide();
GuildBankTabLimitBackgroundRight:Hide();
end
end
function GuildBankTab_OnClick(self, mouseButton, currentTab)
if ( GuildBankInfo:IsShown() ) then
GuildBankInfoSaveButton:Click();
end
if ( not currentTab ) then
currentTab = self:GetParent():GetID();
end
SetCurrentGuildBankTab(currentTab);
GuildBankFrame_UpdateTabs();
if ( IsGuildLeader() and mouseButton == "RightButton" and currentTab ~= (GetNumGuildBankTabs() + 1) ) then
--Show the popup if it's a right click
GuildBankPopupFrame:Show();
GuildBankPopupFrame_Update(currentTab);
end
GuildBankFrame_Update();
if ( GuildBankFrameLog:IsShown() ) then
if ( GuildBankFrame.mode == "log" ) then
QueryGuildBankTab(currentTab); --Need this to get the number of withdrawals left for this tab
QueryGuildBankLog(currentTab);
GuildBankFrame_UpdateLog();
else
QueryGuildBankLog(MAX_GUILDBANK_TABS+1);
GuildBankFrame_UpdateMoneyLog();
end
elseif ( GuildBankInfo:IsShown() ) then
QueryGuildBankText(currentTab);
else
QueryGuildBankTab(currentTab);
end
end
function GuildBankFrame_HideColumns()
if ( not GuildBankColumn1:IsShown() ) then
return;
end
for i=1, NUM_GUILDBANK_COLUMNS do
_G["GuildBankColumn"..i]:Hide();
end
end
function GuildBankFrame_ShowColumns()
if ( GuildBankColumn1:IsShown() ) then
return;
end
for i=1, NUM_GUILDBANK_COLUMNS do
_G["GuildBankColumn"..i]:Show();
end
end
function GuildBankFrame_DesaturateColumns(isDesaturated)
for i=1, NUM_GUILDBANK_COLUMNS do
SetDesaturation(_G["GuildBankColumn"..i.."Background"], isDesaturated);
end
end
function GuildBankItemButton_OnLoad(self)
self:RegisterForClicks("LeftButtonUp", "RightButtonUp");
self:RegisterForDrag("LeftButton");
self.SplitStack = function(button, split)
SplitGuildBankItem(GetCurrentGuildBankTab(), button:GetID(), split);
end
self.UpdateTooltip = GuildBankItemButton_OnEnter;
end
function GuildBankItemButton_OnEnter(self)
GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
GameTooltip:SetGuildBankItem(GetCurrentGuildBankTab(), self:GetID());
end
function GuildBankFrame_UpdateLog()
local tab = GetCurrentGuildBankTab();
local numTransactions = GetNumGuildBankTransactions(tab);
local type, name, itemLink, count, tab1, tab2, year, month, day, hour;
local msg;
GuildBankMessageFrame:Clear();
for i=1, numTransactions, 1 do
type, name, itemLink, count, tab1, tab2, year, month, day, hour = GetGuildBankTransaction(tab, i);
if ( not name ) then
name = UNKNOWN;
end
name = NORMAL_FONT_COLOR_CODE..name..FONT_COLOR_CODE_CLOSE;
if ( type == "deposit" ) then
msg = format(GUILDBANK_DEPOSIT_FORMAT, name, itemLink);
if ( count > 1 ) then
msg = msg..format(GUILDBANK_LOG_QUANTITY, count);
end
elseif ( type == "withdraw" ) then
msg = format(GUILDBANK_WITHDRAW_FORMAT, name, itemLink);
if ( count > 1 ) then
msg = msg..format(GUILDBANK_LOG_QUANTITY, count);
end
elseif ( type == "move" ) then
msg = format(GUILDBANK_MOVE_FORMAT, name, itemLink, count, GetGuildBankTabInfo(tab1), GetGuildBankTabInfo(tab2));
end
if ( msg ) then
GuildBankMessageFrame:AddMessage( msg..GUILD_BANK_LOG_TIME_PREPEND..format(GUILD_BANK_LOG_TIME, RecentTimeDate(year, month, day, hour)) );
end
end
FauxScrollFrame_Update(GuildBankTransactionsScrollFrame, numTransactions, MAX_TRANSACTIONS_SHOWN, GUILDBANK_TRANSACTION_HEIGHT );
end
function GuildBankFrame_UpdateMoneyLog()
local numTransactions = GetNumGuildBankMoneyTransactions();
local type, name, amount, year, month, day, hour;
local msg;
local money;
GuildBankMessageFrame:Clear();
for i=1, numTransactions, 1 do
type, name, amount, year, month, day, hour = GetGuildBankMoneyTransaction(i);
if ( not name ) then
name = UNKNOWN;
end
name = NORMAL_FONT_COLOR_CODE..name..FONT_COLOR_CODE_CLOSE;
money = GetDenominationsFromCopper(amount);
if ( type == "deposit" ) then
msg = format(GUILDBANK_DEPOSIT_MONEY_FORMAT, name, money);
elseif ( type == "withdraw" ) then
msg = format(GUILDBANK_WITHDRAW_MONEY_FORMAT, name, money);
elseif ( type == "repair" ) then
msg = format(GUILDBANK_REPAIR_MONEY_FORMAT, name, money);
elseif ( type == "withdrawForTab" ) then
msg = format(GUILDBANK_WITHDRAWFORTAB_MONEY_FORMAT, name, money);
elseif ( type == "buyTab" ) then
msg = format(GUILDBANK_BUYTAB_MONEY_FORMAT, name, money);
end
GuildBankMessageFrame:AddMessage(msg..GUILD_BANK_LOG_TIME_PREPEND..format(GUILD_BANK_LOG_TIME, RecentTimeDate(year, month, day, hour)));
end
FauxScrollFrame_Update(GuildBankTransactionsScrollFrame, numTransactions, MAX_TRANSACTIONS_SHOWN, GUILDBANK_TRANSACTION_HEIGHT );
end
function GuildBankLogScroll()
local offset = FauxScrollFrame_GetOffset(GuildBankTransactionsScrollFrame);
local numTransactions = 0;
if ( GuildBankFrame.mode == "log" ) then
numTransactions = GetNumGuildBankTransactions(GetCurrentGuildBankTab());
elseif ( GuildBankFrame.mode == "moneylog" ) then
numTransactions = GetNumGuildBankMoneyTransactions();
end
GuildBankMessageFrame:SetScrollOffset(offset);
FauxScrollFrame_Update(GuildBankTransactionsScrollFrame, numTransactions, MAX_TRANSACTIONS_SHOWN, GUILDBANK_TRANSACTION_HEIGHT );
end
function IsTabViewable(tab)
GuildBankFrame.nextAvailableTab = nil;
local view = false;
for i=1, MAX_GUILDBANK_TABS do
local _, _, isViewable = GetGuildBankTabInfo(i);
if ( isViewable ) then
if ( not GuildBankFrame.nextAvailableTab ) then
GuildBankFrame.nextAvailableTab = i;
end
if ( i == tab ) then
view = true;
end
end
end
return view;
end
function GuildBankFrame_UpdateWithdrawMoney()
local withdrawLimit = GetGuildBankWithdrawMoney();
if ( withdrawLimit >= 0 ) then
local amount;
if ( (not CanGuildBankRepair() and not CanWithdrawGuildBankMoney()) or (CanGuildBankRepair() and not CanWithdrawGuildBankMoney()) ) then
amount = 0;
else
amount = GetGuildBankMoney();
end
withdrawLimit = min(withdrawLimit, amount);
MoneyFrame_Update("GuildBankWithdrawMoneyFrame", withdrawLimit);
GuildBankMoneyUnlimitedLabel:Hide();
GuildBankWithdrawMoneyFrame:Show();
else
GuildBankMoneyUnlimitedLabel:Show();
GuildBankWithdrawMoneyFrame:Hide();
end
end
function GuildBankFrame_UpdateTabard()
--Set the tabard images
local tabardBackgroundUpper, tabardBackgroundLower, tabardEmblemUpper, tabardEmblemLower, tabardBorderUpper, tabardBorderLower = GetGuildTabardFileNames();
if ( not tabardEmblemUpper ) then
tabardBackgroundUpper = "Textures\\GuildEmblems\\Background_49_TU_U";
tabardBackgroundLower = "Textures\\GuildEmblems\\Background_49_TL_U";
end
GuildBankEmblemBackgroundUL:SetTexture(tabardBackgroundUpper);
GuildBankEmblemBackgroundUR:SetTexture(tabardBackgroundUpper);
GuildBankEmblemBackgroundBL:SetTexture(tabardBackgroundLower);
GuildBankEmblemBackgroundBR:SetTexture(tabardBackgroundLower);
GuildBankEmblemUL:SetTexture(tabardEmblemUpper);
GuildBankEmblemUR:SetTexture(tabardEmblemUpper);
GuildBankEmblemBL:SetTexture(tabardEmblemLower);
GuildBankEmblemBR:SetTexture(tabardEmblemLower);
GuildBankEmblemBorderUL:SetTexture(tabardBorderUpper);
GuildBankEmblemBorderUR:SetTexture(tabardBorderUpper);
GuildBankEmblemBorderBL:SetTexture(tabardBorderLower);
GuildBankEmblemBorderBR:SetTexture(tabardBorderLower);
end
function GuildBankFrame_UpdateTabInfo(tab)
local text = GetGuildBankText(tab);
if ( text ) then
GuildBankTabInfoEditBox.text = text;
GuildBankTabInfoEditBox:SetText(text);
else
GuildBankTabInfoEditBox:SetText("");
end
end
--Popup functions
function GuildBankPopupFrame_Update(tab)
local numguildBankIcons = GetNumMacroItemIcons();
local guildBankPopupIcon, guildBankPopupButton;
local guildBankPopupOffset = FauxScrollFrame_GetOffset(GuildBankPopupScrollFrame);
local index;
local _, tabTexture = GetGuildBankTabInfo(GetCurrentGuildBankTab());
-- Icon list
local texture;
for i=1, NUM_GUILDBANK_ICONS_SHOWN do
guildBankPopupIcon = _G["GuildBankPopupButton"..i.."Icon"];
guildBankPopupButton = _G["GuildBankPopupButton"..i];
index = (guildBankPopupOffset * NUM_GUILDBANK_ICONS_PER_ROW) + i;
texture = GetMacroItemIconInfo(index);
if ( index <= numguildBankIcons ) then
guildBankPopupIcon:SetTexture(texture);
guildBankPopupButton:Show();
else
guildBankPopupIcon:SetTexture("");
guildBankPopupButton:Hide();
end
if ( GuildBankPopupFrame.selectedIcon ) then
if ( index == GuildBankPopupFrame.selectedIcon ) then
guildBankPopupButton:SetChecked(1);
else
guildBankPopupButton:SetChecked(nil);
end
elseif ( tabTexture == texture ) then
guildBankPopupButton:SetChecked(1);
GuildBankPopupFrame.selectedIcon = index;
else
guildBankPopupButton:SetChecked(nil);
end
end
--Only do this if the player hasn't clicked on an icon or the icon is not visible
if ( not GuildBankPopupFrame.selectedIcon ) then
for i=1, numguildBankIcons do
texture = GetMacroItemIconInfo(i);
if ( tabTexture == texture ) then
GuildBankPopupFrame.selectedIcon = i;
break;
end
end
end
-- Scrollbar stuff
FauxScrollFrame_Update(GuildBankPopupScrollFrame, ceil(numguildBankIcons / NUM_GUILDBANK_ICONS_PER_ROW) , NUM_GUILDBANK_ICON_ROWS, GUILDBANK_ICON_ROW_HEIGHT );
end
function GuildBankPopupFrame_OnShow(self)
local name = GetGuildBankTabInfo(GetCurrentGuildBankTab());
if ( not name or name == "" ) then
name = format(GUILDBANK_TAB_NUMBER, GetCurrentGuildBankTab());
end
GuildBankPopupEditBox:SetText(name);
GuildBankPopupFrame.selectedIcon = nil;
end
function GuildBankPopupButton_OnClick(self, button)
local offset = FauxScrollFrame_GetOffset(GuildBankPopupScrollFrame);
local index = (offset * NUM_GUILDBANK_ICONS_PER_ROW)+self:GetID();
GuildBankPopupFrame.selectedIcon = index;
GuildBankPopupFrame_Update(GetCurrentGuildBankTab());
end
function GuildBankPopupOkayButton_OnClick(self)
local name = GuildBankPopupEditBox:GetText();
local tab = GetCurrentGuildBankTab();
if ( not name or name == "" ) then
name = format(GUILDBANK_TAB_NUMBER, tab);
end
SetGuildBankTabInfo(tab, name, GuildBankPopupFrame.selectedIcon);
GuildBankPopupFrame:Hide();
end
function GuildBankPopupFrame_CancelEdit()
GuildBankPopupFrame:Hide();
end
@@ -0,0 +1,6 @@
## Interface: 30300
## Title: Blizzard Guild Bank UI
## Secure: 1
## LoadOnDemand: 1
Blizzard_GuildBankUI.xml
Localization.lua
File diff suppressed because it is too large Load Diff
@@ -0,0 +1 @@
-- This file is executed at the end of addon load
@@ -0,0 +1,129 @@
INSPECTFRAME_SUBFRAMES = { "InspectPaperDollFrame", "InspectPVPFrame", "InspectTalentFrame", "InspectTalentFrame", "InspectTalentFrame" };
UIPanelWindows["InspectFrame"] = { area = "left", pushable = 0 };
function InspectFrame_Show(unit)
HideUIPanel(InspectFrame);
if ( CanInspect(unit, true) ) then
NotifyInspect(unit);
InspectFrame.unit = unit;
InspectSwitchTabs(1);
ShowUIPanel(InspectFrame);
InspectFrame_UpdateTalentTab();
end
end
function InspectFrame_OnLoad(self)
self:RegisterEvent("PLAYER_TARGET_CHANGED");
self:RegisterEvent("PARTY_MEMBERS_CHANGED");
self:RegisterEvent("UNIT_NAME_UPDATE");
self:RegisterEvent("UNIT_PORTRAIT_UPDATE");
self.unit = nil;
-- Tab Handling code
PanelTemplates_SetNumTabs(self, 3);
PanelTemplates_SetTab(self, 1);
end
function InspectFrame_OnEvent(self, event, ...)
if ( not self:IsShown() ) then
return;
end
if ( event == "PLAYER_TARGET_CHANGED" or event == "PARTY_MEMBERS_CHANGED" ) then
if ( (event == "PLAYER_TARGET_CHANGED" and self.unit == "target") or
(event == "PARTY_MEMBERS_CHANGED" and self.unit ~= "target") ) then
if ( CanInspect(self.unit) ) then
InspectFrame_UnitChanged(self);
else
HideUIPanel(InspectFrame);
end
end
return;
elseif ( event == "UNIT_NAME_UPDATE" ) then
local arg1 = ...;
if ( arg1 == self.unit ) then
InspectNameText:SetText(UnitName(arg1));
end
return;
elseif ( event == "UNIT_PORTRAIT_UPDATE" ) then
local arg1 = ...;
if ( arg1 == self.unit ) then
SetPortraitTexture(InspectFramePortrait, arg1);
end
return;
end
end
function InspectFrame_UnitChanged(self)
local unit = self.unit;
NotifyInspect(unit);
InspectPaperDollFrame_OnShow(self);
SetPortraitTexture(InspectFramePortrait, unit);
InspectNameText:SetText(UnitName(unit));
InspectFrame_UpdateTalentTab();
if ( InspectPVPFrame:IsShown() ) then
InspectPVPFrame_OnShow();
end
end
function InspectFrame_OnShow(self)
if ( not self.unit ) then
return;
end
PlaySound("igCharacterInfoOpen");
SetPortraitTexture(InspectFramePortrait, self.unit);
InspectNameText:SetText(UnitName(self.unit));
end
function InspectFrame_OnHide(self)
self.unit = nil;
PlaySound("igCharacterInfoClose");
-- Clear the player being inspected
ClearInspectPlayer();
-- in the InspectTalentFrame_Update function, a default talent tab is selected smartly if there is no tab selected
-- it actually ends up feeling natural to have this behavior happen every time the frame is shown
PanelTemplates_SetTab(InspectTalentFrame, nil);
end
function InspectFrame_OnUpdate(self)
if ( not UnitIsVisible(self.unit) ) then
HideUIPanel(InspectFrame);
end
end
function InspectSwitchTabs(newID)
local newFrame = _G[INSPECTFRAME_SUBFRAMES[newID]];
local oldFrame = _G[INSPECTFRAME_SUBFRAMES[PanelTemplates_GetSelectedTab(InspectFrame)]];
if ( newFrame ) then
if ( oldFrame ) then
oldFrame:Hide();
end
PanelTemplates_SetTab(InspectFrame, newID);
ShowUIPanel(InspectFrame);
newFrame:Show();
end
end
function InspectFrameTab_OnClick(self)
PlaySound("igCharacterInfoTab");
InspectSwitchTabs(self:GetID());
end
function InspectFrame_UpdateTalentTab()
if ( not InspectFrame.unit ) then
return;
end
local level = UnitLevel(InspectFrame.unit);
if ( level > 0 and level < 10 ) then
PanelTemplates_DisableTab(InspectFrame, 3);
if ( PanelTemplates_GetSelectedTab(InspectFrame) == 3 ) then
InspectSwitchTabs(1);
end
else
PanelTemplates_EnableTab(InspectFrame, 3);
InspectTalentFrame_UpdateTabs();
end
end
@@ -0,0 +1,9 @@
## Interface: 30300
## Title: Blizzard Inspect UI
## Secure: 1
## LoadOnDemand: 1
Blizzard_InspectUI.xml
InspectPaperDollFrame.xml
InspectPVPFrame.xml
InspectTalentFrame.xml
Localization.lua
@@ -0,0 +1,135 @@
<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="Blizzard_InspectUI.lua"/>
<Frame name="InspectFrame" toplevel="true" movable="true" enableMouse="true" hidden="true" parent="UIParent">
<Size>
<AbsDimension x="384" y="512"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="0" y="-104"/>
</Offset>
</Anchor>
</Anchors>
<HitRectInsets>
<AbsInset left="0" right="30" top="0" bottom="45"/>
</HitRectInsets>
<Layers>
<Layer level="ARTWORK">
<Texture name="InspectFramePortrait">
<Size>
<AbsDimension x="60" y="60"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="7" y="-6"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
</Layer>
</Layers>
<Frames>
<Frame name="InspectNameFrame">
<Size>
<AbsDimension x="109" y="12"/>
</Size>
<Anchors>
<Anchor point="CENTER">
<Offset>
<AbsDimension x="6" y="232"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer>
<FontString name="InspectNameText" inherits="GameFontNormal" text="NAME">
<Size>
<AbsDimension x="109" y="16"/>
</Size>
<Anchors>
<Anchor point="CENTER"/>
</Anchors>
<Color r="1.0" g="1.0" b="1.0"/>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnLoad function="RaiseFrameLevel"/>
</Scripts>
</Frame>
<Button name="InspectFrameCloseButton" inherits="UIPanelCloseButton">
<Anchors>
<Anchor point="CENTER" relativeTo="InspectFrame" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="-44" y="-25"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad function="RaiseFrameLevel"/>
</Scripts>
</Button>
<Button name="InspectFrameTab1" inherits="CharacterFrameTabButtonTemplate" id="1" text="CHARACTER">
<Anchors>
<Anchor point="CENTER" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="60" y="61"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick function="InspectFrameTab_OnClick"/>
<OnEnter>
GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
GameTooltip:SetText(CHARACTER_INFO, 1.0,1.0,1.0 );
</OnEnter>
<OnLeave function="GameTooltip_Hide"/>
</Scripts>
</Button>
<Button name="InspectFrameTab2" inherits="CharacterFrameTabButtonTemplate" id="2" text="PVP">
<Anchors>
<Anchor point="LEFT" relativeTo="InspectFrameTab1" relativePoint="RIGHT">
<Offset>
<AbsDimension x="-16" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick function="InspectFrameTab_OnClick"/>
<OnEnter>
GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
GameTooltip:SetText(PLAYER_V_PLAYER, 1.0,1.0,1.0 );
</OnEnter>
<OnLeave function="GameTooltip_Hide"/>
</Scripts>
</Button>
<Button name="InspectFrameTab3" inherits="CharacterFrameTabButtonTemplate" id="3" text="TALENTS">
<Anchors>
<Anchor point="LEFT" relativeTo="InspectFrameTab2" relativePoint="RIGHT">
<Offset>
<AbsDimension x="-16" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick function="InspectFrameTab_OnClick"/>
<OnEnter>
GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
GameTooltip:SetText(TALENTS, 1.0,1.0,1.0 );
</OnEnter>
<OnLeave function="GameTooltip_Hide"/>
</Scripts>
</Button>
</Frames>
<Scripts>
<OnLoad function="InspectFrame_OnLoad"/>
<OnEvent function="InspectFrame_OnEvent"/>
<OnShow function="InspectFrame_OnShow"/>
<OnHide function="InspectFrame_OnHide"/>
<OnUpdate function="InspectFrame_OnUpdate"/>
</Scripts>
</Frame>
</Ui>
@@ -0,0 +1,79 @@
function InspectHonorFrame_OnLoad(self)
self:RegisterEvent("INSPECT_HONOR_UPDATE");
end
function InspectHonorFrame_OnEvent(self, event, ...)
if ( event == "INSPECT_HONOR_UPDATE" ) then
InspectHonorFrame_Update();
end
end
function InspectHonorFrame_OnShow()
if ( not HasInspectHonorData() ) then
RequestInspectHonorData();
else
InspectHonorFrame_Update();
end
end
function InspectHonorFrame_Update()
local todayHK, todayHonor, yesterdayHK, yesterdayHonor, lifetimeHK, lifetimeRank = GetInspectHonorData();
-- Yesterday's values
InspectHonorFrameYesterdayHKValue:SetText(yesterdayHK);
InspectHonorFrameYesterdayContributionValue:SetText(yesterdayHonor);
-- This week's values
--InspectHonorFrameThisWeekHKValue:SetText(thisweekHK);
--InspectHonorFrameThisWeekContributionValue:SetText(thisweekHonor);
-- Last Week's values
--InspectHonorFrameLastWeekHKValue:SetText(lastweekHK);
--InspectHonorFrameLastWeekContributionValue:SetText(lastweekHonor);
--InspectHonorFrameLastWeekStandingValue:SetText(lastweekStanding);
-- This session's values
InspectHonorFrameCurrentHKValue:SetText(todayHK);
--InspectHonorFrameCurrentDKValue:SetText(sessionDK);
-- Lifetime stats
InspectHonorFrameLifeTimeHKValue:SetText(lifetimeHK);
--InspectHonorFrameLifeTimeDKValue:SetText(lifetimeDK);
local rankName, rankNumber = GetPVPRankInfo(lifetimeRank);
if ( not rankName ) then
rankName = NONE;
end
InspectHonorFrameLifeTimeRankValue:SetText(rankName);
-- Set rank name and number
rankName, rankNumber = GetPVPRankInfo(UnitPVPRank("target"));
if ( not rankName ) then
rankName = NONE;
end
InspectHonorFrameCurrentPVPRank:SetText("("..RANK.." "..rankNumber..")");
InspectHonorFrameCurrentPVPRank:Show();
InspectHonorFrameCurrentPVPTitle:SetText(rankName);
InspectHonorFrameCurrentPVPTitle:Show();
-- Set icon
if ( rankNumber > 0 ) then
InspectHonorFramePvPIcon:SetTexture(format("%s%02d","Interface\\PvPRankBadges\\PvPRank",rankNumber));
InspectHonorFramePvPIcon:Show();
else
InspectHonorFramePvPIcon:Hide();
end
-- Set rank progress and bar color
local factionGroup, factionName = UnitFactionGroup("target");
if ( factionGroup == "Alliance" ) then
InspectHonorFrameProgressBar:SetStatusBarColor(0.05, 0.15, 0.36);
else
InspectHonorFrameProgressBar:SetStatusBarColor(0.63, 0.09, 0.09);
end
--InspectHonorFrameProgressBar:SetValue(GetInspectPVPRankProgress());
-- Recenter rank text
InspectHonorFrameCurrentPVPTitle:SetPoint("TOP", "InspectHonorFrame", "TOP", - InspectHonorFrameCurrentPVPRank:GetWidth()/2, -83);
end
@@ -0,0 +1,351 @@
<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="InspectHonorFrame.lua"/>
<Frame name="InspectHonorFrame" setAllPoints="true" enableMouse="true" parent="InspectFrame" hidden="true" id="2">
<HitRectInsets>
<AbsInset left="0" right="30" top="0" bottom="75"/>
</HitRectInsets>
<Layers>
<Layer level="BACKGROUND">
<Texture file="Interface\PaperDollInfoFrame\UI-Character-General-TopLeft">
<Size>
<AbsDimension x="256" y="256"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="2" y="-1"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<Texture file="Interface\PaperDollInfoFrame\UI-Character-General-TopRight">
<Size>
<AbsDimension x="128" y="256"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="258" y="-1"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<Texture file="Interface\PaperDollInfoFrame\UI-Character-General-BottomLeft">
<Size>
<AbsDimension x="256" y="256"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="2" y="-257"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<Texture file="Interface\PaperDollInfoFrame\UI-Character-General-BottomRight">
<Size>
<AbsDimension x="128" y="256"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="258" y="-257"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
</Layer>
<Layer level="ARTWORK">
<Texture file="Interface\PaperDollInfoFrame\UI-Character-Honor-TopLeft">
<Size>
<AbsDimension x="256" y="256"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="22" y="-69"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<Texture file="Interface\PaperDollInfoFrame\UI-Character-Honor-TopRight">
<Size>
<AbsDimension x="128" y="256"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="275" y="-69"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<Texture file="Interface\PaperDollInfoFrame\UI-Character-Honor-BottomLeft">
<Size>
<AbsDimension x="256" y="128"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="22" y="-325"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<Texture file="Interface\PaperDollInfoFrame\UI-Character-Honor-BottomRight">
<Size>
<AbsDimension x="128" y="128"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="275" y="-325"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<FontString name="InspectHonorFrameCurrentPVPTitle" inherits="GameFontNormal">
<Anchors>
<Anchor point="TOP">
<Offset>
<AbsDimension x="0" y="-81"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="InspectHonorFrameCurrentPVPRank" inherits="GameFontNormalSmall">
<Anchors>
<Anchor point="LEFT" relativeTo="InspectHonorFrameCurrentPVPTitle" relativePoint="RIGHT">
<Offset>
<AbsDimension x="5" y="-1"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="InspectHonorFrameCurrentSessionTitle" inherits="GameFontNormal" text="HONOR_THIS_SESSION">
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="36" y="-112"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="InspectHonorFrameYesterdayTitle" inherits="GameFontNormal" text="HONOR_YESTERDAY">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="InspectHonorFrameCurrentSessionTitle" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-41"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="InspectHonorFrameThisWeekTitle" inherits="GameFontNormal" text="HONOR_THISWEEK">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="InspectHonorFrameYesterdayTitle" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-43"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="InspectHonorFrameLastWeekTitle" inherits="GameFontNormal" text="HONOR_LASTWEEK">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="InspectHonorFrameThisWeekTitle" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-42"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="InspectHonorFrameLifeTimeTitle" inherits="GameFontNormal" text="HONOR_LIFETIME">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="InspectHonorFrameLastWeekTitle" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-64"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
<Layer level="OVERLAY">
<Texture name="InspectHonorFramePvPIcon">
<Size>
<AbsDimension x="24" y="24"/>
</Size>
<Anchors>
<Anchor point="RIGHT" relativeTo="InspectHonorFrameCurrentPVPTitle" relativePoint="LEFT">
<Offset>
<AbsDimension x="-5" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
</Layer>
</Layers>
<Frames>
<Frame name="InspectHonorFrameCurrentHK" inherits="HonorFrameHKButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="InspectHonorFrameCurrentSessionTitle" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="10" y="-3"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="InspectHonorFrameCurrentDK" inherits="HonorFrameDKButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="InspectHonorFrameCurrentHK" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-2"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="InspectHonorFrameYesterdayHK" inherits="HonorFrameHKButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="InspectHonorFrameYesterdayTitle" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="10" y="-3"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="InspectHonorFrameYesterdayContribution" inherits="HonorFrameContributionButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="InspectHonorFrameYesterdayHK" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-3"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="InspectHonorFrameThisWeekHK" inherits="HonorFrameHKButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="InspectHonorFrameThisWeekTitle" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="10" y="-3"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="InspectHonorFrameThisWeekContribution" inherits="HonorFrameContributionButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="InspectHonorFrameThisWeekHK" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-3"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="InspectHonorFrameLastWeekHK" inherits="HonorFrameHKButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="InspectHonorFrameLastWeekTitle" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="10" y="-3"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="InspectHonorFrameLastWeekContribution" inherits="HonorFrameContributionButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="InspectHonorFrameLastWeekHK" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-2"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="InspectHonorFrameLastWeekStanding" inherits="HonorFrameStandingButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="InspectHonorFrameLastWeekContribution" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-2"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="InspectHonorFrameLifeTimeHK" inherits="HonorFrameHKButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="InspectHonorFrameLifeTimeTitle" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="10" y="-4"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="InspectHonorFrameLifeTimeDK" inherits="HonorFrameDKButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="InspectHonorFrameLifeTimeHK" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-4"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="InspectHonorFrameLifeTimeRank" inherits="HonorFrameRankButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="InspectHonorFrameLifeTimeDK" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-4"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="InspectHonorFrameRankButton" enableMouse="true" hidden="false">
<Size>
<AbsDimension x="10" y="24"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativeTo="InspectHonorFramePvPIcon"/>
<Anchor point="RIGHT" relativeTo="InspectHonorFrameCurrentPVPRank"/>
</Anchors>
<Scripts>
<OnEnter>
GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
GameTooltip:SetText(RANK, HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b);
GameTooltip:AddLine(NEWBIE_TOOLTIP_RANK, NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b, 1);
GameTooltip:Show();
</OnEnter>
<OnLeave function="GameTooltip_Hide"/>
</Scripts>
</Frame>
<StatusBar name="InspectHonorFrameProgressBar" drawLayer="BORDER" minValue="0" maxValue="1" defaultValue="0">
<Size>
<AbsDimension x="315" y="29"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="22" y="-77"/>
</Offset>
</Anchor>
</Anchors>
<Frames>
<Frame name="InspectHonorFrameProgressButton" enableMouse="true" setAllPoints="true">
<Scripts>
<OnLoad function="LowerFrameLevel"/>
<OnEnter>
GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
GameTooltip:SetText(RANK_POSITION, HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b);
GameTooltip:AddLine(NEWBIE_TOOLTIP_RANK_POSITION, NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b, 1);
GameTooltip:Show();
</OnEnter>
<OnLeave function="GameTooltip_Hide"/>
</Scripts>
</Frame>
</Frames>
<Scripts>
<OnLoad function="LowerFrameLevel"/>
</Scripts>
<BarTexture name="$parentBar" file="Interface\PaperDollInfoFrame\UI-Character-Skills-Bar" />
</StatusBar>
</Frames>
<Scripts>
<OnLoad function="InspectHonorFrame_OnLoad"/>
<OnShow function="InspectHonorFrame_OnShow"/>
<OnEvent function="InspectHonorFrame_OnEvent"/>
</Scripts>
</Frame>
</Ui>
@@ -0,0 +1,176 @@
function InspectPVPFrame_OnLoad(self)
InspectPVPFrameLine1:SetAlpha(0.3);
InspectPVPHonorKillsLabel:SetVertexColor(0.6, 0.6, 0.6);
InspectPVPHonorHonorLabel:SetVertexColor(0.6, 0.6, 0.6);
InspectPVPHonorTodayLabel:SetVertexColor(0.6, 0.6, 0.6);
InspectPVPHonorYesterdayLabel:SetVertexColor(0.6, 0.6, 0.6);
InspectPVPHonorLifetimeLabel:SetVertexColor(0.6, 0.6, 0.6);
self:RegisterEvent("INSPECT_HONOR_UPDATE");
end
function InspectPVPFrame_OnEvent(self, event, ...)
if ( event == "INSPECT_HONOR_UPDATE" ) then
InspectPVPFrame_Update();
end
end
function InspectPVPFrame_OnShow()
InspectPVPFrame_Update();
if ( not HasInspectHonorData() ) then
RequestInspectHonorData();
else
InspectPVPFrame_Update();
end
end
function InspectPVPFrame_SetFaction()
local factionGroup = UnitFactionGroup("player");
if ( factionGroup ) then
InspectPVPFrameHonorIcon:SetTexture("Interface\\TargetingFrame\\UI-PVP-"..factionGroup);
InspectPVPFrameHonorIcon:Show();
end
end
function InspectPVPFrame_Update()
for i=1, MAX_ARENA_TEAMS do
GetInspectArenaTeamData(i);
end
InspectPVPFrame_SetFaction();
InspectPVPHonor_Update();
InspectPVPTeam_Update();
end
function InspectPVPTeam_Update()
-- Display Elements
local button, buttonName, highlight, data, standard, emblem, border;
-- Data Elements
local teamName, teamSize, teamRating, teamPlayed, teamWins, teamLoss, playerPlayed, playerRating, playerPlayedPct, teamRank;
local background = {};
local borderColor = {};
local emblemColor = {};
local ARENA_TEAMS = {};
ARENA_TEAMS[1] = {size = 2};
ARENA_TEAMS[2] = {size = 3};
ARENA_TEAMS[3] = {size = 5};
-- Sort teams by size
local buttonIndex = 0;
for index, value in pairs(ARENA_TEAMS) do
for i=1, MAX_ARENA_TEAMS do
teamName, teamSize = GetInspectArenaTeamData(i);
if ( value.size == teamSize ) then
value.index = i;
end
end
end
-- fill out data
for index, value in pairs(ARENA_TEAMS) do
if ( value.index ) then
buttonIndex = buttonIndex + 1;
-- Pull Values
teamName, teamSize, teamRating, teamPlayed, teamWins, playerPlayed, playerRating, background.r, background.g, background.b, emblem, emblemColor.r, emblemColor.g, emblemColor.b, border, borderColor.r, borderColor.g, borderColor.b = GetInspectArenaTeamData(value.index);
teamLoss = teamPlayed - teamWins;
if ( teamPlayed ~= 0 ) then
playerPlayedPct = floor( ( playerPlayed / teamPlayed ) * 100 );
else
playerPlayedPct = floor( ( playerPlayed / 1 ) * 100 );
end
-- Set button elements to variables
button = _G["InspectPVPTeam"..buttonIndex];
buttonName = "InspectPVPTeam"..buttonIndex;
data = buttonName.."Data";
standard = buttonName.."Standard";
button:SetID(value.index);
-- Populate Data
_G[data.."TypeLabel"]:SetText(ARENA_THIS_SEASON);
_G[data.."Name"]:SetText(teamName);
_G[data.."Rating"]:SetText(teamRating);
_G[data.."Games"]:SetText(teamPlayed);
_G[data.."Wins"]:SetText(teamWins);
_G[data.."Loss"]:SetText(teamLoss);
_G[data.."Played"]:SetText(playerRating);
_G[data.."Played"]:SetVertexColor(1.0, 1.0, 1.0);
_G[data.."PlayedLabel"]:SetText(RATING);
-- Set TeamSize Banner
_G[standard.."Banner"]:SetTexture("Interface\\PVPFrame\\PVP-Banner-"..teamSize);
_G[standard.."Banner"]:SetVertexColor(background.r, background.g, background.b);
_G[standard.."Border"]:SetVertexColor(borderColor.r, borderColor.g, borderColor.b);
_G[standard.."Emblem"]:SetVertexColor(emblemColor.r, emblemColor.g, emblemColor.b);
if ( border ~= -1 ) then
_G[standard.."Border"]:SetTexture("Interface\\PVPFrame\\PVP-Banner-"..teamSize.."-Border-"..border);
end
if ( emblem ~= -1 ) then
_G[standard.."Emblem"]:SetTexture("Interface\\PVPFrame\\Icons\\PVP-Banner-Emblem-"..emblem);
end
-- Set visual elements
_G[data]:Show();
button:SetAlpha(1);
_G[buttonName.."Highlight"]:SetAlpha(1);
_G[buttonName.."Highlight"]:SetBackdropBorderColor(1.0, 0.82, 0);
_G[standard]:SetAlpha(1);
_G[standard.."Border"]:Show();
_G[standard.."Emblem"]:Show();
_G[buttonName.."Background"]:SetVertexColor(0, 0, 0);
_G[buttonName.."Background"]:SetAlpha(1);
_G[buttonName.."TeamType"]:Hide();
end
end
-- show unused teams
for index, value in pairs(ARENA_TEAMS) do
if ( not value.index ) then
-- Set button elements to variables
buttonIndex = buttonIndex + 1;
button = _G["InspectPVPTeam"..buttonIndex];
buttonName = "InspectPVPTeam"..buttonIndex;
data = buttonName.."Data";
-- Set standard type
_G[buttonName.."StandardBanner"]:SetTexture("Interface\\PVPFrame\\PVP-Banner-"..value.size);
-- Hide or Show items
button:SetAlpha(0.4);
_G[data]:Hide();
_G[buttonName.."Background"]:SetVertexColor(0, 0, 0);
_G[buttonName.."Standard"]:SetAlpha(0.1);
_G[buttonName.."StandardBorder"]:Hide();
_G[buttonName.."StandardEmblem"]:Hide();
_G[buttonName.."TeamType"]:SetFormattedText(PVP_TEAMSIZE, value.size, value.size);
_G[buttonName.."TeamType"]:Show();
end
end
end
-- PVP Honor Data
function InspectPVPHonor_Update()
local todayHK, todayHonor, yesterdayHK, yesterdayHonor, lifetimeHK, lifetimeRank = GetInspectHonorData();
-- Yesterday's values
InspectPVPHonorYesterdayKills:SetText(yesterdayHK);
InspectPVPHonorYesterdayHonor:SetText(yesterdayHonor);
-- Lifetime values
InspectPVPHonorLifetimeKills:SetText(lifetimeHK);
InspectPVPFrameHonorPoints:SetText("");
InspectPVPFrameArenaPoints:SetText("");
-- Hide Point Values
InspectPVPFrameHonorPoints:Hide();
InspectPVPFrameArenaPoints:Hide();
-- This session's values
InspectPVPHonorTodayKills:SetText(todayHK);
InspectPVPHonorTodayHonor:SetText(todayHonor);
InspectPVPHonorTodayHonor:SetHeight(14);
end
@@ -0,0 +1,479 @@
<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="InspectPVPFrame.lua"/>
<Include file="PVPFrameTemplates.xml"/>
<Frame name="InspectPVPFrame" setAllPoints="true" enableMouse="true" parent="InspectFrame" hidden="true" id="2">
<HitRectInsets>
<AbsInset left="0" right="30" top="0" bottom="75"/>
</HitRectInsets>
<Layers>
<Layer level="BACKGROUND">
<Texture file="Interface\PaperDollInfoFrame\UI-Character-General-TopLeft">
<Size>
<AbsDimension x="256" y="256"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="2" y="-1"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<Texture file="Interface\PaperDollInfoFrame\UI-Character-General-TopRight">
<Size>
<AbsDimension x="128" y="256"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="258" y="-1"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<Texture file="Interface\PaperDollInfoFrame\UI-Character-General-BottomLeft">
<Size>
<AbsDimension x="256" y="256"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="2" y="-257"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<Texture file="Interface\PaperDollInfoFrame\UI-Character-General-BottomRight">
<Size>
<AbsDimension x="128" y="256"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="258" y="-257"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
</Layer>
<Layer level="BORDER">
<Texture name="InspectPVPFrameBackground" file="Interface\PVPFrame\UI-Character-PVP">
<Size>
<AbsDimension x="512" y="512"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="14" y="-36"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
</Layer>
</Layers>
<Frames>
<Frame name="InspectPVPFrameHonor" hidden="false">
<Size>
<AbsDimension x="300" y="20"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="InspectPVPFrameBackground" relativePoint="TOPLEFT">
<Offset>
<AbsDimension x="118" y="-2"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<FontString name="$parentLabel" inherits="GameFontHighlightSmall" text="PVP_LABEL_HONOR">
<Anchors>
<Anchor point="LEFT" relativeTo="$parent">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentPoints" inherits="GameFontNormal" justifyH="RIGHT">
<Anchors>
<Anchor point="LEFT" relativeTo="$parentLabel" relativePoint="RIGHT">
<Offset>
<AbsDimension x="15" y="0"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<Texture name="$parentIcon">
<Size>
<AbsDimension x="28" y="28"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativeTo="$parentPoints" relativePoint="RIGHT">
<Offset>
<AbsDimension x="4" y="-6"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnEnter>
GameTooltip_SetDefaultAnchor(GameTooltip, self);
GameTooltip:SetText(HONOR_POINTS, HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b);
GameTooltip:AddLine(TOOLTIP_HONOR_POINTS, nil, nil, nil, 1);
GameTooltip:Show();
</OnEnter>
<OnLeave function="GameTooltip_Hide"/>
</Scripts>
</Frame>
<Frame name="InspectPVPFrameArena">
<Size>
<AbsDimension x="300" y="20"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="InspectPVPFrameBackground" relativePoint="TOPLEFT">
<Offset>
<AbsDimension x="120" y="-95"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<FontString name="$parentLabel" inherits="GameFontHighlightSmall" text="PVP_LABEL_ARENA">
<Anchors>
<Anchor point="LEFT" relativeTo="$parent">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentPoints" inherits="GameFontNormal" justifyH="RIGHT">
<Anchors>
<Anchor point="LEFT" relativeTo="$parentLabel" relativePoint="RIGHT">
<Offset>
<AbsDimension x="15" y="0"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<Texture name="$parentIcon" file="Interface\PVPFrame\PVP-ArenaPoints-Icon">
<Size>
<AbsDimension x="17" y="15"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativeTo="$parentPoints" relativePoint="RIGHT">
<Offset>
<AbsDimension x="5" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnEnter>
GameTooltip_SetDefaultAnchor(GameTooltip, self);
GameTooltip:SetText(ARENA_POINTS, HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b);
GameTooltip:AddLine(TOOLTIP_ARENA_POINTS, nil, nil, nil, 1);
GameTooltip:Show();
</OnEnter>
<OnLeave function="GameTooltip_Hide"/>
</Scripts>
</Frame>
<!-- Individual -->
<Frame name="InspectPVPHonor">
<Size>
<AbsDimension x="300" y="100"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="InspectPVPFrameBackground" relativePoint="TOPLEFT">
<Offset>
<AbsDimension x="15" y="-28"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<FontString name="$parentKillsLabel" inherits="GameFontDisableSmall" text="KILLS">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="InspectPVPHonor">
<Offset>
<AbsDimension x="25" y="-24"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentHonorLabel" inherits="GameFontDisableSmall" text="HONOR">
<Anchors>
<Anchor point="TOPRIGHT" relativeTo="$parentKillsLabel" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="0" y="-10"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<Texture name="InspectPVPFrameLine1" file="Interface\PVPFrame\UI-Character-PVP-Elements">
<Size>
<AbsDimension x="250" y="5"/>
</Size>
<Anchors>
<Anchor point="BOTTOMLEFT" relativeTo="$parentKillsLabel" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="-10" y="4"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0" right="0.4140625" top="0.76171875" bottom="0.765625"/>
</Texture>
<!-- Today Begin -->
<FontString name="$parentTodayLabel" inherits="GameFontDisableSmall" text="HONOR_TODAY">
<Anchors>
<Anchor point="BOTTOMLEFT" relativeTo="$parentKillsLabel" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="30" y="10"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentTodayKills" inherits="GameFontHighlightSmall">
<Anchors>
<Anchor point="TOP" relativeTo="$parentTodayLabel" relativePoint="BOTTOM">
<Offset>
<AbsDimension x="0" y="-10"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentTodayHonor" inherits="GameFontHighlightSmall">
<Anchors>
<Anchor point="TOP" relativeTo="$parentTodayKills" relativePoint="BOTTOM">
<Offset>
<AbsDimension x="0" y="-10"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<!-- Today End -->
<!-- Yesterday Begin -->
<FontString name="$parentYesterdayLabel" inherits="GameFontDisableSmall" text="HONOR_YESTERDAY">
<Anchors>
<Anchor point="LEFT" relativeTo="$parentTodayLabel" relativePoint="RIGHT">
<Offset>
<AbsDimension x="30" y="0"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentYesterdayKills" inherits="GameFontHighlightSmall">
<Anchors>
<Anchor point="TOP" relativeTo="$parentYesterdayLabel" relativePoint="BOTTOM">
<Offset>
<AbsDimension x="0" y="-10"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentYesterdayHonor" inherits="GameFontHighlightSmall" >
<Anchors>
<Anchor point="TOP" relativeTo="$parentYesterdayKills" relativePoint="BOTTOM">
<Offset>
<AbsDimension x="0" y="-10"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<!-- Yesterday End -->
<!-- Lifetime Begin -->
<FontString name="$parentLifetimeLabel" inherits="GameFontDisableSmall" text="HONOR_LIFETIME">
<Anchors>
<Anchor point="LEFT" relativeTo="$parentYesterdayLabel" relativePoint="RIGHT">
<Offset>
<AbsDimension x="30" y="0"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentLifetimeKills" inherits="GameFontHighlightSmall">
<Anchors>
<Anchor point="TOP" relativeTo="$parentLifetimeLabel" relativePoint="BOTTOM">
<Offset>
<AbsDimension x="0" y="-10"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentLifetimeHonor" inherits="GameFontDisableSmall" text="-">
<Anchors>
<Anchor point="TOP" relativeTo="$parentLifetimeKills" relativePoint="BOTTOM">
<Offset>
<AbsDimension x="0" y="-10"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<!-- Lifetime End -->
</Layer>
</Layers>
</Frame>
<!-- Arena Teams -->
<Frame name="InspectPVPTeam1Standard" inherits="PVPTeamStandardTemplate">
<Anchors>
<Anchor point="LEFT" relativeTo="InspectPVPFrameBackground">
<Offset>
<AbsDimension x="16" y="85"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Button name="InspectPVPTeam1" inherits="PVPTeamBorderTemplate" id="1">
<Anchors>
<Anchor point="LEFT" relativeTo="InspectPVPTeam1Standard">
<Offset>
<AbsDimension x="33" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<FontString name="$parentTeamType" inherits="GameFontDisableLarge" hidden="true">
<Anchors>
<Anchor point="CENTER">
<Offset>
<AbsDimension x="-8" y="0"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Frames>
<Frame name="$parentData" inherits="PVPTeamDataTemplate" hidden="true">
<Anchors>
<Anchor point="TOPLEFT"/>
</Anchors>
</Frame>
</Frames>
<Scripts>
<OnClick>
</OnClick>
<OnEnter>
</OnEnter>
<OnLeave>
</OnLeave>
<OnMouseUp>
</OnMouseUp>
<OnMouseDown>
</OnMouseDown>
</Scripts>
</Button>
<Frame name="InspectPVPTeam2Standard" inherits="PVPTeamStandardTemplate">
<Anchors>
<Anchor point="LEFT" relativeTo="InspectPVPFrameBackground">
<Offset>
<AbsDimension x="16" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Button name="InspectPVPTeam2" inherits="PVPTeamBorderTemplate" id="2">
<Anchors>
<Anchor point="LEFT" relativeTo="InspectPVPTeam2Standard">
<Offset>
<AbsDimension x="33" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<FontString name="$parentTeamType" inherits="GameFontDisableLarge" hidden="true">
<Anchors>
<Anchor point="CENTER">
<Offset>
<AbsDimension x="-8" y="0"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Frames>
<Frame name="$parentData" inherits="PVPTeamDataTemplate" hidden="true">
<Anchors>
<Anchor point="TOPLEFT"/>
</Anchors>
</Frame>
</Frames>
<Scripts>
<OnClick>
</OnClick>
<OnEnter>
</OnEnter>
<OnLeave>
</OnLeave>
<OnMouseUp>
</OnMouseUp>
<OnMouseDown>
</OnMouseDown>
</Scripts>
</Button>
<Frame name="InspectPVPTeam3Standard" inherits="PVPTeamStandardTemplate">
<Anchors>
<Anchor point="LEFT" relativeTo="InspectPVPFrameBackground">
<Offset>
<AbsDimension x="16" y="-85"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Button name="InspectPVPTeam3" inherits="PVPTeamBorderTemplate" id="3">
<Anchors>
<Anchor point="LEFT" relativeTo="InspectPVPTeam3Standard">
<Offset>
<AbsDimension x="33" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<FontString name="$parentTeamType" inherits="GameFontDisableLarge" hidden="true">
<Anchors>
<Anchor point="CENTER">
<Offset>
<AbsDimension x="-8" y="0"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Frames>
<Frame name="$parentData" inherits="PVPTeamDataTemplate" hidden="true">
<Anchors>
<Anchor point="TOPLEFT"/>
</Anchors>
</Frame>
</Frames>
<Scripts>
<OnClick>
</OnClick>
<OnEnter>
</OnEnter>
<OnLeave>
</OnLeave>
<OnMouseUp>
</OnMouseUp>
<OnMouseDown>
</OnMouseDown>
</Scripts>
</Button>
</Frames>
<Scripts>
<OnLoad function="InspectPVPFrame_OnLoad"/>
<OnShow function="InspectPVPFrame_OnShow"/>
<OnEvent function="InspectPVPFrame_OnEvent"/>
</Scripts>
</Frame>
</Ui>
@@ -0,0 +1,148 @@
function InspectPaperDollFrame_OnLoad(self)
self:RegisterEvent("UNIT_MODEL_CHANGED");
self:RegisterEvent("UNIT_LEVEL");
end
function InspectModelFrame_OnUpdate(self, elapsedTime)
if ( InspectModelRotateLeftButton:GetButtonState() == "PUSHED" ) then
self.rotation = self.rotation + (elapsedTime * 2 * PI * ROTATIONS_PER_SECOND);
if ( self.rotation < 0 ) then
self.rotation = self.rotation + (2 * PI);
end
InspectModelFrame:SetRotation(self.rotation);
end
if ( InspectModelRotateRightButton:GetButtonState() == "PUSHED" ) then
self.rotation = self.rotation - (elapsedTime * 2 * PI * ROTATIONS_PER_SECOND);
if ( self.rotation > (2 * PI) ) then
self.rotation = self.rotation - (2 * PI);
end
InspectModelFrame:SetRotation(self.rotation);
end
end
function InspectModelFrame_OnLoad(self)
self.rotation = 0.61;
InspectModelFrame:SetRotation(self.rotation);
self:RegisterEvent("DISPLAY_SIZE_CHANGED");
end
function InspectModelRotateLeftButton_OnClick()
InspectModelFrame.rotation = InspectModelFrame.rotation - 0.03;
InspectModelFrame:SetRotation(InspectModelFrame.rotation);
PlaySound("igInventoryRotateCharacter");
end
function InspectModelRotateRightButton_OnClick()
InspectModelFrame.rotation = InspectModelFrame.rotation + 0.03;
InspectModelFrame:SetRotation(InspectModelFrame.rotation);
PlaySound("igInventoryRotateCharacter");
end
function InspectPaperDollFrame_OnEvent(self, event, unit)
if ( unit and unit == InspectFrame.unit ) then
if ( event == "UNIT_MODEL_CHANGED" ) then
InspectModelFrame:RefreshUnit();
elseif ( event == "UNIT_LEVEL" ) then
InspectPaperDollFrame_SetLevel();
end
return;
end
end
function InspectPaperDollFrame_SetLevel()
local unit, level = InspectFrame.unit, UnitLevel(InspectFrame.unit);
if ( level == -1 ) then
level = "??";
end
InspectLevelText:SetFormattedText(PLAYER_LEVEL,level, UnitRace(unit), UnitClass(unit));
end
function InspectPaperDollFrame_OnShow()
InspectModelFrame:SetUnit(InspectFrame.unit);
InspectPaperDollFrame_SetLevel();
InspectPaperDollItemSlotButton_Update(InspectHeadSlot);
InspectPaperDollItemSlotButton_Update(InspectNeckSlot);
InspectPaperDollItemSlotButton_Update(InspectShoulderSlot);
InspectPaperDollItemSlotButton_Update(InspectBackSlot);
InspectPaperDollItemSlotButton_Update(InspectChestSlot);
InspectPaperDollItemSlotButton_Update(InspectShirtSlot);
InspectPaperDollItemSlotButton_Update(InspectTabardSlot);
InspectPaperDollItemSlotButton_Update(InspectWristSlot);
InspectPaperDollItemSlotButton_Update(InspectHandsSlot);
InspectPaperDollItemSlotButton_Update(InspectWaistSlot);
InspectPaperDollItemSlotButton_Update(InspectLegsSlot);
InspectPaperDollItemSlotButton_Update(InspectFeetSlot);
InspectPaperDollItemSlotButton_Update(InspectFinger0Slot);
InspectPaperDollItemSlotButton_Update(InspectFinger1Slot);
InspectPaperDollItemSlotButton_Update(InspectTrinket0Slot);
InspectPaperDollItemSlotButton_Update(InspectTrinket1Slot);
InspectPaperDollItemSlotButton_Update(InspectMainHandSlot);
InspectPaperDollItemSlotButton_Update(InspectSecondaryHandSlot);
InspectPaperDollItemSlotButton_Update(InspectRangedSlot);
end
function InspectPaperDollItemSlotButton_OnLoad(self)
self:RegisterEvent("UNIT_INVENTORY_CHANGED");
local slotName = self:GetName();
local id;
local textureName;
local checkRelic;
id, textureName, checkRelic = GetInventorySlotInfo(strsub(slotName,8));
self:SetID(id);
local texture = _G[slotName.."IconTexture"];
texture:SetTexture(textureName);
self.backgroundTextureName = textureName;
self.checkRelic = checkRelic;
end
function InspectPaperDollItemSlotButton_OnEvent(self, event, ...)
if ( event == "UNIT_INVENTORY_CHANGED" ) then
local arg1 = ...;
if ( arg1 == InspectFrame.unit ) then
InspectPaperDollItemSlotButton_Update(self);
end
return;
end
end
function InspectPaperDollItemSlotButton_OnEnter(self)
GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
if ( not GameTooltip:SetInventoryItem(InspectFrame.unit, self:GetID()) ) then
local text = _G[strupper(strsub(self:GetName(), 8))];
if ( self.checkRelic and UnitHasRelicSlot(InspectFrame.unit) ) then
text = _G["RELICSLOT"];
end
GameTooltip:SetText(text);
end
CursorUpdate(self);
end
function InspectPaperDollItemSlotButton_Update(button)
local unit = InspectFrame.unit;
local textureName = GetInventoryItemTexture(unit, button:GetID());
if ( textureName ) then
SetItemButtonTexture(button, textureName);
SetItemButtonCount(button, GetInventoryItemCount(unit, button:GetID()));
button.hasItem = 1;
else
local textureName = button.backgroundTextureName;
if ( button.checkRelic and UnitHasRelicSlot(unit) ) then
textureName = "Interface\\Paperdoll\\UI-PaperDoll-Slot-Relic.blp";
end
SetItemButtonTexture(button, textureName);
SetItemButtonCount(button, 0);
button.hasItem = nil;
end
if ( GameTooltip:IsOwned(button) ) then
if ( texture ) then
if ( not GameTooltip:SetInventoryItem(InspectFrame.unit, button:GetID()) ) then
GameTooltip:SetText(_G[strupper(strsub(button:GetName(), 8))]);
end
else
GameTooltip:Hide();
end
end
end
@@ -0,0 +1,352 @@
<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="InspectPaperDollFrame.lua"/>
<Button name="InspectPaperDollItemSlotButtonTemplate" inherits="ItemButtonTemplate" virtual="true">
<Scripts>
<OnLoad>
InspectPaperDollItemSlotButton_OnLoad(self);
</OnLoad>
<OnEvent>
InspectPaperDollItemSlotButton_OnEvent(self, event, ...);
</OnEvent>
<OnClick>
HandleModifiedItemClick(GetInventoryItemLink(InspectFrame.unit, self:GetID()));
</OnClick>
<OnUpdate>
CursorOnUpdate(self);
if ( GameTooltip:IsOwned(self) ) then
InspectPaperDollItemSlotButton_OnEnter(self);
end
</OnUpdate>
<OnEnter>
InspectPaperDollItemSlotButton_OnEnter(self, motion);
</OnEnter>
<OnLeave>
GameTooltip:Hide();
ResetCursor();
</OnLeave>
</Scripts>
<NormalTexture file="Interface\Buttons\UI-Quickslot2">
<Size>
<AbsDimension x="64" y="64"/>
</Size>
<Anchors>
<Anchor point="CENTER">
<Offset>
<AbsDimension x="0" y="-1"/>
</Offset>
</Anchor>
</Anchors>
</NormalTexture>
</Button>
<Frame name="InspectPaperDollFrame" setAllPoints="true" parent="InspectFrame" id="1">
<Layers>
<Layer level="BACKGROUND">
<Texture file="Interface\PaperDollInfoFrame\UI-Character-CharacterTab-L1">
<Size>
<AbsDimension x="256" y="256"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT"/>
</Anchors>
</Texture>
<Texture file="Interface\PaperDollInfoFrame\UI-Character-CharacterTab-R1">
<Size>
<AbsDimension x="128" y="256"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="256" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<Texture file="Interface\PaperDollInfoFrame\UI-Character-CharacterTab-BottomLeft">
<Size>
<AbsDimension x="256" y="256"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="0" y="-256"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<Texture file="Interface\PaperDollInfoFrame\UI-Character-CharacterTab-BottomRight">
<Size>
<AbsDimension x="128" y="256"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="256" y="-256"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<FontString name="InspectLevelText" inherits="GameFontNormalSmall" text="Level level race class">
<Anchors>
<Anchor point="TOP" relativeTo="InspectNameText" relativePoint="BOTTOM">
<Offset>
<AbsDimension x="0" y="-6"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="InspectTitleText" inherits="GameFontNormalSmall" text="title of the player" hidden="true">
<Anchors>
<Anchor point="TOP" relativeTo="InspectLevelText" relativePoint="BOTTOM">
<Offset>
<AbsDimension x="0" y="-1"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="InspectGuildText" inherits="GameFontNormalSmall" text="title of guild" hidden="true">
<Anchors>
<Anchor point="TOP" relativeTo="InspectTitleText" relativePoint="BOTTOM">
<Offset>
<AbsDimension x="0" y="-1"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Frames>
<PlayerModel name="InspectModelFrame">
<Size>
<AbsDimension x="233" y="300"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="65" y="-78"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad function="InspectModelFrame_OnLoad"/>
<OnEvent>
self:RefreshUnit();
</OnEvent>
<OnUpdate function="InspectModelFrame_OnUpdate"/>
</Scripts>
<Frames>
<Button name="InspectModelRotateLeftButton">
<Size>
<AbsDimension x="35" y="35"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="InspectModelFrame" relativePoint="TOPLEFT"/>
</Anchors>
<Scripts>
<OnLoad>
self:RegisterForClicks("LeftButtonDown", "LeftButtonUp");
</OnLoad>
<OnClick function="InspectModelRotateLeftButton_OnClick"/>
</Scripts>
<NormalTexture file="Interface\Buttons\UI-RotationLeft-Button-Up"/>
<PushedTexture file="Interface\Buttons\UI-RotationLeft-Button-Down"/>
<HighlightTexture file="Interface\Buttons\ButtonHilight-Round" alphaMode="ADD"/>
</Button>
<Button name="InspectModelRotateRightButton">
<Size>
<AbsDimension x="35" y="35"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="InspectModelRotateLeftButton" relativePoint="TOPRIGHT"/>
</Anchors>
<Scripts>
<OnLoad>
self:RegisterForClicks("LeftButtonDown", "LeftButtonUp");
</OnLoad>
<OnClick function="InspectModelRotateRightButton_OnClick"/>
</Scripts>
<NormalTexture file="Interface\Buttons\UI-RotationRight-Button-Up"/>
<PushedTexture file="Interface\Buttons\UI-RotationRight-Button-Down"/>
<HighlightTexture file="Interface\Buttons\ButtonHilight-Round" alphaMode="ADD"/>
</Button>
</Frames>
</PlayerModel>
<Button name="InspectHeadSlot" inherits="InspectPaperDollItemSlotButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="21" y="-74"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="InspectNeckSlot" inherits="InspectPaperDollItemSlotButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="InspectHeadSlot" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-4"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="InspectShoulderSlot" inherits="InspectPaperDollItemSlotButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="InspectNeckSlot" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-4"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="InspectBackSlot" inherits="InspectPaperDollItemSlotButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="InspectShoulderSlot" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-4"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="InspectChestSlot" inherits="InspectPaperDollItemSlotButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="InspectBackSlot" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-4"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="InspectShirtSlot" inherits="InspectPaperDollItemSlotButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="InspectChestSlot" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-4"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="InspectTabardSlot" inherits="InspectPaperDollItemSlotButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="InspectShirtSlot" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-4"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="InspectWristSlot" inherits="InspectPaperDollItemSlotButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="InspectTabardSlot" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-4"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="InspectHandsSlot" inherits="InspectPaperDollItemSlotButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="305" y="-74"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="InspectWaistSlot" inherits="InspectPaperDollItemSlotButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="InspectHandsSlot" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-4"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="InspectLegsSlot" inherits="InspectPaperDollItemSlotButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="InspectWaistSlot" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-4"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="InspectFeetSlot" inherits="InspectPaperDollItemSlotButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="InspectLegsSlot" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-4"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="InspectFinger0Slot" inherits="InspectPaperDollItemSlotButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="InspectFeetSlot" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-4"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="InspectFinger1Slot" inherits="InspectPaperDollItemSlotButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="InspectFinger0Slot" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-4"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="InspectTrinket0Slot" inherits="InspectPaperDollItemSlotButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="InspectFinger1Slot" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-4"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="InspectTrinket1Slot" inherits="InspectPaperDollItemSlotButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="InspectTrinket0Slot" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-4"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="InspectMainHandSlot" inherits="InspectPaperDollItemSlotButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="122" y="127"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="InspectSecondaryHandSlot" inherits="InspectPaperDollItemSlotButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="InspectMainHandSlot" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="5" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="InspectRangedSlot" inherits="InspectPaperDollItemSlotButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="InspectSecondaryHandSlot" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="5" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Button>
</Frames>
<Scripts>
<OnLoad function="InspectPaperDollFrame_OnLoad"/>
<OnEvent function="InspectPaperDollFrame_OnEvent"/>
<OnShow function="InspectPaperDollFrame_OnShow"/>
</Scripts>
</Frame>
</Ui>
@@ -0,0 +1,151 @@
local talentSpecInfoCache = {};
function InspectTalentFrameTalent_OnClick(self, button)
if ( IsModifiedClick("CHATLINK") ) then
local link = GetTalentLink(PanelTemplates_GetSelectedTab(InspectTalentFrame), self:GetID(),
InspectTalentFrame.inspect, InspectTalentFrame.pet, InspectTalentFrame.talentGroup);
if ( link ) then
ChatEdit_InsertLink(link);
end
end
end
function InspectTalentFrameTalent_OnEvent(self, event, ...)
if ( GameTooltip:IsOwned(self) ) then
GameTooltip:SetTalent(PanelTemplates_GetSelectedTab(InspectTalentFrame), self:GetID(),
InspectTalentFrame.inspect, InspectTalentFrame.pet, InspectTalentFrame.talentGroup);
end
end
function InspectTalentFrameTalent_OnEnter(self)
GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
GameTooltip:SetTalent(PanelTemplates_GetSelectedTab(InspectTalentFrame), self:GetID(),
InspectTalentFrame.inspect, InspectTalentFrame.pet, InspectTalentFrame.talentGroup);
end
function InspectTalentFrame_UpdateTabs()
local numTabs = GetNumTalentTabs(InspectTalentFrame.inspect, InspectTalentFrame.pet);
local selectedTab = PanelTemplates_GetSelectedTab(InspectTalentFrame);
local tab;
for i = 1, MAX_TALENT_TABS do
tab = _G["InspectTalentFrameTab"..i];
if ( tab ) then
talentSpecInfoCache[i] = talentSpecInfoCache[i] or { };
if ( i <= numTabs ) then
local name, icon, pointsSpent, background, previewPointsSpent = GetTalentTabInfo(i, InspectTalentFrame.inspect, InspectTalentFrame.pet, InspectTalentFrame.talentGroup);
if ( i == selectedTab ) then
-- If tab is the selected tab set the points spent info
local displayPointsSpent = pointsSpent + previewPointsSpent;
InspectTalentFrameSpentPointsText:SetFormattedText(MASTERY_POINTS_SPENT, name, HIGHLIGHT_FONT_COLOR_CODE..displayPointsSpent..FONT_COLOR_CODE_CLOSE);
InspectTalentFrame.pointsSpent = pointsSpent;
InspectTalentFrame.previewPointsSpent = previewPointsSpent;
end
tab:SetText(name);
PanelTemplates_TabResize(tab, -10);
tab:Show();
else
tab:Hide();
talentSpecInfoCache[i].name = nil;
end
end
end
end
function InspectTalentFrame_Update()
-- update spec info first
TalentFrame_UpdateSpecInfoCache(talentSpecInfoCache, InspectTalentFrame.inspect, InspectTalentFrame.pet, InspectTalentFrame.talentGroup);
-- update tabs
-- select a tab if one is not already selected
if ( not PanelTemplates_GetSelectedTab(InspectTalentFrame) ) then
-- if there is a primary tab then we'll prefer that one
if ( talentSpecInfoCache.primaryTabIndex > 0 ) then
PanelTemplates_SetTab(InspectTalentFrame, talentSpecInfoCache.primaryTabIndex);
else
PanelTemplates_SetTab(InspectTalentFrame, DEFAULT_TALENT_TAB);
end
end
InspectTalentFrame_UpdateTabs();
-- update parent tabs
PanelTemplates_UpdateTabs(InspectFrame);
end
function InspectTalentFrame_Refresh()
InspectTalentFrame.talentGroup = GetActiveTalentGroup(InspectTalentFrame.inspect);
InspectTalentFrame.unit = InspectFrame.unit;
TalentFrame_Update(InspectTalentFrame);
end
function InspectTalentFrame_OnLoad(self)
self.updateFunction = InspectTalentFrame_Update;
self.inspect = true;
self.pet = false;
self.talentGroup = 1;
TalentFrame_Load(self);
local button;
for i = 1, MAX_NUM_TALENTS do
button = _G["InspectTalentFrameTalent"..i];
if ( button ) then
button:SetScript("OnClick", InspectTalentFrameTalent_OnClick);
button:SetScript("OnEvent", InspectTalentFrameTalent_OnEvent);
button:SetScript("OnEnter", InspectTalentFrameTalent_OnEnter);
end
end
-- setup tabs
PanelTemplates_SetNumTabs(self, MAX_TALENT_TABS);
PanelTemplates_UpdateTabs(self);
end
function InspectTalentFrame_OnShow()
InspectTalentFrame:RegisterEvent("INSPECT_TALENT_READY");
InspectTalentFrame_Refresh();
end
function InspectTalentFrame_OnHide()
InspectTalentFrame:UnregisterEvent("INSPECT_TALENT_READY");
wipe(talentSpecInfoCache);
end
function InspectTalentFrame_OnEvent(self, event, ...)
if ( event == "INSPECT_TALENT_READY" ) then
InspectTalentFrame_Refresh();
end
end
function InspectTalentFrameDownArrow_OnClick(self)
local parent = self:GetParent();
parent:SetValue(parent:GetValue() + (parent:GetHeight() / 2));
PlaySound("UChatScrollButton");
UIFrameFlashStop(InspectTalentFrameScrollButtonOverlay);
end
function InspectTalentFramePointsBar_OnEnter(self)
GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
GameTooltip:AddLine(TALENT_POINTS);
local pointsColor;
for index, info in ipairs(talentSpecInfoCache) do
if ( info.name ) then
if ( talentSpecInfoCache.primaryTabIndex == index ) then
pointsColor = GREEN_FONT_COLOR;
else
pointsColor = HIGHLIGHT_FONT_COLOR;
end
GameTooltip:AddDoubleLine(
info.name,
info.pointsSpent,
HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b,
pointsColor.r, pointsColor.g, pointsColor.b,
1
);
end
end
GameTooltip:Show();
end
@@ -0,0 +1,453 @@
<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="InspectTalentFrame.lua"/>
<Frame name="InspectTalentFrame" setAllPoints="true" enableMouse="true" parent="InspectFrame" hidden="true" id="4">
<HitRectInsets>
<AbsInset left="0" right="30" top="0" bottom="45"/>
</HitRectInsets>
<Layers>
<Layer level="BACKGROUND">
<Texture name="InspectTalentFramePortrait">
<Size>
<AbsDimension x="60" y="60"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="7" y="-6"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
</Layer>
<Layer level="BORDER">
<Texture file="Interface\PaperDollInfoFrame\UI-Character-General-TopLeft">
<Size>
<AbsDimension x="256" y="256"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="2" y="-1"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<Texture file="Interface\PaperDollInfoFrame\UI-Character-General-TopRight">
<Size>
<AbsDimension x="128" y="256"/>
</Size>
<Anchors>
<Anchor point="TOPRIGHT">
<Offset>
<AbsDimension x="2" y="-1"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<Texture file="Interface\PaperDollInfoFrame\UI-Character-General-BottomLeft">
<Size>
<AbsDimension x="256" y="256"/>
</Size>
<Anchors>
<Anchor point="BOTTOMLEFT">
<Offset>
<AbsDimension x="2" y="-1"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<Texture file="Interface\PaperDollInfoFrame\UI-Character-General-BottomRight">
<Size>
<AbsDimension x="128" y="256"/>
</Size>
<Anchors>
<Anchor point="BOTTOMRIGHT">
<Offset>
<AbsDimension x="2" y="-1"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
</Layer>
<Layer level="ARTWORK">
<Texture name="InspectTalentFrameBackgroundTopLeft">
<Size>
<AbsDimension x="256" y="256"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="23" y="-77"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<Texture name="InspectTalentFrameBackgroundTopRight">
<Size>
<AbsDimension x="64" y="256"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="InspectTalentFrameBackgroundTopLeft" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<Texture name="InspectTalentFrameBackgroundBottomLeft">
<Size>
<AbsDimension x="256" y="128"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="InspectTalentFrameBackgroundTopLeft" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<Texture name="InspectTalentFrameBackgroundBottomRight">
<Size>
<AbsDimension x="64" y="128"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="InspectTalentFrameBackgroundTopLeft" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
</Layer>
</Layers>
<Frames>
<Button name="$parentTab1" inherits="TabButtonTemplate" text="OK" id="1">
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="70" y="-40"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
PanelTemplates_Tab_OnClick(self, InspectTalentFrame);
InspectTalentFrame_Update();
TalentFrame_Update(InspectTalentFrame);
PlaySound("igMainMenuOptionCheckBoxOn");
</OnClick>
</Scripts>
</Button>
<Button name="$parentTab2" inherits="TabButtonTemplate" text="OK" id="2">
<Anchors>
<Anchor point="LEFT" relativeTo="$parentTab1" relativePoint="RIGHT"/>
</Anchors>
<Scripts>
<OnClick>
PanelTemplates_Tab_OnClick(self, InspectTalentFrame);
InspectTalentFrame_Update();
TalentFrame_Update(InspectTalentFrame);
PlaySound("igMainMenuOptionCheckBoxOn");
</OnClick>
</Scripts>
</Button>
<Button name="$parentTab3" inherits="TabButtonTemplate" text="OK" id="3">
<Anchors>
<Anchor point="LEFT" relativeTo="$parentTab2" relativePoint="RIGHT"/>
</Anchors>
<Scripts>
<OnClick>
PanelTemplates_Tab_OnClick(self, InspectTalentFrame);
InspectTalentFrame_Update();
TalentFrame_Update(InspectTalentFrame);
PlaySound("igMainMenuOptionCheckBoxOn");
</OnClick>
</Scripts>
</Button>
<Button name="InspectTalentFrameCloseButton" inherits="UIPanelCloseButton">
<Anchors>
<Anchor point="CENTER" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="-44" y="-25"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Frame name="InspectTalentFramePointsBar">
<Size x="331" y="26"/>
<Anchors>
<Anchor point="LEFT">
<Offset x="16" y="0"/>
</Anchor>
<Anchor point="RIGHT">
<Offset x="-36" y="0"/>
</Anchor>
<Anchor point="BOTTOM">
<Offset x="0" y="81"/>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture name="$parentBackground" file="Interface\Buttons\UI-Button-Borders2" setAllPoints="true">
<Size x="331" y="26"/>
<TexCoords left="0.0" right="0.646484375" top="0.2109375" bottom="0.4140625"/>
</Texture>
</Layer>
<Layer level="BORDER">
<Texture name="$parentBorderLeft" file="Interface\Buttons\UI-Button-Borders2">
<Size x="6" y="18"/>
<Anchors>
<Anchor point="LEFT">
<Offset x="4" y="0"/>
</Anchor>
<Anchor point="TOP">
<Offset x="0" y="-5"/>
</Anchor>
<Anchor point="BOTTOM">
<Offset x="0" y="5"/>
</Anchor>
</Anchors>
<TexCoords left="0.0" right="0.01171875" top="0.421875" bottom="0.5625"/>
</Texture>
<Texture name="$parentBorderRight" file="Interface\Buttons\UI-Button-Borders2">
<Size x="6" y="18"/>
<Anchors>
<Anchor point="RIGHT">
<Offset x="-4" y="0"/>
</Anchor>
<Anchor point="TOP">
<Offset x="0" y="-5"/>
</Anchor>
<Anchor point="BOTTOM">
<Offset x="0" y="5"/>
</Anchor>
</Anchors>
<TexCoords left="0.3046875" right="0.31640625" top="0.421875" bottom="0.5625"/>
</Texture>
<Texture name="$parentBorderMiddle" file="Interface\Buttons\UI-Button-Borders2">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parentBorderLeft" relativePoint="TOPRIGHT"/>
<Anchor point="BOTTOMRIGHT" relativeTo="$parentBorderRight" relativePoint="BOTTOMLEFT"/>
</Anchors>
<TexCoords left="0.01171875" right="0.3046875" top="0.421875" bottom="0.5625"/>
</Texture>
</Layer>
<Layer level="ARTWORK">
<FontString name="InspectTalentFrameSpentPointsText" inherits="GameFontNormalSmall" justifyH="LEFT">
<Size x="0" y="15"/>
<Anchors>
<Anchor point="LEFT">
<Offset x="12" y="1"/>
</Anchor>
</Anchors>
</FontString>
<FontString name="InspectTalentFrameTalentPointsText" inherits="GameFontNormalSmall" justifyH="RIGHT">
<Size x="0" y="15"/>
<Anchors>
<Anchor point="RIGHT">
<Offset x="-12" y="1"/>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnEnter function="InspectTalentFramePointsBar_OnEnter"/>
<OnLeave function="GameTooltip_Hide"/>
</Scripts>
</Frame>
<ScrollFrame name="InspectTalentFrameScrollFrame" inherits="UIPanelScrollFrameTemplate">
<Size>
<AbsDimension x="296" y="332"/>
</Size>
<Anchors>
<Anchor point="TOPRIGHT">
<Offset>
<AbsDimension x="-65" y="-77"/>
</Offset>
</Anchor>
<Anchor point="BOTTOM" relativeTo="InspectTalentFramePointsBar" relativePoint="TOP">
<Offset x="0" y="0"/>
</Anchor>
</Anchors>
<Layers>
<Layer level="ARTWORK">
<Texture file="Interface\PaperDollInfoFrame\UI-Character-ScrollBar">
<Size>
<AbsDimension x="31" y="256"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="-2" y="5"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0" right="0.484375" top="0" bottom="1.0"/>
</Texture>
<Texture file="Interface\PaperDollInfoFrame\UI-Character-ScrollBar">
<Size>
<AbsDimension x="31" y="106"/>
</Size>
<Anchors>
<Anchor point="BOTTOMLEFT" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="-2" y="-2"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0.515625" right="1.0" top="0" bottom="0.4140625"/>
</Texture>
</Layer>
</Layers>
<ScrollChild>
<Frame name="InspectTalentFrameScrollChildFrame">
<Size>
<AbsDimension x="320" y="50"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT"/>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture name="InspectTalentFrameBranch1" inherits="TalentBranchTemplate"/>
<Texture name="InspectTalentFrameBranch2" inherits="TalentBranchTemplate"/>
<Texture name="InspectTalentFrameBranch3" inherits="TalentBranchTemplate"/>
<Texture name="InspectTalentFrameBranch4" inherits="TalentBranchTemplate"/>
<Texture name="InspectTalentFrameBranch5" inherits="TalentBranchTemplate"/>
<Texture name="InspectTalentFrameBranch6" inherits="TalentBranchTemplate"/>
<Texture name="InspectTalentFrameBranch7" inherits="TalentBranchTemplate"/>
<Texture name="InspectTalentFrameBranch8" inherits="TalentBranchTemplate"/>
<Texture name="InspectTalentFrameBranch9" inherits="TalentBranchTemplate"/>
<Texture name="InspectTalentFrameBranch10" inherits="TalentBranchTemplate"/>
<Texture name="InspectTalentFrameBranch11" inherits="TalentBranchTemplate"/>
<Texture name="InspectTalentFrameBranch12" inherits="TalentBranchTemplate"/>
<Texture name="InspectTalentFrameBranch13" inherits="TalentBranchTemplate"/>
<Texture name="InspectTalentFrameBranch14" inherits="TalentBranchTemplate"/>
<Texture name="InspectTalentFrameBranch15" inherits="TalentBranchTemplate"/>
<Texture name="InspectTalentFrameBranch16" inherits="TalentBranchTemplate"/>
<Texture name="InspectTalentFrameBranch17" inherits="TalentBranchTemplate"/>
<Texture name="InspectTalentFrameBranch18" inherits="TalentBranchTemplate"/>
<Texture name="InspectTalentFrameBranch19" inherits="TalentBranchTemplate"/>
<Texture name="InspectTalentFrameBranch20" inherits="TalentBranchTemplate"/>
<Texture name="InspectTalentFrameBranch21" inherits="TalentBranchTemplate"/>
<Texture name="InspectTalentFrameBranch22" inherits="TalentBranchTemplate"/>
<Texture name="InspectTalentFrameBranch23" inherits="TalentBranchTemplate"/>
<Texture name="InspectTalentFrameBranch24" inherits="TalentBranchTemplate"/>
<Texture name="InspectTalentFrameBranch25" inherits="TalentBranchTemplate"/>
<Texture name="InspectTalentFrameBranch26" inherits="TalentBranchTemplate"/>
<Texture name="InspectTalentFrameBranch27" inherits="TalentBranchTemplate"/>
<Texture name="InspectTalentFrameBranch28" inherits="TalentBranchTemplate"/>
<Texture name="InspectTalentFrameBranch29" inherits="TalentBranchTemplate"/>
<Texture name="InspectTalentFrameBranch30" inherits="TalentBranchTemplate"/>
</Layer>
</Layers>
<Frames>
<Button name="InspectTalentFrameTalent1" inherits="TalentButtonTemplate" id="1"/>
<Button name="InspectTalentFrameTalent2" inherits="TalentButtonTemplate" id="2"/>
<Button name="InspectTalentFrameTalent3" inherits="TalentButtonTemplate" id="3"/>
<Button name="InspectTalentFrameTalent4" inherits="TalentButtonTemplate" id="4"/>
<Button name="InspectTalentFrameTalent5" inherits="TalentButtonTemplate" id="5"/>
<Button name="InspectTalentFrameTalent6" inherits="TalentButtonTemplate" id="6"/>
<Button name="InspectTalentFrameTalent7" inherits="TalentButtonTemplate" id="7"/>
<Button name="InspectTalentFrameTalent8" inherits="TalentButtonTemplate" id="8"/>
<Button name="InspectTalentFrameTalent9" inherits="TalentButtonTemplate" id="9"/>
<Button name="InspectTalentFrameTalent10" inherits="TalentButtonTemplate" id="10"/>
<Button name="InspectTalentFrameTalent11" inherits="TalentButtonTemplate" id="11"/>
<Button name="InspectTalentFrameTalent12" inherits="TalentButtonTemplate" id="12"/>
<Button name="InspectTalentFrameTalent13" inherits="TalentButtonTemplate" id="13"/>
<Button name="InspectTalentFrameTalent14" inherits="TalentButtonTemplate" id="14"/>
<Button name="InspectTalentFrameTalent15" inherits="TalentButtonTemplate" id="15"/>
<Button name="InspectTalentFrameTalent16" inherits="TalentButtonTemplate" id="16"/>
<Button name="InspectTalentFrameTalent17" inherits="TalentButtonTemplate" id="17"/>
<Button name="InspectTalentFrameTalent18" inherits="TalentButtonTemplate" id="18"/>
<Button name="InspectTalentFrameTalent19" inherits="TalentButtonTemplate" id="19"/>
<Button name="InspectTalentFrameTalent20" inherits="TalentButtonTemplate" id="20"/>
<Button name="InspectTalentFrameTalent21" inherits="TalentButtonTemplate" id="21"/>
<Button name="InspectTalentFrameTalent22" inherits="TalentButtonTemplate" id="22"/>
<Button name="InspectTalentFrameTalent23" inherits="TalentButtonTemplate" id="23"/>
<Button name="InspectTalentFrameTalent24" inherits="TalentButtonTemplate" id="24"/>
<Button name="InspectTalentFrameTalent25" inherits="TalentButtonTemplate" id="25"/>
<Button name="InspectTalentFrameTalent26" inherits="TalentButtonTemplate" id="26"/>
<Button name="InspectTalentFrameTalent27" inherits="TalentButtonTemplate" id="27"/>
<Button name="InspectTalentFrameTalent28" inherits="TalentButtonTemplate" id="28"/>
<Button name="InspectTalentFrameTalent29" inherits="TalentButtonTemplate" id="29"/>
<Button name="InspectTalentFrameTalent30" inherits="TalentButtonTemplate" id="30"/>
<Button name="InspectTalentFrameTalent31" inherits="TalentButtonTemplate" id="31"/>
<Button name="InspectTalentFrameTalent32" inherits="TalentButtonTemplate" id="32"/>
<Button name="InspectTalentFrameTalent33" inherits="TalentButtonTemplate" id="33"/>
<Button name="InspectTalentFrameTalent34" inherits="TalentButtonTemplate" id="34"/>
<Button name="InspectTalentFrameTalent35" inherits="TalentButtonTemplate" id="35"/>
<Button name="InspectTalentFrameTalent36" inherits="TalentButtonTemplate" id="36"/>
<Button name="InspectTalentFrameTalent37" inherits="TalentButtonTemplate" id="37"/>
<Button name="InspectTalentFrameTalent38" inherits="TalentButtonTemplate" id="38"/>
<Button name="InspectTalentFrameTalent39" inherits="TalentButtonTemplate" id="39"/>
<Button name="InspectTalentFrameTalent40" inherits="TalentButtonTemplate" id="40"/>
<Frame name="InspectTalentFrameArrowFrame" setAllPoints="true">
<Layers>
<Layer level="OVERLAY">
<Texture name="InspectTalentFrameArrow1" inherits="TalentArrowTemplate"/>
<Texture name="InspectTalentFrameArrow2" inherits="TalentArrowTemplate"/>
<Texture name="InspectTalentFrameArrow3" inherits="TalentArrowTemplate"/>
<Texture name="InspectTalentFrameArrow4" inherits="TalentArrowTemplate"/>
<Texture name="InspectTalentFrameArrow5" inherits="TalentArrowTemplate"/>
<Texture name="InspectTalentFrameArrow6" inherits="TalentArrowTemplate"/>
<Texture name="InspectTalentFrameArrow7" inherits="TalentArrowTemplate"/>
<Texture name="InspectTalentFrameArrow8" inherits="TalentArrowTemplate"/>
<Texture name="InspectTalentFrameArrow9" inherits="TalentArrowTemplate"/>
<Texture name="InspectTalentFrameArrow10" inherits="TalentArrowTemplate"/>
<Texture name="InspectTalentFrameArrow11" inherits="TalentArrowTemplate"/>
<Texture name="InspectTalentFrameArrow12" inherits="TalentArrowTemplate"/>
<Texture name="InspectTalentFrameArrow13" inherits="TalentArrowTemplate"/>
<Texture name="InspectTalentFrameArrow14" inherits="TalentArrowTemplate"/>
<Texture name="InspectTalentFrameArrow15" inherits="TalentArrowTemplate"/>
<Texture name="InspectTalentFrameArrow16" inherits="TalentArrowTemplate"/>
<Texture name="InspectTalentFrameArrow17" inherits="TalentArrowTemplate"/>
<Texture name="InspectTalentFrameArrow18" inherits="TalentArrowTemplate"/>
<Texture name="InspectTalentFrameArrow19" inherits="TalentArrowTemplate"/>
<Texture name="InspectTalentFrameArrow20" inherits="TalentArrowTemplate"/>
<Texture name="InspectTalentFrameArrow21" inherits="TalentArrowTemplate"/>
<Texture name="InspectTalentFrameArrow22" inherits="TalentArrowTemplate"/>
<Texture name="InspectTalentFrameArrow23" inherits="TalentArrowTemplate"/>
<Texture name="InspectTalentFrameArrow24" inherits="TalentArrowTemplate"/>
<Texture name="InspectTalentFrameArrow25" inherits="TalentArrowTemplate"/>
<Texture name="InspectTalentFrameArrow26" inherits="TalentArrowTemplate"/>
<Texture name="InspectTalentFrameArrow27" inherits="TalentArrowTemplate"/>
<Texture name="InspectTalentFrameArrow28" inherits="TalentArrowTemplate"/>
<Texture name="InspectTalentFrameArrow29" inherits="TalentArrowTemplate"/>
<Texture name="InspectTalentFrameArrow30" inherits="TalentArrowTemplate"/>
</Layer>
</Layers>
</Frame>
</Frames>
</Frame>
</ScrollChild>
</ScrollFrame>
<Frame name="InspectTalentFrameScrollButtonOverlay" parent="InspectTalentFrameScrollFrameScrollBarScrollDownButton" hidden="true">
<Size>
<AbsDimension x="32" y="32"/>
</Size>
<Anchors>
<Anchor point="CENTER">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="OVERLAY">
<Texture file="Interface\Buttons\UI-ScrollBar-Button-Overlay" setAllPoints="true" alphaMode="ADD"/>
</Layer>
</Layers>
</Frame>
</Frames>
<Scripts>
<OnShow function="InspectTalentFrame_OnShow"/>
<OnHide function="InspectTalentFrame_OnHide"/>
<OnLoad function="InspectTalentFrame_OnLoad"/>
<OnEvent function="InspectTalentFrame_OnEvent"/>
</Scripts>
</Frame>
</Ui>
@@ -0,0 +1 @@
-- This file is executed at the end of addon load
@@ -0,0 +1,229 @@
UIPanelWindows["ItemSocketingFrame"] = { area = "left", pushable = 0 };
GEM_TYPE_INFO = {};
GEM_TYPE_INFO["Yellow"] = {w=43, h=43, left=0, right=0.16796875, top=0.640625, bottom=0.80859375, r=0.97, g=0.82, b=0.29, CBLeft=0.5546875, CBRight=0.7578125, CBTop=0, CBBottom=0.20703125, OBLeft=0.7578125, OBRight=0.9921875, OBTop=0, OBBottom=0.22265625};
GEM_TYPE_INFO["Red"] = {w=43, h=43, left=0.1796875, right=0.34375, top=0.640625, bottom=0.80859375, r=1, g=0.47, b=0.47, CBLeft=0.5546875, CBRight=0.7578125, CBTop=0.4765625, CBBottom=0.68359375, OBLeft=0.7578125, OBRight=0.9921875, OBTop=0.4765625, OBBottom=0.69921875};
GEM_TYPE_INFO["Blue"] = {w=43, h=43, left=0.3515625, right=0.51953125, top=0.640625, bottom=0.80859375, r=0.47, g=0.67, b=1, CBLeft=0.5546875, CBRight=0.7578125, CBTop=0.23828125, CBBottom=0.4453125, OBLeft=0.7578125, OBRight=0.9921875, OBTop=0.23828125, OBBottom=0.4609375};
GEM_TYPE_INFO["Meta"] = {w=57, h=52, left=0.171875, right=0.3984375, top=0.40234375, bottom=0.609375, r=1, g=1, b=1, CBLeft=0.5546875, CBRight=0.7578125, CBTop=0, CBBottom=0.20703125, OBLeft=0.7578125, OBRight=0.9921875, OBTop=0, OBBottom=0.22265625};
GEM_TYPE_INFO["Socket"] = {w=57, h=52, left=0.171875, right=0.3984375, top=0.40234375, bottom=0.609375, r=1, g=1, b=1, CBLeft=0.5546875, CBRight=0.7578125, CBTop=0, CBBottom=0.20703125, OBLeft=0.7578125, OBRight=0.9921875, OBTop=0, OBBottom=0.22265625};
ITEM_SOCKETING_DESCRIPTION_MIN_WIDTH = 240;
function ItemSocketingFrame_OnLoad(self)
self:RegisterEvent("SOCKET_INFO_UPDATE");
self:RegisterEvent("SOCKET_INFO_CLOSE");
ItemSocketingScrollFrameScrollBarScrollUpButton:SetPoint("BOTTOM", ItemSocketingScrollFrameScrollBar, "TOP", 0, 1);
ItemSocketingScrollFrameScrollBarScrollDownButton:SetPoint("TOP", ItemSocketingScrollFrameScrollBar, "BOTTOM", 0, -3);
ItemSocketingScrollFrameTop:SetPoint("TOP", ItemSocketingScrollFrameScrollBarScrollUpButton, "TOP", -2, 3);
ItemSocketingScrollFrameScrollBar:SetPoint("TOPLEFT", ItemSocketingScrollFrame, "TOPRIGHT", 7.9999995231628, -18);
ItemSocketingScrollFrameScrollBar:SetHeight(221);
ItemSocketingDescription:SetMinimumWidth(ITEM_SOCKETING_DESCRIPTION_MIN_WIDTH, 1);
end
function ItemSocketingFrame_OnEvent(self, event, ...)
if ( event == "SOCKET_INFO_UPDATE" ) then
ItemSocketingFrame_Update();
ItemSocketingFrame_LoadUI();
if ( not ItemSocketingFrame:IsShown() ) then
ShowUIPanel(ItemSocketingFrame);
end
elseif ( event == "SOCKET_INFO_CLOSE" ) then
HideUIPanel(ItemSocketingFrame);
end
end
function ItemSocketingFrame_Update()
ItemSocketingFrame.destroyingGem = nil;
ItemSocketingFrame.itemIsRefundable = nil;
ItemSocketingFrame.itemIsBoundTradeable = nil;
if(GetSocketItemRefundable()) then
ItemSocketingFrame.itemIsRefundable = true;
elseif(GetSocketItemBoundTradeable()) then
ItemSocketingFrame.itemIsBoundTradeable = true;
end
local numSockets = GetNumSockets();
local name, icon, quality, gemMatchesSocket;
local socket, socketName;
local numNewGems = numSockets;
local closedBracket, openBracket;
local bracketsOpen, gemColor, gemBorder, gemColorText, gemInfo;
local numMatches = 0;
for i=1, MAX_NUM_SOCKETS do
socket = _G["ItemSocketingSocket"..i];
socketName = "ItemSocketingSocket"..i;
closedBracket = _G[socketName.."BracketFrameClosedBracket"];
openBracket = _G[socketName.."BracketFrameOpenBracket"];
if ( i <= numSockets ) then
-- See if there's a replacement gem and if not see if there's an existing gem
name, icon, gemMatchesSocket = GetNewSocketInfo(i);
bracketsOpen = 1;
if ( not name ) then
name, icon, gemMatchesSocket = GetExistingSocketInfo(i);
if ( icon ) then
bracketsOpen = nil;
end
-- Count down new gems if there's no name
numNewGems = numNewGems - 1;
elseif ( GetExistingSocketInfo(i) ) then
ItemSocketingFrame.destroyingGem = 1;
end
--Handle one color only right now
gemColor = GetSocketTypes(i);
if ( gemMatchesSocket ) then
local color = GEM_TYPE_INFO[gemColor];
AnimatedShine_Start(socket, color.r, color.g, color.b);
numMatches = numMatches + 1;
else
AnimatedShine_Stop(socket);
end
if ( bracketsOpen ) then
-- Show open brackets
closedBracket:Hide();
openBracket:Show();
else
-- Show closed brackets
closedBracket:Show();
openBracket:Hide();
end
if ( gemColor ~= "" ) then
gemInfo = GEM_TYPE_INFO[gemColor];
gemBorder = _G[socketName.."Background"]
gemBorder:SetWidth(gemInfo.w);
gemBorder:SetHeight(gemInfo.h);
gemBorder:SetTexCoord(gemInfo.left, gemInfo.right, gemInfo.top, gemInfo.bottom);
gemBorder:Show();
if ( gemColor == "Meta" ) then
-- Special stuff for meta gem sockets
SetDesaturation(openBracket, 1);
SetDesaturation(closedBracket, 1);
openBracket:SetTexCoord(gemInfo.OBLeft, gemInfo.OBRight, gemInfo.OBTop, gemInfo.OBBottom);
closedBracket:SetTexCoord(gemInfo.CBLeft, gemInfo.CBRight, gemInfo.CBTop, gemInfo.CBBottom);
else
SetDesaturation(openBracket, nil);
SetDesaturation(closedBracket, nil);
openBracket:SetTexCoord(gemInfo.OBLeft, gemInfo.OBRight, gemInfo.OBTop, gemInfo.OBBottom);
closedBracket:SetTexCoord(gemInfo.CBLeft, gemInfo.CBRight, gemInfo.CBTop, gemInfo.CBBottom);
end
if ( ENABLE_COLORBLIND_MODE == "1" ) then
gemColorText = _G[socketName.."Color"];
gemColorText:SetText(_G[strupper(gemColor) .. "_GEM"]);
gemColorText:Show();
else
_G[socketName.."Color"]:Hide();
end
else
gemBorder:Hide();
end
SetItemButtonTexture(socket, icon);
socket:Show();
else
socket:Hide();
end
end
-- Playsound if all sockets are matched
if ( numMatches == numsockets ) then
-- Will probably need a new sound
PlaySound("MapPing");
end
-- Position the sockets and show/hide the border graphics
if ( numSockets == 3 ) then
ItemSocketingSocket1Right:Hide();
ItemSocketingSocket2Left:Show();
ItemSocketingSocket2Right:Hide();
ItemSocketingSocket3Left:Show();
ItemSocketingSocket3Right:Show();
ItemSocketingSocket1:SetPoint("BOTTOM", ItemSocketingFrame, "BOTTOM", -75, 62);
elseif ( numSockets == 2 ) then
ItemSocketingSocket1Right:Hide();
ItemSocketingSocket2Left:Show();
ItemSocketingSocket2Right:Show();
ItemSocketingSocket1:SetPoint("BOTTOM", ItemSocketingFrame, "BOTTOM", -35, 62);
else
ItemSocketingSocket1:SetPoint("BOTTOM", ItemSocketingFrame, "BOTTOM", 0, 62);
ItemSocketingSocket1Right:Show();
end
-- Set portrait
name, icon, quality = GetSocketItemInfo();
SetPortraitToTexture("ItemSocketingFramePortrait", icon);
-- see if has a scrollbar and resize accordingly
local scrollBarOffset = 28;
if ( ItemSocketingScrollFrame:GetVerticalScrollRange() ~= 0 ) then
scrollBarOffset = 0;
end
ItemSocketingScrollFrame:SetWidth(269+scrollBarOffset);
ItemSocketingDescription:SetMinimumWidth(ITEM_SOCKETING_DESCRIPTION_MIN_WIDTH+scrollBarOffset, 1);
-- Owner needs to be set everytime since it is cleared everytime the tooltip is hidden
ItemSocketingDescription:SetOwner(ItemSocketingScrollChild, "ANCHOR_PRESERVE");
ItemSocketingDescription:SetSocketedItem();
-- Update socket button
if ( numNewGems == 0 ) then
ItemSocketingSocketButton_Disable();
else
ItemSocketingSocketButton_Enable();
end
end
function ItemSocketingSocketButton_OnScrollRangeChanged()
-- see if has a scrollbar and resize accordingly
local scrollBarOffset = 28;
if ( ItemSocketingScrollFrame:GetVerticalScrollRange() ~= 0 ) then
scrollBarOffset = 0;
end
ItemSocketingScrollFrame:SetWidth(269+scrollBarOffset);
ItemSocketingDescription:SetMinimumWidth(ITEM_SOCKETING_DESCRIPTION_MIN_WIDTH+scrollBarOffset, 1);
ItemSocketingDescription:SetSocketedItem();
end
function ItemSocketingSocketButton_OnEnter(self)
local newSocket = GetNewSocketInfo(self:GetID());
local existingSocket = GetExistingSocketInfo(self:GetID());
GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
if ( newSocket ) then
GameTooltip:SetSocketGem(self:GetID());
else
GameTooltip:SetExistingSocketGem(self:GetID());
end
if ( newSocket and existingSocket ) then
ShoppingTooltip1:SetOwner(GameTooltip, "ANCHOR_NONE");
ShoppingTooltip1:ClearAllPoints();
ShoppingTooltip1:SetPoint("TOPLEFT", "GameTooltip", "TOPRIGHT", 0, -10);
ShoppingTooltip1:SetExistingSocketGem(self:GetID(), 1);
ShoppingTooltip1:Show();
end
end
function ItemSocketingSocketButton_OnEvent(self, event, ...)
if ( event == "SOCKET_INFO_UPDATE" ) then
if ( GameTooltip:IsOwned(self) ) then
ItemSocketingSocketButton_OnEnter(self);
end
end
end
function ItemSocketingSocketButton_Disable()
ItemSocketingSocketButton.disabled = 1;
ItemSocketingSocketButton:Disable();
ItemSocketingSocketButtonLeft:SetTexture("Interface\\Buttons\\UI-Panel-Button-Disabled");
ItemSocketingSocketButtonMiddle:SetTexture("Interface\\Buttons\\UI-Panel-Button-Disabled");
ItemSocketingSocketButtonRight:SetTexture("Interface\\Buttons\\UI-Panel-Button-Disabled");
end
function ItemSocketingSocketButton_Enable()
ItemSocketingSocketButton.disabled = nil;
ItemSocketingSocketButton:Enable();
ItemSocketingSocketButtonLeft:SetTexture("Interface\\Buttons\\UI-Panel-Button-Up");
ItemSocketingSocketButtonMiddle:SetTexture("Interface\\Buttons\\UI-Panel-Button-Up");
ItemSocketingSocketButtonRight:SetTexture("Interface\\Buttons\\UI-Panel-Button-Up");
end
@@ -0,0 +1,6 @@
## Interface: 30300
## Title: Blizzard Item Socketing UI
## Secure: 1
## LoadOnDemand: 1
Blizzard_ItemSocketingUI.xml
Localization.lua
@@ -0,0 +1,461 @@
<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="Blizzard_ItemSocketingUI.lua"/>
<Button name="ItemSocketingSocketButtonTemplate" virtual="true">
<Size>
<AbsDimension x="40" y="40"/>
</Size>
<Layers>
<Layer level="BACKGROUND">
<Texture name="$parentRight" file="Interface\ItemSocketingFrame\UI-ItemSockets">
<Size>
<AbsDimension x="73" y="55"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativePoint="CENTER">
<Offset>
<AbsDimension x="5" y="5"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0.28515625" right="0.5703125" top="0" bottom="0.21484375"/>
</Texture>
</Layer>
<Layer level="BORDER">
<Texture file="Interface\ItemSocketingFrame\UI-ItemSockets">
<Size>
<AbsDimension x="72" y="74"/>
</Size>
<Anchors>
<Anchor point="CENTER">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0.71875" right="1" top="0.7109375" bottom="1"/>
</Texture>
<Texture name="$parentBackground" file="Interface\ItemSocketingFrame\UI-ItemSockets">
<Size>
<AbsDimension x="43" y="44"/>
</Size>
<Anchors>
<Anchor point="CENTER">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
</Layer>
<Layer level="ARTWORK">
<Texture name="$parentIconTexture">
<Size x="38" y="38"/>
<Anchors>
<Anchor point="CENTER">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<!--<Texture name="$parentBorder" file="Interface\ItemSocketingFrame\UI-ItemSockets">
<Size>
<AbsDimension x="53" y="53"/>
</Size>
<Anchors>
<Anchor point="CENTER">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Texture>-->
</Layer>
<Layer level="OVERLAY">
<FontString name="$parentColor" inherits="TextStatusBarText" text="Color" hidden="true">
<Anchors>
<Anchor point="CENTER"/>
</Anchors>
</FontString>
</Layer>
</Layers>
<Frames>
<Frame name="$parentShine" inherits="AnimatedShineTemplate">
<Anchors>
<Anchor point="CENTER">
<Offset>
<AbsDimension x="-1" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="$parentBracketFrame" setAllPoints="true">
<Layers>
<Layer level="ARTWORK">
<Texture name="$parentClosedBracket" file="Interface\ItemSocketingFrame\UI-ItemSockets">
<Size>
<AbsDimension x="53" y="53"/>
</Size>
<Anchors>
<Anchor point="CENTER">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0.5546875" right="0.7578125" top="0" bottom="0.20703125"/>
</Texture>
<Texture name="$parentOpenBracket" file="Interface\ItemSocketingFrame\UI-ItemSockets">
<Size>
<AbsDimension x="61" y="57"/>
</Size>
<Anchors>
<Anchor point="CENTER">
<Offset>
<AbsDimension x="0" y="-1"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0.7578125" right="0.9921875" top="0" bottom="0.22265625"/>
</Texture>
</Layer>
</Layers>
</Frame>
</Frames>
<Scripts>
<OnLoad>
self:RegisterForDrag("LeftButton");
self:RegisterEvent("SOCKET_INFO_UPDATE");
</OnLoad>
<OnEvent>
ItemSocketingSocketButton_OnEvent(self, event, ...);
</OnEvent>
<OnClick>
if ( IsModifiedClick() ) then
local link = GetNewSocketLink(self:GetID()) or
GetExistingSocketLink(self:GetID());
HandleModifiedItemClick(link);
else
StaticPopup_Hide("DELETE_ITEM");
StaticPopup_Hide("DELETE_GOOD_ITEM");
ClickSocketButton(self:GetID());
end
</OnClick>
<OnReceiveDrag>
StaticPopup_Hide("DELETE_ITEM");
StaticPopup_Hide("DELETE_GOOD_ITEM");
ClickSocketButton(self:GetID());
</OnReceiveDrag>
<OnDragStart>
StaticPopup_Hide("DELETE_ITEM");
StaticPopup_Hide("DELETE_GOOD_ITEM");
ClickSocketButton(self:GetID());
</OnDragStart>
<OnEnter>
ItemSocketingSocketButton_OnEnter(self, motion);
</OnEnter>
<OnLeave>
GameTooltip:Hide();
ShoppingTooltip1:Hide();
</OnLeave>
</Scripts>
<NormalTexture file=""/>
<PushedTexture file="Interface\Buttons\UI-Quickslot-Depress"/>
<HighlightTexture file="Interface\Buttons\ButtonHilight-Square" alphaMode="ADD"/>
</Button>
<Frame name="ItemSocketingFrame" toplevel="true" parent="UIParent" enableMouse="true" hidden="true">
<Size>
<AbsDimension x="354" y="467"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="0" y="-104"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture name="ItemSocketingFramePortrait">
<Size>
<AbsDimension x="60" y="60"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="7" y="-6"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
</Layer>
<Layer level="BORDER">
<Texture file="Interface\ItemSocketingFrame\UI-ItemSocketingFrame">
<Size>
<AbsDimension x="512" y="512"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<FontString inherits="GameFontNormal" text="ITEM_SOCKETING">
<Anchors>
<Anchor point="TOP">
<Offset>
<AbsDimension x="15" y="-18"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Frames>
<ScrollFrame name="ItemSocketingScrollFrame" inherits="UIPanelScrollFrameTemplate">
<Size>
<AbsDimension x="269" y="255"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset x="32" y="-89"/>
</Anchor>
</Anchors>
<Layers>
<Layer level="ARTWORK">
<Texture name="$parentTop" file="Interface\ItemSocketingFrame\UI-ItemSocketingFrame-ScrollBar">
<Size>
<AbsDimension x="29" y="256"/>
</Size>
<Anchors>
<Anchor point="TOP"/>
</Anchors>
<TexCoords left="0" right="0.46875" top="0" bottom="1"/>
</Texture>
<Texture name="$parentBottom" file="Interface\ItemSocketingFrame\UI-ItemSocketingFrame-ScrollBar">
<Size>
<AbsDimension x="29" y="5"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parentTop" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0.53125" right="1" top="0" bottom="0.01953125"/>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnLoad>
self.scrollBarHideable = 1;
ScrollFrame_OnLoad(self);
ScrollFrame_OnScrollRangeChanged(self, 0, 0);
</OnLoad>
<OnScrollRangeChanged>
ScrollFrame_OnScrollRangeChanged(self, 0, yrange);
ItemSocketingSocketButton_OnScrollRangeChanged(self);
</OnScrollRangeChanged>
</Scripts>
<ScrollChild>
<Frame name="ItemSocketingScrollChild">
<Size>
<AbsDimension x="259" y="250"/>
</Size>
<Frames>
<GameTooltip name="ItemSocketingDescription" inherits="GameTooltipTemplate" setAllPoints="true" hidden="false">
<Scripts>
<OnLoad>
self:SetBackdrop(nil);
</OnLoad>
</Scripts>
</GameTooltip>
</Frames>
</Frame>
</ScrollChild>
</ScrollFrame>
<Button name="ItemSocketingSocket1" inherits="ItemSocketingSocketButtonTemplate" id="1">
<Anchors>
<Anchor point="BOTTOM">
<Offset>
<AbsDimension x="0" y="37"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture name="ItemSocketingSocket1Left" file="Interface\ItemSocketingFrame\UI-ItemSockets">
<Size>
<AbsDimension x="73" y="55"/>
</Size>
<Anchors>
<Anchor point="RIGHT" relativePoint="CENTER">
<Offset>
<AbsDimension x="-5" y="5"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0" right="0.28515625" top="0" bottom="0.21484375"/>
</Texture>
</Layer>
</Layers>
</Button>
<Button name="ItemSocketingSocket2" inherits="ItemSocketingSocketButtonTemplate" id="2">
<Anchors>
<Anchor point="LEFT" relativeTo="ItemSocketingSocket1" relativePoint="RIGHT">
<Offset>
<AbsDimension x="40" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture name="ItemSocketingSocket2Left" file="Interface\ItemSocketingFrame\UI-ItemSockets">
<Size>
<AbsDimension x="73" y="46"/>
</Size>
<Anchors>
<Anchor point="RIGHT" relativePoint="CENTER">
<Offset>
<AbsDimension x="-5" y="0"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0" right="0.28515625" top="0.21484375" bottom="0.39453125"/>
</Texture>
</Layer>
</Layers>
</Button>
<Button name="ItemSocketingSocket3" inherits="ItemSocketingSocketButtonTemplate" id="3">
<Anchors>
<Anchor point="LEFT" relativeTo="ItemSocketingSocket2" relativePoint="RIGHT">
<Offset>
<AbsDimension x="40" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture name="ItemSocketingSocket3Left" file="Interface\ItemSocketingFrame\UI-ItemSockets">
<Size>
<AbsDimension x="73" y="46"/>
</Size>
<Anchors>
<Anchor point="RIGHT" relativePoint="CENTER">
<Offset>
<AbsDimension x="-5" y="0"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0" right="0.28515625" top="0.21484375" bottom="0.39453125"/>
</Texture>
</Layer>
</Layers>
</Button>
<Button name="ItemSocketingSocketButton" text="SOCKET_GEMS">
<Size>
<AbsDimension x="162" y="22"/>
</Size>
<Anchors>
<Anchor point="BOTTOMRIGHT">
<Offset>
<AbsDimension x="-10" y="33"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture name="$parentLeft" file="Interface\Buttons\UI-Panel-Button-Up">
<Size>
<AbsDimension x="12" y="22"/>
</Size>
<Anchors>
<Anchor point="LEFT"/>
</Anchors>
<TexCoords left="0" right="0.09375" top="0" bottom="0.6875"/>
</Texture>
<Texture name="$parentRight" file="Interface\Buttons\UI-Panel-Button-Up">
<Size>
<AbsDimension x="12" y="22"/>
</Size>
<Anchors>
<Anchor point="RIGHT"/>
</Anchors>
<TexCoords left="0.53125" right="0.625" top="0" bottom="0.6875"/>
</Texture>
<Texture name="$parentMiddle" file="Interface\Buttons\UI-Panel-Button-Up">
<Size>
<AbsDimension x="12" y="22"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativeTo="$parentLeft" relativePoint="RIGHT"/>
<Anchor point="RIGHT" relativeTo="$parentRight" relativePoint="LEFT"/>
</Anchors>
<TexCoords left="0.09375" right="0.53125" top="0" bottom="0.6875"/>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnClick>
if( ItemSocketingFrame.itemIsRefundable) then
local dialog = StaticPopup_Show("END_REFUND");
if(dialog) then
dialog.data = 2;
end
elseif ( ItemSocketingFrame.itemIsBoundTradeable ) then
local dialog = StaticPopup_Show("END_BOUND_TRADEABLE", nil, nil, "gem");
elseif ( ItemSocketingFrame.destroyingGem ) then
StaticPopup_Show("CONFIRM_ACCEPT_SOCKETS");
else
AcceptSockets();
PlaySound("JewelcraftingFinalize");
end
</OnClick>
<OnMouseDown>
if ( not self.disabled ) then
_G[self:GetName().."Left"]:SetTexture("Interface\\Buttons\\UI-Panel-Button-Down");
_G[self:GetName().."Middle"]:SetTexture("Interface\\Buttons\\UI-Panel-Button-Down");
_G[self:GetName().."Right"]:SetTexture("Interface\\Buttons\\UI-Panel-Button-Down");
end
</OnMouseDown>
<OnMouseUp>
if ( not self.disabled ) then
_G[self:GetName().."Left"]:SetTexture("Interface\\Buttons\\UI-Panel-Button-Up");
_G[self:GetName().."Middle"]:SetTexture("Interface\\Buttons\\UI-Panel-Button-Up");
_G[self:GetName().."Right"]:SetTexture("Interface\\Buttons\\UI-Panel-Button-Up");
end
</OnMouseUp>
</Scripts>
<NormalFont style="GameFontNormal"/>
<DisabledFont style="GameFontDisable"/>
<HighlightFont style="GameFontHighlight"/>
<HighlightTexture inherits="UIPanelButtonHighlightTexture"/>
</Button>
<Button name="ItemSocketingCloseButton" inherits="UIPanelCloseButton">
<Anchors>
<Anchor point="TOPRIGHT" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="-1" y="-9"/>
</Offset>
</Anchor>
</Anchors>
</Button>
</Frames>
<Scripts>
<OnLoad function="ItemSocketingFrame_OnLoad"/>
<OnShow>
PlaySound("igCharacterInfoOpen");
</OnShow>
<OnEvent function="ItemSocketingFrame_OnEvent"/>
<OnHide>
PlaySound("igCharacterInfoClose");
StaticPopup_Hide("CONFIRM_ACCEPT_SOCKETS");
CloseSocketInfo();
</OnHide>
</Scripts>
</Frame>
</Ui>
@@ -0,0 +1 @@
-- This file is executed at the end of addon load
@@ -0,0 +1,353 @@
MAX_ACCOUNT_MACROS = 36;
MAX_CHARACTER_MACROS = 18;
NUM_MACROS_PER_ROW = 6;
NUM_MACRO_ICONS_SHOWN = 20;
NUM_ICONS_PER_ROW = 5;
NUM_ICON_ROWS = 4;
MACRO_ICON_ROW_HEIGHT = 36;
UIPanelWindows["MacroFrame"] = { area = "left", pushable = 5, whileDead = 1 };
function MacroFrame_Show()
ShowUIPanel(MacroFrame);
end
function MacroFrame_OnLoad(self)
MacroFrame_SetAccountMacros();
PanelTemplates_SetNumTabs(MacroFrame, 2);
PanelTemplates_SetTab(MacroFrame, 1);
end
function MacroFrame_OnShow(self)
MacroFrame_Update();
PlaySound("igCharacterInfoOpen");
UpdateMicroButtons();
end
function MacroFrame_OnHide(self)
MacroPopupFrame:Hide();
MacroFrame_SaveMacro();
--SaveMacros();
PlaySound("igCharacterInfoClose");
UpdateMicroButtons();
end
function MacroFrame_SetAccountMacros()
MacroFrame.macroBase = 0;
MacroFrame.macroMax = MAX_ACCOUNT_MACROS;
local numAccountMacros, numCharacterMacros = GetNumMacros();
if ( numAccountMacros > 0 ) then
MacroFrame_SelectMacro(MacroFrame.macroBase + 1);
else
MacroFrame_SelectMacro(nil);
end
end
function MacroFrame_SetCharacterMacros()
MacroFrame.macroBase = MAX_ACCOUNT_MACROS;
MacroFrame.macroMax = MAX_CHARACTER_MACROS;
local numAccountMacros, numCharacterMacros = GetNumMacros();
if ( numCharacterMacros > 0 ) then
MacroFrame_SelectMacro(MacroFrame.macroBase + 1);
else
MacroFrame_SelectMacro(nil);
end
end
function MacroFrame_Update()
local numMacros;
local numAccountMacros, numCharacterMacros = GetNumMacros();
local macroButtonName, macroButton, macroIcon, macroName;
local name, texture, body;
local selectedName, selectedBody, selectedIcon;
if ( MacroFrame.macroBase == 0 ) then
numMacros = numAccountMacros;
else
numMacros = numCharacterMacros;
end
-- Macro List
local maxMacroButtons = max(MAX_ACCOUNT_MACROS, MAX_CHARACTER_MACROS);
for i=1, maxMacroButtons do
macroButtonName = "MacroButton"..i;
macroButton = _G[macroButtonName];
macroIcon = _G[macroButtonName.."Icon"];
macroName = _G[macroButtonName.."Name"];
if ( i <= MacroFrame.macroMax ) then
if ( i <= numMacros ) then
name, texture, body = GetMacroInfo(MacroFrame.macroBase + i);
macroIcon:SetTexture(texture);
macroName:SetText(name);
macroButton:Enable();
-- Highlight Selected Macro
if ( MacroFrame.selectedMacro and (i == (MacroFrame.selectedMacro - MacroFrame.macroBase)) ) then
macroButton:SetChecked(1);
MacroFrameSelectedMacroName:SetText(name);
MacroFrameText:SetText(body);
MacroFrameSelectedMacroButton:SetID(i);
MacroFrameSelectedMacroButtonIcon:SetTexture(texture);
MacroPopupFrame.selectedIconTexture = texture;
else
macroButton:SetChecked(0);
end
else
macroButton:SetChecked(0);
macroIcon:SetTexture("");
macroName:SetText("");
macroButton:Disable();
end
macroButton:Show();
else
macroButton:Hide();
end
end
-- Macro Details
if ( MacroFrame.selectedMacro ~= nil ) then
MacroFrame_ShowDetails();
MacroDeleteButton:Enable();
else
MacroFrame_HideDetails();
MacroDeleteButton:Disable();
end
--Update New Button
if ( numMacros < MacroFrame.macroMax ) then
MacroNewButton:Enable();
else
MacroNewButton:Disable();
end
-- Disable Buttons
if ( MacroPopupFrame:IsShown() ) then
MacroEditButton:Disable();
MacroDeleteButton:Disable();
else
MacroEditButton:Enable();
MacroDeleteButton:Enable();
end
if ( not MacroFrame.selectedMacro ) then
MacroDeleteButton:Disable();
end
end
function MacroFrame_AddMacroLine(line)
if ( MacroFrameText:IsVisible() ) then
MacroFrameText:SetText(MacroFrameText:GetText()..line);
end
end
function MacroButton_OnClick(self, button)
MacroFrame_SaveMacro();
MacroFrame_SelectMacro(MacroFrame.macroBase + self:GetID());
MacroFrame_Update();
MacroPopupFrame:Hide();
MacroFrameText:ClearFocus();
end
function MacroFrame_SelectMacro(id)
MacroFrame.selectedMacro = id;
end
function MacroFrame_DeleteMacro()
local selectedMacro = MacroFrame.selectedMacro;
DeleteMacro(selectedMacro);
-- the order of the return values (account macros, character macros) matches up with the IDs of the tabs
local numMacros = select(PanelTemplates_GetSelectedTab(MacroFrame), GetNumMacros());
if ( selectedMacro > numMacros + MacroFrame.macroBase) then
selectedMacro = selectedMacro - 1;
end
if ( selectedMacro <= MacroFrame.macroBase ) then
MacroFrame.selectedMacro = nil;
else
MacroFrame.selectedMacro = selectedMacro;
end
MacroFrame_Update();
MacroFrameText:ClearFocus();
end
function MacroNewButton_OnClick(self, button)
MacroFrame_SaveMacro();
MacroPopupFrame.mode = "new";
MacroPopupFrame:Show();
end
function MacroEditButton_OnClick(self, button)
MacroFrame_SaveMacro();
MacroPopupFrame.mode = "edit";
MacroPopupFrame:Show();
end
function MacroFrame_HideDetails()
MacroEditButton:Hide();
MacroFrameCharLimitText:Hide();
MacroFrameText:Hide();
MacroFrameSelectedMacroName:Hide();
MacroFrameSelectedMacroBackground:Hide();
MacroFrameSelectedMacroButton:Hide();
end
function MacroFrame_ShowDetails()
MacroEditButton:Show();
MacroFrameCharLimitText:Show();
MacroFrameEnterMacroText:Show();
MacroFrameText:Show();
MacroFrameSelectedMacroName:Show();
MacroFrameSelectedMacroBackground:Show();
MacroFrameSelectedMacroButton:Show();
end
function MacroButtonContainer_OnLoad(self)
local button;
local maxMacroButtons = max(MAX_ACCOUNT_MACROS, MAX_CHARACTER_MACROS);
for i=1, maxMacroButtons do
button = CreateFrame("CheckButton", "MacroButton"..i, self, "MacroButtonTemplate");
button:SetID(i);
if ( i == 1 ) then
button:SetPoint("TOPLEFT", self, "TOPLEFT", 6, -6);
elseif ( mod(i, NUM_MACROS_PER_ROW) == 1 ) then
button:SetPoint("TOP", "MacroButton"..(i-NUM_MACROS_PER_ROW), "BOTTOM", 0, -10);
else
button:SetPoint("LEFT", "MacroButton"..(i-1), "RIGHT", 13, 0);
end
end
end
function MacroPopupFrame_OnShow(self)
MacroPopupEditBox:SetFocus();
PlaySound("igCharacterInfoOpen");
MacroPopupFrame_Update(self);
MacroPopupOkayButton_Update();
if ( self.mode == "new" ) then
MacroFrameText:Hide();
MacroPopupButton_SelectTexture(1);
end
-- Disable Buttons
MacroEditButton:Disable();
MacroDeleteButton:Disable();
MacroNewButton:Disable();
MacroFrameTab1:Disable();
MacroFrameTab2:Disable();
end
function MacroPopupFrame_OnHide(self)
if ( self.mode == "new" ) then
MacroFrameText:Show();
MacroFrameText:SetFocus();
end
-- Enable Buttons
MacroEditButton:Enable();
MacroDeleteButton:Enable();
local numMacros;
local numAccountMacros, numCharacterMacros = GetNumMacros();
if ( MacroFrame.macroBase == 0 ) then
numMacros = numAccountMacros;
else
numMacros = numCharacterMacros;
end
if ( numMacros < MacroFrame.macroMax ) then
MacroNewButton:Enable();
end
-- Enable tabs
PanelTemplates_UpdateTabs(MacroFrame);
end
function MacroPopupFrame_Update(self)
self = self or MacroPopupFrame;
local numMacroIcons = GetNumMacroIcons();
local macroPopupIcon, macroPopupButton;
local macroPopupOffset = FauxScrollFrame_GetOffset(MacroPopupScrollFrame);
local index;
-- Determine whether we're creating a new macro or editing an existing one
if ( self.mode == "new" ) then
MacroPopupEditBox:SetText("");
elseif ( self.mode == "edit" ) then
local name, texture, body = GetMacroInfo(MacroFrame.selectedMacro);
MacroPopupEditBox:SetText(name);
end
-- Icon list
local texture;
for i=1, NUM_MACRO_ICONS_SHOWN do
macroPopupIcon = _G["MacroPopupButton"..i.."Icon"];
macroPopupButton = _G["MacroPopupButton"..i];
index = (macroPopupOffset * NUM_ICONS_PER_ROW) + i;
texture = GetMacroIconInfo(index);
if ( index <= numMacroIcons ) then
macroPopupIcon:SetTexture(texture);
macroPopupButton:Show();
else
macroPopupIcon:SetTexture("");
macroPopupButton:Hide();
end
if ( MacroPopupFrame.selectedIcon and (index == MacroPopupFrame.selectedIcon) ) then
macroPopupButton:SetChecked(1);
elseif ( MacroPopupFrame.selectedIconTexture == texture ) then
macroPopupButton:SetChecked(1);
else
macroPopupButton:SetChecked(nil);
end
end
-- Scrollbar stuff
FauxScrollFrame_Update(MacroPopupScrollFrame, ceil(numMacroIcons / NUM_ICONS_PER_ROW) , NUM_ICON_ROWS, MACRO_ICON_ROW_HEIGHT );
end
function MacroPopupFrame_CancelEdit()
MacroPopupFrame:Hide();
MacroFrame_Update();
MacroPopupFrame.selectedIcon = nil;
end
function MacroPopupOkayButton_Update()
if ( (strlen(MacroPopupEditBox:GetText()) > 0) and MacroPopupFrame.selectedIcon ) then
MacroPopupOkayButton:Enable();
else
MacroPopupOkayButton:Disable();
end
if ( MacroPopupFrame.mode == "edit" and (strlen(MacroPopupEditBox:GetText()) > 0) ) then
MacroPopupOkayButton:Enable();
end
end
function MacroPopupButton_SelectTexture(selectedIcon)
MacroPopupFrame.selectedIcon = selectedIcon;
-- Clear out selected texture
MacroPopupFrame.selectedIconTexture = nil;
MacroFrameSelectedMacroButtonIcon:SetTexture(GetMacroIconInfo(MacroPopupFrame.selectedIcon));
MacroPopupOkayButton_Update();
local mode = MacroPopupFrame.mode;
MacroPopupFrame.mode = nil;
MacroPopupFrame_Update(MacroPopupFrame);
MacroPopupFrame.mode = mode;
end
function MacroPopupButton_OnClick(self, button)
MacroPopupButton_SelectTexture(self:GetID() + (FauxScrollFrame_GetOffset(MacroPopupScrollFrame) * NUM_ICONS_PER_ROW));
end
function MacroPopupOkayButton_OnClick(self, button)
local index = 1
if ( MacroPopupFrame.mode == "new" ) then
index = CreateMacro(MacroPopupEditBox:GetText(), MacroPopupFrame.selectedIcon, nil, (MacroFrame.macroBase > 0));
elseif ( MacroPopupFrame.mode == "edit" ) then
index = EditMacro(MacroFrame.selectedMacro, MacroPopupEditBox:GetText(), MacroPopupFrame.selectedIcon);
end
MacroPopupFrame:Hide();
MacroFrame_SelectMacro(index);
MacroFrame_Update();
end
function MacroFrame_SaveMacro()
if ( MacroFrame.textChanged and MacroFrame.selectedMacro ) then
EditMacro(MacroFrame.selectedMacro, nil, nil, MacroFrameText:GetText());
MacroFrame.textChanged = nil;
end
end
@@ -0,0 +1,6 @@
## Interface: 30300
## Title: Blizzard Macro UI
## Secure: 1
## LoadOnDemand: 1
Blizzard_MacroUI.xml
Localization.lua
@@ -0,0 +1,840 @@
<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="Blizzard_MacroUI.lua"/>
<CheckButton name="MacroButtonTemplate" inherits="PopupButtonTemplate" virtual="true">
<Scripts>
<OnLoad>
self:RegisterForDrag("LeftButton");
</OnLoad>
<OnClick>
MacroButton_OnClick(self, button, down);
</OnClick>
<OnDragStart>
PickupMacro(MacroFrame.macroBase + self:GetID());
</OnDragStart>
</Scripts>
</CheckButton>
<CheckButton name="MacroPopupButtonTemplate" inherits="SimplePopupButtonTemplate" virtual="true">
<Scripts>
<OnClick>
MacroPopupButton_OnClick(self, button, down);
</OnClick>
</Scripts>
<NormalTexture name="$parentIcon" nonBlocking="true">
<Size>
<AbsDimension x="36" y="36"/>
</Size>
<Anchors>
<Anchor point="CENTER">
<Offset>
<AbsDimension x="0" y="-1"/>
</Offset>
</Anchor>
</Anchors>
</NormalTexture>
<HighlightTexture alphaMode="ADD" file="Interface\Buttons\ButtonHilight-Square"/>
<CheckedTexture alphaMode="ADD" file="Interface\Buttons\CheckButtonHilight"/>
</CheckButton>
<Frame name="MacroFrame" toplevel="true" movable="true" parent="UIParent" enableMouse="true" hidden="true">
<Size>
<AbsDimension x="384" y="512"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="0" y="-104"/>
</Offset>
</Anchor>
</Anchors>
<HitRectInsets>
<AbsInset left="0" right="34" top="0" bottom="75"/>
</HitRectInsets>
<Layers>
<Layer level="BACKGROUND">
<Texture name="MacroFramePortrait" file="Interface\MacroFrame\MacroFrame-Icon">
<Size>
<AbsDimension x="60" y="60"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="7" y="-6"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
</Layer>
<Layer level="BORDER">
<Texture file="Interface\PaperDollInfoFrame\UI-Character-General-TopLeft">
<Size>
<AbsDimension x="256" y="256"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT"/>
</Anchors>
</Texture>
<Texture file="Interface\PaperDollInfoFrame\UI-Character-General-TopRight">
<Size>
<AbsDimension x="128" y="256"/>
</Size>
<Anchors>
<Anchor point="TOPRIGHT"/>
</Anchors>
</Texture>
<Texture file="Interface\MacroFrame\MacroFrame-BotLeft">
<Size>
<AbsDimension x="256" y="256"/>
</Size>
<Anchors>
<Anchor point="BOTTOMLEFT"/>
</Anchors>
</Texture>
<Texture file="Interface\MacroFrame\MacroFrame-BotRight">
<Size>
<AbsDimension x="128" y="256"/>
</Size>
<Anchors>
<Anchor point="BOTTOMRIGHT"/>
</Anchors>
</Texture>
<FontString inherits="GameFontNormal" text="CREATE_MACROS">
<Anchors>
<Anchor point="TOP" relativeTo="MacroFrame">
<Offset>
<AbsDimension x="0" y="-17"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
<Layer level="ARTWORK">
<Texture name="MacroHorizontalBarLeft" file="Interface\ClassTrainerFrame\UI-ClassTrainer-HorizontalBar">
<Size>
<AbsDimension x="256" y="16"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="15" y="-220"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0" right="1.0" top="0" bottom="0.25"/>
</Texture>
<Texture file="Interface\ClassTrainerFrame\UI-ClassTrainer-HorizontalBar">
<Size>
<AbsDimension x="75" y="16"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativeTo="MacroHorizontalBarLeft" relativePoint="RIGHT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0" right="0.29296875" top="0.25" bottom="0.5"/>
</Texture>
<Texture name="MacroFrameSelectedMacroBackground" file="Interface\Buttons\UI-EmptySlot">
<Size>
<AbsDimension x="64" y="64"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="16" y="-228"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<FontString name="MacroFrameSelectedMacroName" inherits="GameFontNormalLarge" justifyH="LEFT">
<Size>
<AbsDimension x="256" y="16"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="MacroFrameSelectedMacroBackground" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="-4" y="-10"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="MacroFrameEnterMacroText" inherits="GameFontHighlightSmall" text="ENTER_MACRO_LABEL">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="MacroFrameSelectedMacroBackground" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="8" y="0"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="MacroFrameCharLimitText" inherits="GameFontHighlightSmall">
<Size>
<AbsDimension x="0" y="10"/>
</Size>
<Anchors>
<Anchor point="BOTTOM">
<Offset>
<AbsDimension x="-15" y="105"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Frames>
<CheckButton name="MacroFrameSelectedMacroButton" frameStrata="HIGH" inherits="MacroButtonTemplate" id="0">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="MacroFrameSelectedMacroBackground">
<Offset>
<AbsDimension x="14" y="-14"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
self:SetChecked(nil);
PickupMacro(MacroFrame.selectedMacro);
</OnClick>
</Scripts>
</CheckButton>
<ScrollFrame name="MacroButtonScrollFrame" inherits="UIPanelScrollFrameTemplate">
<Size x="294" y="146"/>
<Anchors>
<Anchor point="TOPLEFT">
<Offset x="23" y="-76"/>
</Anchor>
</Anchors>
<Layers>
<Layer level="ARTWORK">
<Texture name="$parentTop" file="Interface\PaperDollInfoFrame\UI-Character-ScrollBar">
<Size>
<AbsDimension x="31" y="102"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="-2" y="5"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0" right="0.484375" top="0" bottom="0.4"/>
</Texture>
<Texture name="$parentBottom" file="Interface\PaperDollInfoFrame\UI-Character-ScrollBar">
<Size>
<AbsDimension x="31" y="106"/>
</Size>
<Anchors>
<Anchor point="BOTTOMLEFT" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="-2" y="-2"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0.515625" right="1.0" top="0" bottom="0.4140625"/>
</Texture>
<Texture name="$parentMiddle" file="Interface\PaperDollInfoFrame\UI-Character-ScrollBar">
<Size>
<AbsDimension x="31" y="1"/>
</Size>
<Anchors>
<Anchor point="TOP" relativeTo="$parentTop" relativePoint="BOTTOM"/>
<Anchor point="BOTTOM" relativeTo="$parentBottom" relativePoint="TOP"/>
</Anchors>
<TexCoords left="0" right="0.484375" top=".75" bottom="1.0"/>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnLoad function="ScrollFrame_OnLoad"/>
</Scripts>
<ScrollChild>
<Frame name="MacroButtonContainer">
<Size x="285" y="10"/>
<Anchors>
<Anchor point="TOPLEFT"/>
</Anchors>
<Scripts>
<OnLoad function="MacroButtonContainer_OnLoad"/>
</Scripts>
</Frame>
</ScrollChild>
</ScrollFrame>
<Button name="MacroEditButton" frameStrata="HIGH" inherits="UIPanelButtonTemplate" text="CHANGE_MACRO_NAME_ICON">
<Size>
<AbsDimension x="170" y="22"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="MacroFrameSelectedMacroBackground">
<Offset>
<AbsDimension x="51" y="-30"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick function="MacroEditButton_OnClick"/>
</Scripts>
</Button>
<ScrollFrame name="MacroFrameScrollFrame" inherits="UIPanelScrollFrameTemplate">
<Size>
<AbsDimension x="286" y="85"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="MacroFrameSelectedMacroBackground" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="11" y="-18"/>
</Offset>
</Anchor>
</Anchors>
<ScrollChild>
<EditBox name="MacroFrameText" multiLine="true" letters="255" autoFocus="false" countInvisibleLetters="true">
<Size>
<AbsDimension x="286" y="85"/>
</Size>
<Scripts>
<OnTextChanged>
MacroFrame.textChanged = 1;
if ( MacroPopupFrame.mode == "new" ) then
MacroPopupFrame:Hide();
end
MacroFrameCharLimitText:SetFormattedText(MACROFRAME_CHAR_LIMIT, MacroFrameText:GetNumLetters());
ScrollingEdit_OnTextChanged(self, self:GetParent());
</OnTextChanged>
<OnCursorChanged function="ScrollingEdit_OnCursorChanged"/>
<OnUpdate>
ScrollingEdit_OnUpdate(self, elapsed, self:GetParent());
</OnUpdate>
<OnEscapePressed function="EditBox_ClearFocus"/>
</Scripts>
<FontString inherits="GameFontHighlightSmall"/>
</EditBox>
</ScrollChild>
</ScrollFrame>
<Button name="MacroFrameTextButton">
<Size>
<AbsDimension x="286" y="85"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="MacroFrameText"/>
</Anchors>
<Scripts>
<OnClick>
MacroFrameText:SetFocus();
</OnClick>
</Scripts>
</Button>
<Frame name="MacroFrameTextBackground">
<Size>
<AbsDimension x="322" y="95"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="MacroFrame">
<Offset>
<AbsDimension x="18" y="-305"/>
</Offset>
</Anchor>
</Anchors>
<Backdrop bgFile="Interface\Tooltips\UI-Tooltip-Background" edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true">
<EdgeSize>
<AbsValue val="16"/>
</EdgeSize>
<TileSize>
<AbsValue val="16"/>
</TileSize>
<BackgroundInsets>
<AbsInset left="5" right="5" top="5" bottom="5"/>
</BackgroundInsets>
</Backdrop>
<Scripts>
<OnLoad>
self:SetBackdropBorderColor(TOOLTIP_DEFAULT_COLOR.r, TOOLTIP_DEFAULT_COLOR.g, TOOLTIP_DEFAULT_COLOR.b);
self:SetBackdropColor(TOOLTIP_DEFAULT_BACKGROUND_COLOR.r, TOOLTIP_DEFAULT_BACKGROUND_COLOR.g, TOOLTIP_DEFAULT_BACKGROUND_COLOR.b);
</OnLoad>
</Scripts>
</Frame>
<Button name="MacroFrameTab1" inherits="TabButtonTemplate" text="GENERAL_MACROS" id="1">
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="65" y="-39"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
PanelTemplates_TabResize(self, -15);
_G[self:GetName().."HighlightTexture"]:SetWidth(self:GetTextWidth() + 31);
</OnLoad>
<OnClick>
PanelTemplates_SetTab(MacroFrame, self:GetID());
MacroFrame_SaveMacro();
MacroFrame_SetAccountMacros();
MacroFrame_Update();
MacroButtonScrollFrame:SetVerticalScroll(0);
</OnClick>
</Scripts>
</Button>
<Button name="MacroFrameTab2" inherits="TabButtonTemplate" id="2">
<Anchors>
<Anchor point="LEFT" relativeTo="MacroFrameTab1" relativePoint="RIGHT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
self:SetFormattedText(CHARACTER_SPECIFIC_MACROS, UnitName("player"));
_G[self:GetName().."HighlightTexture"]:SetWidth(self:GetTextWidth() + 31);
PanelTemplates_TabResize(self, -15, nil, 150);
</OnLoad>
<OnClick>
PanelTemplates_SetTab(MacroFrame, self:GetID());
MacroFrame_SaveMacro();
MacroFrame_SetCharacterMacros();
MacroFrame_Update();
MacroButtonScrollFrame:SetVerticalScroll(0);
</OnClick>
</Scripts>
</Button>
<Button name="MacroDeleteButton" inherits="UIPanelButtonGrayTemplate" text="DELETE">
<Size>
<AbsDimension x="80" y="22"/>
</Size>
<Anchors>
<Anchor point="BOTTOMLEFT" relativeTo="MacroFrame">
<Offset>
<AbsDimension x="17" y="79"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
MacroFrame_DeleteMacro();
</OnClick>
</Scripts>
</Button>
<Button name="MacroNewButton" inherits="UIPanelButtonTemplate" text="NEW">
<Size>
<AbsDimension x="80" y="22"/>
</Size>
<Anchors>
<Anchor point="CENTER" relativeTo="MacroFrame" relativePoint="TOPLEFT">
<Offset>
<AbsDimension x="222" y="-422"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick function="MacroNewButton_OnClick"/>
</Scripts>
</Button>
<Button name="MacroExitButton" inherits="UIPanelButtonTemplate" text="EXIT">
<Size>
<AbsDimension x="80" y="22"/>
</Size>
<Anchors>
<Anchor point="CENTER" relativeTo="MacroFrame" relativePoint="TOPLEFT">
<Offset>
<AbsDimension x="303" y="-422"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick function="HideParentPanel"/>
</Scripts>
</Button>
<Button name="MacroFrameCloseButton" inherits="UIPanelCloseButton">
<Anchors>
<Anchor point="TOPRIGHT" relativeTo="MacroFrame" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="-29" y="-8"/>
</Offset>
</Anchor>
</Anchors>
</Button>
</Frames>
<Scripts>
<OnLoad function="MacroFrame_OnLoad"/>
<OnShow function="MacroFrame_OnShow"/>
<OnHide function="MacroFrame_OnHide"/>
</Scripts>
</Frame>
<Frame name="MacroPopupFrame" toplevel="true" parent="UIParent" movable="true" enableMouse="true" hidden="true">
<Size>
<AbsDimension x="297" y="298"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="MacroFrame" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="-40" y="-40"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture file="Interface\MacroFrame\MacroPopup-TopLeft">
<Size>
<AbsDimension x="256" y="256"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT"/>
</Anchors>
</Texture>
<Texture file="Interface\MacroFrame\MacroPopup-TopRight">
<Size>
<AbsDimension x="64" y="256"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="256" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<Texture file="Interface\MacroFrame\MacroPopup-BotLeft">
<Size>
<AbsDimension x="256" y="64"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="0" y="-256"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<Texture file="Interface\MacroFrame\MacroPopup-BotRight">
<Size>
<AbsDimension x="64" y="64"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="256" y="-256"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<FontString inherits="GameFontHighlightSmall" text="MACRO_POPUP_TEXT">
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="24" y="-21"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString inherits="GameFontHighlightSmall" text="MACRO_POPUP_CHOOSE_ICON">
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="24" y="-69"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Frames>
<EditBox name="MacroPopupEditBox" letters="16" historyLines="0">
<Size>
<AbsDimension x="182" y="20"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="29" y="-35"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture name="MacroPopupNameLeft" file="Interface\ClassTrainerFrame\UI-ClassTrainer-FilterBorder">
<Size>
<AbsDimension x="12" y="29"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="-11" y="0"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0" right="0.09375" top="0" bottom="1.0"/>
</Texture>
<Texture name="MacroPopupNameMiddle" file="Interface\ClassTrainerFrame\UI-ClassTrainer-FilterBorder">
<Size>
<AbsDimension x="175" y="29"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativeTo="MacroPopupNameLeft" relativePoint="RIGHT"/>
</Anchors>
<TexCoords left="0.09375" right="0.90625" top="0" bottom="1.0"/>
</Texture>
<Texture name="MacroPopupNameRight" file="Interface\ClassTrainerFrame\UI-ClassTrainer-FilterBorder">
<Size>
<AbsDimension x="12" y="29"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativeTo="MacroPopupNameMiddle" relativePoint="RIGHT"/>
</Anchors>
<TexCoords left="0.90625" right="1.0" top="0" bottom="1.0"/>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnTextChanged>
MacroPopupOkayButton_Update();
MacroFrameSelectedMacroName:SetText(self:GetText());
</OnTextChanged>
<OnEscapePressed function="MacroPopupFrame_CancelEdit"/>
<OnEnterPressed>
if ( MacroPopupOkayButton:IsEnabled() ~= 0 ) then
MacroPopupOkayButton_OnClick(MacroPopupOkayButton);
end
</OnEnterPressed>
</Scripts>
<FontString inherits="ChatFontNormal"/>
</EditBox>
<ScrollFrame name="MacroPopupScrollFrame" inherits="ClassTrainerListScrollFrameTemplate">
<Size>
<AbsDimension x="296" y="195"/>
</Size>
<Anchors>
<Anchor point="TOPRIGHT" relativeTo="MacroPopupFrame" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="-39" y="-67"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnVerticalScroll>
FauxScrollFrame_OnVerticalScroll(self, offset, MACRO_ICON_ROW_HEIGHT, MacroPopupFrame_Update);
</OnVerticalScroll>
</Scripts>
</ScrollFrame>
<CheckButton name="MacroPopupButton1" inherits="MacroPopupButtonTemplate" id="1">
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="24" y="-85"/>
</Offset>
</Anchor>
</Anchors>
</CheckButton>
<CheckButton name="MacroPopupButton2" inherits="MacroPopupButtonTemplate" id="2">
<Anchors>
<Anchor point="LEFT" relativeTo="MacroPopupButton1" relativePoint="RIGHT">
<Offset>
<AbsDimension x="10" y="0"/>
</Offset>
</Anchor>
</Anchors>
</CheckButton>
<CheckButton name="MacroPopupButton3" inherits="MacroPopupButtonTemplate" id="3">
<Anchors>
<Anchor point="LEFT" relativeTo="MacroPopupButton2" relativePoint="RIGHT">
<Offset>
<AbsDimension x="10" y="0"/>
</Offset>
</Anchor>
</Anchors>
</CheckButton>
<CheckButton name="MacroPopupButton4" inherits="MacroPopupButtonTemplate" id="4">
<Anchors>
<Anchor point="LEFT" relativeTo="MacroPopupButton3" relativePoint="RIGHT">
<Offset>
<AbsDimension x="10" y="0"/>
</Offset>
</Anchor>
</Anchors>
</CheckButton>
<CheckButton name="MacroPopupButton5" inherits="MacroPopupButtonTemplate" id="5">
<Anchors>
<Anchor point="LEFT" relativeTo="MacroPopupButton4" relativePoint="RIGHT">
<Offset>
<AbsDimension x="10" y="0"/>
</Offset>
</Anchor>
</Anchors>
</CheckButton>
<CheckButton name="MacroPopupButton6" inherits="MacroPopupButtonTemplate" id="6">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="MacroPopupButton1" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-8"/>
</Offset>
</Anchor>
</Anchors>
</CheckButton>
<CheckButton name="MacroPopupButton7" inherits="MacroPopupButtonTemplate" id="7">
<Anchors>
<Anchor point="LEFT" relativeTo="MacroPopupButton6" relativePoint="RIGHT">
<Offset>
<AbsDimension x="10" y="0"/>
</Offset>
</Anchor>
</Anchors>
</CheckButton>
<CheckButton name="MacroPopupButton8" inherits="MacroPopupButtonTemplate" id="8">
<Anchors>
<Anchor point="LEFT" relativeTo="MacroPopupButton7" relativePoint="RIGHT">
<Offset>
<AbsDimension x="10" y="0"/>
</Offset>
</Anchor>
</Anchors>
</CheckButton>
<CheckButton name="MacroPopupButton9" inherits="MacroPopupButtonTemplate" id="9">
<Anchors>
<Anchor point="LEFT" relativeTo="MacroPopupButton8" relativePoint="RIGHT">
<Offset>
<AbsDimension x="10" y="0"/>
</Offset>
</Anchor>
</Anchors>
</CheckButton>
<CheckButton name="MacroPopupButton10" inherits="MacroPopupButtonTemplate" id="10">
<Anchors>
<Anchor point="LEFT" relativeTo="MacroPopupButton9" relativePoint="RIGHT">
<Offset>
<AbsDimension x="10" y="0"/>
</Offset>
</Anchor>
</Anchors>
</CheckButton>
<CheckButton name="MacroPopupButton11" inherits="MacroPopupButtonTemplate" id="11">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="MacroPopupButton6" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-8"/>
</Offset>
</Anchor>
</Anchors>
</CheckButton>
<CheckButton name="MacroPopupButton12" inherits="MacroPopupButtonTemplate" id="12">
<Anchors>
<Anchor point="LEFT" relativeTo="MacroPopupButton11" relativePoint="RIGHT">
<Offset>
<AbsDimension x="10" y="0"/>
</Offset>
</Anchor>
</Anchors>
</CheckButton>
<CheckButton name="MacroPopupButton13" inherits="MacroPopupButtonTemplate" id="13">
<Anchors>
<Anchor point="LEFT" relativeTo="MacroPopupButton12" relativePoint="RIGHT">
<Offset>
<AbsDimension x="10" y="0"/>
</Offset>
</Anchor>
</Anchors>
</CheckButton>
<CheckButton name="MacroPopupButton14" inherits="MacroPopupButtonTemplate" id="14">
<Anchors>
<Anchor point="LEFT" relativeTo="MacroPopupButton13" relativePoint="RIGHT">
<Offset>
<AbsDimension x="10" y="0"/>
</Offset>
</Anchor>
</Anchors>
</CheckButton>
<CheckButton name="MacroPopupButton15" inherits="MacroPopupButtonTemplate" id="15">
<Anchors>
<Anchor point="LEFT" relativeTo="MacroPopupButton14" relativePoint="RIGHT">
<Offset>
<AbsDimension x="10" y="0"/>
</Offset>
</Anchor>
</Anchors>
</CheckButton>
<CheckButton name="MacroPopupButton16" inherits="MacroPopupButtonTemplate" id="16">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="MacroPopupButton11" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-8"/>
</Offset>
</Anchor>
</Anchors>
</CheckButton>
<CheckButton name="MacroPopupButton17" inherits="MacroPopupButtonTemplate" id="17">
<Anchors>
<Anchor point="LEFT" relativeTo="MacroPopupButton16" relativePoint="RIGHT">
<Offset>
<AbsDimension x="10" y="0"/>
</Offset>
</Anchor>
</Anchors>
</CheckButton>
<CheckButton name="MacroPopupButton18" inherits="MacroPopupButtonTemplate" id="18">
<Anchors>
<Anchor point="LEFT" relativeTo="MacroPopupButton17" relativePoint="RIGHT">
<Offset>
<AbsDimension x="10" y="0"/>
</Offset>
</Anchor>
</Anchors>
</CheckButton>
<CheckButton name="MacroPopupButton19" inherits="MacroPopupButtonTemplate" id="19">
<Anchors>
<Anchor point="LEFT" relativeTo="MacroPopupButton18" relativePoint="RIGHT">
<Offset>
<AbsDimension x="10" y="0"/>
</Offset>
</Anchor>
</Anchors>
</CheckButton>
<CheckButton name="MacroPopupButton20" inherits="MacroPopupButtonTemplate" id="20">
<Anchors>
<Anchor point="LEFT" relativeTo="MacroPopupButton19" relativePoint="RIGHT">
<Offset>
<AbsDimension x="10" y="0"/>
</Offset>
</Anchor>
</Anchors>
</CheckButton>
<Button name="MacroPopupCancelButton" inherits="UIPanelButtonTemplate" text="CANCEL">
<Size>
<AbsDimension x="78" y="22"/>
</Size>
<Anchors>
<Anchor point="BOTTOMRIGHT" relativeTo="MacroPopupFrame">
<Offset>
<AbsDimension x="-11" y="13"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
MacroPopupFrame_CancelEdit();
PlaySound("gsTitleOptionOK");
</OnClick>
</Scripts>
</Button>
<Button name="MacroPopupOkayButton" inherits="UIPanelButtonTemplate" text="OKAY">
<Size>
<AbsDimension x="78" y="22"/>
</Size>
<Anchors>
<Anchor point="RIGHT" relativeTo="MacroPopupCancelButton" relativePoint="LEFT">
<Offset>
<AbsDimension x="-2" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
MacroPopupOkayButton_OnClick();
PlaySound("gsTitleOptionOK");
</OnClick>
</Scripts>
</Button>
</Frames>
<Scripts>
<OnShow function="MacroPopupFrame_OnShow"/>
<OnHide function="MacroPopupFrame_OnHide"/>
</Scripts>
</Frame>
</Ui>
@@ -0,0 +1 @@
-- This file is executed at the end of addon load
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,7 @@
## Interface: 30300
## Title: Blizzard Raid UI
## Secure: 1
## LoadOnDemand: 1
## SavedVariablesPerCharacter: RAID_PULLOUT_POSITIONS, RAID_SINGLE_POSITIONS
Blizzard_RaidUI.xml
Localization.lua
File diff suppressed because it is too large Load Diff
@@ -0,0 +1 @@
-- This file is executed at the end of addon load
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,6 @@
## Interface: 30300
## Title: Blizzard Talent UI
## Secure: 1
## LoadOnDemand: 1
Blizzard_TalentUI.xml
Localization.lua
@@ -0,0 +1,780 @@
<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="Blizzard_TalentUI.lua"/>
<CheckButton name="PlayerSpecTabTemplate" virtual="true" hidden="true">
<Size x="32" y="32"/>
<Layers>
<Layer level="BACKGROUND">
<Texture name="$parentBackground" file="Interface\SpellBook\SpellBook-SkillLineTab">
<Size x="64" y="64"/>
<Anchors>
<Anchor point="TOPLEFT">
<Offset x="-3" y="11"/>
</Anchor>
</Anchors>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnClick>
PlaySound("igCharacterInfoTab");
PlayerSpecTab_OnClick(self, button, down);
</OnClick>
<OnEnter>
PlayerSpecTab_OnEnter(self, motion);
</OnEnter>
<OnLeave>
GameTooltip:Hide();
</OnLeave>
</Scripts>
<NormalTexture/>
<HighlightTexture file="Interface\Buttons\ButtonHilight-Square" alphaMode="ADD"/>
<CheckedTexture file="Interface\Buttons\CheckButtonHilight" alphaMode="ADD"/>
</CheckButton>
<Button name="PlayerTalentTabTemplate" inherits="CharacterFrameTabButtonTemplate" virtual="true">
<Scripts>
<OnLoad>
PlayerTalentTab_OnLoad(self);
</OnLoad>
<OnEvent>
PlayerTalentTab_OnEvent(self, event, ...);
</OnEvent>
<OnClick>
PlayerTalentTab_OnClick(self, button, down);
</OnClick>
<OnEnter>
PlayerTalentFrameTab_OnEnter(self, motion);
</OnEnter>
<OnLeave>
GameTooltip:Hide();
</OnLeave>
</Scripts>
</Button>
<Button name="PlayerGlyphTabTemplate" inherits="CharacterFrameTabButtonTemplate" virtual="true">
<Scripts>
<OnLoad>
PlayerGlyphTab_OnLoad(self);
</OnLoad>
<OnEvent>
PlayerGlyphTab_OnEvent(self, event, ...);
</OnEvent>
<OnClick>
PlayerGlyphTab_OnClick(self, button, down);
</OnClick>
<OnEnter>
PlayerTalentFrameTab_OnEnter(self, motion);
</OnEnter>
<OnLeave>
GameTooltip:Hide();
</OnLeave>
</Scripts>
</Button>
<Button name="PlayerTalentButtonTemplate" inherits="TalentButtonTemplate" virtual="true">
<Scripts>
<OnLoad>
self:RegisterForClicks("LeftButtonUp", "RightButtonUp");
self:RegisterEvent("PREVIEW_TALENT_POINTS_CHANGED");
self:RegisterEvent("PREVIEW_PET_TALENT_POINTS_CHANGED");
self:RegisterEvent("PLAYER_TALENT_UPDATE");
self:RegisterEvent("PET_TALENT_UPDATE");
</OnLoad>
</Scripts>
</Button>
<Frame name="PlayerTalentFrame" enableMouse="true" toplevel="true" parent="UIParent" hidden="true">
<Size>
<AbsDimension x="384" y="512"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="0" y="-104"/>
</Offset>
</Anchor>
</Anchors>
<HitRectInsets>
<AbsInset left="0" right="30" top="0" bottom="45"/>
</HitRectInsets>
<Layers>
<Layer level="BACKGROUND">
<Texture name="PlayerTalentFramePortrait">
<Size>
<AbsDimension x="60" y="60"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="7" y="-6"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<Texture name="PlayerTalentFrameActiveSpecTabHighlight" file="Interface\SpellBook\SpellBook-SkillLineTab-Glow" hidden="true">
<Size x="74" y="86"/>
</Texture>
</Layer>
<Layer level="BORDER">
<Texture name="PlayerTalentFrameTopLeft" file="Interface\PaperDollInfoFrame\UI-Character-General-TopLeft">
<Size>
<AbsDimension x="256" y="256"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="2" y="-1"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<Texture name="PlayerTalentFrameTopRight" file="Interface\PaperDollInfoFrame\UI-Character-General-TopRight">
<Size>
<AbsDimension x="128" y="256"/>
</Size>
<Anchors>
<Anchor point="TOPRIGHT">
<Offset>
<AbsDimension x="2" y="-1"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<Texture name="PlayerTalentFrameBottomLeft" file="Interface\PaperDollInfoFrame\UI-Character-General-BottomLeft">
<Size>
<AbsDimension x="256" y="256"/>
</Size>
<Anchors>
<Anchor point="BOTTOMLEFT">
<Offset>
<AbsDimension x="2" y="-1"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<Texture name="PlayerTalentFrameBottomRight" file="Interface\PaperDollInfoFrame\UI-Character-General-BottomRight">
<Size>
<AbsDimension x="128" y="256"/>
</Size>
<Anchors>
<Anchor point="BOTTOMRIGHT">
<Offset>
<AbsDimension x="2" y="-1"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
</Layer>
<Layer level="OVERLAY">
<FontString name="PlayerTalentFrameTitleText" inherits="GameFontNormal" text="TALENTS">
<Anchors>
<Anchor point="TOP">
<Offset>
<AbsDimension x="0" y="-18"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Frames>
<Button name="PlayerTalentFrameCloseButton" inherits="UIPanelCloseButton">
<Anchors>
<Anchor point="CENTER" relativePoint="TOPRIGHT">
<Offset x="-44" y="-25"/>
</Anchor>
</Anchors>
</Button>
<Frame name="PlayerTalentFrameStatusFrame" hidden="true">
<Size x="264" y="20"/>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="PlayerTalentFrame">
<Offset>
<AbsDimension x="75" y="-46"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="OVERLAY">
<Texture name="PlayerTalentFramePointsLeft" file="Interface\Common\Common-Input-Border">
<Size>
<AbsDimension x="8" y="20"/>
</Size>
<Anchors>
<Anchor point="LEFT"/>
</Anchors>
<TexCoords left="0" right="0.0625" top="0" bottom="0.625"/>
</Texture>
<Texture name="PlayerTalentFramePointsMiddle" file="Interface\Common\Common-Input-Border">
<Size>
<AbsDimension x="248" y="20"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativeTo="PlayerTalentFramePointsLeft" relativePoint="RIGHT"/>
</Anchors>
<TexCoords left="0.0625" right="0.9375" top="0" bottom="0.625"/>
</Texture>
<Texture name="PlayerTalentFramePointsRight" file="Interface\Common\Common-Input-Border">
<Size>
<AbsDimension x="8" y="20"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativeTo="PlayerTalentFramePointsMiddle" relativePoint="RIGHT"/>
</Anchors>
<TexCoords left="0.9375" right="1.0" top="0" bottom="0.625"/>
</Texture>
<FontString name="PlayerTalentFrameStatusText" inherits="GameFontNormal" text="TALENT_ACTIVE_SPEC_STATUS">
<Anchors>
<Anchor point="CENTER">
<Offset x="0" y="0"/>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
</Frame>
<Button name="PlayerTalentFrameActivateButton" inherits="UIPanelButtonTemplate2" text="TALENT_SPEC_ACTIVATE">
<Size x="80" y="22"/>
<Anchors>
<Anchor point="TOP">
<Offset x="10" y="-45"/>
</Anchor>
</Anchors>
<Scripts>
<OnLoad function="PlayerTalentFrameActivateButton_OnLoad"/>
<OnClick function="PlayerTalentFrameActivateButton_OnClick"/>
<OnShow function="PlayerTalentFrameActivateButton_OnShow"/>
<OnHide function="PlayerTalentFrameActivateButton_OnHide"/>
<OnEvent function="PlayerTalentFrameActivateButton_OnEvent"/>
</Scripts>
</Button>
<Frame name="PlayerTalentFramePointsBar">
<Size x="331" y="26"/>
<Anchors>
<Anchor point="LEFT">
<Offset x="16" y="0"/>
</Anchor>
<Anchor point="RIGHT">
<Offset x="-36" y="0"/>
</Anchor>
<Anchor point="BOTTOM">
<Offset x="0" y="81"/>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture name="$parentBackground" file="Interface\Buttons\UI-Button-Borders2" setAllPoints="true">
<Size x="331" y="26"/>
<TexCoords left="0.0" right="0.646484375" top="0.2109375" bottom="0.4140625"/>
</Texture>
</Layer>
<Layer level="BORDER">
<Texture name="$parentBorderLeft" file="Interface\Buttons\UI-Button-Borders2">
<Size x="6" y="18"/>
<Anchors>
<Anchor point="LEFT">
<Offset x="4" y="0"/>
</Anchor>
<Anchor point="TOP">
<Offset x="0" y="-5"/>
</Anchor>
<Anchor point="BOTTOM">
<Offset x="0" y="5"/>
</Anchor>
</Anchors>
<TexCoords left="0.0" right="0.01171875" top="0.421875" bottom="0.5625"/>
</Texture>
<Texture name="$parentBorderRight" file="Interface\Buttons\UI-Button-Borders2">
<Size x="6" y="18"/>
<Anchors>
<Anchor point="RIGHT">
<Offset x="-4" y="0"/>
</Anchor>
<Anchor point="TOP">
<Offset x="0" y="-5"/>
</Anchor>
<Anchor point="BOTTOM">
<Offset x="0" y="5"/>
</Anchor>
</Anchors>
<TexCoords left="0.3046875" right="0.31640625" top="0.421875" bottom="0.5625"/>
</Texture>
<Texture name="$parentBorderMiddle" file="Interface\Buttons\UI-Button-Borders2">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parentBorderLeft" relativePoint="TOPRIGHT"/>
<Anchor point="BOTTOMRIGHT" relativeTo="$parentBorderRight" relativePoint="BOTTOMLEFT"/>
</Anchors>
<TexCoords left="0.01171875" right="0.3046875" top="0.421875" bottom="0.5625"/>
</Texture>
</Layer>
<Layer level="ARTWORK">
<FontString name="PlayerTalentFrameSpentPointsText" inherits="GameFontNormalSmall" justifyH="LEFT">
<Size x="0" y="15"/>
<Anchors>
<Anchor point="LEFT">
<Offset x="12" y="1"/>
</Anchor>
</Anchors>
</FontString>
<FontString name="PlayerTalentFrameTalentPointsText" inherits="GameFontNormalSmall" justifyH="RIGHT">
<Size x="0" y="15"/>
<Anchors>
<Anchor point="RIGHT">
<Offset x="-12" y="1"/>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
</Frame>
<Frame name="PlayerTalentFramePreviewBar" hidden="true">
<Size x="331" y="26"/>
<Anchors>
<Anchor point="LEFT">
<Offset x="20" y="0"/>
</Anchor>
<Anchor point="RIGHT">
<Offset x="-36" y="0"/>
</Anchor>
<Anchor point="BOTTOM">
<Offset x="0" y="81"/>
</Anchor>
</Anchors>
<Layers>
<Layer level="BORDER">
<Texture name="$parentButtonBorder" file="Interface\Buttons\UI-Button-Borders2">
<Size x="164" y="26"/>
<Anchors>
<Anchor point="RIGHT"/>
</Anchors>
<TexCoords left="0.16015625" right="0.470703125" top="0.0" bottom="0.203125"/>
</Texture>
</Layer>
</Layers>
<Frames>
<Button name="PlayerTalentFrameResetButton" inherits="UIPanelButtonTemplate" text="RESET">
<Size x="80" y="22"/>
<Anchors>
<Anchor point="RIGHT">
<Offset x="-4" y="0"/>
</Anchor>
</Anchors>
<Scripts>
<OnEnter function="PlayerTalentFrameResetButton_OnEnter"/>
<OnLeave function="GameTooltip_Hide"/>
<OnClick function="PlayerTalentFrameResetButton_OnClick"/>
</Scripts>
</Button>
<Button name="PlayerTalentFrameLearnButton" inherits="UIPanelButtonTemplate" text="LEARN">
<Size x="80" y="22"/>
<Anchors>
<Anchor point="RIGHT" relativeTo="PlayerTalentFrameResetButton" relativePoint="LEFT"/>
</Anchors>
<Scripts>
<OnEnter function="PlayerTalentFrameLearnButton_OnEnter"/>
<OnLeave function="GameTooltip_Hide"/>
<OnClick function="PlayerTalentFrameLearnButton_OnClick"/>
</Scripts>
</Button>
<Frame name="PlayerTalentFramePreviewBarFiller">
<Size x="296" y="26"/>
<Anchors>
<Anchor point="LEFT"/>
<Anchor point="RIGHT" relativeTo="$parentButtonBorder" relativePoint="LEFT">
<Offset x="0" y="0"/>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture name="$parentButtonBackgroundLeft" file="Interface\Buttons\UI-Button-Borders2">
<Size x="8" y="26"/>
<Anchors>
<Anchor point="LEFT"/>
<Anchor point="TOP"/>
<Anchor point="BOTTOM"/>
</Anchors>
<TexCoords left="0.470703125" right="0.484375" top="0.0" bottom="0.203125"/>
</Texture>
<Texture name="$parentButtonBackgroundRight" file="Interface\Buttons\UI-Button-Borders2">
<Size x="8" y="26"/>
<Anchors>
<Anchor point="RIGHT"/>
<Anchor point="TOP"/>
<Anchor point="BOTTOM"/>
</Anchors>
<TexCoords left="0.78515625" right="0.80078125" top="0.0" bottom="0.203125"/>
</Texture>
<Texture name="$parentButtonBackgroundMiddle" file="Interface\Buttons\UI-Button-Borders2">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parentButtonBackgroundLeft" relativePoint="TOPRIGHT"/>
<Anchor point="BOTTOMRIGHT" relativeTo="$parentButtonBackgroundRight" relativePoint="BOTTOMLEFT"/>
</Anchors>
<TexCoords left="0.484375" right="0.78515625" top="0.0" bottom="0.203125"/>
</Texture>
</Layer>
</Layers>
</Frame>
</Frames>
</Frame>
<ScrollFrame name="PlayerTalentFrameScrollFrame" inherits="UIPanelScrollFrameTemplate">
<Size>
<AbsDimension x="296" y="332"/>
</Size>
<Anchors>
<Anchor point="TOPRIGHT">
<Offset>
<AbsDimension x="-65" y="-77"/>
</Offset>
</Anchor>
<Anchor point="BOTTOM" relativeTo="PlayerTalentFramePointsBar" relativePoint="TOP">
<Offset x="0" y="0"/>
</Anchor>
</Anchors>
<Layers>
<Layer level="BORDER">
<Texture name="PlayerTalentFrameBackgroundTopLeft">
<Size x="256" y="256"/>
<Anchors>
<Anchor point="TOPLEFT"/>
<Anchor point="RIGHT">
<Offset x="-40" y="0"/>
</Anchor>
<Anchor point="BOTTOM">
<Offset x="0" y="76"/>
</Anchor>
</Anchors>
<TexCoords left="0.0" right="1.0" top="0.0" bottom="1.0"/>
</Texture>
<Texture name="PlayerTalentFrameBackgroundTopRight">
<Size x="44" y="256"/>
<Anchors>
<Anchor point="TOPRIGHT"/>
<Anchor point="BOTTOMLEFT" relativeTo="PlayerTalentFrameBackgroundTopLeft" relativePoint="BOTTOMRIGHT"/>
</Anchors>
<TexCoords left="0.0" right="0.6875" top="0.0" bottom="1.0"/>
</Texture>
<Texture name="PlayerTalentFrameBackgroundBottomLeft">
<Size x="256" y="75"/>
<Anchors>
<Anchor point="BOTTOMLEFT"/>
<Anchor point="TOPRIGHT" relativeTo="PlayerTalentFrameBackgroundTopLeft" relativePoint="BOTTOMRIGHT"/>
</Anchors>
<TexCoords left="0.0" right="1.0" top="0.0" bottom="0.5859375"/>
</Texture>
<Texture name="PlayerTalentFrameBackgroundBottomRight">
<Size x="44" y="75"/>
<Anchors>
<Anchor point="BOTTOMRIGHT"/>
<Anchor point="TOPLEFT" relativeTo="PlayerTalentFrameBackgroundTopLeft" relativePoint="BOTTOMRIGHT"/>
</Anchors>
<TexCoords left="0.0" right="0.6875" top="0.0" bottom="0.5859375"/>
</Texture>
</Layer>
<Layer level="ARTWORK">
<Texture name="PlayerTalentFrameScrollFrameBackgroundTop" file="Interface\PaperDollInfoFrame\UI-Character-ScrollBar">
<Size>
<AbsDimension x="31" y="256"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="-2" y="5"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0" right="0.484375" top="0" bottom="1.0"/>
</Texture>
<Texture name="PlayerTalentFrameScrollFrameBackgroundBottom" file="Interface\PaperDollInfoFrame\UI-Character-ScrollBar">
<Size>
<AbsDimension x="31" y="106"/>
</Size>
<Anchors>
<Anchor point="BOTTOMLEFT" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="-2" y="-2"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0.515625" right="1.0" top="0" bottom="0.4140625"/>
</Texture>
</Layer>
</Layers>
<Frames>
<Frame name="PlayerTalentFrameActiveTalentGroupFrame" hidden="true">
<Size x="0" y="0"/>
<Anchors>
<Anchor point="TOPLEFT">
<Offset x="-2" y="4"/>
</Anchor>
<Anchor point="BOTTOMRIGHT">
<Offset x="2" y="-4"/>
</Anchor>
</Anchors>
<Backdrop bgFile="Interface\Tooltips\UI-Tooltip-Background" edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true">
<BorderColor r="1.0" g="0.82" b="0.0" a="1.0"/>
<Color r="0.0" g="0.0" b="0.0" a="0.0"/>
<EdgeSize>
<AbsValue val="16"/>
</EdgeSize>
<TileSize>
<AbsValue val="16"/>
</TileSize>
</Backdrop>
</Frame>
</Frames>
<ScrollChild>
<Frame name="PlayerTalentFrameScrollChildFrame">
<Size>
<AbsDimension x="320" y="50"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT"/>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture name="PlayerTalentFrameBranch1" inherits="TalentBranchTemplate"/>
<Texture name="PlayerTalentFrameBranch2" inherits="TalentBranchTemplate"/>
<Texture name="PlayerTalentFrameBranch3" inherits="TalentBranchTemplate"/>
<Texture name="PlayerTalentFrameBranch4" inherits="TalentBranchTemplate"/>
<Texture name="PlayerTalentFrameBranch5" inherits="TalentBranchTemplate"/>
<Texture name="PlayerTalentFrameBranch6" inherits="TalentBranchTemplate"/>
<Texture name="PlayerTalentFrameBranch7" inherits="TalentBranchTemplate"/>
<Texture name="PlayerTalentFrameBranch8" inherits="TalentBranchTemplate"/>
<Texture name="PlayerTalentFrameBranch9" inherits="TalentBranchTemplate"/>
<Texture name="PlayerTalentFrameBranch10" inherits="TalentBranchTemplate"/>
<Texture name="PlayerTalentFrameBranch11" inherits="TalentBranchTemplate"/>
<Texture name="PlayerTalentFrameBranch12" inherits="TalentBranchTemplate"/>
<Texture name="PlayerTalentFrameBranch13" inherits="TalentBranchTemplate"/>
<Texture name="PlayerTalentFrameBranch14" inherits="TalentBranchTemplate"/>
<Texture name="PlayerTalentFrameBranch15" inherits="TalentBranchTemplate"/>
<Texture name="PlayerTalentFrameBranch16" inherits="TalentBranchTemplate"/>
<Texture name="PlayerTalentFrameBranch17" inherits="TalentBranchTemplate"/>
<Texture name="PlayerTalentFrameBranch18" inherits="TalentBranchTemplate"/>
<Texture name="PlayerTalentFrameBranch19" inherits="TalentBranchTemplate"/>
<Texture name="PlayerTalentFrameBranch20" inherits="TalentBranchTemplate"/>
<Texture name="PlayerTalentFrameBranch21" inherits="TalentBranchTemplate"/>
<Texture name="PlayerTalentFrameBranch22" inherits="TalentBranchTemplate"/>
<Texture name="PlayerTalentFrameBranch23" inherits="TalentBranchTemplate"/>
<Texture name="PlayerTalentFrameBranch24" inherits="TalentBranchTemplate"/>
<Texture name="PlayerTalentFrameBranch25" inherits="TalentBranchTemplate"/>
<Texture name="PlayerTalentFrameBranch26" inherits="TalentBranchTemplate"/>
<Texture name="PlayerTalentFrameBranch27" inherits="TalentBranchTemplate"/>
<Texture name="PlayerTalentFrameBranch28" inherits="TalentBranchTemplate"/>
<Texture name="PlayerTalentFrameBranch29" inherits="TalentBranchTemplate"/>
<Texture name="PlayerTalentFrameBranch30" inherits="TalentBranchTemplate"/>
</Layer>
</Layers>
<Frames>
<Button name="PlayerTalentFrameTalent1" inherits="PlayerTalentButtonTemplate" id="1"/>
<Button name="PlayerTalentFrameTalent2" inherits="PlayerTalentButtonTemplate" id="2"/>
<Button name="PlayerTalentFrameTalent3" inherits="PlayerTalentButtonTemplate" id="3"/>
<Button name="PlayerTalentFrameTalent4" inherits="PlayerTalentButtonTemplate" id="4"/>
<Button name="PlayerTalentFrameTalent5" inherits="PlayerTalentButtonTemplate" id="5"/>
<Button name="PlayerTalentFrameTalent6" inherits="PlayerTalentButtonTemplate" id="6"/>
<Button name="PlayerTalentFrameTalent7" inherits="PlayerTalentButtonTemplate" id="7"/>
<Button name="PlayerTalentFrameTalent8" inherits="PlayerTalentButtonTemplate" id="8"/>
<Button name="PlayerTalentFrameTalent9" inherits="PlayerTalentButtonTemplate" id="9"/>
<Button name="PlayerTalentFrameTalent10" inherits="PlayerTalentButtonTemplate" id="10"/>
<Button name="PlayerTalentFrameTalent11" inherits="PlayerTalentButtonTemplate" id="11"/>
<Button name="PlayerTalentFrameTalent12" inherits="PlayerTalentButtonTemplate" id="12"/>
<Button name="PlayerTalentFrameTalent13" inherits="PlayerTalentButtonTemplate" id="13"/>
<Button name="PlayerTalentFrameTalent14" inherits="PlayerTalentButtonTemplate" id="14"/>
<Button name="PlayerTalentFrameTalent15" inherits="PlayerTalentButtonTemplate" id="15"/>
<Button name="PlayerTalentFrameTalent16" inherits="PlayerTalentButtonTemplate" id="16"/>
<Button name="PlayerTalentFrameTalent17" inherits="PlayerTalentButtonTemplate" id="17"/>
<Button name="PlayerTalentFrameTalent18" inherits="PlayerTalentButtonTemplate" id="18"/>
<Button name="PlayerTalentFrameTalent19" inherits="PlayerTalentButtonTemplate" id="19"/>
<Button name="PlayerTalentFrameTalent20" inherits="PlayerTalentButtonTemplate" id="20"/>
<Button name="PlayerTalentFrameTalent21" inherits="PlayerTalentButtonTemplate" id="21"/>
<Button name="PlayerTalentFrameTalent22" inherits="PlayerTalentButtonTemplate" id="22"/>
<Button name="PlayerTalentFrameTalent23" inherits="PlayerTalentButtonTemplate" id="23"/>
<Button name="PlayerTalentFrameTalent24" inherits="PlayerTalentButtonTemplate" id="24"/>
<Button name="PlayerTalentFrameTalent25" inherits="PlayerTalentButtonTemplate" id="25"/>
<Button name="PlayerTalentFrameTalent26" inherits="PlayerTalentButtonTemplate" id="26"/>
<Button name="PlayerTalentFrameTalent27" inherits="PlayerTalentButtonTemplate" id="27"/>
<Button name="PlayerTalentFrameTalent28" inherits="PlayerTalentButtonTemplate" id="28"/>
<Button name="PlayerTalentFrameTalent29" inherits="PlayerTalentButtonTemplate" id="29"/>
<Button name="PlayerTalentFrameTalent30" inherits="PlayerTalentButtonTemplate" id="30"/>
<Button name="PlayerTalentFrameTalent31" inherits="PlayerTalentButtonTemplate" id="31"/>
<Button name="PlayerTalentFrameTalent32" inherits="PlayerTalentButtonTemplate" id="32"/>
<Button name="PlayerTalentFrameTalent33" inherits="PlayerTalentButtonTemplate" id="33"/>
<Button name="PlayerTalentFrameTalent34" inherits="PlayerTalentButtonTemplate" id="34"/>
<Button name="PlayerTalentFrameTalent35" inherits="PlayerTalentButtonTemplate" id="35"/>
<Button name="PlayerTalentFrameTalent36" inherits="PlayerTalentButtonTemplate" id="36"/>
<Button name="PlayerTalentFrameTalent37" inherits="PlayerTalentButtonTemplate" id="37"/>
<Button name="PlayerTalentFrameTalent38" inherits="PlayerTalentButtonTemplate" id="38"/>
<Button name="PlayerTalentFrameTalent39" inherits="PlayerTalentButtonTemplate" id="39"/>
<Button name="PlayerTalentFrameTalent40" inherits="PlayerTalentButtonTemplate" id="40"/>
<Frame name="PlayerTalentFrameArrowFrame" setAllPoints="true">
<Layers>
<Layer level="OVERLAY">
<Texture name="PlayerTalentFrameArrow1" inherits="TalentArrowTemplate"/>
<Texture name="PlayerTalentFrameArrow2" inherits="TalentArrowTemplate"/>
<Texture name="PlayerTalentFrameArrow3" inherits="TalentArrowTemplate"/>
<Texture name="PlayerTalentFrameArrow4" inherits="TalentArrowTemplate"/>
<Texture name="PlayerTalentFrameArrow5" inherits="TalentArrowTemplate"/>
<Texture name="PlayerTalentFrameArrow6" inherits="TalentArrowTemplate"/>
<Texture name="PlayerTalentFrameArrow7" inherits="TalentArrowTemplate"/>
<Texture name="PlayerTalentFrameArrow8" inherits="TalentArrowTemplate"/>
<Texture name="PlayerTalentFrameArrow9" inherits="TalentArrowTemplate"/>
<Texture name="PlayerTalentFrameArrow10" inherits="TalentArrowTemplate"/>
<Texture name="PlayerTalentFrameArrow11" inherits="TalentArrowTemplate"/>
<Texture name="PlayerTalentFrameArrow12" inherits="TalentArrowTemplate"/>
<Texture name="PlayerTalentFrameArrow13" inherits="TalentArrowTemplate"/>
<Texture name="PlayerTalentFrameArrow14" inherits="TalentArrowTemplate"/>
<Texture name="PlayerTalentFrameArrow15" inherits="TalentArrowTemplate"/>
<Texture name="PlayerTalentFrameArrow16" inherits="TalentArrowTemplate"/>
<Texture name="PlayerTalentFrameArrow17" inherits="TalentArrowTemplate"/>
<Texture name="PlayerTalentFrameArrow18" inherits="TalentArrowTemplate"/>
<Texture name="PlayerTalentFrameArrow19" inherits="TalentArrowTemplate"/>
<Texture name="PlayerTalentFrameArrow20" inherits="TalentArrowTemplate"/>
<Texture name="PlayerTalentFrameArrow21" inherits="TalentArrowTemplate"/>
<Texture name="PlayerTalentFrameArrow22" inherits="TalentArrowTemplate"/>
<Texture name="PlayerTalentFrameArrow23" inherits="TalentArrowTemplate"/>
<Texture name="PlayerTalentFrameArrow24" inherits="TalentArrowTemplate"/>
<Texture name="PlayerTalentFrameArrow25" inherits="TalentArrowTemplate"/>
<Texture name="PlayerTalentFrameArrow26" inherits="TalentArrowTemplate"/>
<Texture name="PlayerTalentFrameArrow27" inherits="TalentArrowTemplate"/>
<Texture name="PlayerTalentFrameArrow28" inherits="TalentArrowTemplate"/>
<Texture name="PlayerTalentFrameArrow29" inherits="TalentArrowTemplate"/>
<Texture name="PlayerTalentFrameArrow30" inherits="TalentArrowTemplate"/>
</Layer>
</Layers>
</Frame>
</Frames>
</Frame>
</ScrollChild>
</ScrollFrame>
<Frame name="PlayerTalentFrameScrollButtonOverlay" parent="PlayerTalentFrameScrollFrameScrollBarScrollDownButton" hidden="true">
<Size>
<AbsDimension x="32" y="32"/>
</Size>
<Anchors>
<Anchor point="CENTER">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="OVERLAY">
<Texture file="Interface\Buttons\UI-ScrollBar-Button-Overlay" setAllPoints="true" alphaMode="ADD"/>
</Layer>
</Layers>
</Frame>
<Button name="PlayerTalentFrameTab1" inherits="PlayerTalentTabTemplate" id="1">
<Anchors>
<Anchor point="BOTTOMLEFT">
<Offset>
<AbsDimension x="15" y="46"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="PlayerTalentFrameTab2" inherits="PlayerTalentTabTemplate" id="2">
<Anchors>
<Anchor point="LEFT" relativeTo="PlayerTalentFrameTab1" relativePoint="RIGHT">
<Offset>
<AbsDimension x="-15" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="PlayerTalentFrameTab3" inherits="PlayerTalentTabTemplate" id="3">
<Anchors>
<Anchor point="LEFT" relativeTo="PlayerTalentFrameTab2" relativePoint="RIGHT">
<Offset>
<AbsDimension x="-15" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="PlayerTalentFrameTab4" inherits="PlayerGlyphTabTemplate" text="GLYPHS" id="4">
<Anchors>
<Anchor point="LEFT" relativeTo="PlayerTalentFrameTab3" relativePoint="RIGHT">
<Offset>
<AbsDimension x="-15" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<CheckButton name="PlayerSpecTab1" inherits="PlayerSpecTabTemplate" id="1">
<Anchors>
<Anchor point="TOPLEFT" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="-32" y="-65"/>
</Offset>
</Anchor>
</Anchors>
<!--
<Layers>
<Layer level="OVERLAY">
<Texture name="$parentOverlayIcon" file="Interface\TalentFrame\UI-TalentFrame-DualTalentSpec">
<Size x="18" y="32"/>
<Anchors>
<Anchor point="CENTER">
<Offset x="0" y="0"/>
</Anchor>
</Anchors>
<TexCoords left="0.390625" right="0.671875" top="0.0" bottom="1.0"/>
</Texture>
</Layer>
</Layers>
-->
<Scripts>
<OnLoad>
PlayerSpecTab_Load(self, "spec1");
</OnLoad>
</Scripts>
</CheckButton>
<CheckButton name="PlayerSpecTab2" inherits="PlayerSpecTabTemplate" id="2">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="PlayerSpecTab1" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-22"/>
</Offset>
</Anchor>
</Anchors>
<!--
<Layers>
<Layer level="OVERLAY">
<Texture name="$parentOverlayIcon" file="Interface\TalentFrame\UI-TalentFrame-DualTalentSpec">
<Size x="18" y="32"/>
<Anchors>
<Anchor point="CENTER">
<Offset x="0" y="0"/>
</Anchor>
</Anchors>
<TexCoords left="0.671875" right="0.9765625" top="0.0" bottom="1.0"/>
</Texture>
</Layer>
</Layers>
-->
<Scripts>
<OnLoad>
PlayerSpecTab_Load(self, "spec2");
</OnLoad>
</Scripts>
</CheckButton>
<CheckButton name="PlayerSpecTab3" inherits="PlayerSpecTabTemplate" id="3">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="PlayerSpecTab2" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-39"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
PlayerSpecTab_Load(self, "petspec1");
</OnLoad>
</Scripts>
</CheckButton>
</Frames>
<Scripts>
<OnShow function="PlayerTalentFrame_OnShow"/>
<OnHide function="PlayerTalentFrame_OnHide"/>
<OnLoad function="PlayerTalentFrame_OnLoad"/>
<OnEvent function="PlayerTalentFrame_OnEvent"/>
</Scripts>
</Frame>
</Ui>
@@ -0,0 +1 @@
-- This file is executed at the end of addon load
@@ -0,0 +1,768 @@
-- speed optimizations (mostly so update functions are faster)
local _G = getfenv(0);
local date = _G.date;
local abs = _G.abs;
local min = _G.min;
local max = _G.max;
local floor = _G.floor;
local mod = _G.mod;
local tonumber = _G.tonumber;
local gsub = _G.gsub;
local GetCVar = _G.GetCVar;
local SetCVar = _G.SetCVar;
local GetGameTime = _G.GetGameTime;
-- private data
local SEC_TO_MINUTE_FACTOR = 1/60;
local SEC_TO_HOUR_FACTOR = SEC_TO_MINUTE_FACTOR*SEC_TO_MINUTE_FACTOR;
local WARNING_SOUND_TRIGGER_OFFSET = -2 * SEC_TO_MINUTE_FACTOR; -- play warning sound 2 sec before alarm sound
local Settings = {
militaryTime = false;
localTime = false;
alarmHour = 12;
alarmMinute = 00;
alarmAM = true;
alarmMessage = "";
alarmEnabled = false;
};
local CVAR_USE_MILITARY_TIME = "timeMgrUseMilitaryTime";
local CVAR_USE_LOCAL_TIME = "timeMgrUseLocalTime";
local CVAR_ALARM_TIME = "timeMgrAlarmTime";
local CVAR_ALARM_MESSAGE = "timeMgrAlarmMessage";
local CVAR_ALARM_ENABLED = "timeMgrAlarmEnabled";
-- public data
MAX_TIMER_SEC = 99*3600 + 59*60 + 59; -- 99:59:59
local function _TimeManager_GetCurrentMinutes(localTime)
local currTime;
if ( localTime ) then
local dateInfo = date("*t");
local hour, minute = dateInfo.hour, dateInfo.min;
currTime = minute + hour*60;
else
local hour, minute = GetGameTime();
currTime = minute + hour*60;
end
return currTime;
end
-- CVar helpers
local function _TimeManager_Setting_SetBool(cvar, field, value)
if ( value ) then
SetCVar(cvar, "1");
else
SetCVar(cvar, "0");
end
Settings[field] = value;
end
local function _TimeManager_Setting_Set(cvar, field, value)
SetCVar(cvar, value);
Settings[field] = value;
end
local function _TimeManager_Setting_SetTime()
local alarmTime = GameTime_ComputeMinutes(Settings.alarmHour, Settings.alarmMinute, Settings.militaryTime, Settings.alarmAM);
SetCVar(CVAR_ALARM_TIME, alarmTime);
end
-- TimeManagerFrame
function TimeManager_Toggle()
if ( TimeManagerFrame:IsShown() ) then
TimeManagerFrame:Hide();
else
TimeManagerFrame:Show();
end
end
function TimeManagerFrame_OnLoad(self)
Settings.militaryTime = GetCVar(CVAR_USE_MILITARY_TIME) == "1";
Settings.localTime = GetCVar(CVAR_USE_LOCAL_TIME) == "1";
local alarmTime = tonumber(GetCVar(CVAR_ALARM_TIME));
Settings.alarmHour = floor(alarmTime / 60);
Settings.alarmMinute = max(min(alarmTime - Settings.alarmHour*60, 59), 0);
Settings.alarmHour = max(min(Settings.alarmHour, 23), 0);
if ( not Settings.militaryTime ) then
if ( Settings.alarmHour == 0 ) then
Settings.alarmHour = 12;
Settings.alarmAM = true;
elseif ( Settings.alarmHour < 12 ) then
Settings.alarmAM = true;
elseif ( Settings.alarmHour == 12 ) then
Settings.alarmAM = false;
else
Settings.alarmHour = Settings.alarmHour - 12;
Settings.alarmAM = false;
end
end
Settings.alarmMessage = GetCVar(CVAR_ALARM_MESSAGE);
Settings.alarmEnabled = GetCVar(CVAR_ALARM_ENABLED) == "1";
self:SetFrameLevel(self:GetFrameLevel() + 2);
UIDropDownMenu_Initialize(TimeManagerAlarmHourDropDown, TimeManagerAlarmHourDropDown_Initialize);
UIDropDownMenu_SetWidth(TimeManagerAlarmHourDropDown, 30, 40);
UIDropDownMenu_Initialize(TimeManagerAlarmMinuteDropDown, TimeManagerAlarmMinuteDropDown_Initialize);
UIDropDownMenu_SetWidth(TimeManagerAlarmMinuteDropDown, 30, 40);
UIDropDownMenu_Initialize(TimeManagerAlarmAMPMDropDown, TimeManagerAlarmAMPMDropDown_Initialize);
-- some languages have ridonculously long am/pm strings (i'm looking at you French) so we may have to
-- readjust the ampm dropdown width plus do some reanchoring if the text is too wide
local maxAMPMWidth;
TimeManagerAMPMDummyText:SetText(TIMEMANAGER_AM);
maxAMPMWidth = TimeManagerAMPMDummyText:GetWidth();
TimeManagerAMPMDummyText:SetText(TIMEMANAGER_PM);
if ( maxAMPMWidth < TimeManagerAMPMDummyText:GetWidth() ) then
maxAMPMWidth = TimeManagerAMPMDummyText:GetWidth();
end
maxAMPMWidth = ceil(maxAMPMWidth);
if ( maxAMPMWidth > 40 ) then
UIDropDownMenu_SetWidth(TimeManagerAlarmAMPMDropDown, maxAMPMWidth + 20, 40);
TimeManagerAlarmAMPMDropDown:SetScript("OnShow", TimeManagerAlarmAMPMDropDown_OnShow);
TimeManagerAlarmAMPMDropDown:SetScript("OnHide", TimeManagerAlarmAMPMDropDown_OnHide);
else
UIDropDownMenu_SetWidth(TimeManagerAlarmAMPMDropDown, 40, 40);
end
TimeManager_Update();
end
function TimeManagerFrame_OnUpdate(self, elapsed)
TimeManager_UpdateTimeTicker();
end
function TimeManagerFrame_OnShow(self)
TimeManager_Update();
TimeManagerStopwatchCheck:SetChecked(StopwatchFrame:IsShown());
PlaySound("igCharacterInfoOpen");
end
function TimeManagerFrame_OnHide(self)
PlaySound("igCharacterInfoClose");
end
function TimeManagerCloseButton_OnClick()
TimeManagerFrame:Hide();
end
function TimeManagerStopwatchCheck_OnClick(self)
Stopwatch_Toggle();
if ( self:GetChecked() ) then
PlaySound("igMainMenuOptionCheckBoxOn");
else
PlaySound("igMainMenuQuit");
end
end
function TimeManagerAlarmHourDropDown_Initialize()
local info = UIDropDownMenu_CreateInfo();
local alarmHour = Settings.alarmHour;
local militaryTime = Settings.militaryTime;
local hourMin, hourMax;
if ( militaryTime ) then
hourMin = 0;
hourMax = 23;
else
hourMin = 1;
hourMax = 12;
end
for hour = hourMin, hourMax, 1 do
info.value = hour;
if ( militaryTime ) then
info.text = format(TIMEMANAGER_24HOUR, hour);
else
info.text = hour;
info.justifyH = "RIGHT";
end
info.func = TimeManagerAlarmHourDropDown_OnClick;
if ( hour == alarmHour ) then
info.checked = 1;
UIDropDownMenu_SetText(TimeManagerAlarmHourDropDown, info.text);
else
info.checked = nil;
end
UIDropDownMenu_AddButton(info);
end
end
function TimeManagerAlarmMinuteDropDown_Initialize()
local info = UIDropDownMenu_CreateInfo();
local alarmMinute = Settings.alarmMinute;
for minute = 0, 55, 5 do
info.value = minute;
info.text = format(TIMEMANAGER_MINUTE, minute);
info.func = TimeManagerAlarmMinuteDropDown_OnClick;
if ( minute == alarmMinute ) then
info.checked = 1;
UIDropDownMenu_SetText(TimeManagerAlarmMinuteDropDown, info.text);
else
info.checked = nil;
end
UIDropDownMenu_AddButton(info);
end
end
function TimeManagerAlarmAMPMDropDown_Initialize()
local info = UIDropDownMenu_CreateInfo();
local pm = (Settings.militaryTime and Settings.alarmHour >= 12) or not Settings.alarmAM;
info.value = 1;
info.text = TIMEMANAGER_AM;
info.func = TimeManagerAlarmAMPMDropDown_OnClick;
if ( not pm ) then
info.checked = 1;
UIDropDownMenu_SetText(TimeManagerAlarmAMPMDropDown, info.text);
else
info.checked = nil;
end
UIDropDownMenu_AddButton(info);
info.value = 0;
info.text = TIMEMANAGER_PM;
info.func = TimeManagerAlarmAMPMDropDown_OnClick;
if ( pm ) then
info.checked = 1;
UIDropDownMenu_SetText(TimeManagerAlarmAMPMDropDown, info.text);
else
info.checked = nil;
end
UIDropDownMenu_AddButton(info);
end
function TimeManagerAlarmHourDropDown_OnClick(self)
UIDropDownMenu_SetSelectedValue(TimeManagerAlarmHourDropDown, self.value);
local oldValue = Settings.alarmHour;
Settings.alarmHour = self.value;
if ( Settings.alarmHour ~= oldValue ) then
TimeManager_StartCheckingAlarm();
end
_TimeManager_Setting_SetTime();
end
function TimeManagerAlarmMinuteDropDown_OnClick(self)
UIDropDownMenu_SetSelectedValue(TimeManagerAlarmMinuteDropDown, self.value);
local oldValue = Settings.alarmMinute;
Settings.alarmMinute = self.value;
if ( Settings.alarmMinute ~= oldValue ) then
TimeManager_StartCheckingAlarm();
end
_TimeManager_Setting_SetTime();
end
function TimeManagerAlarmAMPMDropDown_OnClick(self)
UIDropDownMenu_SetSelectedValue(TimeManagerAlarmAMPMDropDown, self.value);
if ( self.value == 1 ) then
if ( not Settings.alarmAM ) then
Settings.alarmAM = true;
TimeManager_StartCheckingAlarm();
end
else
if ( Settings.alarmAM ) then
Settings.alarmAM = false;
TimeManager_StartCheckingAlarm();
end
end
_TimeManager_Setting_SetTime();
end
function TimeManagerAlarmAMPMDropDown_OnShow()
-- readjust the size of and reanchor TimeManagerAlarmAMPMDropDown and all frames below it
TimeManagerAlarmAMPMDropDown:SetPoint("TOPLEFT", TimeManagerAlarmHourDropDown, "BOTTOMLEFT", 0, 5);
TimeManagerAlarmMessageFrame:SetPoint("TOPLEFT", TimeManagerAlarmHourDropDown, "BOTTOMLEFT", 20, -23);
TimeManagerAlarmEnabledButton:SetPoint("CENTER", TimeManagerFrame, "CENTER", -20, -69);
TimeManagerMilitaryTimeCheck:SetPoint("TOPLEFT", TimeManagerFrame, "TOPLEFT", 174, -207);
end
function TimeManagerAlarmAMPMDropDown_OnHide()
-- readjust the size of and reanchor TimeManagerAlarmAMPMDropDown and all frames below it
TimeManagerAlarmAMPMDropDown:SetPoint("LEFT", TimeManagerAlarmHourDropDown, "RIGHT", -22, 0);
TimeManagerAlarmMessageFrame:SetPoint("TOPLEFT", TimeManagerAlarmHourDropDown, "BOTTOMLEFT", 20, 0);
TimeManagerAlarmEnabledButton:SetPoint("CENTER", TimeManagerFrame, "CENTER", -20, -50);
TimeManagerMilitaryTimeCheck:SetPoint("TOPLEFT", TimeManagerFrame, "TOPLEFT", 174, -207);
end
function TimeManager_Update()
TimeManager_UpdateTimeTicker();
TimeManager_UpdateAlarmTime();
TimeManagerAlarmEnabledButton_Update();
TimeManagerAlarmMessageEditBox:SetText(Settings.alarmMessage);
TimeManagerMilitaryTimeCheck:SetChecked(Settings.militaryTime);
TimeManagerLocalTimeCheck:SetChecked(Settings.localTime);
end
function TimeManager_UpdateAlarmTime()
UIDropDownMenu_SetSelectedValue(TimeManagerAlarmHourDropDown, Settings.alarmHour);
UIDropDownMenu_SetSelectedValue(TimeManagerAlarmMinuteDropDown, Settings.alarmMinute);
UIDropDownMenu_SetText(TimeManagerAlarmMinuteDropDown, format(TIMEMANAGER_MINUTE, Settings.alarmMinute));
if ( Settings.militaryTime ) then
TimeManagerAlarmAMPMDropDown:Hide();
UIDropDownMenu_SetText(TimeManagerAlarmHourDropDown, format(TIMEMANAGER_24HOUR, Settings.alarmHour));
else
TimeManagerAlarmAMPMDropDown:Show();
UIDropDownMenu_SetText(TimeManagerAlarmHourDropDown, Settings.alarmHour);
if ( Settings.alarmAM ) then
UIDropDownMenu_SetSelectedValue(TimeManagerAlarmAMPMDropDown, 1);
UIDropDownMenu_SetText(TimeManagerAlarmAMPMDropDown, TIMEMANAGER_AM);
else
UIDropDownMenu_SetSelectedValue(TimeManagerAlarmAMPMDropDown, 0);
UIDropDownMenu_SetText(TimeManagerAlarmAMPMDropDown, TIMEMANAGER_PM);
end
end
end
function TimeManager_UpdateTimeTicker()
TimeManagerFrameTicker:SetText(GameTime_GetTime(false));
end
function TimeManagerAlarmMessageEditBox_OnEnterPressed(self)
self:ClearFocus();
end
function TimeManagerAlarmMessageEditBox_OnEscapePressed(self)
self:ClearFocus();
end
function TimeManagerAlarmMessageEditBox_OnEditFocusLost(self)
_TimeManager_Setting_Set(CVAR_ALARM_MESSAGE, "alarmMessage", TimeManagerAlarmMessageEditBox:GetText());
end
function TimeManagerAlarmEnabledButton_Update()
if ( Settings.alarmEnabled ) then
TimeManagerAlarmEnabledButton:SetText(TIMEMANAGER_ALARM_ENABLED);
TimeManagerAlarmEnabledButton:SetNormalFontObject(GameFontNormal);
TimeManagerAlarmEnabledButton:SetNormalTexture("Interface\\Buttons\\UI-Panel-Button-Up");
TimeManagerAlarmEnabledButton:SetPushedTexture("Interface\\Buttons\\UI-Panel-Button-Down");
else
TimeManagerAlarmEnabledButton:SetText(TIMEMANAGER_ALARM_DISABLED);
TimeManagerAlarmEnabledButton:SetNormalFontObject(GameFontHighlight);
TimeManagerAlarmEnabledButton:SetNormalTexture("Interface\\Buttons\\UI-Panel-Button-Disabled");
TimeManagerAlarmEnabledButton:SetPushedTexture("Interface\\Buttons\\UI-Panel-Button-Disabled-Down");
end
end
function TimeManagerAlarmEnabledButton_OnClick(self)
_TimeManager_Setting_SetBool(CVAR_ALARM_ENABLED, "alarmEnabled", not Settings.alarmEnabled);
if ( Settings.alarmEnabled ) then
PlaySound("igMainMenuOptionCheckBoxOn");
TimeManager_StartCheckingAlarm();
else
PlaySound("igMainMenuOptionCheckBoxOff");
if ( TimeManagerClockButton.alarmFiring ) then
TimeManager_TurnOffAlarm();
end
end
TimeManagerAlarmEnabledButton_Update();
end
function TimeManagerMilitaryTimeCheck_OnClick(self)
TimeManager_ToggleTimeFormat();
if ( self:GetChecked() ) then
PlaySound("igMainMenuOptionCheckBoxOn");
else
PlaySound("igMainMenuOptionCheckBoxOff");
end
end
function TimeManager_ToggleTimeFormat()
local alarmHour = Settings.alarmHour;
if ( Settings.militaryTime ) then
_TimeManager_Setting_SetBool(CVAR_USE_MILITARY_TIME, "militaryTime", false);
Settings.alarmHour, Settings.alarmAM = GameTime_ComputeStandardTime(Settings.alarmHour);
else
_TimeManager_Setting_SetBool(CVAR_USE_MILITARY_TIME, "militaryTime", true);
Settings.alarmHour = GameTime_ComputeMilitaryTime(Settings.alarmHour, Settings.alarmAM);
end
_TimeManager_Setting_SetTime();
TimeManager_UpdateAlarmTime();
-- TimeManagerFrame_OnUpdate will pick up the time ticker change
-- TimeManagerClockButton_OnUpdate will pick up the clock change
if ( CalendarFrame_UpdateTimeFormat ) then
-- update the Calendar's time format if it's available
CalendarFrame_UpdateTimeFormat();
end
end
function TimeManagerLocalTimeCheck_OnClick(self)
TimeManager_ToggleLocalTime();
-- since we're changing which time type we're checking, we need to check the alarm now
TimeManager_StartCheckingAlarm();
if ( self:GetChecked() ) then
PlaySound("igMainMenuOptionCheckBoxOn");
else
PlaySound("igMainMenuOptionCheckBoxOff");
end
end
function TimeManager_ToggleLocalTime()
_TimeManager_Setting_SetBool(CVAR_USE_LOCAL_TIME, "localTime", not Settings.localTime);
-- TimeManagerFrame_OnUpdate will pick up the time ticker change
-- TimeManagerClockButton_OnUpdate will pick up the clock change
end
-- TimeManagerClockButton
function TimeManagerClockButton_Show()
TimeManagerClockButton:Show();
end
function TimeManagerClockButton_Hide()
TimeManagerClockButton:Hide();
end
function TimeManagerClockButton_OnLoad(self)
self:SetFrameLevel(self:GetFrameLevel() + 2);
TimeManagerClockButton_Update();
if ( Settings.alarmEnabled ) then
TimeManager_StartCheckingAlarm();
end
self:RegisterForClicks("AnyUp");
end
function TimeManagerClockButton_Update()
TimeManagerClockTicker:SetText(GameTime_GetTime(false));
end
function TimeManagerClockButton_OnEnter(self)
GameTooltip:SetOwner(self, "ANCHOR_LEFT");
TimeManagerClockButton:SetScript("OnUpdate", TimeManagerClockButton_OnUpdateWithTooltip);
end
function TimeManagerClockButton_OnLeave(self)
GameTooltip:Hide();
TimeManagerClockButton:SetScript("OnUpdate", TimeManagerClockButton_OnUpdate);
end
function TimeManagerClockButton_OnClick(self)
if ( self.alarmFiring ) then
PlaySound("igMainMenuQuit");
TimeManager_TurnOffAlarm();
else
TimeManager_Toggle();
end
end
function TimeManagerClockButton_OnUpdate(self, elapsed)
TimeManagerClockButton_Update();
if ( self.checkAlarm and Settings.alarmEnabled ) then
TimeManager_CheckAlarm(elapsed);
end
end
function TimeManagerClockButton_OnUpdateWithTooltip(self, elapsed)
TimeManagerClockButton_OnUpdate(self, elapsed);
TimeManagerClockButton_UpdateTooltip();
end
function TimeManager_ShouldCheckAlarm()
return TimeManagerClockButton.checkAlarm and Settings.alarmEnabled;
end
function TimeManager_StartCheckingAlarm()
TimeManagerClockButton.checkAlarm = true;
-- set the time to play the warning sound
local alarmTime = GameTime_ComputeMinutes(Settings.alarmHour, Settings.alarmMinute, Settings.militaryTime, Settings.alarmAM);
local warningTime = alarmTime + WARNING_SOUND_TRIGGER_OFFSET;
-- max minutes per day = 24*60 = 1440
if ( warningTime < 0 ) then
warningTime = warningTime + 1440;
elseif ( warningTime > 1440 ) then
warningTime = warningTime - 1440;
end
TimeManagerClockButton.warningTime = warningTime;
TimeManagerClockButton.checkAlarmWarning = true;
-- since game time isn't available in seconds, we have to keep track of the previous minute
-- in order to play our alarm warning sound at the right time
TimeManagerClockButton.currentMinute = _TimeManager_GetCurrentMinutes(Settings.localTime);
TimeManagerClockButton.currentMinuteCounter = 0;
end
function TimeManager_CheckAlarm(elapsed)
local currTime = _TimeManager_GetCurrentMinutes(Settings.localTime);
local alarmTime = GameTime_ComputeMinutes(Settings.alarmHour, Settings.alarmMinute, Settings.militaryTime, Settings.alarmAM);
-- check for the warning sound
local clockButton = TimeManagerClockButton;
if ( clockButton.checkAlarmWarning ) then
if ( clockButton.currentMinute ~= currTime ) then
clockButton.currentMinute = currTime;
clockButton.currentMinuteCounter = 0;
end
local secOffset = floor(clockButton.currentMinuteCounter) * SEC_TO_MINUTE_FACTOR;
if ( (currTime + secOffset) == clockButton.warningTime ) then
TimeManager_FireAlarmWarning();
end
clockButton.currentMinuteCounter = clockButton.currentMinuteCounter + elapsed;
end
-- check for the alarm sound
if ( currTime == alarmTime ) then
TimeManager_FireAlarm();
end
end
function TimeManager_FireAlarmWarning()
TimeManagerClockButton.checkAlarmWarning = false;
PlaySound("AlarmClockWarning1");
end
function TimeManager_FireAlarm()
TimeManagerClockButton.alarmFiring = true;
TimeManagerClockButton.checkAlarm = false;
-- do a bunch of crazy stuff to get the player's attention
if ( gsub(Settings.alarmMessage, "%s", "") ~= "" ) then
local info = ChatTypeInfo["SYSTEM"];
DEFAULT_CHAT_FRAME:AddMessage(Settings.alarmMessage, info.r, info.g, info.b, info.id);
RaidNotice_AddMessage(RaidWarningFrame, Settings.alarmMessage, ChatTypeInfo["RAID_WARNING"]);
end
PlaySound("AlarmClockWarning2");
UIFrameFlash(TimeManagerAlarmFiredTexture, 0.5, 0.5, -1);
-- show the clock if necessary, but record its current state so it can return to that state after
-- the player turns the alarm off
TimeManagerClockButton.prevShown = TimeManagerClockButton:IsShown();
TimeManagerClockButton:Show();
end
function TimeManager_TurnOffAlarm()
UIFrameFlashStop(TimeManagerAlarmFiredTexture);
if ( not TimeManagerClockButton.prevShown ) then
TimeManagerClockButton:Hide();
end
TimeManagerClockButton.alarmFiring = false;
end
function TimeManager_IsAlarmFiring()
return TimeManagerClockButton.alarmFiring;
end
function TimeManagerClockButton_UpdateTooltip()
GameTooltip:ClearLines();
if ( TimeManagerClockButton.alarmFiring ) then
if ( gsub(Settings.alarmMessage, "%s", "") ~= "" ) then
GameTooltip:AddLine(Settings.alarmMessage, HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b, 1);
GameTooltip:AddLine(" ");
end
GameTooltip:AddLine(TIMEMANAGER_ALARM_TOOLTIP_TURN_OFF);
else
GameTime_UpdateTooltip();
GameTooltip:AddLine(" ");
GameTooltip:AddLine(GAMETIME_TOOLTIP_TOGGLE_CLOCK);
end
-- readjust tooltip size
GameTooltip:Show();
end
-- StopwatchFrame
function Stopwatch_Toggle()
if ( StopwatchFrame:IsShown() ) then
StopwatchFrame:Hide();
else
StopwatchFrame:Show();
end
end
function Stopwatch_StartCountdown(hour, minute, second)
local sec = 0;
if ( hour ) then
sec = hour * 3600;
end
if ( minute ) then
sec = sec + minute * 60;
end
if ( second ) then
sec = sec + second;
end
if ( sec == 0 ) then
Stopwatch_Toggle();
return;
end
if ( sec > MAX_TIMER_SEC ) then
StopwatchTicker.timer = MAX_TIMER_SEC;
elseif ( sec < 0 ) then
StopwatchTicker.timer = 0;
else
StopwatchTicker.timer = sec;
end
StopwatchTicker_Update();
StopwatchTicker.reverse = sec > 0;
StopwatchFrame:Show();
end
function Stopwatch_Play()
if ( StopwatchPlayPauseButton.playing ) then
return;
end
StopwatchPlayPauseButton.playing = true;
StopwatchTicker:SetScript("OnUpdate", StopwatchTicker_OnUpdate);
StopwatchPlayPauseButton:SetNormalTexture("Interface\\TimeManager\\PauseButton");
end
function Stopwatch_Pause()
if ( not StopwatchPlayPauseButton.playing ) then
return;
end
StopwatchPlayPauseButton.playing = false;
StopwatchTicker:SetScript("OnUpdate", nil);
StopwatchPlayPauseButton:SetNormalTexture("Interface\\Buttons\\UI-SpellbookIcon-NextPage-Up");
end
function Stopwatch_IsPlaying()
return StopwatchPlayPauseButton.playing;
end
function Stopwatch_Clear()
StopwatchTicker.timer = 0;
StopwatchTicker.reverse = false;
StopwatchTicker:SetScript("OnUpdate", nil);
StopwatchTicker_Update();
StopwatchPlayPauseButton.playing = false;
StopwatchPlayPauseButton:SetNormalTexture("Interface\\Buttons\\UI-SpellbookIcon-NextPage-Up");
end
function Stopwatch_FinishCountdown()
Stopwatch_Clear();
PlaySound("AlarmClockWarning3");
end
function StopwatchCloseButton_OnClick()
PlaySound("igMainMenuQuit");
StopwatchFrame:Hide();
end
function StopwatchFrame_OnLoad(self)
self:RegisterEvent("ADDON_LOADED");
self:RegisterEvent("PLAYER_LOGOUT");
self:RegisterForDrag("LeftButton");
StopwatchTabFrame:SetAlpha(0);
Stopwatch_Clear();
end
function StopwatchFrame_OnEvent(self, event, ...)
if ( event == "ADDON_LOADED" ) then
local name = ...;
if ( name == "Blizzard_TimeManager" ) then
if ( not BlizzardStopwatchOptions ) then
BlizzardStopwatchOptions = {};
end
if ( BlizzardStopwatchOptions.position ) then
StopwatchFrame:ClearAllPoints();
StopwatchFrame:SetPoint("CENTER", "UIParent", "BOTTOMLEFT", BlizzardStopwatchOptions.position.x, BlizzardStopwatchOptions.position.y);
StopwatchFrame:SetUserPlaced(true);
else
StopwatchFrame:SetPoint("TOPRIGHT", "UIParent", "TOPRIGHT", -250, -300);
end
end
elseif ( event == "PLAYER_LOGOUT" ) then
if ( StopwatchFrame:IsUserPlaced() ) then
if ( not BlizzardStopwatchOptions.position ) then
BlizzardStopwatchOptions.position = {};
end
BlizzardStopwatchOptions.position.x, BlizzardStopwatchOptions.position.y = StopwatchFrame:GetCenter();
StopwatchFrame:SetUserPlaced(false);
else
BlizzardStopwatchOptions.position = nil;
end
end
end
function StopwatchFrame_OnUpdate(self)
if ( self.prevMouseIsOver ) then
if ( not self:IsMouseOver() ) then
UIFrameFadeOut(StopwatchTabFrame, CHAT_FRAME_FADE_TIME);
self.prevMouseIsOver = false;
end
else
if ( self:IsMouseOver() ) then
UIFrameFadeIn(StopwatchTabFrame, CHAT_FRAME_FADE_TIME);
self.prevMouseIsOver = true;
end
end
end
function StopwatchFrame_OnShow(self)
TimeManagerStopwatchCheck:SetChecked(1);
end
function StopwatchFrame_OnHide(self)
UIFrameFadeRemoveFrame(StopwatchTabFrame);
StopwatchTabFrame:SetAlpha(0);
self.prevMouseIsOver = false;
TimeManagerStopwatchCheck:SetChecked(nil);
end
function StopwatchFrame_OnMouseDown(self)
self:SetScript("OnUpdate", nil);
end
function StopwatchFrame_OnMouseUp(self)
self:SetScript("OnUpdate", StopwatchFrame_OnUpdate);
end
function StopwatchFrame_OnDragStart(self)
self:StartMoving();
end
function StopwatchFrame_OnDragStop(self)
StopwatchFrame_OnMouseUp(self); -- OnMouseUp won't fire if OnDragStart fired after OnMouseDown
self:StopMovingOrSizing();
end
function StopwatchTicker_OnUpdate(self, elapsed)
if ( self.reverse ) then
self.timer = self.timer - elapsed;
if ( self.timer <= 0 ) then
Stopwatch_FinishCountdown();
return;
end
else
self.timer = self.timer + elapsed;
end
StopwatchTicker_Update();
end
function StopwatchTicker_Update()
local timer = StopwatchTicker.timer;
local hour = min(floor(timer*SEC_TO_HOUR_FACTOR), 99);
local minute = mod(timer*SEC_TO_MINUTE_FACTOR, 60);
local second = mod(timer, 60);
StopwatchTickerHour:SetFormattedText(STOPWATCH_TIME_UNIT, hour);
StopwatchTickerMinute:SetFormattedText(STOPWATCH_TIME_UNIT, minute);
StopwatchTickerSecond:SetFormattedText(STOPWATCH_TIME_UNIT, second);
end
function StopwatchResetButton_OnClick()
Stopwatch_Clear();
PlaySound("igMainMenuOptionCheckBoxOff");
end
function StopwatchPlayPauseButton_OnClick(self)
if ( self.playing ) then
Stopwatch_Pause();
PlaySound("igMainMenuOptionCheckBoxOff");
else
Stopwatch_Play();
PlaySound("igMainMenuOptionCheckBoxOn");
end
end
@@ -0,0 +1,7 @@
## Interface: 30300
## Title: Blizzard Time Manager
## Secure: 1
## LoadOnDemand: 1
## SavedVariablesPerCharacter: BlizzardStopwatchOptions
Blizzard_TimeManager.xml
Localization.lua
@@ -0,0 +1,503 @@
<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="Blizzard_TimeManager.lua"/>
<Frame name="TimeManagerFrame" toplevel="true" parent="UIParent" enableMouse="true" frameStrata="DIALOG" hidden="true">
<Size x="256" y="256"/>
<Anchors>
<Anchor point="TOPRIGHT">
<Offset x="45" y="-170"/>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture name="TimeManagerGlobe" file="Interface\TimeManager\GlobeIcon">
<Size x="64" y="64"/>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="6" y="-4"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
</Layer>
<Layer level="BORDER">
<Texture file="Interface\PaperDollInfoFrame\UI-Character-General-TopLeft">
<Size x="172" y="240"/>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0" right="0.671875" top="0" bottom="0.937500"/>
</Texture>
<Texture file="Interface\PaperDollInfoFrame\UI-Character-General-TopRight">
<Size x="68" y="240"/>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="172" y="0"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0.46875" right="1" top="0" bottom="0.937500"/>
</Texture>
<Texture file="Interface\PaperDollInfoFrame\UI-Character-General-BottomLeft">
<Size x="172" y="88"/>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="0" y="-240"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0" right="0.671875" top="0.65625" bottom="1.0"/>
</Texture>
<Texture file="Interface\PaperDollInfoFrame\UI-Character-General-BottomRight">
<Size x="68" y="88"/>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="172" y="-240"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0.46875" right="1.0" top="0.65625" bottom="1.0"/>
</Texture>
<FontString name="TimeManagerFrameTicker" inherits="GameFontHighlightLarge" text="TIMEMANAGER_TICKER" justifyH="CENTER">
<Anchors>
<Anchor point="CENTER" relativeTo="TimeManagerGlobe">
<Offset x="-2" y="0"/>
</Anchor>
</Anchors>
</FontString>
<FontString inherits="GameFontWhite" text="TIMEMANAGER_TITLE">
<Anchors>
<Anchor point="TOP">
<Offset x="0" y="-17"/>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Frames>
<Button name="TimeManagerCloseButton" inherits="UIPanelCloseButton">
<Anchors>
<Anchor point="TOPRIGHT">
<Offset x="-46" y="-8"/>
</Anchor>
</Anchors>
<Scripts>
<OnClick function="TimeManagerCloseButton_OnClick"/>
</Scripts>
</Button>
<Frame name="TimeManagerStopwatchFrame">
<Size x="160" y="60"/>
<Anchors>
<Anchor point="TOPRIGHT">
<Offset x="-40" y="-24"/>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture name="TimeManagerStopwatchFrameBackground" file="Interface\QuestFrame\UI-QuestItemNameFrame">
<Size x="150" y="50"/>
<Anchors>
<Anchor point="RIGHT">
<Offset>
<AbsDimension x="-4" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
</Layer>
<Layer level="ARTWORK">
<FontString name="TimeManagerStopwatchFrameText" text="TIMEMANAGER_SHOW_STOPWATCH" inherits="GameFontNormalSmall" justifyH="RIGHT">
<Anchors>
<Anchor point="RIGHT">
<Offset x="-48" y="0"/>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Frames>
<CheckButton name="TimeManagerStopwatchCheck">
<Size x="28" y="28"/>
<Anchors>
<Anchor point="RIGHT">
<Offset x="-17" y="1"/>
</Anchor>
</Anchors>
<Scripts>
<OnClick function="TimeManagerStopwatchCheck_OnClick"/>
</Scripts>
<NormalTexture file="Interface\Icons\INV_Misc_PocketWatch_01">
<Size x="28" y="28"/>
<Anchors>
<Anchor point="CENTER">
<Offset>
<AbsDimension x="0" y="-1"/>
</Offset>
</Anchor>
</Anchors>
</NormalTexture>
<HighlightTexture alphaMode="ADD" file="Interface\Buttons\ButtonHilight-Square"/>
<CheckedTexture alphaMode="ADD" file="Interface\Buttons\CheckButtonHilight"/>
</CheckButton>
</Frames>
</Frame>
<Frame name="TimeManagerAlarmTimeFrame">
<Size x="145" y="52"/>
<Anchors>
<Anchor point="TOPLEFT">
<Offset x="25" y="-80"/>
</Anchor>
</Anchors>
<Layers>
<Layer level="ARTWORK">
<FontString name="TimeManagerAlarmTimeLabel" inherits="GameFontNormalSmall" text="TIMEMANAGER_ALARM_TIME">
<Anchors>
<Anchor point="TOPLEFT">
<Offset x="0" y="0"/>
</Anchor>
</Anchors>
</FontString>
<FontString name="TimeManagerAMPMDummyText" inherits="GameFontHighlightSmall" hidden="true">
<Anchors>
<Anchor point="TOPLEFT">
<Offset x="0" y="0"/>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Frames>
<Frame name="TimeManagerAlarmHourDropDown" inherits="UIDropDownMenuTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="TimeManagerAlarmTimeLabel" relativePoint="BOTTOMLEFT">
<Offset x="-20" y="-4"/>
</Anchor>
</Anchors>
</Frame>
<Frame name="TimeManagerAlarmMinuteDropDown" inherits="UIDropDownMenuTemplate">
<Anchors>
<Anchor point="LEFT" relativeTo="TimeManagerAlarmHourDropDown" relativePoint="RIGHT">
<Offset x="-22" y="0"/>
</Anchor>
</Anchors>
</Frame>
<Frame name="TimeManagerAlarmAMPMDropDown" inherits="UIDropDownMenuTemplate">
<Anchors>
<Anchor point="LEFT" relativeTo="TimeManagerAlarmMinuteDropDown" relativePoint="RIGHT">
<Offset x="-22" y="0"/>
</Anchor>
</Anchors>
</Frame>
</Frames>
</Frame>
<Frame name="TimeManagerAlarmMessageFrame">
<Size x="160" y="40"/>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="TimeManagerAlarmHourDropDown" relativePoint="BOTTOMLEFT">
<Offset x="20" y="0"/>
</Anchor>
</Anchors>
<Layers>
<Layer level="ARTWORK">
<FontString name="TimeManagerAlarmMessageLabel" inherits="GameFontNormalSmall" text="TIMEMANAGER_ALARM_MESSAGE">
<Anchors>
<Anchor point="TOPLEFT">
<Offset x="0" y="0"/>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Frames>
<EditBox name="TimeManagerAlarmMessageEditBox" inherits="InputBoxTemplate" autoFocus="false" letters="32" historyLines="1">
<Size x="160" y="20"/>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="TimeManagerAlarmMessageLabel" relativePoint="BOTTOMLEFT">
<Offset x="4" y="-4"/>
</Anchor>
</Anchors>
<Scripts>
<OnEnterPressed function="TimeManagerAlarmMessageEditBox_OnEnterPressed"/>
<OnEscapePressed function="TimeManagerAlarmMessageEditBox_OnEscapePressed"/>
<OnEditFocusLost function="TimeManagerAlarmMessageEditBox_OnEditFocusLost"/>
</Scripts>
</EditBox>
</Frames>
</Frame>
<Button name="TimeManagerAlarmEnabledButton" inherits="UIPanelButtonTemplate">
<Size x="160" y="20"/>
<Anchors>
<Anchor point="CENTER">
<Offset x="-20" y="-50"/>
</Anchor>
</Anchors>
<Scripts>
<OnClick function="TimeManagerAlarmEnabledButton_OnClick"/>
</Scripts>
</Button>
<CheckButton name="TimeManagerMilitaryTimeCheck" inherits="UICheckButtonTemplate">
<Size x="24" y="24"/>
<Anchors>
<Anchor point="TOPLEFT">
<Offset x="171" y="-203"/>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
_G[self:GetName().."Text"]:SetText(TIMEMANAGER_24HOURMODE);
TimeManagerMilitaryTimeCheckText:ClearAllPoints();
TimeManagerMilitaryTimeCheckText:SetPoint("RIGHT", self, "RIGHT", -self:GetWidth(), 0);
TimeManagerMilitaryTimeCheckText:SetFontObject(GameFontHighlightSmall);
</OnLoad>
<OnClick function="TimeManagerMilitaryTimeCheck_OnClick"/>
</Scripts>
</CheckButton>
<CheckButton name="TimeManagerLocalTimeCheck" inherits="UICheckButtonTemplate">
<Size x="24" y="24"/>
<Anchors>
<Anchor point="TOPRIGHT" relativeTo="TimeManagerMilitaryTimeCheck" relativePoint="BOTTOMRIGHT">
<Offset x="0" y="6"/>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
_G[self:GetName().."Text"]:SetText(TIMEMANAGER_LOCALTIME);
TimeManagerLocalTimeCheckText:ClearAllPoints();
TimeManagerLocalTimeCheckText:SetPoint("RIGHT", self, "RIGHT", -self:GetWidth(), 0);
TimeManagerLocalTimeCheckText:SetFontObject(GameFontHighlightSmall);
</OnLoad>
<OnClick function="TimeManagerLocalTimeCheck_OnClick"/>
</Scripts>
</CheckButton>
</Frames>
<Scripts>
<OnLoad function="TimeManagerFrame_OnLoad"/>
<OnUpdate function="TimeManagerFrame_OnUpdate"/>
<OnShow function="TimeManagerFrame_OnShow"/>
<OnHide function="TimeManagerFrame_OnHide"/>
</Scripts>
</Frame>
<!-- Minimap button to access the TimeManagerButton -->
<Button name="TimeManagerClockButton" parent="Minimap" hidden="true">
<Size x="60" y="28"/>
<Anchors>
<Anchor point="CENTER">
<Offset x="0" y="-68"/>
</Anchor>
</Anchors>
<Layers>
<Layer level="BORDER">
<Texture file="Interface\TimeManager\ClockBackground" setAllPoints="true">
<TexCoords left="0.015625" right="0.8125" top="0.015625" bottom="0.390625"/>
</Texture>
</Layer>
<Layer level="ARTWORK">
<FontString name="TimeManagerClockTicker" inherits="GameFontHighlightSmall">
<Anchors>
<Anchor point="CENTER">
<Offset x="0" y="0"/>
</Anchor>
</Anchors>
</FontString>
<Texture name="TimeManagerAlarmFiredTexture" file="Interface\TimeManager\ClockBackground" alphaMode="ADD" hidden="true" setAllPoints="true">
<TexCoords left="0.015625" right="0.8125" top="0.51625" bottom="0.890625"/>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnLoad function="TimeManagerClockButton_OnLoad"/>
<OnEnter function="TimeManagerClockButton_OnEnter"/>
<OnLeave function="TimeManagerClockButton_OnLeave"/>
<OnUpdate function="TimeManagerClockButton_OnUpdate"/>
<OnClick function="TimeManagerClockButton_OnClick"/>
</Scripts>
</Button>
<!-- Stopwatch -->
<Frame name="StopwatchFrame" toplevel="true" parent="UIParent" movable="true" enableMouse="true" hidden="true" clampedToScreen="true" frameStrata="DIALOG">
<Size x="132" y="44"/>
<Anchors>
<Anchor point="TOPRIGHT">
<Offset x="-250" y="-300"/>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture name="$parentBackgroundLeft" file="Interface\TimeManager\TimerBackground">
<Size x="122" y="29"/>
<Anchors>
<Anchor point="BOTTOMLEFT"/>
</Anchors>
<TexCoords left="0.046875" right="1.0" top="0" bottom="0.453125"/>
</Texture>
<Texture file="Interface\TimeManager\TimerBackground">
<Size x="10" y="29"/>
<Anchors>
<Anchor point="LEFT" relativeTo="$parentBackgroundLeft" relativePoint="RIGHT"/>
</Anchors>
<TexCoords left="0.0" right="0.078125" top="0.46875" bottom="0.921875"/>
</Texture>
</Layer>
</Layers>
<Frames>
<Frame name="StopwatchTicker">
<Size x="100" y="20"/>
<Anchors>
<Anchor point="BOTTOMRIGHT">
<Offset x="-49" y="3"/>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<FontString name="StopwatchTickerSecond" inherits="GameFontHighlightLarge" justifyH="CENTER">
<Anchors>
<Anchor point="TOPRIGHT">
<Offset x="0" y="0"/>
</Anchor>
</Anchors>
</FontString>
<FontString text=":" inherits="GameFontHighlightLarge">
<Anchors>
<Anchor point="TOPRIGHT">
<Offset x="-22" y="0"/>
</Anchor>
</Anchors>
</FontString>
<FontString name="StopwatchTickerMinute" inherits="GameFontHighlightLarge" justifyH="CENTER">
<Anchors>
<Anchor point="TOPRIGHT">
<Offset x="-27" y="0"/>
</Anchor>
</Anchors>
</FontString>
<FontString text=":" inherits="GameFontHighlightLarge">
<Anchors>
<Anchor point="TOPRIGHT">
<Offset x="-49" y="0"/>
</Anchor>
</Anchors>
</FontString>
<FontString name="StopwatchTickerHour" inherits="GameFontHighlightLarge" justifyH="CENTER">
<Anchors>
<Anchor point="TOPRIGHT">
<Offset x="-54" y="0"/>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
</Frame>
<Frame name="StopwatchTabFrame">
<Size x="126" y="16"/>
<Anchors>
<Anchor point="TOP">
<Offset x="0" y="0"/>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture name="$parentLeft" file="Interface\ChatFrame\ChatFrameTab">
<Size x="7" y="1"/>
<Anchors>
<Anchor point="LEFT"/>
<Anchor point="TOP"/>
<Anchor point="BOTTOM"/>
</Anchors>
<TexCoords left="0.03125" right="0.140625" top="0.28125" bottom="1.0"/>
</Texture>
<Texture name="$parentMiddle" file="Interface\ChatFrame\ChatFrameTab">
<Size x="112" y="1"/>
<Anchors>
<Anchor point="LEFT" relativeTo="$parentLeft" relativePoint="RIGHT"/>
<Anchor point="TOP"/>
<Anchor point="BOTTOM"/>
</Anchors>
<TexCoords left="0.140625" right="0.859375" top="0.28125" bottom="1.0"/>
</Texture>
<Texture name="$parentRight" file="Interface\ChatFrame\ChatFrameTab">
<Size x="7" y="1"/>
<Anchors>
<Anchor point="LEFT" relativeTo="$parentMiddle" relativePoint="RIGHT"/>
<Anchor point="TOP"/>
<Anchor point="BOTTOM"/>
</Anchors>
<TexCoords left="0.859375" right="0.96875" top="0.28125" bottom="1.0"/>
</Texture>
<FontString name="StopwatchTitle" text="STOPWATCH_TITLE" inherits="GameFontNormalSmall" justifyH="CENTER">
<Anchors>
<Anchor point="TOP">
<Offset x="0" y="-3"/>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Frames>
<Button name="StopwatchCloseButton" inherits="UIPanelCloseButton">
<Size x="20" y="20"/>
<Anchors>
<Anchor point="TOPRIGHT">
<Offset x="1" y="1"/>
</Anchor>
</Anchors>
<Scripts>
<OnClick function="StopwatchCloseButton_OnClick"/>
</Scripts>
</Button>
</Frames>
</Frame>
<Button name="StopwatchResetButton">
<Size x="24" y="24"/>
<Anchors>
<Anchor point="BOTTOMRIGHT">
<Offset x="-2" y="3"/>
</Anchor>
</Anchors>
<Scripts>
<OnEnter>
GameTooltip_AddNewbieTip(self, nil, 1.0, 1.0, 1.0, NEWBIE_TOOLTIP_STOPWATCH_RESETBUTTON, 1);
</OnEnter>
<OnLeave function="GameTooltip_Hide"/>
<OnClick function="StopwatchResetButton_OnClick"/>
</Scripts>
<NormalTexture file="Interface\TimeManager\ResetButton"/>
<HighlightTexture file="Interface\Buttons\UI-Common-MouseHilight" alphaMode="ADD"/>
</Button>
<Button name="StopwatchPlayPauseButton">
<Size x="24" y="24"/>
<Anchors>
<Anchor point="RIGHT" relativeTo="StopwatchResetButton" relativePoint="LEFT">
<Offset x="5" y="0"/>
</Anchor>
</Anchors>
<Scripts>
<OnEnter>
GameTooltip_AddNewbieTip(self, nil, 1.0, 1.0, 1.0, NEWBIE_TOOLTIP_STOPWATCH_PLAYPAUSEBUTTON, 1);
</OnEnter>
<OnLeave function="GameTooltip_Hide"/>
<OnClick function="StopwatchPlayPauseButton_OnClick"/>
</Scripts>
<NormalTexture file="Interface\Buttons\UI-SpellbookIcon-NextPage-Up"/>
<HighlightTexture file="Interface\Buttons\UI-Common-MouseHilight" alphaMode="ADD"/>
</Button>
</Frames>
<Scripts>
<OnLoad function="StopwatchFrame_OnLoad"/>
<OnEvent function="StopwatchFrame_OnEvent"/>
<OnUpdate function="StopwatchFrame_OnUpdate"/>
<OnShow function="StopwatchFrame_OnShow"/>
<OnHide function="StopwatchFrame_OnHide"/>
<OnMouseDown function="StopwatchFrame_OnMouseDown"/>
<OnMouseUp function="StopwatchFrame_OnMouseUp"/>
<OnDragStart function="StopwatchFrame_OnDragStart"/>
<OnDragStop function="StopwatchFrame_OnDragStop"/>
</Scripts>
</Frame>
</Ui>
@@ -0,0 +1 @@
-- This file is executed at the end of addon load
@@ -0,0 +1,313 @@
UIPanelWindows["TokenFrame"] = { area = "left", pushable = 1, whileDead = 1 };
TOKEN_BUTTON_OFFSET = 3;
MAX_WATCHED_TOKENS = 3;
BACKPACK_TOKENFRAME_HEIGHT = 22;
-- REMOVE ME!!!
SlashCmdList["TOKENUI"] = function() ToggleCharacter("TokenFrame"); end;
function TokenButton_OnLoad(self)
local name = self:GetName();
self.count = _G[name.."Count"];
self.name = _G[name.."Name"];
self.icon = _G[name.."Icon"];
self.check = _G[name.."Check"];
self.expandIcon = _G[name.."ExpandIcon"];
self.categoryLeft = _G[name.."CategoryLeft"];
self.categoryRight = _G[name.."CategoryRight"];
self.highlight = _G[name.."Highlight"];
self.stripe = _G[name.."Stripe"];
end
function TokenFrame_OnLoad()
TokenFrameContainerScrollBar.Show =
function (self)
TokenFrameContainer:SetWidth(299);
for _, button in next, _G["TokenFrameContainer"].buttons do
button:SetWidth(295);
end
getmetatable(self).__index.Show(self);
end
TokenFrameContainerScrollBar.Hide =
function (self)
TokenFrameContainer:SetWidth(313);
for _, button in next, TokenFrameContainer.buttons do
button:SetWidth(313);
end
getmetatable(self).__index.Hide(self);
end
TokenFrameContainer.update = TokenFrame_Update;
HybridScrollFrame_CreateButtons(TokenFrameContainer, "TokenButtonTemplate", 0, -2, "TOPLEFT", "TOPLEFT", 0, -TOKEN_BUTTON_OFFSET);
local buttons = TokenFrameContainer.buttons;
local numButtons = #buttons;
for i=1, numButtons do
if ( mod(i, 2) == 1 ) then
buttons[i].stripe:Hide();
end
end
end
function TokenFrame_OnShow(self)
SetButtonPulse(CharacterFrameTab5, 0, 1); --Stop the button pulse
TokenFrame_Update();
end
function TokenFrame_Update()
-- Setup the buttons
local scrollFrame = TokenFrameContainer;
local offset = HybridScrollFrame_GetOffset(scrollFrame);
local buttons = scrollFrame.buttons;
local numButtons = #buttons;
local numTokenTypes = GetCurrencyListSize();
local name, isHeader, isExpanded, isUnused, isWatched, count, extraCurrencyType, icon, itemID;
local button, index;
for i=1, numButtons do
index = offset+i;
name, isHeader, isExpanded, isUnused, isWatched, count, extraCurrencyType, icon, itemID = GetCurrencyListInfo(index);
button = buttons[i];
button.check:Hide();
if ( not name or name == "" ) then
button:Hide();
else
if ( isHeader ) then
button.categoryLeft:Show();
button.categoryRight:Show();
button.expandIcon:Show();
button.count:SetText("");
button.icon:SetTexture("");
if ( isExpanded ) then
button.expandIcon:SetTexCoord(0.5625, 1, 0, 0.4375);
else
button.expandIcon:SetTexCoord(0, 0.4375, 0, 0.4375);
end
button.highlight:SetTexture("Interface\\TokenFrame\\UI-TokenFrame-CategoryButton");
button.highlight:SetPoint("TOPLEFT", button, "TOPLEFT", 3, -2);
button.highlight:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", -3, 2);
button:SetText(name);
button.name:SetText("");
button.itemID = nil;
button.LinkButton:Hide();
else
button.categoryLeft:Hide();
button.categoryRight:Hide();
button.expandIcon:Hide();
button.count:SetText(count);
button.extraCurrencyType = extraCurrencyType;
if ( extraCurrencyType == 1 ) then --Arena points
button.icon:SetTexture("Interface\\PVPFrame\\PVP-ArenaPoints-Icon");
button.icon:SetTexCoord(0, 1, 0, 1);
elseif ( extraCurrencyType == 2 ) then --Honor points
local factionGroup = UnitFactionGroup("player");
if ( factionGroup ) then
button.icon:SetTexture("Interface\\TargetingFrame\\UI-PVP-"..factionGroup);
button.icon:SetTexCoord( 0.03125, 0.59375, 0.03125, 0.59375 );
else
button.icon:Hide() --We don't know their faction yet!
button.icon:SetTexCoord(0, 1, 0, 1);
end
else
button.icon:SetTexture(icon);
button.icon:SetTexCoord(0, 1, 0, 1);
end
if ( isWatched ) then
button.check:Show();
end
button.highlight:SetTexture("Interface\\QuestFrame\\UI-QuestTitleHighlight");
button.highlight:SetPoint("TOPLEFT", button, "TOPLEFT", 0, 0);
button.highlight:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", 0, 0);
--Gray out the text if the count is 0
if ( count == 0 ) then
button.count:SetFontObject("GameFontDisable");
button.name:SetFontObject("GameFontDisable");
else
button.count:SetFontObject("GameFontHighlight");
button.name:SetFontObject("GameFontHighlight");
end
button:SetText("");
button.name:SetText(name);
button.itemID = itemID;
button.LinkButton:Show();
end
--Manage highlight
if ( name == TokenFrame.selectedToken ) then
TokenFrame.selectedID = index;
button:LockHighlight();
else
button:UnlockHighlight();
end
button.index = index;
button.isHeader = isHeader;
button.isExpanded = isExpanded;
button.isUnused = isUnused;
button.isWatched = isWatched;
button:Show();
end
end
local totalHeight = numTokenTypes * (button:GetHeight()+TOKEN_BUTTON_OFFSET);
local displayedHeight = #buttons * (button:GetHeight()+TOKEN_BUTTON_OFFSET);
HybridScrollFrame_Update(scrollFrame, totalHeight, displayedHeight);
if ( numTokenTypes == 0 ) then
CharacterFrameTab5:Hide();
else
CharacterFrameTab5:Show();
end
end
function TokenFramePopup_CloseIfHidden()
-- This handles the case where you close a category with the selected token popup shown
local numTokenTypes = GetCurrencyListSize();
local selectedFound;
for i=1, numTokenTypes do
if ( TokenFrame.selectedToken == GetCurrencyListInfo(i) ) then
selectedFound = 1;
end
end
if ( not selectedFound ) then
TokenFramePopup:Hide();
end
end
function BackpackTokenFrame_Update()
local watchButton;
local name, count, extraCurrencyType, icon;
for i=1, MAX_WATCHED_TOKENS do
name, count, extraCurrencyType, icon, itemID = GetBackpackCurrencyInfo(i);
-- Update watched tokens
if ( name ) then
watchButton = _G["BackpackTokenFrameToken"..i];
watchButton.extraCurrencyType = extraCurrencyType;
if ( extraCurrencyType == 1 ) then --Arena points
watchButton.icon:SetTexture("Interface\\PVPFrame\\PVP-ArenaPoints-Icon");
watchButton.icon:SetTexCoord(0, 1, 0, 1);
elseif ( extraCurrencyType == 2 ) then --Honor points
local factionGroup = UnitFactionGroup("player");
if ( factionGroup ) then
watchButton.icon:SetTexture("Interface\\TargetingFrame\\UI-PVP-"..factionGroup);
watchButton.icon:SetTexCoord( 0.03125, 0.59375, 0.03125, 0.59375 );
else
watchButton.icon:SetTexCoord(0, 1, 0, 1);
end
else
watchButton.icon:SetTexture(icon);
watchButton.icon:SetTexCoord(0, 1, 0, 1);
end
if ( count <= 99999 ) then
watchButton.count:SetText(count);
else
watchButton.count:SetText("*");
end
watchButton:Show();
BackpackTokenFrame.shouldShow = 1;
BackpackTokenFrame.numWatchedTokens = i;
watchButton.itemID = itemID;
else
_G["BackpackTokenFrameToken"..i]:Hide();
if ( i == 1 ) then
BackpackTokenFrame.shouldShow = nil;
end
_G["BackpackTokenFrameToken"..i].itemID = nil;
end
end
end
function GetNumWatchedTokens()
if ( not BackpackTokenFrame.numWatchedTokens ) then
-- No count yet so get it
BackpackTokenFrame_Update();
end
return BackpackTokenFrame.numWatchedTokens or 0;
end
function BackpackTokenFrame_IsShown()
return BackpackTokenFrame.shouldShow;
end
function ManageBackpackTokenFrame(backpack)
if ( not backpack ) then
backpack = GetBackpackFrame();
end
if ( not backpack ) then
-- If still no backpack then we don't show the frame
BackpackTokenFrame:Hide();
return;
end
if ( BackpackTokenFrame_IsShown() ) then
BackpackTokenFrame:SetParent(backpack);
BackpackTokenFrame:SetPoint("BOTTOMLEFT", backpack, "BOTTOMLEFT", 9, 0);
backpack:SetHeight(BACKPACK_HEIGHT+BACKPACK_TOKENFRAME_HEIGHT);
BackpackTokenFrame:Show();
else
backpack:SetHeight(BACKPACK_HEIGHT);
BackpackTokenFrame:Hide();
end
end
function TokenButton_OnClick(self)
if ( self.isHeader ) then
if ( self.isExpanded ) then
ExpandCurrencyList(self.index, 0);
else
ExpandCurrencyList(self.index, 1);
end
else
TokenFrame.selectedToken = self.name:GetText();
if ( IsModifiedClick("TOKENWATCHTOGGLE") ) then
TokenFrame.selectedID = self.index;
if ( self.isWatched ) then
SetCurrencyBackpack(TokenFrame.selectedID, 0);
self.isWatched = false;
else
-- Set an error message if trying to show too many quests
if ( GetNumWatchedTokens() >= MAX_WATCHED_TOKENS ) then
UIErrorsFrame:AddMessage(format(TOO_MANY_WATCHED_TOKENS, MAX_WATCHED_TOKENS), 1.0, 0.1, 0.1, 1.0);
return;
end
SetCurrencyBackpack(TokenFrame.selectedID, 1);
self.isWatched = true;
end
if ( TokenFrame.selectedID == self.index ) then
TokenFrame_UpdatePopup(self);
end
BackpackTokenFrame_Update();
ManageBackpackTokenFrame();
else
if ( TokenFramePopup:IsShown() ) then
if ( TokenFrame.selectedID == self.index ) then
TokenFramePopup:Hide();
else
TokenFramePopup:Show();
end
else
TokenFramePopup:Show();
end
TokenFrame.selectedID = self.index;
TokenFrame_UpdatePopup(self);
end
end
TokenFrame_Update();
TokenFramePopup_CloseIfHidden();
end
function TokenFrame_UpdatePopup(button)
TokenFramePopupInactiveCheckBox:SetChecked(button.isUnused);
TokenFramePopupBackpackCheckBox:SetChecked(button.isWatched);
end
function TokenButtonLinkButton_OnClick(self, button)
if ( IsModifiedClick("CHATLINK") ) then
ChatEdit_InsertLink(select(2, GetItemInfo(self:GetParent().itemID)));
end
end
function BackpackTokenButton_OnClick(self, button)
if ( IsModifiedClick("CHATLINK") ) then
ChatEdit_InsertLink(select(2, GetItemInfo(self.itemID)));
end
end
@@ -0,0 +1,6 @@
## Interface: 30300
## Title: Blizzard_TokenUI
## Secure: 1
Blizzard_TokenUI.lua
Blizzard_TokenUI.xml
Localization.lua
@@ -0,0 +1,504 @@
<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">
<Button name="TokenButtonTemplate" virtual="true">
<Size>
<AbsDimension x="295" y="17"/>
</Size>
<Layers>
<Layer level="BACKGROUND">
<Texture name="$parentStripe" setAllPoints="true">
<Color a=".08" r="1" g="1" b="1"/>
</Texture>
</Layer>
<Layer level="BORDER">
<Texture name="$parentIcon">
<Size>
<AbsDimension x="15" y="15"/>
</Size>
<Anchors>
<Anchor point="RIGHT" >
<Offset x="-20" y="0"/>
</Anchor>
</Anchors>
</Texture>
<FontString name="$parentCount" inherits="GameFontHighlightRight" text="100">
<Anchors>
<Anchor point="RIGHT" relativeTo="$parentIcon" relativePoint="LEFT">
<Offset x="-5" y="0"/>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentName" inherits="GameFontHighlightLeft">
<Size>
<AbsDimension x="210" y="11"/>
</Size>
<Anchors>
<Anchor point="LEFT">
<Offset x="11" y="0"/>
</Anchor>
</Anchors>
</FontString>
<Texture name="$parentCheck" file="Interface\Buttons\UI-CheckBox-Check">
<Size>
<AbsDimension x="16" y="16"/>
</Size>
<Anchors>
<Anchor point="RIGHT">
<Offset x="-3" y="0"/>
</Anchor>
</Anchors>
</Texture>
<Texture name="$parentCategoryRight" file="Interface\TokenFrame\UI-TokenFrame-CategoryButton">
<Size>
<AbsDimension x="37" y="18"/>
</Size>
<Anchors>
<Anchor point="RIGHT">
<Offset x="0" y="0"/>
</Anchor>
</Anchors>
<TexCoords left="0" right="0.14453125" top="0.296875" bottom="0.578125"/>
</Texture>
<Texture name="$parentCategoryLeft" file="Interface\TokenFrame\UI-TokenFrame-CategoryButton">
<Size>
<AbsDimension x="256" y="18"/>
</Size>
<Anchors>
<Anchor point="LEFT">
<Offset x="0" y="0"/>
</Anchor>
<Anchor point="RIGHT" relativeTo="$parentCategoryRight" relativePoint="LEFT">
<Offset x="0" y="0"/>
</Anchor>
</Anchors>
<TexCoords left="0" right="1" top="0" bottom="0.28125"/>
</Texture>
</Layer>
<Layer level="ARTWORK">
<Texture name="$parentExpandIcon" file="Interface\Buttons\UI-PlusMinus-Buttons">
<Size>
<AbsDimension x="7" y="7"/>
</Size>
<Anchors>
<Anchor point="RIGHT">
<Offset x="-8" y="0"/>
</Anchor>
</Anchors>
</Texture>
</Layer>
</Layers>
<Frames>
<Button enableMouse="true" parentKey="LinkButton">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parentIcon">
<Offset x="0" y="0"/>
</Anchor>
<Anchor point="BOTTOMRIGHT" relativeTo="$parentIcon">
<Offset x="0" y="0"/>
</Anchor>
</Anchors>
<Scripts>
<OnEnter>
GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
if ( self:GetParent().extraCurrencyType == 1 ) then
GameTooltip:SetText(ARENA_POINTS, HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b);
GameTooltip:AddLine(TOOLTIP_ARENA_POINTS, nil, nil, nil, 1);
GameTooltip:Show();
elseif ( self:GetParent().extraCurrencyType == 2 ) then
GameTooltip:SetText(HONOR_POINTS, HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b);
GameTooltip:AddLine(TOOLTIP_HONOR_POINTS, nil, nil, nil, 1);
GameTooltip:Show();
else
GameTooltip:SetCurrencyToken(self:GetParent().index);
end
</OnEnter>
<OnLeave>
GameTooltip:Hide();
</OnLeave>
<OnClick>
TokenButtonLinkButton_OnClick(self, button, down);
</OnClick>
</Scripts>
</Button>
</Frames>
<Scripts>
<OnLoad>
TokenButton_OnLoad(self);
</OnLoad>
<OnClick>
TokenButton_OnClick(self, button, down);
</OnClick>
</Scripts>
<ButtonText>
<Anchors>
<Anchor point="CENTER">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</ButtonText>
<NormalFont style="GameFontNormal"/>
<HighlightTexture name="$parentHighlight" file="Interface\TokenFrame\UI-TokenFrame-CategoryButton" alphaMode="ADD">
<Anchors>
<Anchor point="TOPLEFT">
<Offset x="3" y="-2"/>
</Anchor>
<Anchor point="BOTTOMRIGHT">
<Offset x="-3" y="2"/>
</Anchor>
</Anchors>
<TexCoords left="0" right="1" top="0.609375" bottom="0.796875"/>
</HighlightTexture>
</Button>
<Frame name="TokenFrame" setAllPoints="true" parent="CharacterFrame" enableMouse="true" hidden="true" id="5">
<HitRectInsets>
<AbsInset left="0" right="30" top="0" bottom="45"/>
</HitRectInsets>
<Layers>
<Layer level="ARTWORK">
<Texture file="Interface\PaperDollInfoFrame\UI-Character-General-TopLeft">
<Size>
<AbsDimension x="256" y="256"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="2" y="-1"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<Texture file="Interface\PaperDollInfoFrame\UI-Character-General-TopRight">
<Size>
<AbsDimension x="128" y="256"/>
</Size>
<Anchors>
<Anchor point="TOPRIGHT">
<Offset>
<AbsDimension x="2" y="-1"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<Texture file="Interface\TalentFrame\UI-TalentFrame-BotLeft">
<Size>
<AbsDimension x="256" y="256"/>
</Size>
<Anchors>
<Anchor point="BOTTOMLEFT">
<Offset>
<AbsDimension x="2" y="-1"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<Texture file="Interface\TalentFrame\UI-TalentFrame-BotRight">
<Size>
<AbsDimension x="128" y="256"/>
</Size>
<Anchors>
<Anchor point="BOTTOMRIGHT">
<Offset>
<AbsDimension x="2" y="-1"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
</Layer>
</Layers>
<Frames>
<ScrollFrame name="$parentContainer" inherits="HybridScrollFrameTemplate">
<Size x="299" y="330"/>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="26" y="-77"/>
</Offset>
</Anchor>
</Anchors>
<Frames>
<Slider name="$parentScrollBar" inherits="HybridScrollBarTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="0" y="-12"/>
</Offset>
</Anchor>
<Anchor point="BOTTOMLEFT" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="0" y="11"/>
</Offset>
</Anchor>
</Anchors>
</Slider>
</Frames>
</ScrollFrame>
<Frame name="$parentMoneyFrame" inherits="SmallMoneyFrameTemplate" hidden="false">
<Anchors>
<Anchor point="BOTTOMRIGHT" relativeTo="TokenFrame" relativePoint="BOTTOMRIGHT">
<Offset x="-115" y="84"/>
</Anchor>
</Anchors>
</Frame>
<Button name="$parentCancelButton" inherits="UIPanelButtonTemplate" text="CLOSE">
<Size>
<AbsDimension x="80" y="22"/>
</Size>
<Anchors>
<Anchor point="CENTER" relativePoint="TOPLEFT">
<Offset>
<AbsDimension x="305" y="-421"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
HideUIPanel(self:GetParent():GetParent());
</OnClick>
</Scripts>
</Button>
<Button inherits="UIPanelCloseButton">
<Anchors>
<Anchor point="CENTER" relativeTo="CharacterFrame" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="-44" y="-25"/>
</Offset>
</Anchor>
</Anchors>
</Button>
</Frames>
<Scripts>
<OnLoad function="TokenFrame_OnLoad"/>
<OnShow function="TokenFrame_OnShow"/>
<OnHide>
TokenFramePopup:Hide();
</OnHide>
</Scripts>
</Frame>
<Frame name="TokenFramePopup" parent="TokenFrame" toplevel="true" hidden="true" enableMouse="true">
<Size>
<AbsDimension x="205" y="100"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="TokenFrame" relativePoint="TOPRIGHT">
<Offset x="-33" y="-28"/>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<FontString name="$parentTitle" inherits="GameFontNormal" text="TOKEN_OPTIONS">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="TokenFramePopup" relativePoint="TOPLEFT">
<Offset x="25" y="-17"/>
</Anchor>
</Anchors>
</FontString>
</Layer>
<Layer level="OVERLAY">
<Texture name="$parentCorner" file="Interface\DialogFrame\UI-DialogBox-Corner">
<Size>
<AbsDimension x="32" y="32"/>
</Size>
<Anchors>
<Anchor point="TOPRIGHT">
<Offset>
<AbsDimension x="-6" y="-7"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
</Layer>
</Layers>
<Frames>
<CheckButton name="$parentInactiveCheckBox" inherits="OptionsSmallCheckButtonTemplate">
<Size>
<AbsDimension x="26" y="26"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="TokenFramePopup" relativePoint="TOPLEFT">
<Offset x="32" y="-32"/>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
_G[self:GetName().."Text"]:SetText(UNUSED);
_G[self:GetName().."Text"]:SetTextColor(HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b);
</OnLoad>
<OnClick>
if ( self:GetChecked() ) then
PlaySound("igMainMenuOptionCheckBoxOn");
SetCurrencyUnused(TokenFrame.selectedID, 1);
else
PlaySound("igMainMenuOptionCheckBoxOff");
SetCurrencyUnused(TokenFrame.selectedID, 0);
end
TokenFrame_Update();
TokenFramePopup_CloseIfHidden();
BackpackTokenFrame_Update();
ManageBackpackTokenFrame();
</OnClick>
<OnEnter>
GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
GameTooltip:SetText(TOKEN_MOVE_TO_UNUSED, nil, nil, nil, nil, 1);
</OnEnter>
<OnLeave function="GameTooltip_Hide"/>
</Scripts>
</CheckButton>
<CheckButton name="$parentBackpackCheckBox" inherits="OptionsSmallCheckButtonTemplate">
<Size>
<AbsDimension x="26" y="26"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="TokenFramePopupInactiveCheckBox" relativePoint="BOTTOMLEFT">
<Offset x="0" y="4"/>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
_G[self:GetName().."Text"]:SetText(SHOW_ON_BACKPACK);
_G[self:GetName().."Text"]:SetTextColor(HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b);
</OnLoad>
<OnClick>
if ( self:GetChecked() ) then
if ( GetNumWatchedTokens() >= MAX_WATCHED_TOKENS ) then
UIErrorsFrame:AddMessage(format(TOO_MANY_WATCHED_TOKENS, MAX_WATCHED_TOKENS), 1.0, 0.1, 0.1, 1.0);
self:SetChecked(false);
return;
end
PlaySound("igMainMenuOptionCheckBoxOn");
SetCurrencyBackpack(TokenFrame.selectedID, 1);
else
PlaySound("igMainMenuOptionCheckBoxOff");
SetCurrencyBackpack(TokenFrame.selectedID, 0);
end
TokenFrame_Update();
BackpackTokenFrame_Update();
ManageBackpackTokenFrame();
</OnClick>
<OnEnter>
GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
GameTooltip:SetText(TOKEN_SHOW_ON_BACKPACK, nil, nil, nil, nil, 1);
</OnEnter>
<OnLeave function="GameTooltip_Hide"/>
</Scripts>
</CheckButton>
<Button name="$parentCloseButton" inherits="UIPanelCloseButton">
<Anchors>
<Anchor point="TOPRIGHT">
<Offset>
<AbsDimension x="-3" y="-3"/>
</Offset>
</Anchor>
</Anchors>
</Button>
</Frames>
<Backdrop bgFile="Interface\DialogFrame\UI-DialogBox-Background" edgeFile="Interface\DialogFrame\UI-DialogBox-Border" tile="true">
<BackgroundInsets>
<AbsInset left="11" right="12" top="12" bottom="11"/>
</BackgroundInsets>
<TileSize>
<AbsValue val="32"/>
</TileSize>
<EdgeSize>
<AbsValue val="32"/>
</EdgeSize>
</Backdrop>
</Frame>
<Button name="BackpackTokenTemplate" hidden="true" virtual="true">
<Size>
<AbsDimension x="50" y="12"/>
</Size>
<Layers>
<Layer level="BACKGROUND">
<FontString name="$parentCount" inherits="GameFontHighlightSmall" justifyH="RIGHT">
<Size x="38" y="10"/>
<Anchors>
<Anchor point="TOPLEFT">
<Offset x="0" y="0"/>
</Anchor>
</Anchors>
</FontString>
<Texture name="$parentIcon">
<Size>
<AbsDimension x="12" y="12"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativeTo="$parentCount" relativePoint="RIGHT">
<Offset x="0" y="0"/>
</Anchor>
</Anchors>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnLoad>
local name = self:GetName();
self.icon = _G[name.."Icon"];
self.count = _G[name.."Count"];
</OnLoad>
<OnEnter>
GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
if ( self.extraCurrencyType == 1 ) then
GameTooltip:SetText(ARENA_POINTS, HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b);
GameTooltip:AddLine(TOOLTIP_ARENA_POINTS, nil, nil, nil, 1);
GameTooltip:Show();
elseif ( self.extraCurrencyType == 2 ) then
GameTooltip:SetText(HONOR_POINTS, HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b);
GameTooltip:AddLine(TOOLTIP_HONOR_POINTS, nil, nil, nil, 1);
GameTooltip:Show();
else
GameTooltip:SetBackpackToken(self:GetID());
end
</OnEnter>
<OnLeave>
GameTooltip:Hide();
</OnLeave>
<OnClick>
BackpackTokenButton_OnClick(self, button, down);
</OnClick>
</Scripts>
</Button>
<Frame name="BackpackTokenFrame" parent="UIParent">
<Size>
<AbsDimension x="183" y="32"/>
</Size>
<Layers>
<Layer level="BACKGROUND">
<Texture file="Interface\ContainerFrame\UI-Backpack-TokenFrame">
<Size>
<AbsDimension x="256" y="32"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset x="0" y="0"/>
</Anchor>
</Anchors>
</Texture>
</Layer>
</Layers>
<Frames>
<Button name="$parentToken1" inherits="BackpackTokenTemplate" id="1">
<Anchors>
<Anchor point="LEFT">
<Offset x="13" y="0"/>
</Anchor>
</Anchors>
</Button>
<Button name="$parentToken2" inherits="BackpackTokenTemplate" id="2">
<Anchors>
<Anchor point="LEFT" relativeTo="$parentToken1" relativePoint="RIGHT">
<Offset x="2" y="0"/>
</Anchor>
</Anchors>
</Button>
<Button name="$parentToken3" inherits="BackpackTokenTemplate" id="3">
<Anchors>
<Anchor point="LEFT" relativeTo="$parentToken2" relativePoint="RIGHT">
<Offset x="2" y="0"/>
</Anchor>
</Anchors>
</Button>
</Frames>
</Frame>
</Ui>
@@ -0,0 +1 @@
-- This file is executed at the end of addon load
@@ -0,0 +1,635 @@
TRADE_SKILLS_DISPLAYED = 8;
MAX_TRADE_SKILL_REAGENTS = 8;
TRADE_SKILL_HEIGHT = 16;
TRADE_SKILL_TEXT_WIDTH = 275;
TradeSkillTypePrefix = {
["optimal"] = " [+++] ",
["medium"] = " [++] ",
["easy"] = " [+] ",
["trivial"] = " ",
["header"] = " ",
}
TradeSkillTypeColor = { };
TradeSkillTypeColor["optimal"] = { r = 1.00, g = 0.50, b = 0.25, font = GameFontNormalLeftOrange };
TradeSkillTypeColor["medium"] = { r = 1.00, g = 1.00, b = 0.00, font = GameFontNormalLeftYellow };
TradeSkillTypeColor["easy"] = { r = 0.25, g = 0.75, b = 0.25, font = GameFontNormalLeftLightGreen };
TradeSkillTypeColor["trivial"] = { r = 0.50, g = 0.50, b = 0.50, font = GameFontNormalLeftGrey };
TradeSkillTypeColor["header"] = { r = 1.00, g = 0.82, b = 0, font = GameFontNormalLeft };
UIPanelWindows["TradeSkillFrame"] = { area = "left", pushable = 3, showFailedFunc = "TradeSkillFrame_ShowFailed" };
CURRENT_TRADESKILL = "";
function TradeSkillFrame_Show()
ShowUIPanel(TradeSkillFrame);
TradeSkillCreateButton:Disable();
TradeSkillCreateAllButton:Disable();
if ( GetTradeSkillSelectionIndex() == 0 ) then
TradeSkillFrame_SetSelection(GetFirstTradeSkill());
else
TradeSkillFrame_SetSelection(GetTradeSkillSelectionIndex());
end
FauxScrollFrame_SetOffset(TradeSkillListScrollFrame, 0);
TradeSkillListScrollFrameScrollBar:SetMinMaxValues(0, 0);
TradeSkillListScrollFrameScrollBar:SetValue(0);
SetPortraitTexture(TradeSkillFramePortrait, "player");
TradeSkillOnlyShowMakeable(TradeSkillFrameAvailableFilterCheckButton:GetChecked());
TradeSkillFrame_Update();
-- Moved to the bottom to prevent addons which hook it from blocking tradeskills
CloseDropDownMenus();
end
function TradeSkillFrame_Hide()
HideUIPanel(TradeSkillFrame);
end
function TradeSkillFrame_ShowFailed(self)
CloseTradeSkill();
end
function TradeSkillFrame_OnLoad(self)
self:RegisterEvent("TRADE_SKILL_UPDATE");
self:RegisterEvent("TRADE_SKILL_FILTER_UPDATE");
self:RegisterEvent("UNIT_PORTRAIT_UPDATE");
self:RegisterEvent("UPDATE_TRADESKILL_RECAST");
end
function TradeSkillFrame_OnEvent(self, event, ...)
if ( not TradeSkillFrame:IsShown() ) then
return;
end
if ( event == "TRADE_SKILL_UPDATE" or event == "TRADE_SKILL_FILTER_UPDATE" ) then
TradeSkillCreateButton:Disable();
TradeSkillCreateAllButton:Disable();
if ( (event ~= "TRADE_SKILL_FILTER_UPDATE") and (GetTradeSkillSelectionIndex() > 1) and (GetTradeSkillSelectionIndex() <= GetNumTradeSkills()) ) then
TradeSkillFrame_SetSelection(GetTradeSkillSelectionIndex());
else
TradeSkillFrame_SetSelection(GetFirstTradeSkill());
FauxScrollFrame_SetOffset(TradeSkillListScrollFrame, 0);
TradeSkillListScrollFrameScrollBar:SetValue(0);
end
TradeSkillFrame_Update();
elseif ( event == "UNIT_PORTRAIT_UPDATE" ) then
local arg1 = ...;
if ( arg1 == "player" ) then
SetPortraitTexture(TradeSkillFramePortrait, "player");
end
elseif ( event == "UPDATE_TRADESKILL_RECAST" ) then
TradeSkillInputBox:SetNumber(GetTradeskillRepeatCount());
end
end
function TradeSkillFrame_Update()
local numTradeSkills = GetNumTradeSkills();
local skillOffset = FauxScrollFrame_GetOffset(TradeSkillListScrollFrame);
local name, rank, maxRank = GetTradeSkillLine();
if ( CURRENT_TRADESKILL ~= name ) then
StopTradeSkillRepeat();
if ( CURRENT_TRADESKILL ~= "" ) then
-- To fix problem with switching between two tradeskills
UIDropDownMenu_Initialize(TradeSkillInvSlotDropDown, TradeSkillInvSlotDropDown_Initialize);
UIDropDownMenu_SetSelectedID(TradeSkillInvSlotDropDown, 1);
UIDropDownMenu_Initialize(TradeSkillSubClassDropDown, TradeSkillSubClassDropDown_Initialize);
UIDropDownMenu_SetSelectedID(TradeSkillSubClassDropDown, 1);
end
CURRENT_TRADESKILL = name;
end
-- If no tradeskills
if ( numTradeSkills == 0 ) then
TradeSkillFrameTitleText:SetFormattedText(TRADE_SKILL_TITLE, GetTradeSkillLine());
TradeSkillSkillName:Hide();
-- TradeSkillSkillLineName:Hide();
TradeSkillSkillIcon:Hide();
TradeSkillRequirementLabel:Hide();
TradeSkillRequirementText:SetText("");
TradeSkillCollapseAllButton:Disable();
for i=1, MAX_TRADE_SKILL_REAGENTS, 1 do
_G["TradeSkillReagent"..i]:Hide();
end
else
TradeSkillSkillName:Show();
-- TradeSkillSkillLineName:Show();
TradeSkillSkillIcon:Show();
TradeSkillCollapseAllButton:Enable();
end
if ( rank < 75 ) and ( not IsTradeSkillLinked() ) then
TradeSkillFrameEditBox:Hide();
SetTradeSkillItemNameFilter(""); --In case they are switching from an inspect WITH a filter directly to their own without.
else
TradeSkillFrameEditBox:Show();
end
-- ScrollFrame update
FauxScrollFrame_Update(TradeSkillListScrollFrame, numTradeSkills, TRADE_SKILLS_DISPLAYED, TRADE_SKILL_HEIGHT, nil, nil, nil, TradeSkillHighlightFrame, 293, 316 );
TradeSkillHighlightFrame:Hide();
local skillName, skillType, numAvailable, isExpanded, altVerb;
local skillIndex, skillButton, skillButtonText, skillButtonCount;
local nameWidth, countWidth;
local skillNamePrefix = " ";
for i=1, TRADE_SKILLS_DISPLAYED, 1 do
skillIndex = i + skillOffset;
skillName, skillType, numAvailable, isExpanded, altVerb = GetTradeSkillInfo(skillIndex);
skillButton = _G["TradeSkillSkill"..i];
skillButtonText = _G["TradeSkillSkill"..i.."Text"];
skillButtonCount = _G["TradeSkillSkill"..i.."Count"];
if ( skillIndex <= numTradeSkills ) then
-- Set button widths if scrollbar is shown or hidden
if ( TradeSkillListScrollFrame:IsShown() ) then
skillButton:SetWidth(293);
else
skillButton:SetWidth(323);
end
local color = TradeSkillTypeColor[skillType];
if ( color ) then
skillButton:SetNormalFontObject(color.font);
skillButtonCount:SetVertexColor(color.r, color.g, color.b);
skillButton.r = color.r;
skillButton.g = color.g;
skillButton.b = color.b;
end
if ( ENABLE_COLORBLIND_MODE == "1" ) then
skillNamePrefix = TradeSkillTypePrefix[skillType] or " ";
end
skillButton:SetID(skillIndex);
skillButton:Show();
-- Handle headers
if ( skillType == "header" ) then
skillButton:SetText(skillName);
skillButtonText:SetWidth(TRADE_SKILL_TEXT_WIDTH);
skillButtonCount:SetText("");
if ( isExpanded ) then
skillButton:SetNormalTexture("Interface\\Buttons\\UI-MinusButton-Up");
else
skillButton:SetNormalTexture("Interface\\Buttons\\UI-PlusButton-Up");
end
_G["TradeSkillSkill"..i.."Highlight"]:SetTexture("Interface\\Buttons\\UI-PlusButton-Hilight");
_G["TradeSkillSkill"..i]:UnlockHighlight();
else
if ( not skillName ) then
return;
end
skillButton:SetNormalTexture("");
_G["TradeSkillSkill"..i.."Highlight"]:SetTexture("");
if ( numAvailable <= 0 ) then
skillButton:SetText(skillNamePrefix..skillName);
skillButtonText:SetWidth(TRADE_SKILL_TEXT_WIDTH);
skillButtonCount:SetText(skillCountPrefix);
else
skillName = skillNamePrefix..skillName;
skillButtonCount:SetText("["..numAvailable.."]");
TradeSkillFrameDummyString:SetText(skillName);
nameWidth = TradeSkillFrameDummyString:GetWidth();
countWidth = skillButtonCount:GetWidth();
skillButtonText:SetText(skillName);
if ( nameWidth + 2 + countWidth > TRADE_SKILL_TEXT_WIDTH ) then
skillButtonText:SetWidth(TRADE_SKILL_TEXT_WIDTH-2-countWidth);
else
skillButtonText:SetWidth(0);
end
end
-- Place the highlight and lock the highlight state
if ( GetTradeSkillSelectionIndex() == skillIndex ) then
TradeSkillHighlightFrame:SetPoint("TOPLEFT", "TradeSkillSkill"..i, "TOPLEFT", 0, 0);
TradeSkillHighlightFrame:Show();
skillButtonCount:SetVertexColor(HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b);
skillButton:LockHighlight();
skillButton.isHighlighted = true;
else
skillButton:UnlockHighlight();
skillButton.isHighlighted = false;
end
end
else
skillButton:Hide();
end
end
-- Set the expand/collapse all button texture
local numHeaders = 0;
local notExpanded = 0;
for i=1, numTradeSkills, 1 do
local skillName, skillType, numAvailable, isExpanded, altVerb = GetTradeSkillInfo(i);
if ( skillName and skillType == "header" ) then
numHeaders = numHeaders + 1;
if ( not isExpanded ) then
notExpanded = notExpanded + 1;
end
end
if ( GetTradeSkillSelectionIndex() == i ) then
-- Set the max makeable items for the create all button
TradeSkillFrame.numAvailable = math.abs(numAvailable);
end
end
-- If all headers are not expanded then show collapse button, otherwise show the expand button
if ( notExpanded ~= numHeaders ) then
TradeSkillCollapseAllButton.collapsed = nil;
TradeSkillCollapseAllButton:SetNormalTexture("Interface\\Buttons\\UI-MinusButton-Up");
else
TradeSkillCollapseAllButton.collapsed = 1;
TradeSkillCollapseAllButton:SetNormalTexture("Interface\\Buttons\\UI-PlusButton-Up");
end
end
function TradeSkillFrame_SetSelection(id)
local skillName, skillType, numAvailable, isExpanded, altVerb = GetTradeSkillInfo(id);
local creatable = 1;
if ( not skillName ) then
creatable = nil;
end
TradeSkillHighlightFrame:Show();
if ( skillType == "header" ) then
TradeSkillHighlightFrame:Hide();
if ( isExpanded ) then
CollapseTradeSkillSubClass(id);
else
ExpandTradeSkillSubClass(id);
end
return;
end
TradeSkillFrame.selectedSkill = id;
SelectTradeSkill(id);
if ( GetTradeSkillSelectionIndex() > GetNumTradeSkills() ) then
return;
end
local color = TradeSkillTypeColor[skillType];
if ( color ) then
TradeSkillHighlight:SetVertexColor(color.r, color.g, color.b);
end
-- General Info
local skillLineName, skillLineRank, skillLineMaxRank = GetTradeSkillLine();
TradeSkillFrameTitleText:SetFormattedText(TRADE_SKILL_TITLE, skillLineName);
-- Set statusbar info
TradeSkillRankFrame:SetStatusBarColor(0.0, 0.0, 1.0, 0.5);
TradeSkillRankFrameBackground:SetVertexColor(0.0, 0.0, 0.75, 0.5);
TradeSkillRankFrame:SetMinMaxValues(0, skillLineMaxRank);
TradeSkillRankFrame:SetValue(skillLineRank);
TradeSkillRankFrameSkillRank:SetText(skillLineRank.."/"..skillLineMaxRank);
TradeSkillSkillName:SetText(skillName);
if ( GetTradeSkillCooldown(id) ) then
TradeSkillSkillCooldown:SetText(COOLDOWN_REMAINING.." "..SecondsToTime(GetTradeSkillCooldown(id)));
else
TradeSkillSkillCooldown:SetText("");
end
TradeSkillSkillIcon:SetNormalTexture(GetTradeSkillIcon(id));
local minMade,maxMade = GetTradeSkillNumMade(id);
if ( maxMade > 1 ) then
if ( minMade == maxMade ) then
TradeSkillSkillIconCount:SetText(minMade);
else
TradeSkillSkillIconCount:SetText(minMade.."-"..maxMade);
end
if ( TradeSkillSkillIconCount:GetWidth() > 39 ) then
TradeSkillSkillIconCount:SetText("~"..floor((minMade + maxMade)/2));
end
else
TradeSkillSkillIconCount:SetText("");
end
-- Reagents
local numReagents = GetTradeSkillNumReagents(id);
if(numReagents > 0) then
TradeSkillReagentLabel:Show();
else
TradeSkillReagentLabel:Hide();
end
for i=1, numReagents, 1 do
local reagentName, reagentTexture, reagentCount, playerReagentCount = GetTradeSkillReagentInfo(id, i);
local reagent = _G["TradeSkillReagent"..i]
local name = _G["TradeSkillReagent"..i.."Name"];
local count = _G["TradeSkillReagent"..i.."Count"];
if ( not reagentName or not reagentTexture ) then
reagent:Hide();
else
reagent:Show();
SetItemButtonTexture(reagent, reagentTexture);
name:SetText(reagentName);
-- Grayout items
if ( playerReagentCount < reagentCount ) then
SetItemButtonTextureVertexColor(reagent, 0.5, 0.5, 0.5);
name:SetTextColor(GRAY_FONT_COLOR.r, GRAY_FONT_COLOR.g, GRAY_FONT_COLOR.b);
creatable = nil;
else
SetItemButtonTextureVertexColor(reagent, 1.0, 1.0, 1.0);
name:SetTextColor(HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b);
end
if ( playerReagentCount >= 100 ) then
playerReagentCount = "*";
end
count:SetText(playerReagentCount.." /"..reagentCount);
end
end
-- Place reagent label
local reagentToAnchorTo = numReagents;
if ( (numReagents > 0) and (mod(numReagents, 2) == 0) ) then
reagentToAnchorTo = reagentToAnchorTo - 1;
end
for i=numReagents + 1, MAX_TRADE_SKILL_REAGENTS, 1 do
_G["TradeSkillReagent"..i]:Hide();
end
local spellFocus = BuildColoredListString(GetTradeSkillTools(id));
if ( spellFocus ) then
TradeSkillRequirementLabel:Show();
TradeSkillRequirementText:SetText(spellFocus);
else
TradeSkillRequirementLabel:Hide();
TradeSkillRequirementText:SetText("");
end
if ( creatable ) then
TradeSkillCreateButton:Enable();
TradeSkillCreateAllButton:Enable();
else
TradeSkillCreateButton:Disable();
TradeSkillCreateAllButton:Disable();
end
if ( GetTradeSkillDescription(id) ) then
TradeSkillDescription:SetText(GetTradeSkillDescription(id))
TradeSkillReagentLabel:SetPoint("TOPLEFT", "TradeSkillDescription", "BOTTOMLEFT", 0, -10);
else
TradeSkillDescription:SetText(" ");
TradeSkillReagentLabel:SetPoint("TOPLEFT", "TradeSkillDescription", "TOPLEFT", 0, 0);
end
-- Reset the number of items to be created
TradeSkillInputBox:SetNumber(GetTradeskillRepeatCount());
--Hide inapplicable buttons if we are inspecting. Otherwise show them
if ( IsTradeSkillLinked() ) then
TradeSkillCreateButton:Hide();
TradeSkillCreateAllButton:Hide();
TradeSkillDecrementButton:Hide();
TradeSkillInputBox:Hide();
TradeSkillIncrementButton:Hide();
TradeSkillLinkButton:Hide();
TradeSkillFrameBottomLeftTexture:SetTexture([[Interface\PaperDollInfoFrame\SkillFrame-BotLeft]]);
TradeSkillFrameBottomRightTexture:SetTexture([[Interface\PaperDollInfoFrame\SkillFrame-BotRight]]);
else
--Change button names and show/hide them depending on if this tradeskill creates an item or casts something
if ( not altVerb ) then
--Its an item with 'Create'
TradeSkillCreateAllButton:Show();
TradeSkillDecrementButton:Show();
TradeSkillInputBox:Show();
TradeSkillIncrementButton:Show();
TradeSkillFrameBottomLeftTexture:SetTexture([[Interface\TradeSkillFrame\UI-TradeSkill-BotLeft]]);
TradeSkillFrameBottomRightTexture:SetTexture([[Interface\ClassTrainerFrame\UI-ClassTrainer-BotRight]])
else
--Its something else
TradeSkillCreateAllButton:Hide();
TradeSkillDecrementButton:Hide();
TradeSkillInputBox:Hide();
TradeSkillIncrementButton:Hide();
TradeSkillFrameBottomLeftTexture:SetTexture([[Interface\ClassTrainerFrame\UI-ClassTrainer-BotLeft]]);
TradeSkillFrameBottomRightTexture:SetTexture([[Interface\ClassTrainerFrame\UI-ClassTrainer-BotRight]]);
end
if ( GetTradeSkillListLink() ) then
TradeSkillLinkButton:Show();
else
TradeSkillLinkButton:Hide();
end
TradeSkillCreateButton:SetText(altVerb or CREATE);
TradeSkillCreateButton:Show();
end
end
function TradeSkillSkillButton_OnClick(self, button)
if ( button == "LeftButton" ) then
TradeSkillFrame_SetSelection(self:GetID());
TradeSkillFrame_Update();
end
end
function TradeSkillFilter_OnTextChanged(self)
local text = self:GetText();
if ( text == SEARCH ) then
SetTradeSkillItemNameFilter("");
return;
end
local minLevel, maxLevel;
local approxLevel = strmatch(text, "^~(%d+)");
if ( approxLevel ) then
minLevel = approxLevel - 2;
maxLevel = approxLevel + 2;
else
minLevel, maxLevel = strmatch(text, "^(%d+)%s*-*%s*(%d*)$");
end
if ( minLevel ) then
if ( maxLevel == "" or maxLevel < minLevel ) then
maxLevel = minLevel;
end
SetTradeSkillItemNameFilter(nil);
SetTradeSkillItemLevelFilter(minLevel, maxLevel);
else
SetTradeSkillItemLevelFilter(0, 0);
SetTradeSkillItemNameFilter(text);
end
end
function TradeSkillCollapseAllButton_OnClick(self)
if (self.collapsed) then
self.collapsed = nil;
ExpandTradeSkillSubClass(0);
else
self.collapsed = 1;
TradeSkillListScrollFrameScrollBar:SetValue(0);
CollapseTradeSkillSubClass(0);
end
end
function TradeSkillSubClassDropDown_OnLoad(self)
SetTradeSkillSubClassFilter(0, 1, 1);
UIDropDownMenu_Initialize(self, TradeSkillSubClassDropDown_Initialize);
UIDropDownMenu_SetWidth(self, 120);
UIDropDownMenu_SetSelectedID(self, 1);
end
function TradeSkillSubClassDropDown_Initialize()
TradeSkillFilterFrame_LoadSubClasses(GetTradeSkillSubClasses());
end
function TradeSkillFilterFrame_LoadSubClasses(...)
local selectedID = UIDropDownMenu_GetSelectedID(TradeSkillSubClassDropDown);
local numSubClasses = select("#", ...);
local allChecked = GetTradeSkillSubClassFilter(0);
-- the first button in the list is going to be an "all subclasses" button
local info = UIDropDownMenu_CreateInfo();
info.text = ALL_SUBCLASSES;
info.func = TradeSkillSubClassDropDownButton_OnClick;
-- select this button if nothing else was selected
info.checked = allChecked and (selectedID == nil or selectedID == 1);
UIDropDownMenu_AddButton(info);
if ( info.checked ) then
UIDropDownMenu_SetText(TradeSkillSubClassDropDown, ALL_SUBCLASSES);
end
local checked;
for i=1, select("#", ...), 1 do
-- if there are no filters then don't check any individual subclasses
if ( allChecked ) then
checked = nil;
else
checked = GetTradeSkillSubClassFilter(i);
if ( checked ) then
UIDropDownMenu_SetText(TradeSkillSubClassDropDown, select(i, ...));
end
end
info.text = select(i, ...);
info.func = TradeSkillSubClassDropDownButton_OnClick;
info.checked = checked;
UIDropDownMenu_AddButton(info);
end
end
function TradeSkillInvSlotDropDown_OnLoad(self)
SetTradeSkillInvSlotFilter(0, 1, 1);
UIDropDownMenu_Initialize(self, TradeSkillInvSlotDropDown_Initialize);
UIDropDownMenu_SetWidth(self, 120);
UIDropDownMenu_SetSelectedID(self, 1);
end
function TradeSkillInvSlotDropDown_Initialize()
TradeSkillFilterFrame_LoadInvSlots(GetTradeSkillInvSlots());
end
function TradeSkillFilterFrame_LoadInvSlots(...)
UIDropDownMenu_SetSelectedID(TradeSkillInvSlotDropDown, nil);
local allChecked = GetTradeSkillInvSlotFilter(0);
local info = UIDropDownMenu_CreateInfo();
local filterCount = select("#", ...);
info.text = ALL_INVENTORY_SLOTS;
info.func = TradeSkillInvSlotDropDownButton_OnClick;
info.checked = allChecked;
UIDropDownMenu_AddButton(info);
local checked;
for i=1, filterCount, 1 do
if ( allChecked and filterCount > 1 ) then
checked = nil;
UIDropDownMenu_SetText(TradeSkillInvSlotDropDown, ALL_INVENTORY_SLOTS);
else
checked = GetTradeSkillInvSlotFilter(i);
if ( checked ) then
UIDropDownMenu_SetText(TradeSkillInvSlotDropDown, select(i, ...));
end
end
info.text = select(i, ...);
info.func = TradeSkillInvSlotDropDownButton_OnClick;
info.checked = checked;
UIDropDownMenu_AddButton(info);
end
end
function TradeSkillFilterFrame_InvSlotName(...)
for i=1, select("#", ...), 1 do
if ( GetTradeSkillInvSlotFilter(i) ) then
return select(i, ...);
end
end
end
function TradeSkillSubClassDropDownButton_OnClick(self)
UIDropDownMenu_SetSelectedID(TradeSkillSubClassDropDown, self:GetID());
SetTradeSkillSubClassFilter(self:GetID() - 1, 1, 1);
if ( self:GetID() ~= 1 ) then
if ( TradeSkillFilterFrame_InvSlotName(GetTradeSkillInvSlots()) ~= TradeSkillInvSlotDropDown.selected ) then
SetTradeSkillInvSlotFilter(0, 1, 1);
UIDropDownMenu_SetSelectedID(TradeSkillInvSlotDropDown, 1);
UIDropDownMenu_SetText(TradeSkillInvSlotDropDown, ALL_INVENTORY_SLOTS);
end
end
TradeSkillListScrollFrameScrollBar:SetValue(0);
FauxScrollFrame_SetOffset(TradeSkillListScrollFrame, 0);
TradeSkillFrame_Update();
end
function TradeSkillInvSlotDropDownButton_OnClick(self)
UIDropDownMenu_SetSelectedID(TradeSkillInvSlotDropDown, self:GetID());
SetTradeSkillInvSlotFilter(self:GetID() - 1, 1, 1);
TradeSkillInvSlotDropDown.selected = TradeSkillFilterFrame_InvSlotName(GetTradeSkillInvSlots());
TradeSkillListScrollFrameScrollBar:SetValue(0);
FauxScrollFrame_SetOffset(TradeSkillListScrollFrame, 0);
TradeSkillFrame_Update();
end
function TradeSkillFrameIncrement_OnClick()
if ( TradeSkillInputBox:GetNumber() < 100 ) then
TradeSkillInputBox:SetNumber(TradeSkillInputBox:GetNumber() + 1);
end
end
function TradeSkillFrameDecrement_OnClick()
if ( TradeSkillInputBox:GetNumber() > 0 ) then
TradeSkillInputBox:SetNumber(TradeSkillInputBox:GetNumber() - 1);
end
end
function TradeSkillItem_OnEnter(self)
if ( TradeSkillFrame.selectedSkill ~= 0 ) then
GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
GameTooltip:SetTradeSkillItem(TradeSkillFrame.selectedSkill);
end
CursorUpdate(self);
end
function TradeSkillFrame_PlaytimeUpdate()
if ( PartialPlayTime() ) then
TradeSkillCreateButton:Disable();
if (not TradeSkillCreateButtonMask:IsShown()) then
TradeSkillCreateButtonMask:Show();
TradeSkillCreateButtonMask.tooltip = format(PLAYTIME_TIRED_ABILITY, REQUIRED_REST_HOURS - floor(GetBillingTimeRested()/60));
end
TradeSkillCreateAllButton:Disable();
if (not TradeSkillCreateAllButtonMask:IsShown()) then
TradeSkillCreateAllButtonMask:Show();
TradeSkillCreateAllButtonMask.tooltip = format(PLAYTIME_TIRED_ABILITY, REQUIRED_REST_HOURS - floor(GetBillingTimeRested()/60));
end
elseif ( NoPlayTime() ) then
TradeSkillCreateButton:Disable();
if (not TradeSkillCreateButtonMask:IsShown()) then
TradeSkillCreateButtonMask:Show();
TradeSkillCreateButtonMask.tooltip = format(PLAYTIME_UNHEALTHY_ABILITY, REQUIRED_REST_HOURS - floor(GetBillingTimeRested()/60));
end
TradeSkillCreateAllButton:Disable();
if (not TradeSkillCreateAllButtonMask:IsShown()) then
TradeSkillCreateAllButtonMask:Show();
TradeSkillCreateAllButtonMask.tooltip = format(PLAYTIME_UNHEALTHY_ABILITY, REQUIRED_REST_HOURS - floor(GetBillingTimeRested()/60));
end
else
if (TradeSkillCreateButtonMask:IsShown() or TradeSkillCreateAllButtonMask:IsShown()) then
TradeSkillCreateButtonMask:Hide();
TradeSkillCreateButtonMask.tooltip = nil;
TradeSkillCreateAllButtonMask:Hide();
TradeSkillCreateAllButtonMask.tooltip = nil;
TradeSkillFrame_SetSelection(TradeSkillFrame.selectedSkill);
TradeSkillFrame_Update()
end
end
end
@@ -0,0 +1,6 @@
## Interface: 30300
## Title: Blizzard Trade Skill UI
## Secure: 1
## LoadOnDemand: 1
Blizzard_TradeSkillUI.xml
Localization.lua
@@ -0,0 +1,989 @@
<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="Blizzard_TradeSkillUI.lua"/>
<Button name="TradeSkillSkillButtonTemplate" inherits="ClassTrainerSkillButtonTemplate" hidden="false" virtual="true">
<Layers>
<Layer level="OVERLAY">
<FontString name="$parentCount" inherits="GameFontNormal">
<Size x="0" y="13"/>
<Anchors>
<Anchor point="LEFT">
<Offset x="0" y="0"/>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnClick>
if ( IsModifiedClick() ) then
HandleModifiedItemClick(GetTradeSkillRecipeLink(self:GetID()));
else
TradeSkillSkillButton_OnClick(self, button);
end
</OnClick>
<OnLoad>
_G[self:GetName().."Count"]:SetPoint("LEFT", self:GetName().."Text", "RIGHT", 2, 0);
</OnLoad>
<OnEnter>
_G[self:GetName().."Count"]:SetVertexColor(HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b);
</OnEnter>
<OnLeave>
if ( not self.isHighlighted ) then
_G[self:GetName().."Count"]:SetVertexColor(self.r, self.g, self.b);
end
</OnLeave>
</Scripts>
</Button>
<Button name="TradeSkillItemTemplate" inherits="QuestItemTemplate" virtual="true">
<Scripts>
<OnEnter>
GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT");
GameTooltip:SetTradeSkillItem(TradeSkillFrame.selectedSkill, self:GetID());
CursorUpdate(self);
</OnEnter>
<OnLeave>
GameTooltip:Hide();
ResetCursor();
</OnLeave>
<OnUpdate>
CursorOnUpdate(self, elapsed);
</OnUpdate>
<OnClick>
HandleModifiedItemClick(GetTradeSkillReagentItemLink(TradeSkillFrame.selectedSkill, self:GetID()));
</OnClick>
</Scripts>
</Button>
<Frame name="TradeSkillFrame" toplevel="true" movable="true" parent="UIParent" enableMouse="true" hidden="true">
<Size>
<AbsDimension x="384" y="512"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="0" y="-104"/>
</Offset>
</Anchor>
</Anchors>
<HitRectInsets>
<AbsInset left="0" right="34" top="0" bottom="75"/>
</HitRectInsets>
<Layers>
<Layer level="BACKGROUND">
<Texture name="TradeSkillFramePortrait">
<Size>
<AbsDimension x="60" y="60"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="7" y="-6"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<FontString name="$parentDummyString" inherits="GameFontNormal" hidden="true">
<Anchors>
<Anchor point="TOPLEFT">
<Offset x="0" y="0"/>
</Anchor>
</Anchors>
<Size x="0" y="0"/>
</FontString>
</Layer>
<Layer level="BORDER">
<Texture file="Interface\ClassTrainerFrame\UI-ClassTrainer-TopLeft">
<Size>
<AbsDimension x="256" y="256"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT"/>
</Anchors>
</Texture>
<Texture file="Interface\ClassTrainerFrame\UI-ClassTrainer-TopRight">
<Size>
<AbsDimension x="128" y="256"/>
</Size>
<Anchors>
<Anchor point="TOPRIGHT"/>
</Anchors>
</Texture>
<Texture name="TradeSkillFrameBottomLeftTexture" file="Interface\TradeSkillFrame\UI-TradeSkill-BotLeft">
<Size>
<AbsDimension x="256" y="256"/>
</Size>
<Anchors>
<Anchor point="BOTTOMLEFT"/>
</Anchors>
</Texture>
<Texture name="TradeSkillFrameBottomRightTexture" file="Interface\ClassTrainerFrame\UI-ClassTrainer-BotRight">
<Size>
<AbsDimension x="128" y="256"/>
</Size>
<Anchors>
<Anchor point="BOTTOMRIGHT"/>
</Anchors>
</Texture>
<FontString name="TradeSkillFrameTitleText" inherits="GameFontNormal" text="Trade Skills">
<Anchors>
<Anchor point="TOP" relativeTo="TradeSkillFrame" relativePoint="TOP">
<Offset>
<AbsDimension x="0" y="-17"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
<Layer level="ARTWORK">
<Texture name="TradeSkillHorizontalBarLeft" file="Interface\ClassTrainerFrame\UI-ClassTrainer-HorizontalBar">
<Size>
<AbsDimension x="256" y="16"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="15" y="-221"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0" right="1.0" top="0" bottom="0.25"/>
</Texture>
<Texture file="Interface\ClassTrainerFrame\UI-ClassTrainer-HorizontalBar">
<Size>
<AbsDimension x="75" y="16"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativeTo="TradeSkillHorizontalBarLeft" relativePoint="RIGHT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0" right="0.29296875" top="0.25" bottom="0.5"/>
</Texture>
</Layer>
</Layers>
<Frames>
<Button name="TradeSkillLinkButton">
<Size>
<AbsDimension x="32" y="16"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativeTo="TradeSkillFrameTitleText" relativePoint="RIGHT">
<Offset>
<AbsDimension x="5" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
local link=GetTradeSkillListLink();
if (not ChatEdit_InsertLink(link) ) then
ChatEdit_GetLastActiveWindow():Show();
ChatEdit_InsertLink(link);
end
</OnClick>
<OnEnter>
GameTooltip:SetOwner(self,"ANCHOR_TOPLEFT");
GameTooltip:SetText(LINK_TRADESKILL_TOOLTIP, nil, nil, nil, nil, 1);
GameTooltip:Show();
</OnEnter>
<OnLeave function="GameTooltip_Hide"/>
</Scripts>
<NormalTexture file="Interface\TradeSkillFrame\UI-TradeSkill-LinkButton">
<TexCoords left="0" right="1.0" top="0" bottom="0.5"/>
</NormalTexture>
<HighlightTexture file="Interface\TradeSkillFrame\UI-TradeSkill-LinkButton" alphaMode="ADD">
<TexCoords left="0" right="1.0" top="0.5" bottom="1.0"/>
</HighlightTexture>
</Button>
<CheckButton name="TradeSkillFrameAvailableFilterCheckButton" inherits="UICheckButtonTemplate">
<Size>
<AbsDimension x="24" y="24"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="70" y="-46"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
TradeSkillFrameAvailableFilterCheckButtonText:SetText(CRAFT_IS_MAKEABLE);
</OnLoad>
<OnClick>
TradeSkillOnlyShowMakeable(self:GetChecked());
</OnClick>
<OnEnter>
GameTooltip:SetOwner(self, "ANCHOR_LEFT");
GameTooltip:SetText(CRAFT_IS_MAKEABLE_TOOLTIP, nil, nil, nil, nil, 1);
</OnEnter>
<OnLeave function="GameTooltip_Hide"/>
</Scripts>
<HitRectInsets>
<AbsInset left="0" right="-75" top="0" bottom="0"/>
</HitRectInsets>
</CheckButton>
<StatusBar name="TradeSkillRankFrame" drawLayer="BACKGROUND" minValue="0" maxValue="1" defaultValue="0" enableMouse="false">
<Size>
<AbsDimension x="265" y="14"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="75" y="-36"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="ARTWORK">
<FontString name="$parentSkillRank" inherits="GameFontHighlightSmall" justifyH="CENTER">
<Size>
<AbsDimension x="0" y="9"/>
</Size>
<Anchors>
<Anchor point="TOP" relativeTo="TradeSkillFrameTitleText">
<Offset>
<AbsDimension x="0" y="-20"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<Texture name="$parentBorder" file="Interface\PaperDollInfoFrame\UI-Character-Skills-BarBorder">
<Size>
<AbsDimension x="274" y="27"/>
</Size>
<Anchors>
<Anchor point="LEFT">
<Offset>
<AbsDimension x="-5" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
</Layer>
<Layer level="BACKGROUND">
<Texture name="$parentBackground">
<Color r="1.0" g="1.0" b="1.0" a="0.2"/>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnLoad>
self:RegisterEvent("SKILL_LINES_CHANGED");
</OnLoad>
<OnEvent function="TradeSkillFrame_Update"/>
</Scripts>
<BarTexture name="$parentBar" file="Interface\PaperDollInfoFrame\UI-Character-Skills-Bar" />
<BarColor r="0.25" g="0.25" b="0.75" />
</StatusBar>
<EditBox name="$parentEditBox" autoFocus="false">
<Size>
<AbsDimension x="128" y="20"/>
</Size>
<Anchors>
<Anchor point="TOPRIGHT" relativeTo="TradeSkillRankFrame" relativePoint="BOTTOMRIGHT">
<Offset x="2" y="2"/>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture name="$parentLeft" file="Interface\Common\Common-Input-Border">
<Size>
<AbsDimension x="8" y="20"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset x="-5" y="0"/>
</Anchor>
</Anchors>
<TexCoords left="0" right="0.0625" top="0" bottom="0.625"/>
</Texture>
<Texture name="$parentRight" file="Interface\Common\Common-Input-Border">
<Size>
<AbsDimension x="8" y="20"/>
</Size>
<Anchors>
<Anchor point="RIGHT">
<Offset x="0" y="0"/>
</Anchor>
</Anchors>
<TexCoords left="0.9375" right="1.0" top="0" bottom="0.625"/>
</Texture>
<Texture name="$parentMiddle" file="Interface\Common\Common-Input-Border">
<Size>
<AbsDimension x="0" y="20"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativeTo="$parentLeft" relativePoint="RIGHT"/>
<Anchor point="RIGHT" relativeTo="$parentRight" relativePoint="LEFT"/>
</Anchors>
<TexCoords left="0.0625" right="0.9375" top="0" bottom="0.625"/>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnShow>
self:SetText(SEARCH);
</OnShow>
<OnEnterPressed function="EditBox_ClearFocus"/>
<OnEscapePressed function="EditBox_ClearFocus"/>
<OnTextChanged function="TradeSkillFilter_OnTextChanged"/>
<OnEditFocusLost>
self:HighlightText(0, 0);
if ( self:GetText() == "" ) then
self:SetText(SEARCH);
end
</OnEditFocusLost>
<OnEditFocusGained>
self:HighlightText();
if ( self:GetText() == SEARCH ) then
self:SetText("");
end
</OnEditFocusGained>
</Scripts>
<FontString inherits="ChatFontSmall"/>
</EditBox>
<Frame name="TradeSkillExpandButtonFrame">
<Size>
<AbsDimension x="54" y="32"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="15" y="-71"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture name="TradeSkillExpandTabLeft" file="Interface\ClassTrainerFrame\UI-ClassTrainer-ExpandTab-Left">
<Size>
<AbsDimension x="8" y="32"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT"/>
</Anchors>
</Texture>
<Texture name="TradeSkillExpandTabMiddle" file="Interface\QuestFrame\UI-QuestLogSortTab-Middle">
<Size>
<AbsDimension x="38" y="32"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativeTo="TradeSkillExpandTabLeft" relativePoint="RIGHT">
<Offset>
<AbsDimension x="0" y="6"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<Texture name="TradeSkillExpandTabRight" file="Interface\QuestFrame\UI-QuestLogSortTab-Right">
<Size>
<AbsDimension x="8" y="32"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativeTo="TradeSkillExpandTabMiddle" relativePoint="RIGHT"/>
</Anchors>
</Texture>
</Layer>
</Layers>
<Frames>
<Button name="TradeSkillCollapseAllButton" hidden="false" inherits="ClassTrainerSkillButtonTemplate">
<Size>
<AbsDimension x="40" y="22"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativeTo="TradeSkillExpandTabLeft" relativePoint="RIGHT">
<Offset>
<AbsDimension x="0" y="3"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
_G[self:GetName()]:SetText(ALL);
</OnLoad>
<OnClick function="TradeSkillCollapseAllButton_OnClick"/>
</Scripts>
</Button>
</Frames>
</Frame>
<Frame name="TradeSkillInvSlotDropDown" inherits="UIDropDownMenuTemplate" id="2">
<Anchors>
<Anchor point="TOPRIGHT">
<Offset>
<AbsDimension x="-25" y="-66"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad function="TradeSkillInvSlotDropDown_OnLoad"/>
</Scripts>
</Frame>
<Frame name="TradeSkillSubClassDropDown" inherits="UIDropDownMenuTemplate" id="1">
<Anchors>
<Anchor point="RIGHT" relativeTo="TradeSkillInvSlotDropDown" relativePoint="LEFT">
<Offset>
<AbsDimension x="35" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad function="TradeSkillSubClassDropDown_OnLoad"/>
</Scripts>
</Frame>
<Frame name="TradeSkillHighlightFrame" hidden="true">
<Size>
<AbsDimension x="293" y="16"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT"/>
</Anchors>
<Layers>
<Layer level="ARTWORK">
<Texture name="TradeSkillHighlight" file="Interface\Buttons\UI-Listbox-Highlight2"/>
</Layer>
</Layers>
</Frame>
<Button name="TradeSkillSkill1" inherits="TradeSkillSkillButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="TradeSkillFrame">
<Offset>
<AbsDimension x="22" y="-96"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="TradeSkillSkill2" inherits="TradeSkillSkillButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="TradeSkillSkill1" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="TradeSkillSkill3" inherits="TradeSkillSkillButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="TradeSkillSkill2" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="TradeSkillSkill4" inherits="TradeSkillSkillButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="TradeSkillSkill3" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="TradeSkillSkill5" inherits="TradeSkillSkillButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="TradeSkillSkill4" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="TradeSkillSkill6" inherits="TradeSkillSkillButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="TradeSkillSkill5" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="TradeSkillSkill7" inherits="TradeSkillSkillButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="TradeSkillSkill6" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="TradeSkillSkill8" inherits="TradeSkillSkillButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="TradeSkillSkill7" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<ScrollFrame name="TradeSkillListScrollFrame" inherits="ClassTrainerListScrollFrameTemplate">
<Size>
<AbsDimension x="296" y="130"/>
</Size>
<Anchors>
<Anchor point="TOPRIGHT" relativeTo="TradeSkillFrame" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="-67" y="-96"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnVerticalScroll>
FauxScrollFrame_OnVerticalScroll(self, offset, TRADE_SKILL_HEIGHT, TradeSkillFrame_Update);
</OnVerticalScroll>
</Scripts>
</ScrollFrame>
<ScrollFrame name="TradeSkillDetailScrollFrame" inherits="ClassTrainerDetailScrollFrameTemplate">
<Size>
<AbsDimension x="297" y="176"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="20" y="-234"/>
</Offset>
</Anchor>
</Anchors>
<ScrollChild>
<Frame name="TradeSkillDetailScrollChildFrame">
<Size>
<AbsDimension x="297" y="150"/>
</Size>
<Layers>
<Layer level="BACKGROUND">
<FontString name="TradeSkillSkillName" inherits="GameFontNormal" text="Skill Name" justifyH="LEFT">
<Size>
<AbsDimension x="244" y="0"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="50" y="-5"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="TradeSkillRequirementLabel" inherits="GameFontHighlightSmall" text="REQUIRES_LABEL">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="TradeSkillSkillName" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="TradeSkillRequirementText" inherits="GameFontHighlightSmall" justifyV="TOP" justifyH="LEFT">
<Size>
<AbsDimension x="180" y="0"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="TradeSkillRequirementLabel" relativePoint="TOPRIGHT" >
<Offset>
<AbsDimension x="4" y="0"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<!--
<FontString name="TradeSkillSkillLineName" inherits="GameFontHighlightSmall" text="Skill Line">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="TradeSkillSkillName" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
-->
<FontString name="TradeSkillSkillCooldown" inherits="GameFontRedSmall">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="TradeSkillRequirementLabel" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<Texture name="TradeSkillDetailHeaderLeft" file="Interface\ClassTrainerFrame\UI-ClassTrainer-DetailHeaderLeft">
<Size>
<AbsDimension x="256" y="64"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="0" y="3"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<Texture file="Interface\ClassTrainerFrame\UI-ClassTrainer-DetailHeaderRight">
<Size>
<AbsDimension x="64" y="64"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="TradeSkillDetailHeaderLeft" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<FontString name="TradeSkillDescription" inherits="GameFontHighlightSmall" justifyH="LEFT">
<Size>
<AbsDimension x="290" y="0"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="5" y="-50"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="TradeSkillReagentLabel" inherits="GameFontNormalSmall" text="SPELL_REAGENTS">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="TradeSkillDescription" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-10"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Frames>
<Button name="TradeSkillSkillIcon">
<Size>
<AbsDimension x="37" y="37"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="8" y="-3"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="ARTWORK">
<FontString name="TradeSkillSkillIconCount" inherits="NumberFontNormal" justifyH="RIGHT" hidden="false">
<Anchors>
<Anchor point="BOTTOMRIGHT">
<Offset>
<AbsDimension x="-5" y="2"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnLoad>
self.hasItem = 1;
</OnLoad>
<OnClick>
HandleModifiedItemClick(GetTradeSkillItemLink(TradeSkillFrame.selectedSkill));
</OnClick>
<OnEnter function="TradeSkillItem_OnEnter"/>
<OnLeave function="GameTooltip_HideResetCursor"/>
<OnUpdate>
if ( GameTooltip:IsOwned(self) ) then
TradeSkillItem_OnEnter(self);
end
CursorOnUpdate(self);
</OnUpdate>
</Scripts>
</Button>
<Button name="TradeSkillReagent1" inherits="TradeSkillItemTemplate" id="1">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="TradeSkillReagentLabel" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="-2" y="-3"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="TradeSkillReagent2" inherits="TradeSkillItemTemplate" id="2">
<Anchors>
<Anchor point="LEFT" relativeTo="TradeSkillReagent1" relativePoint="RIGHT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="TradeSkillReagent3" inherits="TradeSkillItemTemplate" id="3">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="TradeSkillReagent1" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-2"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="TradeSkillReagent4" inherits="TradeSkillItemTemplate" id="4">
<Anchors>
<Anchor point="LEFT" relativeTo="TradeSkillReagent3" relativePoint="RIGHT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="TradeSkillReagent5" inherits="TradeSkillItemTemplate" id="5">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="TradeSkillReagent3" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-2"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="TradeSkillReagent6" inherits="TradeSkillItemTemplate" id="6">
<Anchors>
<Anchor point="LEFT" relativeTo="TradeSkillReagent5" relativePoint="RIGHT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="TradeSkillReagent7" inherits="TradeSkillItemTemplate" id="7">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="TradeSkillReagent6" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-2"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="TradeSkillReagent8" inherits="TradeSkillItemTemplate" id="8">
<Anchors>
<Anchor point="LEFT" relativeTo="TradeSkillReagent7" relativePoint="RIGHT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Button>
</Frames>
</Frame>
</ScrollChild>
</ScrollFrame>
<Button name="TradeSkillCreateButton" inherits="UIPanelButtonTemplate" text="CREATE">
<Size>
<AbsDimension x="80" y="22"/>
</Size>
<Anchors>
<Anchor point="CENTER" relativeTo="TradeSkillFrame" relativePoint="TOPLEFT">
<Offset>
<AbsDimension x="224" y="-422"/>
</Offset>
</Anchor>
</Anchors>
<Frames>
<Frame name="$parentMask" setAllPoints="true" enableMouse="true" hidden="true">
<Scripts>
<OnEnter>
if (self.tooltip) then
GameTooltip:SetOwner(self, "ANCHOR_LEFT");
GameTooltip:SetText(self.tooltip, nil, nil, nil, nil, 1);
end
</OnEnter>
<OnLeave function="GameTooltip_Hide"/>
</Scripts>
</Frame>
</Frames>
<Scripts>
<OnClick>
if ( (not PartialPlayTime()) and (not NoPlayTime()) ) then
DoTradeSkill(TradeSkillFrame.selectedSkill, TradeSkillInputBox:GetNumber());
TradeSkillInputBox:ClearFocus();
end
</OnClick>
</Scripts>
</Button>
<Button name="TradeSkillCancelButton" inherits="UIPanelButtonTemplate" text="EXIT">
<Size>
<AbsDimension x="80" y="22"/>
</Size>
<Anchors>
<Anchor point="CENTER" relativeTo="TradeSkillFrame" relativePoint="TOPLEFT">
<Offset>
<AbsDimension x="305" y="-422"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick function="HideParentPanel"/>
</Scripts>
</Button>
<Button name="TradeSkillCreateAllButton" inherits="UIPanelButtonTemplate" text="CREATE_ALL">
<Size>
<AbsDimension x="80" y="22"/>
</Size>
<Anchors>
<Anchor point="RIGHT" relativeTo="TradeSkillCreateButton" relativePoint="LEFT">
<Offset>
<AbsDimension x="-86" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Frames>
<Frame name="$parentMask" setAllPoints="true" enableMouse="true" hidden="true">
<Scripts>
<OnEnter>
if (self.tooltip) then
GameTooltip:SetOwner(self, "ANCHOR_LEFT");
GameTooltip:SetText(self.tooltip, nil, nil, nil, nil, 1);
end
</OnEnter>
<OnLeave function="GameTooltip_Hide"/>
</Scripts>
</Frame>
</Frames>
<Scripts>
<OnClick>
if ( (not PartialPlayTime()) and (not NoPlayTime()) ) then
TradeSkillInputBox:SetNumber(TradeSkillFrame.numAvailable);
DoTradeSkill(TradeSkillFrame.selectedSkill, TradeSkillFrame.numAvailable);
TradeSkillInputBox:ClearFocus();
end
</OnClick>
</Scripts>
</Button>
<Button name="TradeSkillDecrementButton">
<Size>
<AbsDimension x="23" y="22"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativeTo="TradeSkillCreateAllButton" relativePoint="RIGHT">
<Offset>
<AbsDimension x="3" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
TradeSkillFrameDecrement_OnClick();
TradeSkillInputBox:ClearFocus();
</OnClick>
</Scripts>
<NormalTexture file="Interface\Buttons\UI-SpellbookIcon-PrevPage-Up"/>
<PushedTexture file="Interface\Buttons\UI-SpellbookIcon-PrevPage-Down"/>
<DisabledTexture file="Interface\Buttons\UI-SpellbookIcon-PrevPage-Disabled"/>
<HighlightTexture file="Interface\Buttons\UI-Common-MouseHilight" alphaMode="ADD"/>
</Button>
<EditBox name="TradeSkillInputBox" letters="3" numeric="true" autoFocus="false">
<Size>
<AbsDimension x="30" y="20"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativeTo="TradeSkillDecrementButton" relativePoint="RIGHT">
<Offset>
<AbsDimension x="4" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture name="$parentLeft" file="Interface\Common\Common-Input-Border">
<Size>
<AbsDimension x="8" y="20"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="-5" y="0"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0" right="0.0625" top="0" bottom="0.625"/>
</Texture>
<Texture name="$parentRight" file="Interface\Common\Common-Input-Border">
<Size>
<AbsDimension x="8" y="20"/>
</Size>
<Anchors>
<Anchor point="RIGHT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0.9375" right="1.0" top="0" bottom="0.625"/>
</Texture>
<Texture name="$parentMiddle" file="Interface\Common\Common-Input-Border">
<Size>
<AbsDimension x="10" y="20"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativeTo="$parentLeft" relativePoint="RIGHT"/>
<Anchor point="RIGHT" relativeTo="$parentRight" relativePoint="LEFT"/>
</Anchors>
<TexCoords left="0.0625" right="0.9375" top="0" bottom="0.625"/>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnEnterPressed function="EditBox_ClearFocus"/>
<OnEscapePressed function="EditBox_ClearFocus"/>
<OnTextChanged>
if ( self:GetText() == "0" ) then
self:SetText("1");
end
</OnTextChanged>
<OnEditFocusLost function="EditBox_ClearHighlight"/>
<OnEditFocusGained function="EditBox_HighlightText"/>
</Scripts>
<FontString inherits="ChatFontNormal"/>
</EditBox>
<Button name="TradeSkillIncrementButton">
<Size>
<AbsDimension x="23" y="22"/>
</Size>
<Anchors>
<Anchor point="RIGHT" relativeTo="TradeSkillCreateButton" relativePoint="LEFT">
<Offset>
<AbsDimension x="-3" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
TradeSkillFrameIncrement_OnClick();
TradeSkillInputBox:ClearFocus();
</OnClick>
</Scripts>
<NormalTexture file="Interface\Buttons\UI-SpellbookIcon-NextPage-Up"/>
<PushedTexture file="Interface\Buttons\UI-SpellbookIcon-NextPage-Down"/>
<DisabledTexture file="Interface\Buttons\UI-SpellbookIcon-NextPage-Disabled"/>
<HighlightTexture file="Interface\Buttons\UI-Common-MouseHilight" alphaMode="ADD"/>
</Button>
<Button name="TradeSkillFrameCloseButton" inherits="UIPanelCloseButton">
<Anchors>
<Anchor point="TOPRIGHT" relativeTo="TradeSkillFrame" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="-29" y="-8"/>
</Offset>
</Anchor>
</Anchors>
</Button>
</Frames>
<Scripts>
<OnLoad function="TradeSkillFrame_OnLoad"/>
<OnEvent function="TradeSkillFrame_OnEvent"/>
<OnShow>
TradeSkillInputBox:SetNumber(1);
PlaySound("igCharacterInfoOpen");
</OnShow>
<OnHide>
CloseTradeSkill();
PlaySound("igCharacterInfoClose");
</OnHide>
<OnUpdate function="TradeSkillFrame_PlaytimeUpdate"/>
</Scripts>
</Frame>
</Ui>

Some files were not shown because too many files have changed in this diff Show More