Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Build 9722
  • Loading branch information
tekkub committed Mar 24, 2009
1 parent 1d826cb commit 8e0cbdb
Show file tree
Hide file tree
Showing 17 changed files with 199 additions and 108 deletions.
Expand Up @@ -27,7 +27,7 @@ function BattlefieldMinimap_Toggle()
SetCVar("showBattlefieldMinimap", "1");
BattlefieldMinimap:Show();
WorldMapZoneMinimapDropDown_Update();
elseif ( instanceType == "none" ) then
elseif ( instanceType ~= "arena" ) then
SetCVar("showBattlefieldMinimap", "2");
BattlefieldMinimap:Show();
WorldMapZoneMinimapDropDown_Update();
Expand Down
25 changes: 0 additions & 25 deletions AddOns/Blizzard_Calendar/Blizzard_Calendar.lua
@@ -1,29 +1,4 @@

-- global constants
CALENDAR_FIRST_WEEKDAY = 1; -- 1=SUN 2=MON 3=TUE 4=WED 5=THU 6=FRI 7=SAT

-- Event Types
CALENDAR_EVENTTYPE_RAID = 1;
CALENDAR_EVENTTYPE_DUNGEON = 2;
CALENDAR_EVENTTYPE_PVP = 3;
CALENDAR_EVENTTYPE_MEETING = 4;
CALENDAR_EVENTTYPE_OTHER = 5;

-- Invite Statuses
CALENDAR_INVITESTATUS_INVITED = 1;
CALENDAR_INVITESTATUS_ACCEPTED = 2;
CALENDAR_INVITESTATUS_DECLINED = 3;
CALENDAR_INVITESTATUS_CONFIRMED = 4;
CALENDAR_INVITESTATUS_OUT = 5;
CALENDAR_INVITESTATUS_STANDBY = 6;
CALENDAR_INVITESTATUS_SIGNEDUP = 7;
CALENDAR_INVITESTATUS_NOT_SIGNEDUP = 8;

-- Invite Types
CALENDAR_INVITETYPE_NORMAL = 1;
CALENDAR_INVITETYPE_SIGNUP = 2;


-- static popups
StaticPopupDialogs["CALENDAR_DELETE_EVENT"] = {
text = "%s",
Expand Down
72 changes: 37 additions & 35 deletions AddOns/Blizzard_GlyphUI/Blizzard_GlyphUI.lua
Expand Up @@ -70,20 +70,29 @@ function GlyphFrameGlyph_UpdateSlot (self)
else
GlyphFrameGlyph_SetGlyphType(self, GLYPHTYPE_MAJOR);
end

self.elapsed = 0;
self.tintElapsed = 0;


local slotAnimation = slotAnimations[id];
if ( not enabled ) then
slotAnimations[id].glyph = nil;
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
slotAnimations[id].glyph = nil;
slotAnimation.glyph = nil;
if ( slotAnimation.sparkle ) then
slotAnimation.sparkle:StopAnimating();
slotAnimation.sparkle:Hide();
end
self.spell = nil;
self.shine:Show();
self.background:Show();
Expand All @@ -94,7 +103,7 @@ function GlyphFrameGlyph_UpdateSlot (self)
self.glyph:Hide();
self.ring:Show();
else
slotAnimations[id].glyph = true;
slotAnimation.glyph = true;
self.spell = glyphSpell;
self.shine:Show();
self.background:Show();
Expand Down Expand Up @@ -369,40 +378,33 @@ end
function GlyphFrame_StartSlotAnimation (slotID, duration, size)
local animation = slotAnimations[slotID];

-- init texture to animate
local sparkleName = "GlyphFrameSparkle"..slotID;
local sparkle = _G[sparkleName];
if ( sparkle and sparkle.wait ) then
-- width and height resize is done
sparkle.wait = false;

-- 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();
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
-- init texture to animate
if ( not sparkle ) then
sparkle = GlyphFrame:CreateTexture(sparkleName, "OVERLAY", "GlyphSparkleTexture");
sparkle.slotID = slotID;
end
-- we need to wait a tick for the width and height resize to take effect
sparkle.wait = true;
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();
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
Expand Down
2 changes: 2 additions & 0 deletions AddOns/Blizzard_TalentUI/Blizzard_TalentUI.lua
Expand Up @@ -213,6 +213,8 @@ function PlayerTalentFrame_ShowGlyphFrame()
else
GlyphFrame:Show();
end
-- don't forget to hide the scroll button overlay or it may show up on top of the GlyphFrame!
UIFrameFlashStop(PlayerTalentFrameScrollButtonOverlay);
end
end

Expand Down
5 changes: 0 additions & 5 deletions FrameXML/ArenaRegistrarFrame.xml
Expand Up @@ -954,11 +954,6 @@
HideUIPanel(ColorPickerFrame);
ClosePetitionVendor();
</OnHide>
<OnKeyDown>
if ( GetBindingFromClick(key) == "TOGGLEGAMEMENU" ) then
HideUIPanel(self);
end
</OnKeyDown>
</Scripts>
</Frame>
</Ui>
26 changes: 26 additions & 0 deletions FrameXML/Constants.lua
Expand Up @@ -288,3 +288,29 @@ COMBATLOG_FILTER_NEUTRAL_UNITS = bit.bor(
COMBATLOG_FILTER_UNKNOWN_UNITS = COMBATLOG_OBJECT_NONE;
COMBATLOG_FILTER_EVERYTHING = 0xFFFFFFFF;

--
-- Calendar
--

CALENDAR_FIRST_WEEKDAY = 1; -- 1=SUN 2=MON 3=TUE 4=WED 5=THU 6=FRI 7=SAT

-- Event Types
CALENDAR_EVENTTYPE_RAID = 1;
CALENDAR_EVENTTYPE_DUNGEON = 2;
CALENDAR_EVENTTYPE_PVP = 3;
CALENDAR_EVENTTYPE_MEETING = 4;
CALENDAR_EVENTTYPE_OTHER = 5;

-- Invite Statuses
CALENDAR_INVITESTATUS_INVITED = 1;
CALENDAR_INVITESTATUS_ACCEPTED = 2;
CALENDAR_INVITESTATUS_DECLINED = 3;
CALENDAR_INVITESTATUS_CONFIRMED = 4;
CALENDAR_INVITESTATUS_OUT = 5;
CALENDAR_INVITESTATUS_STANDBY = 6;
CALENDAR_INVITESTATUS_SIGNEDUP = 7;
CALENDAR_INVITESTATUS_NOT_SIGNEDUP = 8;

-- Invite Types
CALENDAR_INVITETYPE_NORMAL = 1;
CALENDAR_INVITETYPE_SIGNUP = 2;
2 changes: 2 additions & 0 deletions FrameXML/ContainerFrame.lua
Expand Up @@ -649,6 +649,8 @@ function ContainerFrame_GetExtendedPriceString(itemButton, quantity)

MerchantFrame.refundBag = bag;
MerchantFrame.refundSlot = slot;
MerchantFrame.honorPoints = honorPoints;
MerchantFrame.arenaPoints = arenaPoints;

local refundItemTexture, _, _, _, _, _, refundItemLink = GetContainerItemInfo(bag, slot);
local itemName, _, itemQuality = GetItemInfo(refundItemLink);
Expand Down
6 changes: 5 additions & 1 deletion FrameXML/GlobalStrings.lua
Expand Up @@ -1625,6 +1625,8 @@ CONFIRM_LOSE_BINDING_CHANGES = "You will lose any unsaved changes if you switch
CONFIRM_OVERWRITE_EQUIPMENT_SET = "You already have an equipment set named %s. Would you like to overwrite it?";
CONFIRM_PET_UNLEARN = "Do you want to unlearn all of your pet's skills? The cost will increase each time you do it.";
CONFIRM_PURCHASE_TOKEN_ITEM = "Are you sure you wish to exchange %s for the following item?";
CONFIRM_REFUND_MAX_ARENA_POINTS = "You are close to the maximum amount of arena points. Selling this item will result in the loss of %d arena points. Proceed?";
CONFIRM_REFUND_MAX_HONOR = "You are close to the maximum amount of honor points. Selling this item will result in the loss of %d honor points. Proceed?";
CONFIRM_REFUND_TOKEN_ITEM = "Are you sure you wish to get a refund of %s for the following item?"; -- for the refund system
CONFIRM_REMOVE_GLYPH = "Are you sure you want to remove %s? This glyph will be permanently destroyed.";
CONFIRM_RESET_INSTANCES = "Do you really want to reset all of your instances?";
Expand Down Expand Up @@ -2673,6 +2675,7 @@ ERR_BATTLEDGROUND_QUEUED_FOR_RATED = "You cannot queue for another battle while
ERR_BATTLEGROUND_ALREADY_IN = "You are already in that battleground.";
ERR_BATTLEGROUND_CANNOT_QUEUE_FOR_RATED = "You cannot queue for a rated match while queued for other battles";
ERR_BATTLEGROUND_INFO_THROTTLED = "You can't do that yet";
ERR_BATTLEGROUND_NOT_IN_BATTLEGROUND = "You can't do that in a battleground.";
ERR_BATTLEGROUND_NOT_IN_TEAM = "Your group is not in the same team";
ERR_BATTLEGROUND_TEAM_LEFT_QUEUE = "Your team has left the arena queue";
ERR_BATTLEGROUND_TOO_MANY_QUEUES = "You can only be queued for 3 battles at once";
Expand Down Expand Up @@ -6860,8 +6863,9 @@ TRANSFER_ABORT_DIFFICULTY3 = "Epic difficulty mode is not available for %s.";
TRANSFER_ABORT_INSUF_EXPAN_LVL1 = "You must have The Burning Crusade expansion installed to access this area.";
TRANSFER_ABORT_INSUF_EXPAN_LVL2 = "You must have The Wrath of the Lich King expansion installed to access this area.";
TRANSFER_ABORT_MAX_PLAYERS = "Transfer Aborted: instance is full"; -- Too many players in instance
TRANSFER_ABORT_NEED_GROUP = "Transfer Aborted: you must be in a group to enter this instance"; -- Player tried to enter a raid or heroic dungeon while not in a group
TRANSFER_ABORT_NEED_GROUP = "Transfer Aborted: you must be in a raid group to enter this instance"; -- Player tried to enter a raid or heroic dungeon while not in a group
TRANSFER_ABORT_NOT_FOUND = "Transfer Aborted: instance not found"; -- Something's wrong with the server
TRANSFER_ABORT_REALM_ONLY = "Transfer Aborted: all players in the party must be from the same realm"; -- Triggers when players from different servers try to enter a "realm-only" dungeon.
TRANSFER_ABORT_TOO_MANY_INSTANCES = "You have entered too many instances recently.";
TRANSFER_ABORT_TOO_MANY_REALM_INSTANCES = "Additional instances cannot be launched, please try again later.";
TRANSFER_ABORT_UNIQUE_MESSAGE1 = "Until you've escaped The Lich King's grasp, you cannot leave this place!";
Expand Down
2 changes: 1 addition & 1 deletion FrameXML/ItemButtonTemplate.lua
Expand Up @@ -10,7 +10,7 @@ function SetItemButtonCount(button, count)

button.count = count;
if ( count > 1 or (button.isBag and count > 0) ) then
if ( count > 999 ) then
if ( count > 1999 ) then
count = "*";
end
getglobal(button:GetName().."Count"):SetText(count);
Expand Down
2 changes: 1 addition & 1 deletion FrameXML/MoneyFrame.lua
Expand Up @@ -381,7 +381,7 @@ function MoneyFrame_Update(frameName, money)

width = width + copperButton:GetWidth();
silverButton:SetPoint("RIGHT", frameName.."CopperButton", "LEFT", spacing, 0);
if ( silverButton:IsShown() ) then
if ( silverButton:IsShown() or goldButton:IsShown() ) then
width = width - spacing;
end
else
Expand Down
11 changes: 10 additions & 1 deletion FrameXML/RestrictedEnvironment.lua
Expand Up @@ -167,7 +167,8 @@ local DIRECT_MACRO_CONDITIONAL_NAMES = {
};

local OTHER_SAFE_FUNCTION_NAMES = {
"GetBindingKey",
"GetBindingKey", "HasAction",
"IsHarmfulSpell", "IsHarmfulItem", "IsHelpfulSpell", "IsHelpfulItem"
};

-- Copy the direct functions into the table
Expand Down Expand Up @@ -208,4 +209,12 @@ function ENV.PlayerInGroup()
or ( GetNumPartyMembers() > 0 and "party" )
end

function ENV.UnitHasVehicleUI(unit)
return UnitCanAssist("player", unit) and UnitHasVehicleUI(unit)
end

function ENV.RegisterStateDriver(frameHandle, ...)
return RegisterStateDriver(GetFrameHandleFrame(frameHandle), ...)
end

ENV = nil;
61 changes: 41 additions & 20 deletions FrameXML/SecureTemplates.lua
Expand Up @@ -124,26 +124,47 @@ function SecureButton_GetAttribute(frame, name)
end

function SecureButton_GetModifiedUnit(self, button)
local unit = SecureButton_GetModifiedAttribute(self, "unit", button);
if ( unit ) then
local unitsuffix = SecureButton_GetModifiedAttribute(self, "unitsuffix", button);
if ( unitsuffix ) then
unit = unit .. unitsuffix;
-- map raid1pet to raidpet1
unit = gsub(unit, "^([^%d]+)([%d]+)[pP][eE][tT]", "%1pet%2");
end
return unit;
end
if ( SecureButton_GetModifiedAttribute(self, "checkselfcast", button) ) then
if ( IsModifiedClick("SELFCAST") ) then
return "player";
end
end
if ( SecureButton_GetModifiedAttribute(self, "checkfocuscast", button) ) then
if ( IsModifiedClick("FOCUSCAST") ) then
return "focus";
end
end
local unit = SecureButton_GetModifiedAttribute(self, "unit", button);
if ( unit ) then
local unitsuffix = SecureButton_GetModifiedAttribute(self, "unitsuffix", button);
if ( unitsuffix ) then
unit = unit .. unitsuffix;
-- map raid1pet to raidpet1
unit = gsub(unit, "^([^%d]+)([%d]+)[pP][eE][tT]", "%1pet%2");
end

local noPet, hadPet = unit:gsub("[pP][eE][tT](%d)", "%1");
if ( hadPet == 0 ) then
noPet, hadPet = unit:gsub("^[pP][eE][tT]", "player");
end
local noPetNoTarget, hadTarget = noPet:gsub("[tT][aA][rR][gG][eE][tT]", "");
if ( UnitHasVehicleUI(noPetNoTarget) and
SecureButton_GetModifiedAttribute(self, "toggleForVehicle", button) and
(noPetNoTarget == noPetNoTarget:gsub("^[mM][oO][uU][sS][eE][oO][vV][eE][rR]", "")
:gsub("^[fF][oO][cC][uU][sS]", "")
:gsub("^[aA][rR][eE][nN][aA]%d", ""))
-- NOTE: using these 3 gsubs is faster than a :lower() call and a table lookup
-- "target" is not included in the above check because it is already filtered out earlier on
) then
if ( hadPet ~= 0 ) then
unit = noPet;
elseif ( (hadTarget == 0) or SecureButton_GetModifiedAttribute(self, "allowVehicleTarget", button) ) then
unit = unit:gsub("^[pP][lL][aA][yY][eE][rR]", "pet"):gsub("^([%a]+)([%d]+)", "%1pet%2");
end
end

return unit;
end
if ( SecureButton_GetModifiedAttribute(self, "checkselfcast", button) ) then
if ( IsModifiedClick("SELFCAST") ) then
return "player";
end
end
if ( SecureButton_GetModifiedAttribute(self, "checkfocuscast", button) ) then
if ( IsModifiedClick("FOCUSCAST") ) then
return "focus";
end
end
end
function SecureButton_GetUnit(self)
local unit = SecureButton_GetAttribute(self, "unit");
Expand Down

0 comments on commit 8e0cbdb

Please sign in to comment.