Commit 727a78bf authored by TOM_RUS's avatar TOM_RUS

WOW-32593patch8.3.0_PTR

parent 30ace150
......@@ -52,6 +52,15 @@ local AuctionHouse =
{ Name = "canCancelAuction", Type = "bool", Nilable = false },
},
},
{
Name = "CanSetFavorite",
Type = "Function",
Returns =
{
{ Name = "canSetFavorite", Type = "bool", Nilable = false },
},
},
{
Name = "CancelAuction",
Type = "Function",
......
......@@ -145,6 +145,7 @@ local CommentatorFrame =
{ Name = "zPos", Type = "number", Nilable = false },
{ Name = "yaw", Type = "number", Nilable = false },
{ Name = "pitch", Type = "number", Nilable = false },
{ Name = "roll", Type = "number", Nilable = false },
{ Name = "fov", Type = "number", Nilable = false },
},
},
......@@ -829,6 +830,7 @@ local CommentatorFrame =
{ Name = "zPos", Type = "number", Nilable = false },
{ Name = "yaw", Type = "number", Nilable = false },
{ Name = "pitch", Type = "number", Nilable = false },
{ Name = "roll", Type = "number", Nilable = false },
{ Name = "fov", Type = "number", Nilable = false },
},
},
......
......@@ -67,7 +67,7 @@ local GuildInfo =
Arguments =
{
{ Name = "unit", Type = "string", Nilable = false },
{ Name = "unit", Type = "string", Nilable = true },
},
Returns =
......
......@@ -6,6 +6,10 @@ local Map =
Functions =
{
{
Name = "CloseWorldMapInteraction",
Type = "Function",
},
{
Name = "GetAreaInfo",
Type = "Function",
......
......@@ -48,6 +48,7 @@ local QuestTaskInfo =
{ Name = "questTitle", Type = "string", Nilable = false },
{ Name = "factionID", Type = "number", Nilable = true },
{ Name = "capped", Type = "bool", Nilable = true },
{ Name = "displayAsObjective", Type = "bool", Nilable = true },
},
},
{
......
local REMAINING_QUOTE_DURATION_THRESHOLD = 10; -- seconds
local MAXIMUM_PREVIEW_PRICE_DIFFERENTIAL = 1.05;
AuctionHouseBuyDialogNotificationFrameMixin = {};
......@@ -81,7 +82,7 @@ function AuctionHouseBuyDialogOkayButtonMixin:OnClick()
end
AuctionHouseBuyDialogMixin = {};
AuctionHouseBuyDialogMixin = CreateFromMixins(AuctionHouseSystemMixin);
local AUCTION_HOUSE_BUY_DIALOG_EVENTS = {
"COMMODITY_PRICE_UPDATED",
......@@ -107,7 +108,7 @@ function AuctionHouseBuyDialogMixin:OnHide()
C_AuctionHouse.CancelCommoditiesPurchase();
self:GetParent():GetAuctionHouseFrame():RefreshSearchResults(AuctionHouseSearchContext.BuyCommodities, AuctionHouseUtil.GetCommoditiesItemKey(self.itemID));
self:GetAuctionHouseFrame():RefreshSearchResults(AuctionHouseSearchContext.BuyCommodities, C_AuctionHouse.MakeItemKey(self.itemID));
end
function AuctionHouseBuyDialogMixin:OnUpdate()
......@@ -131,11 +132,16 @@ end
function AuctionHouseBuyDialogMixin:OnEvent(event, ...)
if event == "COMMODITY_PRICE_UPDATED" then
local updatedUnitPrice, updatedTotalPrice = ...;
local currentUnitPrice = self.unitPricePreview;
if updatedUnitPrice > currentUnitPrice then
local currentTotalPrice = self.unitPricePreview * self.quantity;
self.Notification:SetPriceIncreases(updatedUnitPrice - currentUnitPrice, updatedTotalPrice - currentTotalPrice);
local currentTotalPrice = self.PriceFrame:GetAmount();
local currentUnitPrice = currentTotalPrice / self.quantity;
if updatedUnitPrice > (currentUnitPrice * MAXIMUM_PREVIEW_PRICE_DIFFERENTIAL) then
self:SetState(BuyState.PriceUnavailable);
elseif updatedUnitPrice > currentUnitPrice then
local totalPriceIncrease = updatedTotalPrice - currentTotalPrice;
local unitPriceIncrease = math.ceil(totalPriceIncrease / self.quantity); -- Using math.ceil directly because we want to show copper.
self.Notification:SetPriceIncreases(unitPriceIncrease, totalPriceIncrease);
self.PriceFrame:SetAmount(updatedTotalPrice);
self:SetState(BuyState.PriceUpdated);
else
self:SetState(BuyState.PriceConfirmed);
......@@ -216,10 +222,10 @@ function AuctionHouseBuyDialogMixin:SetState(buyState)
self:SetScript("OnUpdate", quoteTimeoutActive and AuctionHouseBuyDialogMixin.OnUpdate or nil);
end
function AuctionHouseBuyDialogMixin:SetItemID(itemID, quantity, unitPricePreview)
function AuctionHouseBuyDialogMixin:SetItemID(itemID, quantity, unitPricePreview, totalPricePreview)
self.itemID = itemID;
self.quantity = quantity;
self.unitPricePreview = unitPricePreview;
self.unitPricePreview = AuctionHouseUtil.SanitizeAuctionHousePrice(unitPricePreview);
local itemName = C_Item.GetItemNameByID(itemID);
local itemQuality = C_Item.GetItemQualityByID(itemID);
......@@ -229,7 +235,7 @@ function AuctionHouseBuyDialogMixin:SetItemID(itemID, quantity, unitPricePreview
self.ItemDisplay.ItemText:SetText(AUCTION_HOUSE_DIALOG_ITEM_FORMAT:format(itemDisplayText, quantity));
end
self.PriceFrame:SetAmount(quantity * unitPricePreview);
self.PriceFrame:SetAmount(totalPricePreview);
self:SetState(BuyState.WaitingForQuote);
end
......
......@@ -106,7 +106,7 @@ function AuctionHouseCommoditiesBuyDisplayMixin:SetQuantitySelected(quantity)
self.QuantityInput:SetQuantity(totalQuantity);
local unitPrice = math.ceil(totalPrice / totalQuantity);
local unitPrice = AuctionHouseUtil.SanitizeAuctionHousePrice(totalPrice / totalQuantity);
self:SetPrice(unitPrice, totalPrice);
end
......@@ -122,7 +122,8 @@ function AuctionHouseCommoditiesBuyDisplayMixin:StartCommoditiesPurchase()
local quantity = self:GetQuantitySelected();
local unitPrice = self.UnitPrice:GetAmount();
self:GetAuctionHouseFrame():StartCommoditiesPurchase(itemID, quantity, unitPrice);
local totalPrice = self.TotalPrice:GetAmount();
self:GetAuctionHouseFrame():StartCommoditiesPurchase(itemID, quantity, unitPrice, totalPrice);
end
function AuctionHouseCommoditiesBuyDisplayMixin:GetAuctionHouseFrame()
......
......@@ -19,7 +19,7 @@ function AuctionHouseCommoditiesListMixin:OnLoad()
local function CommoditiesListRefreshResults()
if self.itemID then
self:GetAuctionHouseFrame():RefreshSearchResults(self.searchContext, AuctionHouseUtil.GetCommoditiesItemKey(self.itemID));
self:GetAuctionHouseFrame():RefreshSearchResults(self.searchContext, C_AuctionHouse.MakeItemKey(self.itemID));
end
end
......@@ -77,11 +77,13 @@ end
function AuctionHouseCommoditiesListMixin:RefreshScrollFrame()
AuctionHouseItemListMixin.RefreshScrollFrame(self);
if not self.isInitialized then
if not self.isInitialized or not self.itemID then
return;
end
if not self.itemID or C_AuctionHouse.HasFullCommoditySearchResults(self.itemID) then
self:GetAuctionHouseFrame():TriggerEvent(AuctionHouseFrameMixin.Event.CommoditiesQuantitySelectionChanged, self.quantitySelected);
if C_AuctionHouse.HasFullCommoditySearchResults(self.itemID) then
return;
end
......@@ -178,6 +180,10 @@ function AuctionHouseCommoditiesBuyListMixin:UpdateGetEntryInfoCallback()
end
function AuctionHouseCommoditiesBuyListMixin:SetQuantitySelected(quantity)
if quantity == self.quantitySelected then
return;
end
self.quantitySelected = quantity;
local _, _, searchResultIndex = AuctionHouseUtil.AggregateSearchResultsByQuantity(self.itemID, quantity);
......
......@@ -684,10 +684,10 @@ function AuctionHouseFrameMixin:RefreshSearchResults(searchContext, itemKey)
end
end
function AuctionHouseFrameMixin:StartCommoditiesPurchase(itemID, quantity, unitPrice)
self.BuyDialog:SetItemID(itemID, quantity, unitPrice);
function AuctionHouseFrameMixin:StartCommoditiesPurchase(itemID, quantity, unitPrice, totalPrice)
self.BuyDialog:SetItemID(itemID, quantity, unitPrice, totalPrice);
self.BuyDialog:Show();
C_AuctionHouse.StartCommoditiesPurchase(itemID, quantity, unitPrice)
C_AuctionHouse.StartCommoditiesPurchase(itemID, quantity, unitPrice);
end
function AuctionHouseFrameMixin:StartItemBid(auctionID, bid)
......
......@@ -570,7 +570,12 @@ local function AuctionHouseFavoriteDropDown_Initialize(self)
local info = UIDropDownMenu_CreateInfo();
info.notCheckable = 1;
info.text = isFavorite and AUCTION_HOUSE_DROPDOWN_REMOVE_FAVORITE or AUCTION_HOUSE_DROPDOWN_SET_FAVORITE;
info.func = function() C_AuctionHouse.SetFavoriteItem(itemKey, not isFavorite); end;
info.disabled = not C_AuctionHouse.CanSetFavorite();
info.func = function()
if C_AuctionHouse.CanSetFavorite() then
C_AuctionHouse.SetFavoriteItem(itemKey, not isFavorite);
end
end;
UIDropDownMenu_AddButton(info);
end
......
......@@ -189,7 +189,9 @@ function AuctionHouseTableCellFavoriteMixin:OnEvent()
end
function AuctionHouseTableCellFavoriteMixin:OnLineEnter()
self.FavoriteButton:LockTexture();
if C_AuctionHouse.CanSetFavorite() then
self.FavoriteButton:LockTexture();
end
end
function AuctionHouseTableCellFavoriteMixin:OnLineLeave()
......@@ -200,6 +202,10 @@ end
AuctionHouseTableCellFavoriteButtonMixin = CreateFromMixins(AuctionHouseTableCellMixin);
function AuctionHouseTableCellFavoriteButtonMixin:OnClick()
if not C_AuctionHouse.CanSetFavorite() then
return;
end
local setToFavorite = not C_AuctionHouse.IsFavoriteItem(self.itemKey);
C_AuctionHouse.SetFavoriteItem(self.itemKey, setToFavorite);
......@@ -208,6 +214,8 @@ function AuctionHouseTableCellFavoriteButtonMixin:OnClick()
end
function AuctionHouseTableCellFavoriteButtonMixin:OnEnter()
self.HighlightTexture:SetAlpha(C_AuctionHouse.CanSetFavorite() and 1.0 or 0);
local row = self:GetParent():GetParent();
ExecuteFrameScript(row, "OnEnter");
end
......
......@@ -433,18 +433,37 @@ function AuctionHouseUtil.ConvertItemSellItemKey(itemKey)
end
function AuctionHouseUtil.SetAuctionHouseTooltip(owner, rowData)
GameTooltip:SetOwner(owner, "ANCHOR_RIGHT");
if rowData.itemLink then
local hideVendorPrice = true;
GameTooltip:SetHyperlink(rowData.itemLink, nil, nil, nil, hideVendorPrice);
else
GameTooltip:SetItemKey(rowData.itemKey.itemID, rowData.itemKey.itemLevel, rowData.itemKey.itemSuffix);
if not BattlePetToolTip_ShowLink(rowData.itemLink) then
GameTooltip:SetOwner(owner, "ANCHOR_RIGHT");
GameTooltip:SetHyperlink(rowData.itemLink);
GameTooltip:Show();
else
GameTooltip:SetOwner(owner, "ANCHOR_RIGHT");
local hideVendorPrice = true;
GameTooltip:SetHyperlink(rowData.itemLink, nil, nil, nil, hideVendorPrice);
GameTooltip:Show();
end
GameTooltip:Show();
elseif rowData.itemKey then
local restrictQualityToFilter = true;
local itemKeyInfo = C_AuctionHouse.GetItemKeyInfo(rowData.itemKey, restrictQualityToFilter);
if itemKeyInfo and itemKeyInfo.battlePetLink then
BattlePetToolTip_ShowLink(itemKeyInfo.battlePetLink);
else
GameTooltip:SetOwner(owner, "ANCHOR_RIGHT");
GameTooltip:SetItemKey(rowData.itemKey.itemID, rowData.itemKey.itemLevel, rowData.itemKey.itemSuffix);
GameTooltip:Show();
end
end
local methodFound, auctionHouseFrame = CallMethodOnNearestAncestor(owner, "GetAuctionHouseFrame");
local bidStatus = auctionHouseFrame and auctionHouseFrame:GetBidStatus(rowData) or nil;
AuctionHouseUtil.AddAuctionHouseTooltipInfo(GameTooltip, rowData.owners, rowData.timeLeft, bidStatus);
if rowData.owners then
local methodFound, auctionHouseFrame = CallMethodOnNearestAncestor(owner, "GetAuctionHouseFrame");
local bidStatus = auctionHouseFrame and auctionHouseFrame:GetBidStatus(rowData) or nil;
AuctionHouseUtil.AddAuctionHouseTooltipInfo(GameTooltip, rowData.owners, rowData.timeLeft, bidStatus);
end
GameTooltip:Show();
end
......@@ -460,29 +479,10 @@ end
function AuctionHouseUtil.LineOnEnterCallback(line, rowData)
line:SetScript("OnUpdate", AuctionHouseUtil.LineOnUpdate);
if rowData.itemLink then
GameTooltip:SetOwner(line, "ANCHOR_RIGHT");
if not BattlePetToolTip_ShowLink(rowData.itemLink) then
GameTooltip:SetHyperlink(rowData.itemLink);
end
GameTooltip:Show();
elseif rowData.itemKey then
local restrictQualityToFilter = true;
local itemKeyInfo = C_AuctionHouse.GetItemKeyInfo(rowData.itemKey, restrictQualityToFilter);
if itemKeyInfo and itemKeyInfo.battlePetLink then
GameTooltip:SetOwner(line, "ANCHOR_RIGHT");
BattlePetToolTip_ShowLink(itemKeyInfo.battlePetLink);
else
GameTooltip:SetOwner(line, "ANCHOR_RIGHT");
GameTooltip:SetItemKey(rowData.itemKey.itemID, rowData.itemKey.itemLevel, rowData.itemKey.itemSuffix);
GameTooltip:Show();
end
AuctionHouseUtil.SetAuctionHouseTooltip(line, rowData);
if IsModifiedClick("DRESSUP") then
ShowInspectCursor();
end
if IsModifiedClick("DRESSUP") then
ShowInspectCursor();
end
line.UpdateTooltip = function(self)
......@@ -538,6 +538,6 @@ function AuctionHouseUtil.IsOwnedAuction(rowData)
(#rowData.owners == 2 and (rowData.containsOwnerItem and rowData.containsAccountItem));
end
function AuctionHouseUtil.GetCommoditiesItemKey(commoditiesID)
return { itemID = commoditiesID };
function AuctionHouseUtil.SanitizeAuctionHousePrice(rawPrice)
return math.ceil(rawPrice / COPPER_PER_SILVER) * COPPER_PER_SILVER;
end
......@@ -576,6 +576,7 @@ do
end
local CALENDAR_FILTER_CVARS = {
{text = CALENDAR_FILTER_HOLIDAYS, cvar = "calendarShowHolidays" },
{text = CALENDAR_FILTER_DARKMOON, cvar = "calendarShowDarkmoon" },
{text = CALENDAR_FILTER_RAID_LOCKOUTS, cvar = "calendarShowLockouts" },
{text = CALENDAR_FILTER_WEEKLY_HOLIDAYS, cvar = "calendarShowWeeklyHolidays" },
......
......@@ -144,10 +144,27 @@ function WardrobeTransmogFrame_EvaluateModel(forceResetModel, resetSettings)
end
if forceResetModel or WardrobeTransmogFrame.ModelScene.creatureDisplayID ~= creatureDisplayID then
if WardrobeTransmogFrame.ModelScene.previousActor then
WardrobeTransmogFrame.ModelScene.previousActor:ClearModel();
WardrobeTransmogFrame.ModelScene.previousActor = nil;
end
if creatureDisplayID then
local actor = WardrobeTransmogFrame.ModelScene:GetPlayerActor();
local _, class = UnitClass("player");
local overrideActorTag;
if class == "DRUID" then
local form = GetShapeshiftFormID();
if form == BEAR_FORM then
overrideActorTag = "druid-bear-form";
elseif form == CAT_FORM then
overrideActorTag = "druid-cat-form";
end
end
-- nil is a valid argument to this function
local actor = WardrobeTransmogFrame.ModelScene:GetPlayerActor(overrideActorTag);
if actor then
actor:SetModelByCreatureDisplayID(creatureDisplayID);
WardrobeTransmogFrame.ModelScene.previousActor = actor;
end
else
local actor = WardrobeTransmogFrame.ModelScene:GetPlayerActor();
......@@ -155,6 +172,7 @@ function WardrobeTransmogFrame_EvaluateModel(forceResetModel, resetSettings)
local sheatheWeapons = false;
local autoDress = true;
actor:SetModelByUnit("player", sheatheWeapons, autoDress);
WardrobeTransmogFrame.ModelScene.previousActor = actor;
end
end
WardrobeTransmogFrame.ModelScene.creatureDisplayID = creatureDisplayID;
......@@ -198,7 +216,7 @@ function WardrobeTransmogFrame_UpdateSlotButton(slotButton)
slotButton.NoItemTexture:Hide();
else
local tag = TRANSMOG_INVALID_CODES[cannotTransmogrifyReason];
if ( tag == "NO_ITEM" ) then
if ( tag == "NO_ITEM" or tag == "INVALID_SLOT_FOR_RACE") then
slotButton.Icon:SetTexture(defaultTexture);
else
slotButton.Icon:SetTexture(texture);
......@@ -214,6 +232,7 @@ function WardrobeTransmogFrame_UpdateSlotButton(slotButton)
-- clear anything in the enchant slot, otherwise cost and Apply button state will still reflect anything pending
C_Transmog.ClearPending(slotButton.slotID, slotButton.transmogType);
end
C_Transmog.SetPending(slotButton.slotID, slotButton.transmogType, 0);
isTransmogrified = false; -- handle legacy, this weapon could have had an illusion applied previously
canTransmogrify = false;
slotButton.invalidWeapon = true;
......
local GUILD_CARDS_PER_PAGE = 3;
local LOAD_PAGES_IN_ADVANCE = 1;
local REQUEST_GUILD_CARDS_NUM = 21;
local REQUEST_TO_JOIN_HEIGHT = 420;
local REQUEST_TO_JOIN_TEXT_HEIGHT = 14;
local MAX_DESCRIPTION_HEIGHT = 150;
......@@ -1657,7 +1658,19 @@ function ClubFinderGuildCardsBaseMixin:OnMouseWheel(delta)
end
end
function ClubFinderGuildCardsBaseMixin:SetSearchingState()
self.SearchingSpinner:Show();
self:GetParent().InsetFrame.GuildDescription:Hide();
self.NextPage:SetEnabled(false);
self:HideCardList();
end
function ClubFinderGuildCardsBaseMixin:PageNext()
if (self.requestedPage and not self.newRequest) then
self:SetSearchingState();
return;
end
self.pageNumber = self.pageNumber + 1;
PlaySound(SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON);
CloseDropDownMenus();
......@@ -1691,10 +1704,6 @@ function ClubFinderGuildCardsBaseMixin:RefreshLayout(cardPage)
return;
end
if (not self:IsShown()) then
return;
end
if(not cardPage) then
cardPage = 1;
end
......@@ -1732,14 +1741,11 @@ function ClubFinderGuildCardsBaseMixin:RefreshLayout(cardPage)
end
else
if (self.requestedPage and not self.newRequest) then
self.SearchingSpinner:Show();
self:GetParent().InsetFrame.GuildDescription:Hide();
self.PreviousPage:SetEnabled(false);
self.NextPage:SetEnabled(false);
else
self:SetSearchingState();
else
self.PreviousPage:Hide();
self.NextPage:Hide();
end
end
end
if(cardPage <= 1) then
......@@ -1751,10 +1757,9 @@ function ClubFinderGuildCardsBaseMixin:RefreshLayout(cardPage)
local numLoadedPages = math.ceil(numCardsTotal / GUILD_CARDS_PER_PAGE);
local shouldRequestNextPage = (self.pagingEnabled and (cardPage + LOAD_PAGES_IN_ADVANCE == numLoadedPages) and ( cardPage + LOAD_PAGES_IN_ADVANCE < self.numPages));
if (shouldRequestNextPage and self.showingCards) then
if (shouldRequestNextPage and self.showingCards and not self.requestedPage) then
local startingIndex = cardPage * GUILD_CARDS_PER_PAGE;
local pageSize = LOAD_PAGES_IN_ADVANCE * GUILD_CARDS_PER_PAGE;
C_ClubFinder.RequestNextGuildPage(startingIndex, 6);
C_ClubFinder.RequestNextGuildPage(startingIndex, REQUEST_GUILD_CARDS_NUM);
self.requestedPage = true;
end
......@@ -1865,7 +1870,7 @@ function ClubFinderGuildAndCommunityMixin:OnEvent(event, ...)
if (buildGuild) then
self.GuildCards:BuildCardList();
if (self.isGuildType) then
self.requestedPage = false;
self.GuildCards.requestedPage = false;
if (self.GuildCards.newRequest) then
self.GuildCards.pageNumber = 1;
self.GuildCards.newRequest = false;
......
......@@ -445,6 +445,11 @@ function CommunitiesFrameMixin:UpdateSelectedClubInfo(clubId)
end
function CommunitiesFrameMixin:ClubFinderHyperLinkClicked(clubFinderId)
if IsCommunitiesUIDisabledByTrialAccount() then
UIErrorsFrame:AddMessage(ERR_RESTRICTED_ACCOUNT_TRIAL, RED_FONT_COLOR:GetRGBA());
return;
end
if not C_ClubFinder.IsEnabled() then
return;
end
......@@ -681,7 +686,6 @@ function CommunitiesFrameMixin:SetClubFinderPostingExpirationText(clubId, isGuil
local isPostingBanned = C_ClubFinder.IsPostingBanned(clubId);
local hasForceDescriptionChange = clubInfo and self:ClubFinderPostingHasActiveFlag(clubId, Enum.ClubFinderClubPostingStatusFlags.ForceDescriptionChange);
local hasForceNameChange = clubInfo and ((clubInfo.clubType == Enum.ClubType.Guild and self:GetNeedsGuildNameChange()) or self:ClubFinderPostingHasActiveFlag(clubId, Enum.ClubFinderClubPostingStatusFlags.ForceNameChange));
if (isPostingBanned) then
if (isGuildType) then
self.PostingExpirationText.InfoButton.tooltipText = CLUB_FINDER_BANNED_POSTING_WARNING:format(CLUB_FINDER_TYPE_GUILD);
......@@ -698,7 +702,7 @@ function CommunitiesFrameMixin:SetClubFinderPostingExpirationText(clubId, isGuil
self.PostingExpirationText.InfoButton.tooltipText = CLUB_FINDER_GUILD_POSTING_ALERT_REMOVED_DESC;
end
self.PostingExpirationText.ExpiredText:Show();
self.PostingExpirationText.InfoButton:Show();
self.PostingExpirationText.InfoButton:SetShown(hasForceNameChange or isPostingBanned or hasForceDescriptionChange);
elseif (expirationTime) then
if (expirationTime > 0) then
if (isGuildCommunitySelected) then
......@@ -761,9 +765,11 @@ function CommunitiesFrameMixin:DisplayReportedAlerts(clubId)
local isPostingBanned = C_ClubFinder.IsPostingBanned(clubId);
local hasForceDescriptionChange = self:ClubFinderPostingHasActiveFlag(clubId, Enum.ClubFinderClubPostingStatusFlags.ForceDescriptionChange);
local hasForceNameChange = self:ClubFinderPostingHasActiveFlag(clubId, Enum.ClubFinderClubPostingStatusFlags.ForceNameChange);
local isGuildOfficer = C_GuildInfo.IsGuildOfficer();
local isGuildLeader = IsGuildLeader();
local needsGuildNameChange = clubInfo.clubType == Enum.ClubType.Guild and (self:GetNeedsGuildNameChange() or hasForceNameChange) and (IsGuildLeader() or C_GuildInfo.IsGuildOfficer());
local needsGuildPostingMessageChange = finderEnabled and clubInfo.clubType == Enum.ClubType.Guild and recruitingClubInfo and (IsGuildLeader() or C_GuildInfo.IsGuildOfficer()) and hasForceDescriptionChange and not isPostingBanned;
local needsGuildNameChange = clubInfo.clubType == Enum.ClubType.Guild and (self:GetNeedsGuildNameChange() or hasForceNameChange) and (isGuildLeader or isGuildOfficer);
local needsGuildPostingMessageChange = finderEnabled and clubInfo.clubType == Enum.ClubType.Guild and recruitingClubInfo and (isGuildLeader or isGuildOfficer) and hasForceDescriptionChange and not isPostingBanned;
local needsCommunityPostingMessageChange = finderEnabled and clubInfo.clubType == Enum.ClubType.Character and recruitingClubInfo and hasCommunityFinderPermissions and hasForceDescriptionChange and not isPostingBanned;
local needsCommunityNameChange = finderEnabled and clubInfo.clubType == Enum.ClubType.Character and recruitingClubInfo and hasCommunityFinderPermissions and hasForceNameChange and not isPostingBanned;
local displayMode = self:GetDisplayMode();
......@@ -773,7 +779,7 @@ function CommunitiesFrameMixin:DisplayReportedAlerts(clubId)
end
if self.GuildNameAlertFrame.topAnchored == nil then
self.GuildNameAlertFrame.topAnchored = not IsGuildLeader();
self.GuildNameAlertFrame.topAnchored = not isGuildLeader;
end
local ReportedDisplayFrame = nil;
......@@ -781,6 +787,15 @@ function CommunitiesFrameMixin:DisplayReportedAlerts(clubId)
--We only want to show one alert at a time. Once the other alert is cleared, it will show the next in the case of numerous.
if needsGuildNameChange then
ReportedDisplayFrame = self.GuildNameChangeFrame;
if(not isGuildLeader) then
ReportedDisplayFrame.GMText:SetText(GUILD_NAME_ALERT_MEMBER_HELP);
else
ReportedDisplayFrame.GMText:SetText(GUILD_NAME_ALERT_GM_HELP);
end
ReportedDisplayFrame.EditBox:SetShown(isGuildLeader);
ReportedDisplayFrame.Button:SetShown(isGuildLeader);
ReportedDisplayFrame.RenameText:SetShown(isGuildLeader);
self.GuildNameAlertFrame.Alert:SetText(GUILD_NAME_ALERT);
self.GuildNameAlertFrame:SetShown(true);
elseif needsCommunityNameChange then
......
......@@ -148,10 +148,13 @@ function CommunitiesSettingsDialogMixin:UpdateCreateButton()
end
function CommunitiesSettingsDialogMixin:PostClub(newName)
if(not C_ClubFinder.IsEnabled()) then
return true;
end
local clubInfo = C_Club.GetClubInfo(self.clubId);
local specsInList = self.LookingForDropdown:GetSpecsList();
local shouldHideNow = true;
C_ClubFinder.SetRecruitmentSettings(Enum.ClubFinderSettingFlags.MaxLevelOnly, self.MaxLevelOnly.Button:GetChecked());
C_ClubFinder.SetRecruitmentSettings(Enum.ClubFinderSettingFlags.AutoAccept, self.AutoAcceptApplications.Button:GetChecked());
......@@ -160,7 +163,7 @@ function CommunitiesSettingsDialogMixin:PostClub(newName)
local minItemLevel = self.MinIlvlOnly.EditBox:GetNumber();
local description = self.Description.EditBox:GetText();
if(clubInfo) then
if(clubInfo and clubInfo.clubType == Enum.ClubType.Character) then
local postClubSuccessful = C_ClubFinder.PostClub(clubInfo.clubId, minItemLevel, newName, description, specsInList, Enum.ClubFinderRequestType.Community);
if (self.ShouldListClub.Button:GetChecked() and postClubSuccessful) then
shouldHideNow = false;
......@@ -288,11 +291,12 @@ end
function CommunitiesSettingsDialogMixin:HideOrShowCommunityFinderOptions(shouldShow)
local clubId = self:GetClubId();
local isPostingBanned = C_ClubFinder.IsPostingBanned(clubId);
local isClubFinderEnabled = C_ClubFinder.IsEnabled()
shouldShow = shouldShow and not isPostingBanned;
if(shouldShow) then
self:SetHeight(680);
elseif (isPostingBanned) then
elseif (isPostingBanned and isClubFinderEnabled) then
self:SetHeight(500);
else
self:SetHeight(480);
......@@ -311,7 +315,7 @@ function CommunitiesSettingsDialogMixin:HideOrShowCommunityFinderOptions(shouldS
self.ClubFocusDropdown.Label:SetShown(shouldShow);
self.ShouldListClub:SetShown(shouldShow);
self.ClubFinderPostingBannedError:SetText(CLUB_FINDER_BANNED_POSTING_WARNING:format(CLUB_FINDER_COMMUNITY_TYPE));
self.ClubFinderPostingBannedError:SetShown(isPostingBanned);
self.ClubFinderPostingBannedError:SetShown(isPostingBanned and isClubFinderEnabled);