diff --git a/Interface/AddOns/Blizzard_APIDocumentation/AzeriteEssenceDocumentation.lua b/Interface/AddOns/Blizzard_APIDocumentation/AzeriteEssenceDocumentation.lua index 23ae7f58536ac172ce04a491fd636a855c6050c9..562a754a30e3759b9d6effacffdbce3cef27cd5a 100644 --- a/Interface/AddOns/Blizzard_APIDocumentation/AzeriteEssenceDocumentation.lua +++ b/Interface/AddOns/Blizzard_APIDocumentation/AzeriteEssenceDocumentation.lua @@ -146,6 +146,15 @@ local AzeriteEssence = { Name = "essenceID", Type = "number", Nilable = false }, }, }, + { + Name = "HasNeverActivatedAnyEssences", + Type = "Function", + + Returns = + { + { Name = "hasNeverActivatedAnyEssences", Type = "bool", Nilable = false }, + }, + }, { Name = "HasPendingActivationEssence", Type = "Function", diff --git a/Interface/AddOns/Blizzard_APIDocumentation/FriendListDocumentation.lua b/Interface/AddOns/Blizzard_APIDocumentation/FriendListDocumentation.lua index e67e2903d76e55b2b7676f737a97b07b5b561ba9..ce6455d9e618699a2056c7ae355a7f9703a4588b 100644 --- a/Interface/AddOns/Blizzard_APIDocumentation/FriendListDocumentation.lua +++ b/Interface/AddOns/Blizzard_APIDocumentation/FriendListDocumentation.lua @@ -393,6 +393,7 @@ local FriendList = Payload = { { Name = "friendId", Type = "number", Nilable = false }, + { Name = "isCompanionApp", Type = "bool", Nilable = false, Default = false }, }, }, { @@ -402,6 +403,7 @@ local FriendList = Payload = { { Name = "friendId", Type = "number", Nilable = false }, + { Name = "isCompanionApp", Type = "bool", Nilable = false, Default = false }, }, }, { diff --git a/Interface/AddOns/Blizzard_APIDocumentation/PvpInfoDocumentation.lua b/Interface/AddOns/Blizzard_APIDocumentation/PvpInfoDocumentation.lua index 91dc723ac5bad938499fed88eedd09f94fcd008d..7189076080e8c5e743d8293e72b9b1186510b584 100644 --- a/Interface/AddOns/Blizzard_APIDocumentation/PvpInfoDocumentation.lua +++ b/Interface/AddOns/Blizzard_APIDocumentation/PvpInfoDocumentation.lua @@ -6,6 +6,24 @@ local PvpInfo = Functions = { + { + Name = "CanDisplayDeaths", + Type = "Function", + + Returns = + { + { Name = "canDisplay", Type = "bool", Nilable = false }, + }, + }, + { + Name = "CanDisplayHonorableKills", + Type = "Function", + + Returns = + { + { Name = "canDisplay", Type = "bool", Nilable = false }, + }, + }, { Name = "CanToggleWarMode", Type = "Function", @@ -496,6 +514,24 @@ local PvpInfo = { Name = "isInBrawl", Type = "bool", Nilable = false }, }, }, + { + Name = "IsMatchConsideredArena", + Type = "Function", + + Returns = + { + { Name = "asArena", Type = "bool", Nilable = false }, + }, + }, + { + Name = "IsMatchFactional", + Type = "Function", + + Returns = + { + { Name = "isFactional", Type = "bool", Nilable = false }, + }, + }, { Name = "IsPVPMap", Type = "Function", diff --git a/Interface/AddOns/Blizzard_APIDocumentation/UIWidgetManagerDocumentation.lua b/Interface/AddOns/Blizzard_APIDocumentation/UIWidgetManagerDocumentation.lua index eb404212516afddad3aef66baad67d7d97158b09..fcb0d3654bc7f31df00c8c1740cc6c16bd9bbf3c 100644 --- a/Interface/AddOns/Blizzard_APIDocumentation/UIWidgetManagerDocumentation.lua +++ b/Interface/AddOns/Blizzard_APIDocumentation/UIWidgetManagerDocumentation.lua @@ -495,6 +495,32 @@ local UIWidgetManager = { Name = "NeitherStateIsGood", Type = "ZoneControlMode", EnumValue = 3 }, }, }, + { + Name = "ZoneControlLeadingEdgeType", + Type = "Enumeration", + NumValues = 2, + MinValue = 0, + MaxValue = 1, + Fields = + { + { Name = "NoLeadingEdge", Type = "ZoneControlLeadingEdgeType", EnumValue = 0 }, + { Name = "UseLeadingEdge", Type = "ZoneControlLeadingEdgeType", EnumValue = 1 }, + }, + }, + { + Name = "ZoneControlDangerFlashType", + Type = "Enumeration", + NumValues = 4, + MinValue = 0, + MaxValue = 3, + Fields = + { + { Name = "ShowOnGoodStates", Type = "ZoneControlDangerFlashType", EnumValue = 0 }, + { Name = "ShowOnBadStates", Type = "ZoneControlDangerFlashType", EnumValue = 1 }, + { Name = "ShowOnBoth", Type = "ZoneControlDangerFlashType", EnumValue = 2 }, + { Name = "ShowOnNeither", Type = "ZoneControlDangerFlashType", EnumValue = 3 }, + }, + }, { Name = "ZoneControlState", Type = "Enumeration", @@ -932,6 +958,8 @@ local UIWidgetManager = { { Name = "shownState", Type = "WidgetShownState", Nilable = false }, { Name = "mode", Type = "ZoneControlMode", Nilable = false }, + { Name = "leadingEdgeType", Type = "ZoneControlLeadingEdgeType", Nilable = false }, + { Name = "dangerFlashType", Type = "ZoneControlDangerFlashType", Nilable = false }, { Name = "zoneEntries", Type = "table", InnerType = "ZoneEntry", Nilable = false }, { Name = "widgetSizeSetting", Type = "number", Nilable = false }, { Name = "textureKitID", Type = "number", Nilable = false }, diff --git a/Interface/AddOns/Blizzard_ArtifactUI/Blizzard_ArtifactPerks.lua b/Interface/AddOns/Blizzard_ArtifactUI/Blizzard_ArtifactPerks.lua index 6f2d7bf2471bac4c25be8c2e7c9dbdbd4e56d174..8b01c31f5380c0f11cc451e952f970964e553bed 100644 --- a/Interface/AddOns/Blizzard_ArtifactUI/Blizzard_ArtifactPerks.lua +++ b/Interface/AddOns/Blizzard_ArtifactUI/Blizzard_ArtifactPerks.lua @@ -792,7 +792,7 @@ local function QueueReveal(self, powerButton, distance, tier) if linkedPowerButton.hasSpentAny then QueueReveal(self, linkedPowerButton, distance, tier); else - local distanceToLink = powerButton:CalculateDistanceTo(linkedPowerButton); + local distanceToLink = CalculateDistanceBetweenRegions(powerButton, linkedPowerButton); local totalDistance = distance + distanceToLink; QueueReveal(self, linkedPowerButton, totalDistance, tier); diff --git a/Interface/AddOns/Blizzard_ArtifactUI/Blizzard_ArtifactPowerButton.lua b/Interface/AddOns/Blizzard_ArtifactUI/Blizzard_ArtifactPowerButton.lua index 571c66c0cc45a5c2d0c7ae6450c74f6e6ac819d9..c9d55f2ba4d274b589d81e8f5bb388e13cacd0f8 100644 --- a/Interface/AddOns/Blizzard_ArtifactUI/Blizzard_ArtifactPowerButton.lua +++ b/Interface/AddOns/Blizzard_ArtifactUI/Blizzard_ArtifactPowerButton.lua @@ -506,13 +506,6 @@ function ArtifactPowerButtonMixin:UpdateIcon() end end -function ArtifactPowerButtonMixin:CalculateDistanceTo(otherPowerButton) - local cx, cy = self:GetCenter(); - local ocx, ocy = otherPowerButton:GetCenter(); - local dx, dy = ocx - cx, ocy - cy; - return math.sqrt(dx * dx + dy * dy); -end - function ArtifactPowerButtonMixin:SetupButton(powerID, anchorRegion, textureKit) local powerInfo = C_ArtifactUI.GetPowerInfo(powerID); diff --git a/Interface/AddOns/Blizzard_AzeriteEssenceUI/Blizzard_AzeriteEssenceUI.lua b/Interface/AddOns/Blizzard_AzeriteEssenceUI/Blizzard_AzeriteEssenceUI.lua index 3bebc431150c840332b6e0f333cbe9155a63e9f1..f4d475cc12db614282f60a75a13891810ba29d7c 100644 --- a/Interface/AddOns/Blizzard_AzeriteEssenceUI/Blizzard_AzeriteEssenceUI.lua +++ b/Interface/AddOns/Blizzard_AzeriteEssenceUI/Blizzard_AzeriteEssenceUI.lua @@ -22,6 +22,20 @@ local HEART_MODEL_SCENE_INFO = StaticModelInfo.CreateModelSceneEntry(256, 196288 local LEARN_MODEL_SCENE_INFO = StaticModelInfo.CreateModelSceneEntry(259, 2101299); -- 8FX_Azerite_AbsorbCurrency_Small_ImpactBase.m2 local UNLOCK_SLOT_MODEL_SCENE_INFO = StaticModelInfo.CreateModelSceneEntry(269, 1983548); -- 8FX_Azerite_Generic_NovaHigh_Base.m2 local UNLOCK_STAMINA_MODEL_SCENE_INFO = StaticModelInfo.CreateModelSceneEntry(270, 1983548); -- 8FX_Azerite_Generic_NovaHigh_Base.m2 +local UNLOCK_SECONDARY_EFFECT_ID = 2924332; -- CFX_Azerite_TimeLostTopaz_Major_Rank4_Cast.m2 + +local LEARN_SHAKE_DELAY = 0.869; +local LEARN_SHAKE = { { x = 0, y = -8}, { x = 0, y = 8}, { x = 0, y = -8}, { x = 0, y = 8}, { x = -3, y = -1}, { x = 2, y = 2}, { x = -2, y = -3}, { x = -1, y = -1}, { x = 4, y = 2}, { x = 3, y = 4}, { x = -3, y = 4}, { x = 4, y = -4}, { x = -4, y = 2}, { x = -2, y = 1}, { x = -3, y = -1}, { x = 2, y = 2}, { x = -2, y = -3}, { x = -1, y = -1}, { x = 4, y = 2}, { x = 3, y = 4}, { x = -3, y = 4}, { x = 4, y = -4}, { x = -4, y = 2}, { x = -2, y = 1}, { x = -3, y = -1}, { x = 2, y = 2}, { x = -2, y = -3}, { x = -1, y = -1}, { x = 4, y = 2}, { x = 3, y = 4}, { x = -3, y = 4}, { x = 4, y = -4}, { x = -4, y = 2}, { x = -2, y = 1}, { x = -3, y = -1}, { x = 2, y = 2}, { x = -2, y = -3}, { x = -1, y = -1}, { x = 4, y = 2}, { x = 3, y = 4}, { x = -3, y = 4}, { x = 4, y = -4}, { x = -4, y = 2}, { x = -2, y = 1}, { x = -3, y = -1}, { x = 2, y = 2}, { x = -2, y = -3}, { x = -1, y = -1}, { x = 4, y = 2}, { x = 3, y = 4}, { x = -3, y = 4}, { x = 4, y = -4}, { x = -4, y = 2}, { x = -2, y = 1}, { x = -3, y = -1}, { x = 2, y = 2}, { x = -2, y = -3}, { x = -1, y = -1}, { x = 4, y = 2}, { x = 3, y = 4}, { x = -3, y = 4}, { x = 4, y = -4}, { x = -4, y = 2}, { x = -2, y = 1}, }; +local LEARN_SHAKE_DURATION = 0.20; +local LEARN_SHAKE_FREQUENCY = 0.001; + +local REVEAL_START_DELAY = 1.2; +local REVEAL_DELAY_SECS_PER_DISTANCE = 0.0035; +local REVEAL_LINE_DURATION_SECS_PER_DISTANCE = 0.0012; +local REVEAL_SWIRL_SLOT_SCALE = 1; +local REVEAL_SWIRL_STAMINA_SCALE = 0.5; + +local MAX_ESSENCE_RANK = 4; local AZERITE_ESSENCE_FRAME_EVENTS = { "UI_MODEL_SCENE_INFO_UPDATED", @@ -108,8 +122,7 @@ function AzeriteEssenceUIMixin:SetupMilestones() lineContainer:SetEndPoints(previousMilestoneFrame, milestoneFrame); lineContainer:SetScrollAnimationProgressOffset(0); - lineContainer:SetState(PowerDependencyLineMixin.LINE_STATE_CONNECTED); - + milestoneFrame.linkLine = lineContainer; lineContainer.fromButton = previousMilestoneFrame; lineContainer.toButton = milestoneFrame; tinsert(self.Lines, lineContainer); @@ -124,11 +137,16 @@ function AzeriteEssenceUIMixin:OnEvent(event, ...) if event == "UI_MODEL_SCENE_INFO_UPDATED" then self:SetupModelScene(); elseif event == "AZERITE_ESSENCE_CHANGED" then - local essenceID = ...; + local essenceID, rank = ...; self:RefreshSlots(); self.EssenceList:Update(); self.EssenceList:OnEssenceChanged(essenceID); AzeriteEssenceLearnAnimFrame:PlayAnim(); + if rank < MAX_ESSENCE_RANK then + PlaySound(SOUNDKIT.UI_82_HEARTOFAZEROTH_LEARNESSENCE_ANIM); + else + PlaySound(SOUNDKIT.UI_82_HEARTOFAZEROTH_LEARNESSENCE_ANIM_RANK4); + end elseif event == "AZERITE_ESSENCE_ACTIVATED" or event == "AZERITE_ESSENCE_ACTIVATION_FAILED" or event == "AZERITE_ESSENCE_UPDATE" then self:ClearNewlyActivatedEssence(); self:RefreshSlots(); @@ -159,12 +177,14 @@ function AzeriteEssenceUIMixin:OnShow() end); end + self.shouldPlayReveal = C_AzeriteEssence:HasNeverActivatedAnyEssences(); + FrameUtil.RegisterFrameForEvents(self, AZERITE_ESSENCE_FRAME_EVENTS); self:RefreshPowerLevel(); self:RefreshMilestones(); - PlaySound(SOUNDKIT.IG_CHARACTER_INFO_OPEN); -- temp? + PlaySound(SOUNDKIT.UI_82_HEARTOFAZEROTH_WINDOW_OPEN); self:TriggerEvent(AzeriteEssenceUIMixin.Event.OnShow); end @@ -180,6 +200,10 @@ function AzeriteEssenceUIMixin:OnHide() self.itemDataLoadedCancelFunc = nil; end + if self.numRevealsPlaying then + self:CancelReveal(); + end + FrameUtil.UnregisterFrameForEvents(self, AZERITE_ESSENCE_FRAME_EVENTS); self:ClearNewlyActivatedEssence(); @@ -189,7 +213,7 @@ function AzeriteEssenceUIMixin:OnHide() self.ActivationGlow:SetAlpha(0); AzeriteEssenceLearnAnimFrame:StopAnim(); - PlaySound(SOUNDKIT.IG_CHARACTER_INFO_CLOSE); -- temp? + PlaySound(SOUNDKIT.UI_82_HEARTOFAZEROTH_WINDOW_CLOSE); self:TriggerEvent(AzeriteEssenceUIMixin.Event.OnHide); end @@ -213,6 +237,18 @@ function AzeriteEssenceUIMixin:OnEssenceActivated(essenceID, slotFrame) self.ActivationGlow.Anim:Stop(); self.ActivationGlow.Anim:Play(); + + if self.shouldPlayReveal then + PlaySound(SOUNDKIT.UI_82_HEARTOFAZEROTH_SLOTFIRSTESSENCE); + C_Timer.After(REVEAL_START_DELAY, + function() + self:PlayReveal(); + end + ); + else + PlaySound(SOUNDKIT.UI_82_HEARTOFAZEROTH_SLOTESSENCE); + end + -- temp sounds if slotFrame.slot == Enum.AzeriteEssence.MainSlot then PlaySound(13827); @@ -237,6 +273,10 @@ function AzeriteEssenceUIMixin:RefreshPowerLevel() end end +function AzeriteEssenceUIMixin:MeetsPowerLevel(level) + return level <= self.powerLevel; +end + function AzeriteEssenceUIMixin:OnEnterPowerLevelBadgeFrame() local itemLocation = C_AzeriteItem.FindActiveAzeriteItem(); if itemLocation then @@ -260,23 +300,21 @@ end function AzeriteEssenceUIMixin:RefreshMilestones() for i, milestoneFrame in ipairs(self.Milestones) do - milestoneFrame:Refresh(); + -- Main slot is always present + if self.shouldPlayReveal and (not milestoneFrame.slot or milestoneFrame.slot ~= Enum.AzeriteEssence.MainSlot) then + milestoneFrame:Hide(); + else + milestoneFrame:Show(); + milestoneFrame:Refresh(); + end end for i, lineContainer in ipairs(self.Lines) do - if lineContainer.toButton.unlocked then - lineContainer:SetState(PowerDependencyLineMixin.LINE_STATE_CONNECTED); - lineContainer:SetAlpha(0.15); + if self.shouldPlayReveal then + lineContainer:Hide(); else - if lineContainer.fromButton.unlocked and lineContainer.toButton.canUnlock then - lineContainer:SetDisconnectedColor(DISCONNECTED_LINE_COLOR); - lineContainer:SetState(PowerDependencyLineMixin.LINE_STATE_DISCONNECTED); - lineContainer:SetAlpha(0.08); - else - lineContainer:SetDisconnectedColor(LOCKED_LINE_COLOR); - lineContainer:SetState(PowerDependencyLineMixin.LINE_STATE_DISCONNECTED); - lineContainer:SetAlpha(0.08); - end + lineContainer:Show(); + lineContainer:Refresh(); end end end @@ -357,6 +395,74 @@ function AzeriteEssenceUIMixin:GetEffectiveEssence(milestoneID) end end +function AzeriteEssenceUIMixin:PlayReveal() + if not self.revealSwirlPool then + self.numRevealsPlaying = 0; + self.revealSwirlPool = CreateFramePool("FRAME", self, "PowerSwirlAnimationTemplate"); + + local previousFrame; + local totalDistance = 0; + for i, milestoneFrame in ipairs(self.Milestones) do + if previousFrame then + local delay = totalDistance * REVEAL_DELAY_SECS_PER_DISTANCE; + local distance = CalculateDistanceBetweenRegions(previousFrame, milestoneFrame); + milestoneFrame:BeginReveal(delay); + self:ApplyRevealSwirl(milestoneFrame, delay); + milestoneFrame.linkLine:BeginReveal(delay, distance); + self.numRevealsPlaying = self.numRevealsPlaying + 1; + totalDistance = totalDistance + distance; + end + previousFrame = milestoneFrame; + end + + PlaySound(SOUNDKIT.UI_82_HEARTOFAZEROTH_NODESREVEAL); + end +end + +function AzeriteEssenceUIMixin:ApplyRevealSwirl(milestoneFrame, delay) + local swirlFrame = self.revealSwirlPool:Acquire(); + swirlFrame:SetAllPoints(milestoneFrame); + swirlFrame:SetFrameLevel(milestoneFrame:GetFrameLevel() + 1); + swirlFrame:SetScale(milestoneFrame.slot and REVEAL_SWIRL_SLOT_SCALE or REVEAL_SWIRL_STAMINA_SCALE); + swirlFrame.timer = C_Timer.NewTimer(delay, + function() + swirlFrame:Show(); + swirlFrame.SelectedAnim:Play(); + end + ); +end + +function AzeriteEssenceUIMixin:OnMilestoneRevealAnimationFinished() + self.numRevealsPlaying = self.numRevealsPlaying - 1; + if self.numRevealsPlaying == 0 then + self.numRevealsPlaying = nil; + self.revealSwirlPool:ReleaseAll(); + self.shouldPlayReveal = false; + self:RefreshMilestones(); + end +end + +function AzeriteEssenceUIMixin:CancelReveal() + for i, milestoneFrame in ipairs(self.Milestones) do + milestoneFrame:CancelReveal(); + end + + for i, lineContainer in ipairs(self.Lines) do + lineContainer:CancelReveal(); + end + + for swirlFrame in self.revealSwirlPool:EnumerateActive() do + if swirlFrame.timer then + swirlFrame.timer:Cancel(); + end + swirlFrame.SelectedAnim:Stop(); + end + self.revealSwirlPool:ReleaseAll(); + + self.numRevealsPlaying = nil; + self.shouldPlayReveal = false; +end + AzeriteEssenceDependencyLineMixin = CreateFromMixins(PowerDependencyLineMixin); function AzeriteEssenceDependencyLineMixin:SetDisconnected() @@ -365,6 +471,37 @@ function AzeriteEssenceDependencyLineMixin:SetDisconnected() PowerDependencyLineMixin.SetDisconnected(self); end +function AzeriteEssenceDependencyLineMixin:Refresh() + if self.toButton.unlocked then + self:SetState(PowerDependencyLineMixin.LINE_STATE_CONNECTED); + self:SetAlpha(0.15); + else + if self.fromButton.unlocked and self.toButton.canUnlock then + self:SetDisconnectedColor(DISCONNECTED_LINE_COLOR); + self:SetState(PowerDependencyLineMixin.LINE_STATE_DISCONNECTED); + self:SetAlpha(0.08); + else + self:SetDisconnectedColor(LOCKED_LINE_COLOR); + self:SetState(PowerDependencyLineMixin.LINE_STATE_DISCONNECTED); + self:SetAlpha(0.08); + end + end +end + +function AzeriteEssenceDependencyLineMixin:BeginReveal(delay, distance) + self:Show(); + self:SetState(PowerDependencyLineMixin.LINE_STATE_CONNECTED); + PowerDependencyLineMixin.BeginReveal(self, delay, distance * REVEAL_LINE_DURATION_SECS_PER_DISTANCE); +end + +function AzeriteEssenceDependencyLineMixin:CancelReveal() + self.RevealAnim:Stop(); +end + +function AzeriteEssenceDependencyLineMixin:OnRevealFinished() + self:Refresh(); +end + AzeriteEssenceListMixin = { }; function AzeriteEssenceListMixin:OnLoad() @@ -393,8 +530,7 @@ end function AzeriteEssenceListMixin:OnEvent(event) if event == "UI_MODEL_SCENE_INFO_UPDATED" then - local forceUpdate = true; - self:SetupModelScene(true); + self.LearnEssenceModelScene.effect = nil; elseif event == "PENDING_AZERITE_ESSENCE_CHANGED" then self:Refresh(); elseif event == "VARIABLES_LOADED" then @@ -412,14 +548,7 @@ function AzeriteEssenceListMixin:SetPendingEssence(essenceID) local essenceInfo = C_AzeriteEssence.GetEssenceInfo(essenceID); if essenceInfo and essenceInfo.unlocked and essenceInfo.valid then C_AzeriteEssence.SetPendingActivationEssence(essenceID); - end -end - -function AzeriteEssenceListMixin:SetupModelScene(forceUpdate) - local scene = self.LearnEssenceModelScene; - if not scene.init or forceUpdate then - scene.init = true; - StaticModelInfo.SetupModelScene(scene, LEARN_MODEL_SCENE_INFO, forceUpdate); + PlaySound(SOUNDKIT.UI_82_HEARTOFAZEROTH_SELECTESSENCE); end end @@ -526,15 +655,35 @@ function AzeriteEssenceListMixin:OnEssenceChanged(essenceID) if self.learnEssenceButton then -- disable the scrollbar ScrollBar_Disable(self.scrollBar); - -- set up scene - local scene = self.LearnEssenceModelScene; - self:SetupModelScene(); - scene:SetPoint("CENTER", self.learnEssenceButton); - scene:Show(); -- play glow self.learnEssenceButton.Glow.Anim:Play(); self.learnEssenceButton.Glow2.Anim:Play(); self.learnEssenceButton.Glow3.Anim:Play(); + -- scene + C_Timer.After(0.769, + function() + local scene = self.LearnEssenceModelScene; + scene:SetPoint("CENTER", self.learnEssenceButton); + if not scene.effect then + local forceUpdate = true; + scene.effect = StaticModelInfo.SetupModelScene(scene, LEARN_MODEL_SCENE_INFO, forceUpdate); + end + if scene.effect then + scene:Show(); + scene.effect:SetAnimation(0, 0, 1, 0); + C_Timer.After(0.769, + function() + scene.effect:SetAnimation(0, 0, 0, 0); + end + ); + C_Timer.After(0.769, + function() + scene.unlockEffect:SetAnimation(0, 0, 0, 0); + end + ); + end + end + ); -- timer so the effect only plays once C_Timer.After(2.969, function() self:CleanUpLearnEssence(); end); end @@ -696,7 +845,7 @@ end function AzeriteMilestoneBaseMixin:OnEvent(event, ...) if event == "UI_MODEL_SCENE_INFO_UPDATED" then - self.unlockEffect = nil; + self.UnlockModelScene.unlockEffect = nil; end end @@ -706,7 +855,7 @@ end function AzeriteMilestoneBaseMixin:OnHide() self:UnregisterEvent("UI_MODEL_SCENE_INFO_UPDATED"); - self.unlockEffect = nil; + self.UnlockModelScene.unlockEffect = nil; end function AzeriteMilestoneBaseMixin:OnMouseUp() @@ -725,21 +874,26 @@ function AzeriteMilestoneBaseMixin:OnLeave() end function AzeriteMilestoneBaseMixin:OnUnlocked() - if not self.unlockEffect then + local scene = self.UnlockModelScene; + if not scene.unlockEffect then local forceUpdate = true; local sceneInfo = self.slot and UNLOCK_SLOT_MODEL_SCENE_INFO or UNLOCK_STAMINA_MODEL_SCENE_INFO; - self.unlockEffect = StaticModelInfo.SetupModelScene(self.UnlockModelScene, sceneInfo, forceUpdate); + scene.unlockEffect = StaticModelInfo.SetupModelScene(scene, sceneInfo, forceUpdate); + scene.secondaryEffect = scene:GetActorByTag("effect2"); + if scene.secondaryEffect then + scene.secondaryEffect:SetModelByFileID(UNLOCK_SECONDARY_EFFECT_ID); + end end - if self.unlockEffect then - self.UnlockModelScene:Show(); - self.unlockEffect:SetAnimation(0, 0, 1, 0); + if scene.unlockEffect then + scene:Show(); + scene.unlockEffect:SetAnimation(0, 0, 1, 0); C_Timer.After(.2, function() - self.unlockEffect:SetAnimation(0, 0, 0, 0); + scene.unlockEffect:SetAnimation(0, 0, 0, 0); C_Timer.After(5, function() - self.UnlockModelScene:Hide(); + scene:Hide(); end ); C_Timer.After(.4, @@ -748,12 +902,69 @@ function AzeriteMilestoneBaseMixin:OnUnlocked() self.SwirlContainer.SelectedAnim:Play(); end ); + if scene.secondaryEffect then + scene.secondaryEffect:SetAnimation(0, 0, 1, 0); + C_Timer.After(0.5, function() scene.secondaryEffect:SetAnimation(0, 0, 0, 0); end); + end end ); if GameTooltip:GetOwner() == self then self:OnEnter(); end end + + if self.slot then + PlaySound(SOUNDKIT.UI_82_HEARTOFAZEROTH_UNLOCKESSENCESLOT); + else + PlaySound(SOUNDKIT.UI_82_HEARTOFAZEROTH_UNLOCKSTAMINANODE); + end +end + +function AzeriteMilestoneBaseMixin:BeginReveal(delay) + self:Show(); + self:Refresh(); + self.RevealAnim.Start:SetEndDelay(delay); + self.RevealAnim:Play(); +end + +function AzeriteMilestoneBaseMixin:CancelReveal(delay) + self.RevealAnim:Stop(); + self:SetAlpha(1); +end + +function AzeriteMilestoneBaseMixin:ShouldShowUnlockState() + if C_AzeriteEssence.IsAtForge() then + return self.canUnlock; + else + return self:GetParent():MeetsPowerLevel(self.requiredLevel) + end +end + +function AzeriteMilestoneBaseMixin:UpdateMilestoneInfo() + local milestoneInfo = C_AzeriteEssence.GetMilestoneInfo(self.milestoneID); + + self.unlocked = milestoneInfo.unlocked; + self.canUnlock = milestoneInfo.canUnlock; + self.requiredLevel = milestoneInfo.requiredLevel; +end + +function AzeriteMilestoneBaseMixin:AddStateToTooltip(requiredLevelString, returnToForgeString) + local wrapText = true; + if C_AzeriteEssence.IsAtForge() then + if self.canUnlock then + GameTooltip_AddColoredLine(GameTooltip, AZERITE_CLICK_TO_SELECT, GREEN_FONT_COLOR, wrapText); + elseif self:GetParent():MeetsPowerLevel(self.requiredLevel) then + GameTooltip_AddColoredLine(GameTooltip, AZERITE_MILESTONE_NO_ACTIVE_LINKS, RED_FONT_COLOR, wrapText); + else + GameTooltip_AddColoredLine(GameTooltip, string.format(requiredLevelString, self.requiredLevel), DISABLED_FONT_COLOR, wrapText); + end + else + if self:ShouldShowUnlockState() then + GameTooltip_AddColoredLine(GameTooltip, returnToForgeString, RED_FONT_COLOR, wrapText); + else + GameTooltip_AddColoredLine(GameTooltip, string.format(requiredLevelString, self.requiredLevel), DISABLED_FONT_COLOR, wrapText); + end + end end AzeriteMilestoneSlotMixin = CreateFromMixins(AzeriteMilestoneBaseMixin); @@ -775,12 +986,9 @@ function AzeriteMilestoneSlotMixin:ShowStateFrame(stateFrame) end function AzeriteMilestoneSlotMixin:Refresh() - local milestoneInfo = C_AzeriteEssence.GetMilestoneInfo(self.milestoneID); + self:UpdateMilestoneInfo(); - self.unlocked = milestoneInfo.unlocked; - self.canUnlock = milestoneInfo.canUnlock; - - if milestoneInfo.unlocked then + if self.unlocked then self:ShowStateFrame(self.UnlockedState); local essenceID = self:GetParent():GetEffectiveEssence(self.milestoneID); local icon; @@ -803,7 +1011,7 @@ function AzeriteMilestoneSlotMixin:Refresh() stateFrame.EmptyGlow.Anim:Play(); end else - if milestoneInfo.canUnlock then + if self:ShouldShowUnlockState() then self:ShowStateFrame(self.AvailableState); if C_AzeriteEssence.IsAtForge() then self.AvailableState.GlowAnim:Stop(); @@ -814,7 +1022,7 @@ function AzeriteMilestoneSlotMixin:Refresh() end else self:ShowStateFrame(self.LockedState); - self.LockedState.UnlockLevelText:SetText(milestoneInfo.requiredLevel); + self.LockedState.UnlockLevelText:SetText(self.requiredLevel); end end end @@ -844,7 +1052,13 @@ function AzeriteMilestoneSlotMixin:OnMouseUp(button) end function AzeriteMilestoneSlotMixin:OnEnter() - GameTooltip:SetOwner(self, "ANCHOR_RIGHT"); + local isMainSlot = self.slot == Enum.AzeriteEssence.MainSlot; + if isMainSlot then + GameTooltip:SetOwner(self, "ANCHOR_RIGHT", -20, 0); + else + GameTooltip:SetOwner(self, "ANCHOR_RIGHT", -10, -5); + end + local essenceID = C_AzeriteEssence.GetMilestoneEssence(self.milestoneID); if essenceID then GameTooltip:SetAzeriteEssenceSlot(self.slot); @@ -858,20 +1072,10 @@ function AzeriteMilestoneSlotMixin:OnEnter() end else local wrapText = true; - local isMainSlot = self.slot == Enum.AzeriteEssence.MainSlot; if not self.unlocked then assert(not isMainSlot); GameTooltip_SetTitle(GameTooltip, AZERITE_ESSENCE_PASSIVE_SLOT); - if self.canUnlock then - if C_AzeriteEssence.IsAtForge() then - GameTooltip_AddColoredLine(GameTooltip, AZERITE_CLICK_TO_SELECT, GREEN_FONT_COLOR, wrapText); - else - GameTooltip_AddColoredLine(GameTooltip, AZERITE_ESSENCE_UNLOCK_SLOT, RED_FONT_COLOR, wrapText); - end - else - local milestoneInfo = C_AzeriteEssence.GetMilestoneInfo(self.milestoneID); - GameTooltip_AddColoredLine(GameTooltip, string.format(AZERITE_ESSENCE_LOCKED_SLOT_LEVEL, milestoneInfo.requiredLevel), DISABLED_FONT_COLOR, wrapText); - end + self:AddStateToTooltip(AZERITE_ESSENCE_LOCKED_SLOT_LEVEL, AZERITE_ESSENCE_UNLOCK_SLOT); else if isMainSlot then GameTooltip_SetTitle(GameTooltip, AZERITE_ESSENCE_EMPTY_MAIN_SLOT); @@ -888,17 +1092,14 @@ end AzeriteMilestoneStaminaMixin = CreateFromMixins(AzeriteMilestoneBaseMixin); function AzeriteMilestoneStaminaMixin:Refresh() - local milestoneInfo = C_AzeriteEssence.GetMilestoneInfo(self.milestoneID); + self:UpdateMilestoneInfo(); - self.unlocked = milestoneInfo.unlocked; - self.canUnlock = milestoneInfo.canUnlock; - - if milestoneInfo.unlocked then + if self.unlocked then self.Icon:SetAtlas("heartofazeroth-node-on"); else self.Icon:SetAtlas("heartofazeroth-node-off"); end - if milestoneInfo.canUnlock then + if not self.unlocked and self:ShouldShowUnlockState() then if C_AzeriteEssence.IsAtForge() then self.GlowAnim:Stop(); self.ForgeGlowAnim:Play(); @@ -925,15 +1126,8 @@ function AzeriteMilestoneStaminaMixin:OnEnter() local wrapText = true; GameTooltip_SetTitle(GameTooltip, spell:GetSpellName()); GameTooltip_AddColoredLine(GameTooltip, spell:GetSpellDescription(), NORMAL_FONT_COLOR, wrapText); - if self.canUnlock then - if C_AzeriteEssence.IsAtForge() then - GameTooltip_AddColoredLine(GameTooltip, AZERITE_CLICK_TO_SELECT, GREEN_FONT_COLOR, wrapText); - else - GameTooltip_AddColoredLine(GameTooltip, AZERITE_ESSENCE_UNLOCK_MILESTONE, RED_FONT_COLOR, wrapText); - end - elseif not self.unlocked then - local milestoneInfo = C_AzeriteEssence.GetMilestoneInfo(self.milestoneID); - GameTooltip_AddColoredLine(GameTooltip, string.format(AZERITE_ESSENCE_LOCKED_MILESTONE_LEVEL, milestoneInfo.requiredLevel), DISABLED_FONT_COLOR, wrapText); + if not self.unlocked then + self:AddStateToTooltip(AZERITE_ESSENCE_LOCKED_MILESTONE_LEVEL, AZERITE_ESSENCE_UNLOCK_MILESTONE); end GameTooltip:Show(); end @@ -960,11 +1154,26 @@ function AzeriteEssenceLearnAnimFrameMixin:PlayAnim() end self.Anim:Stop(); + + local runeIndex = random(1, 15); + local runeAtlas = "heartofazeroth-animation-rune"..runeIndex; + local useAtlasSize = true; + for i, texture in ipairs(self.Textures) do texture:SetAlpha(0); + if texture.isRune then + texture:SetAtlas(runeAtlas, useAtlasSize); + end end + self:Show(); self.Anim:Play(); + + C_Timer.After(LEARN_SHAKE_DELAY, + function() + ShakeFrame(self:GetParent(), LEARN_SHAKE, LEARN_SHAKE_DURATION, LEARN_SHAKE_FREQUENCY); + end + ); end function AzeriteEssenceLearnAnimFrameMixin:StopAnim() diff --git a/Interface/AddOns/Blizzard_AzeriteEssenceUI/Blizzard_AzeriteEssenceUI.xml b/Interface/AddOns/Blizzard_AzeriteEssenceUI/Blizzard_AzeriteEssenceUI.xml index 8d5c197846faaa9aa12d688451597cb34159c26a..1a27fdb3b5119a96880d9251ebb2ccb4e8a41ca1 100644 --- a/Interface/AddOns/Blizzard_AzeriteEssenceUI/Blizzard_AzeriteEssenceUI.xml +++ b/Interface/AddOns/Blizzard_AzeriteEssenceUI/Blizzard_AzeriteEssenceUI.xml @@ -16,6 +16,17 @@ + + + + + + + self:GetParent():GetParent():OnMilestoneRevealAnimationFinished(); + + + + @@ -65,8 +76,8 @@ - - + + @@ -94,12 +105,12 @@ - - + + - - + + @@ -186,8 +197,8 @@ - - + + @@ -200,10 +211,10 @@ - + - + @@ -227,12 +238,12 @@ - - + + - - + + @@ -482,7 +493,7 @@ @@ -571,7 +582,7 @@ - + @@ -623,24 +634,38 @@ + + + - + + + + + + + + - + + + + + @@ -653,6 +678,9 @@ + + + @@ -691,19 +719,29 @@ - + - + - + + + + + + + + + + + @@ -711,7 +749,7 @@ - + @@ -752,13 +790,17 @@ + + + - - - + + + + diff --git a/Interface/AddOns/Blizzard_Communities/ClubFinder.lua b/Interface/AddOns/Blizzard_Communities/ClubFinder.lua index fd8383b3882c460cb9cc97c57e61c9d78f12d3cb..2fc61c1fb9aa48e1f4f9558a57fd820a6a3e9cb7 100644 --- a/Interface/AddOns/Blizzard_Communities/ClubFinder.lua +++ b/Interface/AddOns/Blizzard_Communities/ClubFinder.lua @@ -11,13 +11,17 @@ function ClubsRecruitmentDialogMixin:OnLoad() UIDropDownMenu_Initialize(self.ClubFocusDropdown, ClubFocusClubDropdownInitialize); end +function ClubsRecruitmentDialogMixin:OnShow() + self:GetParent():RegisterDialogShown(self); +end + function ClubsRecruitmentDialogMixin:PostClub() local communityFrame = self:GetParent(); local clubInfo = C_Club.GetClubInfo(communityFrame:GetSelectedClubId()); local specsInList = self.LookingForDropdown:GetSpecsList(); local minItemLevel = self.MinIlvlOnly.EditBox:GetNumber(); - local description = self.RecruitmentMessageFrame.EditBox:GetText():gsub("\n",""); + local description = self.RecruitmentMessageFrame.RecruitmentMessageInput.EditBox:GetText():gsub("\n",""); local minimumLevel = 0; if (self.MaxLevelOnly.Button:GetChecked()) then @@ -34,7 +38,7 @@ end ClubFinderRequestToJoinMixin = {}; function ClubFinderRequestToJoinMixin:ApplyToClub() - local editbox = self.MessageFrame.EditBox; + local editbox = self.MessageFrame.MessageScroll.EditBox; local selectedSpecs = { }; for i, spec in ipairs(self.Specs) do if(spec.CheckBox:GetChecked()) then @@ -43,6 +47,14 @@ function ClubFinderRequestToJoinMixin:ApplyToClub() end C_ClubFinder.RequestMembershipToClub(self.info.clubFinderGUID, editbox:GetText():gsub("\n",""), selectedSpecs); + local requestType; + if (self:GetParent().isGuildType) then + requestType = Enum.ClubFinderRequestType.Guild; + else + requestType = Enum.ClubFinderRequestType.Community; + end + + C_ClubFinder.PlayerRequestPendingClubsList(requestType); self.card.RequestJoin:Hide(); self.card.RequestStatus:SetTextColor(GREEN_FONT_COLOR:GetRGB()); @@ -907,31 +919,26 @@ function ClubFinderCommunitiesCardFrameMixin:OnLoad() self.PendingCardList = { }; self.CardList = { }; self.pendingCardListSize = 0; + self.isPendingListShowing = false; + self.ListScrollFrame.update = function() self:RefreshLayout() end; + + HybridScrollFrame_CreateButtons(self.ListScrollFrame, "ClubFinderCommunitiesCardTemplate", 13, -10, "TOPLEFT", nil, nil, -5); end function ClubFinderCommunitiesCardFrameMixin:BuildCardList() - self.CardList = { }; self.CardList = C_ClubFinder.ReturnMatchingCommunityList(); - - if not self.ListScrollFrame.buttons and self.CardList and #self.CardList > 0 then - HybridScrollFrame_CreateButtons(self.ListScrollFrame, "ClubFinderCommunitiesCardTemplate", 13, -10, "TOPLEFT", nil, nil, -5); - else - self.ListScrollFrame.scrollBar:Hide(); - self:GetParent().InsetFrame.GuildDescription:SetText(CLUB_FINDER_SEARCH_NOTHING_FOUND); - end + self.ListScrollFrame.scrollBar:Hide(); + self:GetParent().InsetFrame.GuildDescription:SetText(CLUB_FINDER_SEARCH_NOTHING_FOUND); end function ClubFinderCommunitiesCardFrameMixin:BuildPendingCardList() - self.PendingCardList = { }; - if not self.ListScrollFrame.buttons then - HybridScrollFrame_CreateButtons(self.ListScrollFrame, "ClubFinderCommunitiesCardTemplate", 13, -10, "TOPLEFT", nil, nil, -5); - end - self.PendingCardList = C_ClubFinder.PlayerReturnPendingCommunitiesList(); self.pendingCardListSize = #self.PendingCardList; + self.ListScrollFrame.scrollBar:Hide(); + self:GetParent().InsetFrame.GuildDescription:SetText(CLUB_FINDER_SEARCH_NOTHING_FOUND); end -function ClubFinderCommunitiesCardFrameMixin:RefreshLayout(shouldShowPendingList) +function ClubFinderCommunitiesCardFrameMixin:RefreshLayout() local playerSpecs = ClubFinderGetPlayerSpecIds(); local showingCards = 0; local numCardsTotal = 0; @@ -940,13 +947,13 @@ function ClubFinderCommunitiesCardFrameMixin:RefreshLayout(shouldShowPendingList local index; if (self.ListScrollFrame.buttons) then - if (shouldShowPendingList) then - numCardsTotal = #self.PendingCardList; + if (self.isPendingListShowing) then + numCardsTotal = self.pendingCardListSize; for i = 1, #self.ListScrollFrame.buttons do index = offset + i; local cardInfo = self.PendingCardList[index]; local currentCard = self.ListScrollFrame.buttons[i]; - if(cardInfo) then + if (cardInfo) then currentCard.playerSpecs = playerSpecs; currentCard.cardInfo = cardInfo; currentCard:UpdateCard(); @@ -979,16 +986,14 @@ function ClubFinderCommunitiesCardFrameMixin:RefreshLayout(shouldShowPendingList if (self:GetParent().InsetFrame.GuildDescription:IsShown()) then self:GetParent().InsetFrame.GuildDescription:Hide(); end - - if (self.ListScrollFrame) then - local totalHeight = numCardsTotal * 88; - HybridScrollFrame_Update(self.ListScrollFrame, totalHeight, self.ListScrollFrame:GetHeight()); - end - self:Show(); else self:GetParent().InsetFrame.GuildDescription:Show(); end + + local displayedHeight = showingCards * 76; + local totalHeight = numCardsTotal * 76; + HybridScrollFrame_Update(self.ListScrollFrame, totalHeight, displayedHeight); end ClubFinderGuildCardsMixin = { }; @@ -1015,6 +1020,7 @@ function ClubFinderGuildCardsMixin:PagePrevious() end function ClubFinderGuildCardsMixin:BuildCardList() + self.CardList = { }; self.CardList = C_ClubFinder.ReturnMatchingGuildList(); self.numPages = 0; @@ -1036,8 +1042,8 @@ function ClubFinderGuildCardsMixin:HideCardList() self.Cards[i]:Hide(); end end - -function ClubFinderGuildCardsMixin:RefreshLayout(cardPage, shouldShowPendingList) + +function ClubFinderGuildCardsMixin:RefreshLayout(cardPage) if(not cardPage) then cardPage = 1; end @@ -1045,9 +1051,9 @@ function ClubFinderGuildCardsMixin:RefreshLayout(cardPage, shouldShowPendingList self:HideCardList(); local playerSpecs = ClubFinderGetPlayerSpecIds(); - local showingCards = false; + local showingCards = false; - if (shouldShowPendingList) then + if (self.isPendingListShowing) then for i = 1, #self.Cards do local pendingCardIndex = (cardPage - 1) * GUILD_CARDS_PER_PAGE + i; local cardInfo = self.PendingCardList[pendingCardIndex]; @@ -1062,21 +1068,20 @@ function ClubFinderGuildCardsMixin:RefreshLayout(cardPage, shouldShowPendingList end end else - for i = 1, #self.Cards do + for i = 1, #self.Cards do local cardIndex = (cardPage - 1) * GUILD_CARDS_PER_PAGE + i; local cardInfo = self.CardList[cardIndex]; - if(cardInfo) then - self.Cards[i].playerSpecs = playerSpecs; - self.Cards[i].cardInfo = cardInfo; - self.Cards[i]:UpdateCard(); - self.Cards[i]:Show(); - showingCards = true; - else - self.Cards[i]:Hide(); - end + if(cardInfo) then + self.Cards[i].playerSpecs = playerSpecs; + self.Cards[i].cardInfo = cardInfo; + self.Cards[i]:UpdateCard(); + self.Cards[i]:Show(); + showingCards = true; + else + self.Cards[i]:Hide(); + end + end end - end - if (showingCards) then if(self.numPages <= 1) then self.PreviousPage:Hide(); @@ -1150,15 +1155,23 @@ function ClubFinderGuildAndCommunityMixin:OnShow() self:RegisterEvent("CLUB_FINDER_RECRUIT_LIST_CHANGED"); self:RegisterEvent("CLUB_FINDER_RECRUITS_UPDATED"); - local GetGuildList = true; C_ClubFinder.PlayerRequestPendingClubsList(Enum.ClubFinderRequestType.All); -- Player's applications to a guild or community - self:UpdateType(self.shouldShowGuildFinderOnly); --Should show communities list first. self.OptionsList:Show(); end +function ClubFinderGuildAndCommunityMixin:ResetToDefaults() + self.GuildCards.CardList = { }; + self.CommunityCards.CardList = { }; + self.GuildCards.PendingCardList = { }; + self.CommunityCards.PendingCardList = { }; + self.OptionsList.SearchBox:SetText(""); + self.isPendingListShowing = true; +end + function ClubFinderGuildAndCommunityMixin:OnHide() CommunitiesFrameInset:Show(); + self:ResetToDefaults(); end function ClubFinderGuildAndCommunityMixin:OnEvent(event, ...) @@ -1169,6 +1182,7 @@ function ClubFinderGuildAndCommunityMixin:OnEvent(event, ...) if (buildGuild) then self.GuildCards:BuildCardList(); if (self.isGuildType) then + self.GuildCards.isPendingListShowing = false; self.GuildCards:RefreshLayout(); self.GuildCards:Show(); end @@ -1176,6 +1190,7 @@ function ClubFinderGuildAndCommunityMixin:OnEvent(event, ...) if (builCommunity) then self.CommunityCards:BuildCardList(); if (not self.isGuildType) then + self.CommunityCards.isPendingListShowing = false; self.CommunityCards:RefreshLayout(); self.CommunityCards:Show(); end @@ -1193,6 +1208,12 @@ function ClubFinderGuildAndCommunityMixin:OnEvent(event, ...) self.GuildCards:RefreshLayout(); end self:UpdateType(self.isGuildType); + + if (self.isGuildType) then + self.PendingClubs:SetText(CLUB_FINDER_PENDING_REQUESTS:format(self.GuildCards.pendingCardListSize)); + else + self.PendingClubs:SetText(CLUB_FINDER_PENDING_REQUESTS:format(self.CommunityCards.pendingCardListSize)); + end end end @@ -1231,13 +1252,16 @@ function ClubFinderGuildAndCommunityMixin:UpdateType(isGuild) end ClubFinderPendingClubsMixin = { }; + function ClubFinderPendingClubsMixin:OnClick() PlaySound(SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON); - + local parentFrame = self:GetParent(); if (self:GetParent().isGuildType) then - self:GetParent().GuildCards:RefreshLayout(1, true); + parentFrame.GuildCards.isPendingListShowing = not parentFrame.GuildCards.isPendingListShowing; + self:GetParent().GuildCards:RefreshLayout(1); else - self:GetParent().CommunityCards:RefreshLayout(true); + parentFrame.CommunityCards.isPendingListShowing = not parentFrame.CommunityCards.isPendingListShowing + self:GetParent().CommunityCards:RefreshLayout(); end end diff --git a/Interface/AddOns/Blizzard_Communities/ClubFinder.xml b/Interface/AddOns/Blizzard_Communities/ClubFinder.xml index b827037395e2d109360dd328a6e0ff2b72255b22..1d06d74ca42cff99f4aa8c2ef65e5e840cc3f41b 100644 --- a/Interface/AddOns/Blizzard_Communities/ClubFinder.xml +++ b/Interface/AddOns/Blizzard_Communities/ClubFinder.xml @@ -2,7 +2,19 @@ ..\..\FrameXML\UI.xsd">