Commit c2f4a78f authored by TOM_RUS's avatar TOM_RUS

WOW-32151patch8.3.0_PTR

parent 31471cf3
......@@ -405,6 +405,15 @@ local AuctionHouse =
{ Name = "numOwnedAuctions", Type = "number", Nilable = false },
},
},
{
Name = "GetNumReplicateItems",
Type = "Function",
Returns =
{
{ Name = "numReplicateItems", Type = "number", Nilable = false },
},
},
{
Name = "GetOwnedAuctionInfo",
Type = "Function",
......@@ -442,6 +451,80 @@ local AuctionHouse =
{ Name = "quoteDurationSeconds", Type = "number", Nilable = false },
},
},
{
Name = "GetReplicateItemBattlePetInfo",
Type = "Function",
Arguments =
{
{ Name = "index", Type = "number", Nilable = false },
},
Returns =
{
{ Name = "creatureID", Type = "number", Nilable = false },
{ Name = "displayID", Type = "number", Nilable = false },
},
},
{
Name = "GetReplicateItemInfo",
Type = "Function",
Arguments =
{
{ Name = "index", Type = "number", Nilable = false },
},
Returns =
{
{ Name = "name", Type = "string", Nilable = true },
{ Name = "texture", Type = "number", Nilable = true },
{ Name = "count", Type = "number", Nilable = false },
{ Name = "qualityID", Type = "number", Nilable = false },
{ Name = "usable", Type = "bool", Nilable = true },
{ Name = "level", Type = "number", Nilable = false },
{ Name = "levelType", Type = "string", Nilable = true },
{ Name = "minBid", Type = "number", Nilable = false },
{ Name = "minIncrement", Type = "number", Nilable = false },
{ Name = "buyoutPrice", Type = "number", Nilable = false },
{ Name = "bidAmount", Type = "number", Nilable = false },
{ Name = "highBidder", Type = "string", Nilable = true },
{ Name = "bidderFullName", Type = "string", Nilable = true },
{ Name = "owner", Type = "string", Nilable = true },
{ Name = "ownerFullName", Type = "string", Nilable = true },
{ Name = "saleStatus", Type = "number", Nilable = false },
{ Name = "itemID", Type = "number", Nilable = false },
{ Name = "hasAllInfo", Type = "bool", Nilable = true },
},
},
{
Name = "GetReplicateItemLink",
Type = "Function",
Arguments =
{
{ Name = "index", Type = "number", Nilable = false },
},
Returns =
{
{ Name = "itemLink", Type = "string", Nilable = true },
},
},
{
Name = "GetReplicateItemTimeLeft",
Type = "Function",
Arguments =
{
{ Name = "index", Type = "number", Nilable = false },
},
Returns =
{
{ Name = "timeLeft", Type = "number", Nilable = false },
},
},
{
Name = "HasFavorites",
Type = "Function",
......@@ -638,6 +721,10 @@ local AuctionHouse =
{ Name = "itemKey", Type = "ItemKey", Nilable = false },
},
},
{
Name = "ReplicateItems",
Type = "Function",
},
{
Name = "RequestMoreBrowseResults",
Type = "Function",
......@@ -679,6 +766,16 @@ local AuctionHouse =
{ Name = "sorts", Type = "table", InnerType = "AuctionHouseSortType", Nilable = false },
},
},
{
Name = "SearchForItemKeys",
Type = "Function",
Arguments =
{
{ Name = "itemKeys", Type = "table", InnerType = "ItemKey", Nilable = false },
{ Name = "sorts", Type = "table", InnerType = "AuctionHouseSortType", Nilable = false },
},
},
{
Name = "SendBrowseQuery",
Type = "Function",
......@@ -734,15 +831,14 @@ local AuctionHouse =
Events =
{
{
Name = "AuctionBidderListUpdate",
Type = "Event",
LiteralName = "AUCTION_BIDDER_LIST_UPDATE",
},
{
Name = "AuctionCanceled",
Type = "Event",
LiteralName = "AUCTION_CANCELED",
Payload =
{
{ Name = "auctionID", Type = "number", Nilable = false },
},
},
{
Name = "AuctionHouseBrowseResultsAdded",
......@@ -783,11 +879,6 @@ local AuctionHouse =
Type = "Event",
LiteralName = "AUCTION_HOUSE_SHOW",
},
{
Name = "AuctionItemListUpdate",
Type = "Event",
LiteralName = "AUCTION_ITEM_LIST_UPDATE",
},
{
Name = "AuctionMultisellFailure",
Type = "Event",
......@@ -812,11 +903,6 @@ local AuctionHouse =
{ Name = "totalToCreate", Type = "number", Nilable = false },
},
},
{
Name = "AuctionOwnedListUpdate",
Type = "Event",
LiteralName = "AUCTION_OWNED_LIST_UPDATE",
},
{
Name = "BidAdded",
Type = "Event",
......@@ -929,11 +1015,6 @@ local AuctionHouse =
{ Name = "itemKey", Type = "ItemKey", Nilable = false },
},
},
{
Name = "NewAuctionUpdate",
Type = "Event",
LiteralName = "NEW_AUCTION_UPDATE",
},
{
Name = "OwnedAuctionAdded",
Type = "Event",
......@@ -957,6 +1038,11 @@ local AuctionHouse =
Type = "Event",
LiteralName = "OWNED_AUCTIONS_UPDATED",
},
{
Name = "ReplicateItemListUpdate",
Type = "Event",
LiteralName = "REPLICATE_ITEM_LIST_UPDATE",
},
},
Tables =
......@@ -1047,7 +1133,7 @@ local AuctionHouse =
{
{ Name = "auctionID", Type = "number", Nilable = false },
{ Name = "itemKey", Type = "ItemKey", Nilable = false },
{ Name = "itemLink", Type = "string", Nilable = false },
{ Name = "itemLink", Type = "string", Nilable = true },
{ Name = "timeLeft", Type = "AuctionHouseTimeLeftBand", Nilable = false },
{ Name = "bidAmount", Type = "number", Nilable = true },
{ Name = "buyoutAmount", Type = "number", Nilable = true },
......@@ -1114,7 +1200,7 @@ local AuctionHouse =
{ Name = "timeLeft", Type = "AuctionHouseTimeLeftBand", Nilable = false },
{ Name = "auctionID", Type = "number", Nilable = false },
{ Name = "quantity", Type = "number", Nilable = false },
{ Name = "itemLink", Type = "string", Nilable = false },
{ Name = "itemLink", Type = "string", Nilable = true },
{ Name = "containsOwnerItem", Type = "bool", Nilable = false },
{ Name = "containsSocketedItem", Type = "bool", Nilable = false },
{ Name = "bidder", Type = "string", Nilable = true },
......@@ -1131,7 +1217,7 @@ local AuctionHouse =
{
{ Name = "auctionID", Type = "number", Nilable = false },
{ Name = "itemKey", Type = "ItemKey", Nilable = false },
{ Name = "itemLink", Type = "string", Nilable = false },
{ Name = "itemLink", Type = "string", Nilable = true },
{ Name = "status", Type = "AuctionStatus", Nilable = false },
{ Name = "quantity", Type = "number", Nilable = false },
{ Name = "timeLeftSeconds", Type = "number", Nilable = false },
......
......@@ -717,18 +717,6 @@ local ClubFinder =
{ Name = "lastUpdatedTime", Type = "number", Nilable = false },
},
},
{
Name = "ClubFinderGuildTabardInfo",
Type = "Structure",
Fields =
{
{ Name = "backgroundColor", Type = "table", Mixin = "ColorMixin", Nilable = false },
{ Name = "borderColor", Type = "table", Mixin = "ColorMixin", Nilable = false },
{ Name = "emblemColor", Type = "table", Mixin = "ColorMixin", Nilable = false },
{ Name = "emblemFileID", Type = "number", Nilable = false },
{ Name = "emblemStyle", Type = "number", Nilable = false },
},
},
{
Name = "ClubSettingsInfo",
Type = "Structure",
......@@ -765,7 +753,7 @@ local ClubFinder =
{ Name = "guildLeader", Type = "string", Nilable = false },
{ Name = "isGuild", Type = "bool", Nilable = false },
{ Name = "emblemInfo", Type = "number", Nilable = false },
{ Name = "tabardInfo", Type = "ClubFinderGuildTabardInfo", Nilable = true },
{ Name = "tabardInfo", Type = "GuildTabardInfo", Nilable = true },
{ Name = "recruitingSpecIds", Type = "table", InnerType = "number", Nilable = false },
{ Name = "recruitmentFlags", Type = "number", Nilable = false },
{ Name = "minILvl", Type = "number", Nilable = false },
......
......@@ -61,6 +61,20 @@ local GuildInfo =
{ Name = "rankOrder", Type = "number", Nilable = false },
},
},
{
Name = "GetGuildTabardInfo",
Type = "Function",
Arguments =
{
{ Name = "unit", Type = "string", Nilable = false },
},
Returns =
{
{ Name = "tabardInfo", Type = "GuildTabardInfo", Nilable = true },
},
},
{
Name = "GuildControlGetRankFlags",
Type = "Function",
......@@ -200,17 +214,7 @@ local GuildInfo =
{ Name = "guildAchievementPoints", Type = "number", Nilable = false },
{ Name = "oldGuildName", Type = "string", Nilable = false },
{ Name = "isNewGuild", Type = "bool", Nilable = true },
{ Name = "bkgColorR", Type = "number", Nilable = true },
{ Name = "bkgColorG", Type = "number", Nilable = true },
{ Name = "bkgColorB", Type = "number", Nilable = true },
{ Name = "borderColorR", Type = "number", Nilable = true },
{ Name = "borderColorG", Type = "number", Nilable = true },
{ Name = "borderColorB", Type = "number", Nilable = true },
{ Name = "emblemColorR", Type = "number", Nilable = true },
{ Name = "emblemColorG", Type = "number", Nilable = true },
{ Name = "emblemColorB", Type = "number", Nilable = true },
{ Name = "emblemFileID", Type = "number", Nilable = true },
{ Name = "emblemIndex", Type = "number", Nilable = true },
{ Name = "tabardInfo", Type = "GuildTabardInfo", Nilable = true },
},
},
{
......
......@@ -6,6 +6,20 @@ local LFGuildInfo =
Functions =
{
{
Name = "GetRecruitingGuildTabardInfo",
Type = "Function",
Arguments =
{
{ Name = "index", Type = "number", Nilable = false },
},
Returns =
{
{ Name = "tabardInfo", Type = "GuildTabardInfo", Nilable = true },
},
},
},
Events =
......
......@@ -187,9 +187,9 @@ function AuctionHouseAuctionsFrameMixin:RefreshSeachResults()
if itemKey then
self:GetAuctionHouseFrame():QueryItem(self:GetSearchContext(), itemKey);
if displayMode == AuctionsFrameDisplayMode.Item then
self.ItemList:RefreshScrollFrame();
self.ItemList:DirtyScrollFrame();
elseif displayMode == AuctionsFrameDisplayMode.Commodity then
self.CommoditiesList:RefreshScrollFrame();
self.CommoditiesList:DirtyScrollFrame();
end
end
end
......@@ -215,18 +215,18 @@ function AuctionHouseAuctionsFrameMixin:OnEvent(event, ...)
self.SummaryList:RefreshScrollFrame();
elseif event == "ITEM_SEARCH_RESULTS_UPDATED" then
self.ItemList:RefreshScrollFrame();
self.ItemList:DirtyScrollFrame();
elseif event == "ITEM_SEARCH_RESULTS_ADDED" then
self.ItemList:RefreshScrollFrame();
self.ItemList:DirtyScrollFrame();
elseif event == "BIDS_UPDATED" then
self.BidsList:RefreshScrollFrame();
self.BidsList:DirtyScrollFrame();
if self:IsDisplayingBids() then
self.SummaryList:RefreshScrollFrame();
end
elseif event == "BID_ADDED" then
self.BidsList:RefreshScrollFrame();
self.BidsList:DirtyScrollFrame();
if self:IsDisplayingBids() then
self.SummaryList:RefreshScrollFrame();
......@@ -267,7 +267,7 @@ function AuctionHouseAuctionsFrameMixin:InitializeAllAuctionsList()
local function AllAuctionsRefreshResults()
self:GetAuctionHouseFrame():QueryAll(AuctionHouseSearchContext.AllAuctions);
self.AllAuctionsList:RefreshScrollFrame();
self.AllAuctionsList:DirtyScrollFrame();
end
local AllAuctionsGetTotalQuantity = nil;
......@@ -295,7 +295,7 @@ function AuctionHouseAuctionsFrameMixin:InitializeBidsList()
local function BidsListRefreshResults()
self:GetAuctionHouseFrame():QueryAll(AuctionHouseSearchContext.AllBids);
self.BidsList:RefreshScrollFrame();
self.BidsList:DirtyScrollFrame();
end
local BidsListGetTotalQuantity = nil;
......@@ -314,17 +314,7 @@ function AuctionHouseAuctionsFrameMixin:InitializeItemList()
return selectedRowData and currentRowData.auctionID == selectedRowData.auctionID;
end);
local function ItemSellFrameListLineOnEnterCallback(line, rowData)
GameTooltip:SetOwner(line, "ANCHOR_RIGHT");
local hideVendorPrice = true;
GameTooltip:SetHyperlink(rowData.itemLink, nil, nil, nil, hideVendorPrice);
AuctionHouseUtil.AddAuctionHouseTooltipInfo(GameTooltip, rowData.owners, rowData.timeLeft);
GameTooltip:Show();
end
self.ItemList:SetLineOnEnterCallback(ItemSellFrameListLineOnEnterCallback);
self.ItemList:SetLineOnEnterCallback(AuctionHouseUtil.SetAuctionHouseTooltip);
self.ItemList:SetLineOnLeaveCallback(GameTooltip_Hide);
local function AuctionsItemListSearchStarted()
......
......@@ -4,6 +4,8 @@ local BROWSE_SCROLL_OFFSET_REFRESH_THRESHOLD = 30;
AuctionHouseBrowseResultsFrameMixin = CreateFromMixins(AuctionHouseSortOrderSystemMixin);
-- These events are registered in OnLoad, as the browse results can be updated
-- when the player retrieves specific item and commodity results.
local AUCTION_HOUSE_BROWSE_RESULTS_FRAME_EVENTS = {
"AUCTION_HOUSE_BROWSE_RESULTS_UPDATED",
"AUCTION_HOUSE_BROWSE_RESULTS_ADDED",
......@@ -16,6 +18,8 @@ function AuctionHouseBrowseResultsFrameMixin:SetupTableBuilder(extraInfoColumn)
end
function AuctionHouseBrowseResultsFrameMixin:OnLoad()
FrameUtil.RegisterFrameForEvents(self, AUCTION_HOUSE_BROWSE_RESULTS_FRAME_EVENTS);
AuctionHouseSortOrderSystemMixin.OnLoad(self);
local scrollFrame = self.ItemList.ScrollFrame;
......@@ -62,7 +66,7 @@ function AuctionHouseBrowseResultsFrameMixin:OnLoad()
self.browseSearchStartedCallback = function ()
self.searchStarted = true;
self.browseResults = {};
self.ItemList:RefreshScrollFrame();
self.ItemList:DirtyScrollFrame();
end;
-- If the player has favorites, an automatic search will be started immediately. This is required because
......@@ -72,8 +76,6 @@ function AuctionHouseBrowseResultsFrameMixin:OnLoad()
end
function AuctionHouseBrowseResultsFrameMixin:OnShow()
FrameUtil.RegisterFrameForEvents(self, AUCTION_HOUSE_BROWSE_RESULTS_FRAME_EVENTS);
self.ItemList:RefreshScrollFrame();
self:GetAuctionHouseFrame():RegisterCallback(AuctionHouseFrameMixin.Event.CategorySelected, self.categorySelectedCallback);
......@@ -81,8 +83,6 @@ function AuctionHouseBrowseResultsFrameMixin:OnShow()
end
function AuctionHouseBrowseResultsFrameMixin:OnHide()
FrameUtil.UnregisterFrameForEvents(self, AUCTION_HOUSE_BROWSE_RESULTS_FRAME_EVENTS);
self:GetAuctionHouseFrame():UnregisterCallback(AuctionHouseFrameMixin.Event.CategorySelected, self.categorySelectedCallback);
self:GetAuctionHouseFrame():UnregisterCallback(AuctionHouseFrameMixin.Event.BrowseSearchStarted, self.browseSearchStartedCallback);
end
......@@ -138,7 +138,7 @@ function AuctionHouseBrowseResultsFrameMixin:UpdateBrowseResults(addedBrowseResu
end
if addedBrowseResults then
self.ItemList:RefreshScrollFrame();
self.ItemList:DirtyScrollFrame();
else
self.ItemList:Reset();
end
......
......@@ -41,14 +41,14 @@ function AuctionHouseCommoditiesListMixin:OnEvent(event, ...)
if event == "COMMODITY_SEARCH_RESULTS_UPDATED" then
self:Reset();
elseif event == "COMMODITY_SEARCH_RESULTS_ADDED" then
self:RefreshScrollFrame();
self:DirtyScrollFrame();
end
end
function AuctionHouseCommoditiesListMixin:SetItemID(itemID)
self.itemID = itemID;
self:UpdateDataProvider();
self:RefreshScrollFrame();
self:DirtyScrollFrame();
end
function AuctionHouseCommoditiesListMixin:UpdateDataProvider()
......@@ -178,7 +178,7 @@ end
function AuctionHouseCommoditiesBuyListMixin:SetQuantitySelected(quantity)
self.quantitySelected = quantity;
self:UpdateDynamicCallbacks();
self:RefreshScrollFrame();
self:DirtyScrollFrame();
end
function AuctionHouseCommoditiesBuyListMixin:OnShow()
......
......@@ -283,6 +283,11 @@ function AuctionHouseFrameMixin:OnLoad()
self.tabsForDisplayMode = {};
for i, tab in ipairs(self.Tabs) do
self.tabsForDisplayMode[tab.displayMode] = i;
if tab == self.SellTab then
self.tabsForDisplayMode[AuctionHouseFrameDisplayMode.CommoditiesSell] = i;
self.tabsForDisplayMode[AuctionHouseFrameDisplayMode.WoWTokenSell] = i;
end
end
end
......@@ -462,7 +467,7 @@ function AuctionHouseFrameMixin:IsListingAuctions()
end
function AuctionHouseFrameMixin:SetPostItem(itemLocation)
if not itemLocation:IsValid() then
if not itemLocation:IsValid() or not C_AuctionHouse.IsSellItemValid(itemLocation) then
return;
end
......
......@@ -8,6 +8,8 @@ local AUCTION_HOUSE_ITEM_BUY_FRAME_EVENTS = {
"ITEM_SEARCH_RESULTS_UPDATED",
"ITEM_SEARCH_RESULTS_ADDED",
"BIDS_UPDATED",
"AUCTION_CANCELED",
"AUCTION_HOUSE_BROWSE_RESULTS_UPDATED",
};
function AuctionHouseItemBuyFrameMixin:OnLoad()
......@@ -25,20 +27,17 @@ function AuctionHouseItemBuyFrameMixin:OnLoad()
end);
self.ItemList:SetHighlightCallback(function(currentRowData, selectedRowData)
return selectedRowData and currentRowData.auctionID == selectedRowData.auctionID;
if self.selectedAuctionCanceled then
if selectedRowData.buyoutAmount == currentRowData.buyoutAmount then
self.ItemList:SetSelectedEntry(currentRowData);
return true;
end
else
return selectedRowData and (currentRowData.auctionID == selectedRowData.auctionID);
end
end);
local function ItemBuyFrameListLineOnEnterCallback(line, rowData)
GameTooltip:SetOwner(line, "ANCHOR_RIGHT");
local hideVendorPrice = true;
GameTooltip:SetHyperlink(rowData.itemLink, nil, nil, nil, hideVendorPrice);
AuctionHouseUtil.AddAuctionHouseTooltipInfo(GameTooltip, rowData.owners, rowData.timeLeft);
GameTooltip:Show();
end
self.ItemList:SetLineOnEnterCallback(ItemBuyFrameListLineOnEnterCallback);
self.ItemList:SetLineOnEnterCallback(AuctionHouseUtil.SetAuctionHouseTooltip);
self.ItemList:SetLineOnLeaveCallback(GameTooltip_Hide);
self.ItemList:SetTableBuilderLayout(AuctionHouseTableBuilder.GetItemBuyListLayout(self, self.ItemList));
......@@ -67,11 +66,19 @@ end
function AuctionHouseItemBuyFrameMixin:OnEvent(event, ...)
if event == "ITEM_SEARCH_RESULTS_UPDATED" then
self.ItemList:Reset();
self.ItemList:DirtyScrollFrame();
elseif event == "ITEM_SEARCH_RESULTS_ADDED" then
self.ItemList:RefreshScrollFrame();
self.ItemList:DirtyScrollFrame();
elseif event == "BIDS_UPDATED" then
self.ItemList:RefreshScrollFrame();
self.ItemList:DirtyScrollFrame();
elseif event == "AUCTION_CANCELED" then
local auctionID = ...;
local selectedRowData = self.ItemList:GetSelectedEntry();
if selectedRowData and selectedRowData.auctionID == auctionID then
self.selectedAuctionCanceled = true;
end
elseif event == "AUCTION_HOUSE_BROWSE_RESULTS_UPDATED" then
self.ItemList:UpdateRefreshFrame();
end
end
......@@ -110,7 +117,7 @@ function AuctionHouseItemBuyFrameMixin:SetItemKey(itemKey)
end
function AuctionHouseItemBuyFrameMixin:OnAuctionSelected(auctionData)
self.selectedAuctionData = auctionData;
self.selectedAuctionCanceled = false;
if auctionData == nil then
self:ResetPrice();
......
......@@ -182,7 +182,7 @@ end
function AuctionHouseItemListMixin:SetSelectedEntry(rowData)
self.selectedRowData = rowData;
self:RefreshScrollFrame();
self:DirtyScrollFrame();
if self.selectionCallback then
self.selectionCallback(rowData);
......@@ -202,9 +202,18 @@ function AuctionHouseItemListMixin:OnShow()
self.dotCount = 0;
end
function AuctionHouseItemListMixin:OnUpdate()
if self.scrollFrameDirty then
self:RefreshScrollFrame();
end
end
function AuctionHouseItemListMixin:Reset()
HybridScrollFrame_SetOffset(self.ScrollFrame, 0);
self:RefreshScrollFrame();
if self:GetScrollOffset() == 0 then
self:RefreshScrollFrame();
else
HybridScrollFrame_SetOffset(self.ScrollFrame, 0);
end
end
function AuctionHouseItemListMixin:SetState(state)
......@@ -220,28 +229,14 @@ function AuctionHouseItemListMixin:SetState(state)
if state == ItemListState.NoSearch then
local searchResultsText = self.searchStartedFunc and select(2, self.searchStartedFunc());
self.ResultsText:SetText(searchResultsText or "");
if self.RefreshFrame:IsShown() then
self.RefreshFrame:Deactivate();
end
elseif state == ItemListState.NoResults then
self.ResultsText:SetText(BROWSE_NO_RESULTS);
if self.RefreshFrame:IsShown() then
self.RefreshFrame:SetQuantity(0);
end
elseif state == ItemListState.ResultsPending then
self.LoadingSpinner:Show();