Skip to content

Commit

Permalink
Build 14179
Browse files Browse the repository at this point in the history
  • Loading branch information
tekkub committed Jun 1, 2011
1 parent c6d8bd9 commit b7cefb1
Show file tree
Hide file tree
Showing 32 changed files with 1,540 additions and 326 deletions.
54 changes: 43 additions & 11 deletions AddOns/Blizzard_CUFProfiles/Blizzard_CompactUnitFrameProfiles.lua
Expand Up @@ -7,7 +7,7 @@ function CompactUnitFrameProfiles_OnLoad(self)
self:RegisterEvent("RAID_ROSTER_UPDATE");

--Get this working with the InterfaceOptions panel.
self.name = COMPACT_UNIT_FRAME_PROFILES;
self.name = COMPACT_UNIT_FRAME_PROFILES_LABEL;
self.options = {};
self.controls = {};

Expand Down Expand Up @@ -174,6 +174,17 @@ function CompactUnitFrameProfiles_CreateProfile(profileName)
CompactUnitFrameProfiles_ActivateRaidProfile(profileName);
end

function CompactUnitFrameProfiles_UpdateNewProfileCreateButton()
local button = CompactUnitFrameProfiles.newProfileDialog.createButton;
local text = strtrim(CompactUnitFrameProfiles.newProfileDialog.editBox:GetText());

if ( text == "" or RaidProfileExists(text) ) then
button:Disable();
else
button:Enable();
end
end

function CompactUnitFrameProfiles_HideNewProfileDialog()
CompactUnitFrameProfiles.newProfileDialog:Hide();
end
Expand All @@ -184,6 +195,7 @@ function CompactUnitFrameProfiles_ShowNewProfileDialog()
CompactUnitFrameProfiles.newProfileDialog:Show();
CompactUnitFrameProfiles.newProfileDialog.editBox:SetText("");
CompactUnitFrameProfiles.newProfileDialog.editBox:SetFocus();
CompactUnitFrameProfiles_UpdateNewProfileCreateButton();
end

function CompactUnitFrameProfiles_ConfirmProfileDeletion(profile)
Expand Down Expand Up @@ -246,37 +258,48 @@ for i=26, 40 do countMap[i] = 40 end;

function CompactUnitFrameProfiles_GetAutoActivationState()
local name, instanceType, difficultyIndex, difficultyName, maxPlayers, dynamicDifficulty, isDynamic = GetInstanceInfo();
if ( not name ) then --We don't have info.
return false;
end

local numPlayers, profileType, enemyType;

if ( instanceType == "party" or instanceType == "raid" ) then
local numPlayers;
if ( maxPlayers <= 5 ) then
numPlayers = 5; --For 5-man dungeons.
else
numPlayers = countMap[maxPlayers];
end
return numPlayers, instanceType, "PvE";
profileType, enemyType = instanceType, "PvE";
elseif ( instanceType == "arena" ) then
--TODO - Get the actual arena size, not just the # in party.
if ( GetNumRaidMembers() <= 2 ) then
return 2, instanceType, "PvP";
numPlayers, profileType, enemyType = 2, instanceType, "PvP";
elseif ( GetNumRaidMembers() <= 3 ) then
return 3, instanceType, "PvP";
numPlayers, profileType, enemyType = 3, instanceType, "PvP";
else
return 5, instanceType, "PvP";
numPlayers, profileType, enemyType = 5, instanceType, "PvP";
end
elseif ( instanceType == "pvp" ) then
if ( IsRatedBattleground() ) then
return 10, instanceType, "PvP";
numPlayers, profileType, enemyType = 10, instanceType, "PvP";
else
return countMap[maxPlayers], instanceType, "PvP";
numPlayers, profileType, enemyType = countMap[maxPlayers], instanceType, "PvP";
end
else
local numRaidMembers = GetNumRaidMembers();
if ( numRaidMembers > 0 ) then
return countMap[GetNumRaidMembers()], "world", "PvE";
numPlayers, profileType, enemyType = countMap[GetNumRaidMembers()], "world", "PvE";
else
return 5, "world", "PvE";
numPlayers, profileType, enemyType = 5, "world", "PvE";
end
end

if ( not numPlayers ) then
return false;
end

return true, numPlayers, profileType, enemyType;
end

function CompactUnitFrameProfiles_CheckAutoActivation()
Expand All @@ -285,7 +308,16 @@ function CompactUnitFrameProfiles_CheckAutoActivation()
return;
end

local numPlayers, activationType, enemyType = CompactUnitFrameProfiles_GetAutoActivationState();
local success, numPlayers, activationType, enemyType = CompactUnitFrameProfiles_GetAutoActivationState();

if ( not success ) then
--We didn't have all the relevent info yet. Update again soon.
AnimTimerFrameUpdateActiveRaidProfileGroup:Play();
return;
else
AnimTimerFrameUpdateActiveRaidProfileGroup:Stop();
end

local spec = GetActiveTalentGroup();
local lastActivationType = CompactUnitFrameProfiles.lastActivationType;

Expand Down
Expand Up @@ -273,6 +273,9 @@
<OnEscapePressed>
self:ClearFocus();
</OnEscapePressed>
<OnTextChanged>
CompactUnitFrameProfiles_UpdateNewProfileCreateButton();
</OnTextChanged>
</Scripts>
<FontString inherits="ChatFontNormal"/>
</EditBox>
Expand Down Expand Up @@ -301,10 +304,8 @@
<Scripts>
<OnClick>
--Also clicked via the OnEnterPressed script in the EditBox.
if ( self:GetParent().editBox:GetText() ~= "" ) then
CompactUnitFrameProfiles_CreateProfile(self:GetParent().editBox:GetText());
CompactUnitFrameProfiles_HideNewProfileDialog();
end
CompactUnitFrameProfiles_CreateProfile(strtrim(self:GetParent().editBox:GetText()));
CompactUnitFrameProfiles_HideNewProfileDialog();
</OnClick>
</Scripts>
</Button>
Expand Down
2 changes: 1 addition & 1 deletion AddOns/Blizzard_MacroUI/Blizzard_MacroUI.xml
Expand Up @@ -328,7 +328,7 @@
<AbsDimension x="80" y="22"/>
</Size>
<Anchors>
<Anchor point="BOTTOMRIGHT" relativeTo="MacroFrameText" relativePoint="TOPRIGHT">
<Anchor point="BOTTOMRIGHT" relativeTo="MacroFrameScrollFrame" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="25" y="10"/>
</Offset>
Expand Down
31 changes: 25 additions & 6 deletions AddOns/Blizzard_MovePad/Blizzard_MovePad.xml
Expand Up @@ -12,7 +12,6 @@
<Anchors>
<Anchor point="TOPRIGHT" x="-90" y="-180"/>
</Anchors>
<TitleRegion setAllPoints="true"/>
<Backdrop bgFile="Interface\Tooltips\UI-Tooltip-Background" edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true">
<EdgeSize>
<AbsValue val="16"/>
Expand All @@ -34,12 +33,12 @@
</Anchors>
<Backdrop bgFile="LockButton-Border"/>
<Scripts>
<OnLoad>
self:SetChecked(false);
MovePadFrame.canMove = false;
</OnLoad>
<OnClick>
if ( self:GetChecked() ) then
self:GetParent():EnableMouse(true);
else
self:GetParent():EnableMouse(false);
end
MovePadFrame.canMove = self:GetChecked();
</OnClick>
</Scripts>
<NormalTexture file="Interface\Buttons\LockButton-Locked-Up"/>
Expand Down Expand Up @@ -183,5 +182,25 @@
</Scripts>
</CheckButton>
</Frames>
<Scripts>
<OnLoad>
self:RegisterForDrag("LeftButton");
</OnLoad>
<OnDragStart>
if( self.canMove ) then
self.moving = true;
self:SetFrameStrata("DIALOG");
self:StartMoving();
end
</OnDragStart>
<OnDragStop>
if( self.canMove and self.moving ) then
self.moving = false;
self:StopMovingOrSizing();
self:SetFrameStrata("BACKGROUND");
ValidateFramePosition(self, 25);
end
</OnDragStop>
</Scripts>
</Frame>
</Ui>
19 changes: 9 additions & 10 deletions AddOns/Blizzard_TradeSkillUI/Blizzard_TradeSkillUI.lua
Expand Up @@ -4,7 +4,8 @@ TRADE_SKILLS_DISPLAYED = 8;
TRADE_SKILL_GUILD_CRAFTERS_DISPLAYED = 10;
MAX_TRADE_SKILL_REAGENTS = 8;
TRADE_SKILL_HEIGHT = 16;
TRADE_SKILL_TEXT_WIDTH = 275;
TRADE_SKILL_TEXT_WIDTH = 270;
TRADE_SKILL_SKILLUP_TEXT_WIDTH = 30;
TRADE_SKILL_LINKED_NAME_WIDTH = 120;

TradeSkillTypePrefix = {
Expand Down Expand Up @@ -169,7 +170,7 @@ function TradeSkillFrame_Update()
TradeSkillHighlightFrame:Hide();
local skillName, skillType, numAvailable, isExpanded, altVerb, numSkillUps;
local skillIndex, skillButton, skillButtonText, skillButtonCount, skillButtonNumSkillUps, skillButtonNumSkillUpsIcon;
local nameWidth, countWidth;
local nameWidth, countWidth, usedWidth;

local skillNamePrefix = " ";
local diplayedSkills = TRADE_SKILLS_DISPLAYED;
Expand Down Expand Up @@ -206,18 +207,16 @@ function TradeSkillFrame_Update()
skillButtonNumSkillUps = _G["TradeSkillSkill"..buttonIndex.."NumSkillUps"];
skillButtonNumSkillUpsText = _G["TradeSkillSkill"..buttonIndex.."NumSkillUpsText"];
skillButtonNumSkillUpsIcon = _G["TradeSkillSkill"..buttonIndex.."NumSkillUpsIcon"];
if ( skillIndex <= numTradeSkills ) then

if ( skillIndex <= numTradeSkills ) then
--turn on the multiskill icon
if not isTradeSkillGuild and numSkillUps > 1 and skillType=="optimal" then
skillButtonNumSkillUps:Show();
skillButtonNumSkillUpsText:SetText(numSkillUps);
usedWidth = TRADE_SKILL_SKILLUP_TEXT_WIDTH;
else
skillButtonNumSkillUps:Hide();
usedWidth = 0;
end



-- Set button widths if scrollbar is shown or hidden
if ( TradeSkillListScrollFrame:IsShown() ) then
skillButton:SetWidth(293);
Expand Down Expand Up @@ -270,16 +269,16 @@ function TradeSkillFrame_Update()
if ( numAvailable <= 0 ) then
skillButton:SetText(skillNamePrefix..skillName);
skillButtonText:SetWidth(TRADE_SKILL_TEXT_WIDTH);
skillButtonCount:SetText(skillCountPrefix);
skillButtonCount:SetText("");
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);
if ( nameWidth + 2 + countWidth > TRADE_SKILL_TEXT_WIDTH - usedWidth ) then
skillButtonText:SetWidth(TRADE_SKILL_TEXT_WIDTH - 2 - countWidth - usedWidth);
else
skillButtonText:SetWidth(0);
end
Expand Down
2 changes: 2 additions & 0 deletions FrameXML/AlertFrames.lua
Expand Up @@ -31,7 +31,9 @@ end
function AlertFrame_AnimateIn(frame)
frame:Show();
frame.animIn:Play();
frame.glow:Show();
frame.glow.animIn:Play();
frame.shine:Show();
frame.shine.animIn:Play();
frame.waitAndAnimOut:Stop(); --Just in case it's already animating out, but we want to reinstate it.
if ( frame:IsMouseOver() ) then
Expand Down
42 changes: 36 additions & 6 deletions FrameXML/AlertFrames.xml
Expand Up @@ -138,7 +138,7 @@
</Texture>
</Layer>
<Layer level="OVERLAY">
<Texture name="$parentShine" file="Interface\AchievementFrame\UI-Achievement-Alert-Glow" alphaMode="ADD" alpha="0" parentKey="shine">
<Texture name="$parentShine" file="Interface\AchievementFrame\UI-Achievement-Alert-Glow" alphaMode="ADD" hidden="true" parentKey="shine">
<Size>
<AbsDimension x="67" y="72"/>
</Size>
Expand All @@ -152,6 +152,11 @@
<Alpha change="1" duration="0.2" order="1"/>
<Translation offsetX="260" offsetY="0" duration="0.85" order="2"/>
<Alpha startDelay="0.35" change="-1" duration="0.5" order="2"/>
<Scripts>
<OnFinished>
self:GetParent():Hide();
</OnFinished>
</Scripts>
</AnimationGroup>
</Animations>
<TexCoords left="0.78125" right="0.912109375" top="0" bottom="0.28125"/>
Expand All @@ -163,7 +168,7 @@
<Frame name="$parentGlowFrame" setAllPoints="true" enableMouse="false" parentKey="glowFrame">
<Layers>
<Layer level="OVERLAY">
<Texture name="$parentGlow" file="Interface\AchievementFrame\UI-Achievement-Alert-Glow" alphaMode="ADD" alpha="0" parentKey="glow">
<Texture name="$parentGlow" file="Interface\AchievementFrame\UI-Achievement-Alert-Glow" alphaMode="ADD" hidden="true" parentKey="glow">
<Size>
<AbsDimension x="415" y="171"/>
</Size>
Expand All @@ -176,6 +181,11 @@
<AnimationGroup name="$parentAnimIn" parentKey="animIn">
<Alpha change="1" duration="0.2" order="1"/>
<Alpha change="-1" duration="0.5" order="2"/>
<Scripts>
<OnFinished>
self:GetParent():Hide();
</OnFinished>
</Scripts>
</AnimationGroup>
</Animations>
<TexCoords left="0" right="0.78125" top="0" bottom="0.66796875"/>
Expand Down Expand Up @@ -277,7 +287,7 @@
</Texture>
</Layer>
<Layer level="OVERLAY">
<Texture name="$parentGlow" file="Interface\AchievementFrame\UI-Achievement-Alert-Glow" alphaMode="ADD" alpha="0" parentKey="glow">
<Texture name="$parentGlow" file="Interface\AchievementFrame\UI-Achievement-Alert-Glow" alphaMode="ADD" hidden="true" parentKey="glow">
<Size>
<AbsDimension x="400" y="171"/>
</Size>
Expand All @@ -290,11 +300,16 @@
<AnimationGroup name="$parentAnimIn" parentKey="animIn">
<Alpha change="1" duration="0.2" order="1"/>
<Alpha change="-1" duration="0.5" order="2"/>
<Scripts>
<OnFinished>
self:GetParent():Hide();
</OnFinished>
</Scripts>
</AnimationGroup>
</Animations>
<TexCoords left="0" right="0.78125" top="0" bottom="0.66796875"/>
</Texture>
<Texture name="$parentShine" file="Interface\AchievementFrame\UI-Achievement-Alert-Glow" alphaMode="ADD" alpha="0" parentKey="shine">
<Texture name="$parentShine" file="Interface\AchievementFrame\UI-Achievement-Alert-Glow" alphaMode="ADD" hidden="true" parentKey="shine">
<Size>
<AbsDimension x="67" y="72"/>
</Size>
Expand All @@ -308,6 +323,11 @@
<Alpha change="1" duration="0.2" order="1"/>
<Translation offsetX="240" offsetY="0" duration="0.85" order="2"/>
<Alpha startDelay="0.35" change="-1" duration="0.5" order="2"/>
<Scripts>
<OnFinished>
self:GetParent():Hide();
</OnFinished>
</Scripts>
</AnimationGroup>
</Animations>
<TexCoords left="0.78125" right="0.912109375" top="0" bottom="0.28125"/>
Expand Down Expand Up @@ -514,7 +534,7 @@
</FontString>
</Layer>
<Layer level="OVERLAY">
<Texture name="$parentGlow" file="Interface\AchievementFrame\UI-Achievement-Alert-Glow" alphaMode="ADD" alpha="0" parentKey="glow">
<Texture name="$parentGlow" file="Interface\AchievementFrame\UI-Achievement-Alert-Glow" alphaMode="ADD" hidden="true" parentKey="glow">
<Size>
<AbsDimension x="350" y="151"/>
</Size>
Expand All @@ -527,11 +547,16 @@
<AnimationGroup name="$parentAnimIn" parentKey="animIn">
<Alpha change="1" duration="0.2" order="1"/>
<Alpha change="-1" duration="0.5" order="2"/>
<Scripts>
<OnFinished>
self:GetParent():Hide();
</OnFinished>
</Scripts>
</AnimationGroup>
</Animations>
<TexCoords left="0" right="0.78125" top="0" bottom="0.66796875"/>
</Texture>
<Texture name="$parentShine" file="Interface\AchievementFrame\UI-Achievement-Alert-Glow" alphaMode="ADD" alpha="0" parentKey="shine">
<Texture name="$parentShine" file="Interface\AchievementFrame\UI-Achievement-Alert-Glow" alphaMode="ADD" hidden="true" parentKey="shine">
<Size>
<AbsDimension x="67" y="60"/>
</Size>
Expand All @@ -545,6 +570,11 @@
<Alpha change="1" duration="0.2" order="1"/>
<Translation offsetX="200" offsetY="0" duration="0.71" order="2"/>
<Alpha startDelay="0.35" change="-1" duration="0.5" order="2"/>
<Scripts>
<OnFinished>
self:GetParent():Hide();
</OnFinished>
</Scripts>
</AnimationGroup>
</Animations>
<TexCoords left="0.78125" right="0.912109375" top="0" bottom="0.28125"/>
Expand Down

0 comments on commit b7cefb1

Please sign in to comment.