Commit 1c4a49ef authored by TOM_RUS's avatar TOM_RUS
Browse files

WOW-30495patch8.2.0_PTR

parent 467edfb1
......@@ -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",
......
......@@ -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 },
},
},
{
......
......@@ -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",
......
......@@ -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 },
......
......@@ -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);
......
......@@ -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);
......
......@@ -16,6 +16,17 @@
</ModelScene>
<Frame parentKey="SwirlContainer" inherits="PowerSwirlAnimationTemplate"/>
</Frames>
<Animations>
<AnimationGroup parentKey="RevealAnim">
<Alpha parentKey="Start" duration=".001" order="1" fromAlpha="0" toAlpha="0"/>
<Alpha duration="0.75" order="2" fromAlpha="0" toAlpha="1"/>
<Scripts>
<OnFinished>
self:GetParent():GetParent():OnMilestoneRevealAnimationFinished();
</OnFinished>
</Scripts>
</AnimationGroup>
</Animations>
<Scripts>
<OnLoad method="OnLoad"/>
<OnEvent method="OnEvent"/>
......@@ -65,8 +76,8 @@
</Anchors>
<Animations>
<AnimationGroup parentKey="Anim" looping="REPEAT">
<Alpha fromAlpha="0" toAlpha="0.4" duration="0.8" smoothing="IN_OUT" order="1"/>
<Alpha fromAlpha="0.4" toAlpha="0" duration="0.8" smoothing="IN_OUT" order="2"/>
<Alpha fromAlpha="0" toAlpha="0.8" duration="0.8" smoothing="IN_OUT" order="1"/>
<Alpha fromAlpha="0.8" toAlpha="0" duration="0.8" smoothing="IN_OUT" order="2"/>
</AnimationGroup>
</Animations>
</Texture>
......@@ -94,12 +105,12 @@
</Layers>
<Animations>
<AnimationGroup parentKey="GlowAnim" setToFinalAlpha="true" looping="REPEAT">
<Alpha childKey="Rune" smoothing="IN_OUT" duration="1.2" order="1" fromAlpha="0.6" toAlpha="1"/>
<Alpha childKey="Rune" smoothing="IN_OUT" duration="1.2" order="2" fromAlpha="1" toAlpha="0.6"/>
<Alpha childKey="Rune" smoothing="IN_OUT" duration="0.8" order="1" fromAlpha="0.2" toAlpha="1"/>
<Alpha childKey="Rune" smoothing="IN_OUT" duration="0.8" order="2" fromAlpha="1" toAlpha="0.2"/>
</AnimationGroup>
<AnimationGroup parentKey="ForgeGlowAnim" setToFinalAlpha="true" looping="REPEAT">
<Alpha childKey="Rune" smoothing="IN_OUT" duration="0.8" order="1" fromAlpha="0.4" toAlpha="1"/>
<Alpha childKey="Rune" smoothing="IN_OUT" duration="0.8" order="2" fromAlpha="1" toAlpha="0.4"/>
<Alpha childKey="Rune" smoothing="IN_OUT" duration="0.6" order="1" fromAlpha="0.2" toAlpha="1"/>
<Alpha childKey="Rune" smoothing="IN_OUT" duration="0.6" order="2" fromAlpha="1" toAlpha="0.2"/>
</AnimationGroup>
</Animations>
</Frame>
......@@ -186,8 +197,8 @@
</Anchors>
<Animations>
<AnimationGroup parentKey="Anim" looping="REPEAT">
<Alpha fromAlpha="0" toAlpha="0.5" duration="0.8" smoothing="IN_OUT" order="1"/>
<Alpha fromAlpha="0.5" toAlpha="0" duration="0.8" smoothing="IN_OUT" order="2"/>
<Alpha fromAlpha="0" toAlpha="0.8" duration="0.8" smoothing="IN_OUT" order="1"/>
<Alpha fromAlpha="0.8" toAlpha="0" duration="0.8" smoothing="IN_OUT" order="2"/>
</AnimationGroup>
</Animations>
</Texture>
......@@ -200,10 +211,10 @@
</Scripts>
</Frame>
<Frame name="AzeriteMilestoneStaminaTemplate" parentArray="Milestones" inherits="AzeriteMilestoneBaseTemplate" mixin="AzeriteMilestoneStaminaMixin" virtual="true">
<Frame name="AzeriteMilestoneStaminaTemplate" inherits="AzeriteMilestoneBaseTemplate" mixin="AzeriteMilestoneStaminaMixin" virtual="true">
<Size x="19" y="24"/>
<KeyValues>
<KeyValue key="swirlScale" type="number" value="0.3"/>
<KeyValue key="swirlScale" type="number" value="0.5"/>
</KeyValues>
<Layers>
<Layer level="BACKGROUND">
......@@ -227,12 +238,12 @@
</Layers>
<Animations>
<AnimationGroup parentKey="GlowAnim" setToFinalAlpha="true" looping="REPEAT">
<Alpha childKey="Glow" smoothing="IN_OUT" duration="1.2" order="1" fromAlpha="0.3" toAlpha="0.7"/>
<Alpha childKey="Glow" smoothing="IN_OUT" duration="1.2" order="2" fromAlpha="0.7" toAlpha="0.3"/>
<Alpha childKey="Glow" smoothing="IN_OUT" duration="0.8" order="1" fromAlpha="0.2" toAlpha="1"/>
<Alpha childKey="Glow" smoothing="IN_OUT" duration="0.8" order="2" fromAlpha="1" toAlpha="0.2"/>
</AnimationGroup>
<AnimationGroup parentKey="ForgeGlowAnim" setToFinalAlpha="true" looping="REPEAT">
<Alpha childKey="Glow" smoothing="IN_OUT" duration="0.8" order="1" fromAlpha="0.3" toAlpha="1"/>
<Alpha childKey="Glow" smoothing="IN_OUT" duration="0.8" order="2" fromAlpha="1" toAlpha="0.3"/>
<Alpha childKey="Glow" smoothing="IN_OUT" duration="0.6" order="1" fromAlpha="0.2" toAlpha="1"/>
<Alpha childKey="Glow" smoothing="IN_OUT" duration="0.6" order="2" fromAlpha="1" toAlpha="0.2"/>
</AnimationGroup>
</Animations>
</Frame>
......@@ -482,7 +493,7 @@
</Anchors>
<Frames>
<ModelScene parentKey="LearnEssenceModelScene" inherits="NonInteractableModelSceneMixinTemplate" frameStrata="HIGH" hidden="true">
<Size x="350" y="350"/>
<Size x="650" y="650"/>
</ModelScene>
<Slider parentKey="ScrollBar" inherits="HybridScrollBarTemplate">
<Anchors>
......@@ -571,7 +582,7 @@
</Texture>
</Layer>
<Layer level="ARTWORK" textureSubLevel="1">
<Texture parentKey="OrbGlass" atlas="heartofazeroth-orb-glass" alphaMode="ADD" alpha="0.3">
<Texture parentKey="OrbGlass" atlas="heartofazeroth-orb-glass" alphaMode="ADD" alpha="0.35">
<Size x="438" y="438"/>
<Anchors>
<Anchor point="CENTER" relativeKey="$parent.OrbBackground"/>
......@@ -623,24 +634,38 @@
<Layers>
<Layer level="ARTWORK">
<Texture parentKey="Rune" parentArray="Textures" alpha="0" alphaMode="ADD" atlas="heartofazeroth-animation-rune4" useAtlasSize="true">
<KeyValues>
<KeyValue key="isRune" type="boolean" value="true"/>
</KeyValues>
<Anchors>
<Anchor point="CENTER"/>
</Anchors>
</Texture>
<Texture parentKey="RuneFlipped" parentArray="Textures" alpha="0" alphaMode="ADD" atlas="heartofazeroth-animation-rune4-flipped" useAtlasSize="true">
<Texture parentKey="RuneFlipped" parentArray="Textures" alpha="0" alphaMode="ADD" atlas="heartofazeroth-animation-rune4" useAtlasSize="true">
<KeyValues>
<KeyValue key="isRune" type="boolean" value="true"/>
</KeyValues>
<Anchors>
<Anchor point="CENTER" relativeKey="$parent.Rune"/>
</Anchors>
<TexCoords left="1" right="0" top="0" bottom="1"/>
</Texture>
<Texture parentKey="Rune2" parentArray="Textures" alpha="0" alphaMode="ADD" atlas="heartofazeroth-animation-rune4" useAtlasSize="true">
<KeyValues>
<KeyValue key="isRune" type="boolean" value="true"/>
</KeyValues>
<Anchors>
<Anchor point="CENTER" relativeKey="$parent.Rune"/>
</Anchors>
</Texture>
<Texture parentKey="RuneFlipped2" parentArray="Textures" alpha="0" alphaMode="ADD" atlas="heartofazeroth-animation-rune4-flipped" useAtlasSize="true">
<Texture parentKey="RuneFlipped2" parentArray="Textures" alpha="0" alphaMode="ADD" atlas="heartofazeroth-animation-rune4" useAtlasSize="true">
<KeyValues>
<KeyValue key="isRune" type="boolean" value="true"/>
</KeyValues>
<Anchors>
<Anchor point="CENTER" relativeKey="$parent.Rune"/>
</Anchors>
<TexCoords left="1" right="0" top="0" bottom="1"/>
</Texture>
<Texture parentKey="RingLargeFlip" parentArray="Textures" alpha="0" alphaMode="ADD" atlas="heartofazeroth-animation-ring" useAtlasSize="true">
<Anchors>
......@@ -653,6 +678,9 @@
</Anchors>
</Texture>
<Texture parentKey="RuneStatic" parentArray="Textures" alpha="0" alphaMode="ADD" atlas="heartofazeroth-animation-rune4" useAtlasSize="true">
<KeyValues>
<KeyValue key="isRune" type="boolean" value="true"/>
</KeyValues>
<Anchors>
<Anchor point="CENTER" relativeKey="$parent.Rune"/>
</Anchors>
......@@ -691,19 +719,29 @@
</Texture>
<Texture parentKey="Starfield" parentArray="Textures" alpha="0" alphaMode="ADD" atlas="heartofazeroth-animation-stars" useAtlasSize="true">
<Anchors>
<Anchor point="CENTER" relativeKey="$parent.RingLarge"/>
<Anchor point="CENTER" relativeKey="$parent.OrbActivated"/>
</Anchors>
</Texture>
</Layer>
<Layer level="ARTWORK" textureSubLevel="2">
<Texture parentKey="Glowies" parentArray="Textures" alpha="0" alphaMode="ADD" atlas="heartofazeroth-animation-Glowies" useAtlasSize="true">
<Anchors>
<Anchor point="CENTER" relativeKey="$parent.RingLarge"/>
<Anchor point="CENTER" relativeKey="$parent.OrbActivated"/>
</Anchors>
</Texture>
<Texture parentKey="Glowies2" parentArray="Textures" alpha="0" alphaMode="ADD" atlas="heartofazeroth-animation-Glowies" useAtlasSize="true">
<Anchors>
<Anchor point="CENTER" relativeKey="$parent.RingLarge"/>
<Anchor point="CENTER" relativeKey="$parent.OrbActivated"/>
</Anchors>
</Texture>
<Texture parentKey="GlassShards" parentArray="Textures" alpha="0" alphaMode="ADD" atlas="heartofazeroth-animation-glassshards" useAtlasSize="true">
<Anchors>
<Anchor point="CENTER" relativeKey="$parent.OrbActivated"/>
</Anchors>
</Texture>
<Texture parentKey="GlassShards2" parentArray="Textures" alpha="0" alphaMode="ADD" atlas="heartofazeroth-animation-glassshards" useAtlasSize="true">
<Anchors>
<Anchor point="CENTER" relativeKey="$parent.OrbActivated"/>
</Anchors>
</Texture>
</Layer>
......@@ -711,7 +749,7 @@
<Texture parentKey="LensflareLine" parentArray="Textures" alpha="0" alphaMode="ADD" atlas="heartofazeroth-animation-LensflareLine">
<Size x="5000" y="387"/>
<Anchors>
<Anchor point="CENTER" relativeKey="$parent.RingLarge"/>
<Anchor point="CENTER" relativeKey="$parent.OrbActivated"/>
</Anchors>
</Texture>
</Layer>
......@@ -752,13 +790,17 @@
<Alpha childKey="Rune2" startDelay="0.802" duration="0" order="1" fromAlpha="0" toAlpha="0.5"/>
<Scale childKey="RingLargeFlip" startDelay="0.802" duration="0.067" order="1" fromScaleX="1" fromScaleY="1" toScaleX="10" toScaleY="0.926"/>
<Scale childKey="RingLargeFlip2" startDelay="0.802" duration="0.067" order="1" fromScaleX="1" fromScaleY="1" toScaleX="10" toScaleY="0.926"/>
<Alpha childKey="Glowies" startDelay="0.802" duration="1.3" order="1" fromAlpha="1" toAlpha="0"/>
<Alpha childKey="Glowies2" startDelay="0.802" duration="1.3" order="1" fromAlpha="1" toAlpha="0"/>
<Alpha childKey="GlassShards" startDelay="0.802" duration="1.3" order="1" fromAlpha="1" toAlpha="0"/>
<Alpha childKey="GlassShards2" startDelay="0.802" duration="1.3" order="1" fromAlpha="1" toAlpha="0"/>
<Scale childKey="Rune" startDelay="0.802" duration="0.067" order="1" fromScaleX="0.01" fromScaleY="1.64" toScaleX="1.25" toScaleY="1.25"/>
<Scale childKey="Rune2" startDelay="0.802" duration="0.067" order="1" fromScaleX="0.01" fromScaleY="1.64" toScaleX="1.25" toScaleY="1.25"/>
<Alpha childKey="Glowies" startDelay="0.802" duration="1.3" order="1" fromAlpha="1" toAlpha="0"/>
<Scale childKey="RuneStatic" startDelay="0.802" duration="1.772" order="1" fromScaleX="1" fromScaleY="1" toScaleX="0.8" toScaleY="0.8"/>
<Scale childKey="Glowies" startDelay="0.802" duration="2" order="1" fromScaleX="0.45" fromScaleY="0.45" toScaleX="0.65" toScaleY="0.65"/>
<Scale childKey="Glowies2" startDelay="0.802" duration="2" order="1" fromScaleX="0.45" fromScaleY="0.45" toScaleX="0.65" toScaleY="0.65"/>
<Scale childKey="Glowies" startDelay="0.802" duration="2" order="1" fromScaleX="0.3" fromScaleY="0.3" toScaleX="0.5" toScaleY="0.5"/>
<Scale childKey="Glowies2" startDelay="0.802" duration="2" order="1" fromScaleX="0.3" fromScaleY="0.3" toScaleX="0.5" toScaleY="0.5"/>
<Scale childKey="GlassShards" startDelay="0.802" duration="2" order="1" fromScaleX="0.45" fromScaleY="0.45" toScaleX="0.6" toScaleY="0.6"/>
<Scale childKey="GlassShards2" startDelay="0.802" duration="2" order="1" fromScaleX="0.45" fromScaleY="0.45" toScaleX="0.6" toScaleY="0.6"/>
<Scale childKey="RingSmall" startDelay="0.869" duration="0.505" order="1" fromScaleX="1" fromScaleY="1" toScaleX="0.94" toScaleY="0.94"/>
<Scale childKey="RingLarge" startDelay="0.869" duration="0.505" order="1" fromScaleX="1" fromScaleY="1" toScaleX="0.926" toScaleY="0.926"/>
<Alpha childKey="Sunburst" startDelay="0.869" duration="0.505" order="1" fromAlpha="1" toAlpha="0.6"/>
......
......@@ -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;