diff --git a/Interface/FrameXML/ChatFrame.lua b/Interface/FrameXML/ChatFrame.lua index 2f0f6e645b..40b7b7121a 100644 --- a/Interface/FrameXML/ChatFrame.lua +++ b/Interface/FrameXML/ChatFrame.lua @@ -2174,7 +2174,7 @@ SlashCmdList["WHO"] = function(msg) ShowWhoPanel(); end WhoFrameEditBox:SetText(msg); - C_FriendList.SendWho(msg, Enum.SocialWhoOrigin.CHAT); + C_FriendList.SendWho(msg, Enum.SocialWhoOrigin.Chat); end SlashCmdList["CHANNEL"] = function(msg, editBox) diff --git a/Interface/FrameXML/FriendsFrame_Shared.lua b/Interface/FrameXML/FriendsFrame_Shared.lua index 8e0a7d7f9b..63ba8789b7 100644 --- a/Interface/FrameXML/FriendsFrame_Shared.lua +++ b/Interface/FrameXML/FriendsFrame_Shared.lua @@ -996,7 +996,7 @@ function OpenFriendsFrame(tab) end function WhoFrameEditBox_OnEnterPressed(self) - C_FriendList.SendWho(self:GetText(), Enum.SocialWhoOrigin.SOCIAL); + C_FriendList.SendWho(self:GetText(), Enum.SocialWhoOrigin.Social); self:ClearFocus(); end diff --git a/Interface/FrameXML/ItemRef.lua b/Interface/FrameXML/ItemRef.lua index c6eb8e8147..fc4c57a69a 100644 --- a/Interface/FrameXML/ItemRef.lua +++ b/Interface/FrameXML/ItemRef.lua @@ -59,7 +59,7 @@ function SetItemRef(link, text, button, chatFrame) if ( ChatEdit_GetActiveWindow() ) then ChatEdit_InsertLink(name); else - C_FriendList.SendWho(WHO_TAG_EXACT..name, Enum.SocialWhoOrigin.ITEM); + C_FriendList.SendWho(WHO_TAG_EXACT..name, Enum.SocialWhoOrigin.Item); end elseif ( button == "RightButton" and (not isGMLink) ) then diff --git a/Interface/FrameXML/PVPHelper.xml b/Interface/FrameXML/PVPHelper.xml index d1aa1f3461..4efe484a2c 100644 --- a/Interface/FrameXML/PVPHelper.xml +++ b/Interface/FrameXML/PVPHelper.xml @@ -172,7 +172,7 @@ - if ( AcceptBattlefieldPort(self:GetParent().activeIndex, true) ) then + if (self:GetParent().activeIndex and AcceptBattlefieldPort(self:GetParent().activeIndex, true )) then if( StaticPopup_Visible( "DEATH" ) ) then StaticPopup_Hide( "DEATH" ); end diff --git a/Interface/FrameXML/PlayerFrame.lua b/Interface/FrameXML/PlayerFrame.lua index b37591cc70..8577edf9d7 100644 --- a/Interface/FrameXML/PlayerFrame.lua +++ b/Interface/FrameXML/PlayerFrame.lua @@ -36,6 +36,7 @@ function PlayerFrame_OnLoad(self) self:RegisterEvent("UNIT_ENTERING_VEHICLE"); self:RegisterEvent("UNIT_EXITING_VEHICLE"); self:RegisterEvent("UNIT_EXITED_VEHICLE"); + self:RegisterEvent("PLAYER_FLAGS_CHANGED"); self:RegisterEvent("VARIABLES_LOADED"); self:RegisterUnitEvent("UNIT_COMBAT", "player", "vehicle"); self:RegisterUnitEvent("UNIT_MAXPOWER", "player", "vehicle"); @@ -111,6 +112,9 @@ function PlayerFrame_UpdatePvPStatus() PlayerPVPIconHitArea.tooltipTitle = PVPFFA; PlayerPVPIconHitArea.tooltipText = NEWBIE_TOOLTIP_PVPFFA; PlayerPVPIconHitArea:Show(); + + PlayerPVPTimerText:Hide(); + PlayerPVPTimerText.timeLeft = nil; elseif ( factionGroup and factionGroup ~= "Neutral" and UnitIsPVP("player") ) then if ( not PlayerPVPIcon:IsShown() ) then PlaySound(SOUNDKIT.IG_PVP_UPDATE); @@ -132,6 +136,19 @@ function PlayerFrame_UpdatePvPStatus() PlayerPrestigeBadge:Hide(); PlayerPVPIcon:Hide(); PlayerPVPIconHitArea:Hide(); + + PlayerPVPTimerText:Hide(); + PlayerPVPTimerText.timeLeft = nil; + end +end + +function PlayerFrame_UpdatePVPTimer() + if ( IsPVPTimerRunning() ) then + PlayerPVPTimerText:Show(); + PlayerPVPTimerText.timeLeft = GetPVPTimer(); + else + PlayerPVPTimerText:Hide(); + PlayerPVPTimerText.timeLeft = nil; end end @@ -159,6 +176,7 @@ function PlayerFrame_OnEvent(self, event, ...) self.onHateList = nil; PlayerFrame_Update(); PlayerFrame_UpdateStatus(); + PlayerFrame_UpdatePVPTimer(); elseif ( event == "PLAYER_ENTER_COMBAT" ) then self.inCombat = 1; PlayerFrame_UpdateStatus(); @@ -217,6 +235,8 @@ function PlayerFrame_OnEvent(self, event, ...) self.inSeat = true; PlayerFrame_UpdateArt(self); end + elseif ( event == "PLAYER_FLAGS_CHANGED" ) then + PlayerFrame_UpdatePVPTimer(); elseif ( event == "VARIABLES_LOADED" ) then PlayerFrame_SetLocked(not PLAYER_FRAME_UNLOCKED); if ( PLAYER_FRAME_CASTBARS_SHOWN ) then @@ -394,6 +414,17 @@ function PlayerFrame_OnUpdate (self, elapsed) PlayerStatusGlow:SetAlpha(alpha); end + if ( PlayerPVPTimerText.timeLeft ) then + PlayerPVPTimerText.timeLeft = PlayerPVPTimerText.timeLeft - elapsed*1000; + local timeLeft = PlayerPVPTimerText.timeLeft; + if ( timeLeft < 0 ) then + PlayerPVPTimerText:Hide() + end + PlayerPVPTimerText:SetFormattedText(SecondsToTimeAbbrev(floor(timeLeft/1000))); + else + PlayerPVPTimerText:Hide(); + end + CombatFeedback_OnUpdate(self, elapsed); end diff --git a/Interface/FrameXML/PlayerFrame.xml b/Interface/FrameXML/PlayerFrame.xml index d040c7e1f5..464872ca4c 100644 --- a/Interface/FrameXML/PlayerFrame.xml +++ b/Interface/FrameXML/PlayerFrame.xml @@ -63,6 +63,11 @@ + + + + + diff --git a/Interface_TBC/FrameXML/Minimap.lua b/Interface_TBC/FrameXML/Minimap.lua index abe65f17e6..08eef341de 100644 --- a/Interface_TBC/FrameXML/Minimap.lua +++ b/Interface_TBC/FrameXML/Minimap.lua @@ -20,6 +20,7 @@ function Minimap_OnLoad(self) self:RegisterEvent("MINIMAP_PING"); self:RegisterEvent("MINIMAP_UPDATE_ZOOM"); self:RegisterEvent("PLAYER_TARGET_CHANGED"); + self:RegisterEvent("PLAYER_FLAGS_CHANGED"); end function ToggleMinimap() @@ -94,6 +95,8 @@ function Minimap_OnEvent(self, event, ...) elseif ( zoom == 0 ) then MinimapZoomOut:Disable(); end + elseif ( event == "PLAYER_FLAGS_CHANGED" ) then + Minimap_Update(); end end diff --git a/Interface_Vanilla/FrameXML/Minimap.lua b/Interface_Vanilla/FrameXML/Minimap.lua index 768dc2f9bd..6f4914dba2 100644 --- a/Interface_Vanilla/FrameXML/Minimap.lua +++ b/Interface_Vanilla/FrameXML/Minimap.lua @@ -20,6 +20,7 @@ function Minimap_OnLoad(self) self:RegisterEvent("MINIMAP_PING"); self:RegisterEvent("MINIMAP_UPDATE_ZOOM"); self:RegisterEvent("PLAYER_TARGET_CHANGED"); + self:RegisterEvent("PLAYER_FLAGS_CHANGED"); end function ToggleMinimap() @@ -94,6 +95,8 @@ function Minimap_OnEvent(self, event, ...) elseif ( zoom == 0 ) then MinimapZoomOut:Disable(); end + elseif ( event == "PLAYER_FLAGS_CHANGED" ) then + Minimap_Update(); end end diff --git a/Interface_Wrath/FrameXML/Minimap.lua b/Interface_Wrath/FrameXML/Minimap.lua index a59b51a2e7..7679ed752c 100644 --- a/Interface_Wrath/FrameXML/Minimap.lua +++ b/Interface_Wrath/FrameXML/Minimap.lua @@ -21,6 +21,7 @@ function Minimap_OnLoad(self) self:RegisterEvent("MINIMAP_PING"); self:RegisterEvent("MINIMAP_UPDATE_ZOOM"); self:RegisterEvent("PLAYER_TARGET_CHANGED"); + self:RegisterEvent("PLAYER_FLAGS_CHANGED"); end function ToggleMinimap() @@ -95,6 +96,8 @@ function Minimap_OnEvent(self, event, ...) elseif ( zoom == 0 ) then MinimapZoomOut:Disable(); end + elseif ( event == "PLAYER_FLAGS_CHANGED" ) then + Minimap_Update(); end end