Commit 353508d7 authored by TOM_RUS's avatar TOM_RUS
Browse files

WOW-29484patch8.1.5_PTR

parent be164f63
......@@ -124,6 +124,9 @@ local CurrencyInfo =
{
{ Name = "currencyType", Type = "number", Nilable = true },
{ Name = "quantity", Type = "number", Nilable = true },
{ Name = "quantityChange", Type = "number", Nilable = true },
{ Name = "quantityGainSource", Type = "number", Nilable = true },
{ Name = "quantityLostSource", Type = "number", Nilable = true },
},
},
{
......
......@@ -67,20 +67,6 @@ local QuestLog =
{ Name = "y", Type = "number", Nilable = false },
},
},
{
Name = "GetNextWaypointQuestIDs",
Type = "Function",
Arguments =
{
{ Name = "questID", Type = "number", Nilable = false },
},
Returns =
{
{ Name = "questIDs", Type = "table", InnerType = "number", Nilable = false },
},
},
{
Name = "GetNextWaypointText",
Type = "Function",
......@@ -92,7 +78,7 @@ local QuestLog =
Returns =
{
{ Name = "titleText", Type = "string", Nilable = false },
{ Name = "waypointText", Type = "string", Nilable = false },
},
},
{
......
......@@ -33,6 +33,15 @@ local ToyBoxInfo =
Events =
{
{
Name = "NewToyAdded",
Type = "Event",
LiteralName = "NEW_TOY_ADDED",
Payload =
{
{ Name = "itemID", Type = "number", Nilable = false },
},
},
{
Name = "ToysUpdated",
Type = "Event",
......
......@@ -3,7 +3,7 @@ local TOY_FANFARE_MODEL_SCENE = 253;
function ToyBox_OnLoad(self)
self.firstCollectedToyID = 0; -- used to track which toy gets the favorite helpbox
self.mostRecentCollectedToyID = UIParent.mostRecentCollectedToyID or nil;
self.autoPageToCollectedToyID = UIParent.autoPageToCollectedToyID or nil;
self.newToys = UIParent.newToys or {};
self.fanfareToys = {};
......@@ -26,7 +26,7 @@ end
function ToyBox_OnEvent(self, event, itemID, new, fanfare)
if ( event == "TOYS_UPDATED" ) then
if (new) then
self.mostRecentCollectedToyID = itemID;
self.autoPageToCollectedToyID = itemID;
if ( not CollectionsJournal:IsShown() ) then
CollectionsJournal_SetTab(CollectionsJournal, 3);
end
......@@ -321,12 +321,12 @@ end
function ToyBox_UpdatePages()
local maxPages = 1 + math.floor( math.max((C_ToyBox.GetNumFilteredToys() - 1), 0) / TOYS_PER_PAGE);
ToyBox.PagingFrame:SetMaxPages(maxPages)
if ToyBox.mostRecentCollectedToyID then
local toyPage = ToyBox_FindPageForToyID(ToyBox.mostRecentCollectedToyID);
if ToyBox.autoPageToCollectedToyID then
local toyPage = ToyBox_FindPageForToyID(ToyBox.autoPageToCollectedToyID);
if toyPage then
ToyBox.PagingFrame:SetCurrentPage(toyPage);
end
ToyBox.mostRecentCollectedToyID = nil;
ToyBox.autoPageToCollectedToyID = nil;
end
end
......
......@@ -91,7 +91,6 @@ function QUEST_TRACKER_MODULE:OnBlockHeaderClick(block, mouseButton)
end
local LINE_TYPE_ANIM = { template = "QuestObjectiveAnimLineTemplate", freeLines = { } };
local LINE_TYPE_WAYPOINT = { template = "QuestObjectiveWaypointLineTemplate", freeLines = { } };
-- *****************************************************************************************************
-- ***** ANIMATIONS
......@@ -243,22 +242,20 @@ function QuestObjectiveTracker_UpdatePOIs()
-- see if we already have a block for this quest
local block = QUEST_TRACKER_MODULE:GetExistingBlock(questID);
if ( block ) then
local isSuperTracked = questID == GetSuperTrackedQuestID();
local shouldShowWaypoint = (questID == GetSuperTrackedQuestID()) or (questID == QuestMapFrame_GetFocusedQuestID());
if ( isComplete and isComplete < 0 ) then
isComplete = false;
elseif ( numObjectives == 0 and playerMoney >= requiredMoney and not startEvent ) then
isComplete = true;
end
local poiButton;
if ( hasLocalPOI ) then
if ( hasLocalPOI or (shouldShowWaypoint and C_QuestLog.GetNextWaypoint(questID) ~= nil) ) then
if ( isComplete ) then
poiButton = QuestPOI_GetButton(ObjectiveTrackerFrame.BlocksFrame, questID, "normal", nil);
else
numPOINumeric = numPOINumeric + 1;
poiButton = QuestPOI_GetButton(ObjectiveTrackerFrame.BlocksFrame, questID, "numeric", numPOINumeric);
end
elseif ( isSuperTracked and C_QuestLog.GetNextWaypoint(questID) ~= nil ) then
poiButton = QuestPOI_GetButton(ObjectiveTrackerFrame.BlocksFrame, questID, "waypoint", nil);
elseif ( isComplete ) then
poiButton = QuestPOI_GetButton(ObjectiveTrackerFrame.BlocksFrame, questID, "remote", nil);
end
......@@ -388,7 +385,7 @@ function QUEST_TRACKER_MODULE:Update()
end
if ( showQuest ) then
local isSuperTracked = questID == GetSuperTrackedQuestID();
local shouldShowWaypoint = (questID == GetSuperTrackedQuestID()) or (questID == QuestMapFrame_GetFocusedQuestID());
local isSequenced = IsQuestSequenced(questID);
local existingBlock = QUEST_TRACKER_MODULE:GetExistingBlock(questID);
local block = QUEST_TRACKER_MODULE:GetBlock(questID);
......@@ -417,15 +414,21 @@ function QUEST_TRACKER_MODULE:Update()
else
local completionText = GetQuestLogCompletionText(questLogIndex);
if ( completionText ) then
if ( shouldShowWaypoint ) then
local waypointText = C_QuestLog.GetNextWaypointText(questID);
if ( waypointText ~= nil ) then
QUEST_TRACKER_MODULE:AddObjective(block, "Waypoint", WAYPOINT_OBJECTIVE_FORMAT_OPTIONAL:format(waypointText));
end
end
QUEST_TRACKER_MODULE:AddObjective(block, "QuestComplete", completionText, nil, OBJECTIVE_DASH_STYLE_HIDE);
else
QUEST_TRACKER_MODULE:AddObjective(block, "QuestComplete", QUEST_WATCH_QUEST_READY, nil, nil, OBJECTIVE_DASH_STYLE_HIDE, OBJECTIVE_TRACKER_COLOR["Complete"]);
end
if ( isSuperTracked ) then
local waypointTitle = C_QuestLog.GetNextWaypointText(questID);
if ( waypointTitle ~= nil ) then
QUEST_TRACKER_MODULE:AddObjective(block, "Waypoint", waypointTitle, LINE_TYPE_WAYPOINT, nil, OBJECTIVE_DASH_STYLE_HIDE, OBJECTIVE_TRACKER_COLOR["Waypoint"], nil, 20);
-- If there isn't completion text, always prefer waypoint to "Ready for turn-in".
local waypointText = C_QuestLog.GetNextWaypointText(questID);
if ( waypointText ~= nil ) then
QUEST_TRACKER_MODULE:AddObjective(block, "Waypoint", waypointText);
else
QUEST_TRACKER_MODULE:AddObjective(block, "QuestComplete", QUEST_WATCH_QUEST_READY, nil, nil, OBJECTIVE_DASH_STYLE_HIDE, OBJECTIVE_TRACKER_COLOR["Complete"]);
end
end
end
......@@ -433,19 +436,19 @@ function QUEST_TRACKER_MODULE:Update()
elseif ( questFailed ) then
QUEST_TRACKER_MODULE:AddObjective(block, "Failed", FAILED, nil, nil, OBJECTIVE_DASH_STYLE_HIDE, OBJECTIVE_TRACKER_COLOR["Failed"]);
else
if ( shouldShowWaypoint ) then
local waypointText = C_QuestLog.GetNextWaypointText(questID);
if ( waypointText ~= nil ) then
QUEST_TRACKER_MODULE:AddObjective(block, "Waypoint", WAYPOINT_OBJECTIVE_FORMAT_OPTIONAL:format(waypointText));
end
end
QuestObjectiveTracker_DoQuestObjectives(block, numObjectives, false, isSequenced, existingBlock);
if ( requiredMoney > playerMoney ) then
local text = GetMoneyString(playerMoney).." / "..GetMoneyString(requiredMoney);
QUEST_TRACKER_MODULE:AddObjective(block, "Money", text);
end
if ( isSuperTracked ) then
local waypointTitle = C_QuestLog.GetNextWaypointText(questID);
if ( waypointTitle ~= nil ) then
QUEST_TRACKER_MODULE:AddObjective(block, "Waypoint", waypointTitle, LINE_TYPE_WAYPOINT, nil, OBJECTIVE_DASH_STYLE_HIDE, OBJECTIVE_TRACKER_COLOR["Waypoint"], nil, 20);
end
end
-- timer bar
if ( failureTime and block.currentLine ) then
local currentLine = block.currentLine;
......@@ -473,15 +476,13 @@ function QUEST_TRACKER_MODULE:Update()
-- quest POI icon
if ( showPOIs ) then
local poiButton;
if ( hasLocalPOI ) then
if ( hasLocalPOI or (shouldShowWaypoint and C_QuestLog.GetNextWaypoint(questID) ~= nil) ) then
if ( isComplete ) then
poiButton = QuestPOI_GetButton(ObjectiveTrackerFrame.BlocksFrame, questID, "normal", nil);
else
numPOINumeric = numPOINumeric + 1;
poiButton = QuestPOI_GetButton(ObjectiveTrackerFrame.BlocksFrame, questID, "numeric", numPOINumeric);
end
elseif ( isSuperTracked and C_QuestLog.GetNextWaypoint(questID) ~= nil ) then
poiButton = QuestPOI_GetButton(ObjectiveTrackerFrame.BlocksFrame, questID, "waypoint", nil);
elseif ( isComplete ) then
poiButton = QuestPOI_GetButton(ObjectiveTrackerFrame.BlocksFrame, questID, "remote", nil);
end
......
......@@ -36,5 +36,4 @@ BannerDataProvider.xml
ContributionCollectorDataProvider.xml
MapLinkDataProvider.xml
SelectableGraveyardDataProvider.xml
MapIndicatorQuestDataProvider.xml
WaypointDataProvider.xml
\ No newline at end of file
MapIndicatorQuestDataProvider.xml
\ No newline at end of file
......@@ -19,10 +19,10 @@ function QuestDataProviderMixin:OnAdded(mapCanvas)
end
if not self.setFocusedQuestIDCallback then
self.setFocusedQuestIDCallback = function(event, ...) self:SetFocusedQuestID(...); end;
self.setFocusedQuestIDCallback = function(event, ...) self:RefreshAllData(...); end;
end
if not self.clearFocusedQuestIDCallback then
self.clearFocusedQuestIDCallback = function(event, ...) self:ClearFocusedQuestID(...); end;
self.clearFocusedQuestIDCallback = function(event, ...) self:RefreshAllData(...); end;
end
self:GetMap():RegisterCallback("SetFocusedQuestID", self.setFocusedQuestIDCallback);
......@@ -36,16 +36,6 @@ function QuestDataProviderMixin:OnRemoved(mapCanvas)
MapCanvasDataProviderMixin.OnRemoved(self, mapCanvas);
end
function QuestDataProviderMixin:SetFocusedQuestID(questID)
self.focusedQuestID = questID;
self:RefreshAllData();
end
function QuestDataProviderMixin:ClearFocusedQuestID(questID)
self.focusedQuestID = nil;
self:RefreshAllData();
end
function QuestDataProviderMixin:OnEvent(event, ...)
if event == "QUEST_LOG_UPDATE" then
self:RefreshAllData();
......@@ -82,12 +72,27 @@ function QuestDataProviderMixin:RefreshAllData(fromOnShow)
local mapInfo = C_Map.GetMapInfo(mapID);
local questsOnMap = C_QuestLog.GetQuestsOnMap(mapID);
local doesMapShowTaskObjectives = C_TaskQuest.DoesMapShowTaskQuestObjectives(mapID);
local function CheckAddQuest(questID, x, y, isMapIndicatorQuest, frameLevelOffset)
if self:ShouldShowQuest(questID, mapInfo.mapType, doesMapShowTaskObjectives, isMapIndicatorQuest) then
local pin = self:AddQuest(questID, x, y, frameLevelOffset);
table.insert(pinsToQuantize, pin);
end
end
if questsOnMap then
for i, info in ipairs(questsOnMap) do
if self:ShouldShowQuest(info.questID, mapInfo.mapType, doesMapShowTaskObjectives, info.isMapIndicatorQuest) then
local pin = self:AddQuest(info.questID, info.x, info.y, i);
table.insert(pinsToQuantize, pin);
end
CheckAddQuest(info.questID, info.x, info.y, info.isMapIndicatorQuest, i);
end
end
local waypointQuestID = QuestMapFrame_GetFocusedQuestID() or GetSuperTrackedQuestID();
if waypointQuestID then
local x, y = C_QuestLog.GetNextWaypointForMap(waypointQuestID, mapID);
if x and y then
local isMapIndicatorQuest = false;
local frameLevelOffset = questsOnMap and (#questsOnMap + 1) or 0;
CheckAddQuest(waypointQuestID, x, y, isMapIndicatorQuest, frameLevelOffset);
end
end
......@@ -101,7 +106,8 @@ function QuestDataProviderMixin:RefreshAllData(fromOnShow)
end
function QuestDataProviderMixin:ShouldShowQuest(questID, mapType, doesMapShowTaskObjectives, isMapIndicatorQuest)
if self.focusedQuestID and self.focusedQuestID ~= questID then
local focusedQuestID = QuestMapFrame_GetFocusedQuestID();
if focusedQuestID and focusedQuestID ~= questID then
return false;
end
if QuestUtils_IsQuestWorldQuest(questID) then
......@@ -251,13 +257,18 @@ function QuestPinMixin:OnLoad()
end
function QuestPinMixin:OnMouseEnter()
local questLogIndex = GetQuestLogIndexByID(self.questID);
local questID = self.questID;
local questLogIndex = GetQuestLogIndexByID(questID);
local title = GetQuestLogTitle(questLogIndex);
GameTooltip:SetOwner(self, "ANCHOR_CURSOR_RIGHT", 5, 2);
GameTooltip:SetText(title);
QuestUtils_AddQuestTypeToTooltip(GameTooltip, self.questID, NORMAL_FONT_COLOR);
QuestUtils_AddQuestTypeToTooltip(GameTooltip, questID, NORMAL_FONT_COLOR);
if poiButton and poiButton.style ~= "numeric" then
local wouldShowWaypointText = questID == GetSuperTrackedQuestID() or questID == QuestMapFrame_GetFocusedQuestID();
local waypointText = wouldShowWaypointText and C_QuestLog.GetNextWaypointText(questID);
if waypointText then
GameTooltip_AddColoredLine(GameTooltip, QUEST_DASH..waypointText, HIGHLIGHT_FONT_COLOR);
elseif poiButton and poiButton.style ~= "numeric" then
local completionText = GetQuestLogCompletionText(questLogIndex) or QUEST_WATCH_QUEST_READY;
GameTooltip:AddLine(QUEST_DASH..completionText, 1, 1, 1, true);
else
......@@ -280,7 +291,7 @@ function QuestPinMixin:OnMouseEnter()
end
end
GameTooltip:Show();
self:GetMap():TriggerEvent("SetHighlightedQuestPOI", self.questID);
self:GetMap():TriggerEvent("SetHighlightedQuestPOI", questID);
end
function QuestPinMixin:OnMouseLeave()
......
WaypointDataProviderMixin = CreateFromMixins(MapCanvasDataProviderMixin);
function WaypointDataProviderMixin:GetPinTemplate()
return "WaypointPinTemplate";
end
function WaypointDataProviderMixin:OnAdded(mapCanvas)
MapCanvasDataProviderMixin.OnAdded(self, mapCanvas);
self:RegisterEvent("SUPER_TRACKED_QUEST_CHANGED");
end
function WaypointDataProviderMixin:OnEvent(event, ...)
if event == "SUPER_TRACKED_QUEST_CHANGED" then
self:RefreshAllData();
end
end
function WaypointDataProviderMixin:RemoveAllData()
self:GetMap():RemoveAllPinsByTemplate(self:GetPinTemplate());
end
function WaypointDataProviderMixin:RefreshAllData(fromOnShow)
self:RemoveAllData();
local mapID = self:GetMap():GetMapID();
if not mapID then
return;
end
if not GetCVarBool("questPOI") then
return;
end
local superTrackedQuestID = GetSuperTrackedQuestID();
if not superTrackedQuestID then
return;
end
local x, y = C_QuestLog.GetNextWaypointForMap(GetSuperTrackedQuestID(), mapID);
if x and y then
self:AddQuest(superTrackedQuestID, x, y);
end
end
function WaypointDataProviderMixin:AddQuest(questID, x, y)
local pin = self:GetMap():AcquirePin(self:GetPinTemplate());
pin.questID = questID;
pin:UseFrameLevelType("PIN_FRAME_LEVEL_SUPER_TRACKED_QUEST");
pin:SetPosition(x, y);
return pin;
end
--[[ Pin ]]--
WaypointPinMixin = CreateFromMixins(MapCanvasPinMixin);
function WaypointPinMixin:OnLoad()
self:SetScalingLimits(1, 0.4125, 0.4125);
self.UpdateTooltip = self.OnMouseEnter;
end
local MAX_NUMBER_OF_QUEST_TITLES = 3;
function WaypointPinMixin:OnMouseEnter()
GameTooltip:SetOwner(self, "ANCHOR_CURSOR_RIGHT", 5, 2);
local waypointTitle = C_QuestLog.GetNextWaypointText(self.questID);
if not waypointTitle then
GameTooltip:Hide();
return;
end
GameTooltip_SetTitle(GameTooltip, waypointTitle, GREEN_FONT_COLOR);
GameTooltip_AddColoredLine(GameTooltip, WAYPOINT_BEST_ROUTE_TOOLTIP, HIGHLIGHT_FONT_COLOR);
local questIDs = C_QuestLog.GetNextWaypointQuestIDs(self.questID);
if not questIDs then
GameTooltip:Hide();
return;
end
for i, questID in ipairs(questIDs) do
if i <= MAX_NUMBER_OF_QUEST_TITLES then
local questTitle = C_QuestLog.GetQuestInfo(questID);
GameTooltip_AddNormalLine(GameTooltip, questTitle);
else
GameTooltip_AddNormalLine(GameTooltip, WAYPOINT_TOOLTIP_MORE_QUESTS_FORMAT:format(#questIDs - MAX_NUMBER_OF_QUEST_TITLES));
break;
end
end
GameTooltip:Show();
end
function WaypointPinMixin:OnMouseLeave()
GameTooltip:Hide();
end
function WaypointPinMixin:OnMouseDown()
self.Texture:Hide();
self.PushedTexture:Show();
self.Icon:SetPoint("CENTER", 2, -2);
end
function WaypointPinMixin:OnMouseUp()
self.Texture:Show();
self.PushedTexture:Hide();
self.Icon:SetPoint("CENTER", 0, 0);
end
\ No newline at end of file
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\FrameXML\UI.xsd">
<Script file="WaypointDataProvider.lua"/>
<Frame name="WaypointPinTemplate" hidden="true" flattenRenderLayers="true" enableMouse="true" mixin="WaypointPinMixin" virtual="true">
<Size x="50" y="50"/>
<Layers>
<Layer level="ARTWORK">
<Texture parentKey="Texture" file="Interface/WorldMap/UI-QuestPoi-NumberIcons" >
<Size x="89" y="90"/>
<Anchors>
<Anchor point="CENTER" />
</Anchors>
<TexCoords left="0.5" right="0.625" top="0.375" bottom="0.5"/>
</Texture>
<Texture parentKey="PushedTexture" file="Interface/WorldMap/UI-QuestPoi-NumberIcons" hidden="true">
<Size x="89" y="90"/>
<Anchors>
<Anchor point="CENTER" />
</Anchors>
<TexCoords left="0.375" right="0.5" top="0.375" bottom="0.5"/>
</Texture>
</Layer>
<Layer level="ARTWORK" textureSubLevel="1">
<Texture parentKey="Icon" atlas="poi-traveldirections-arrow">
<!-- We want the asset to be 13x17, but we need this to work right with scaling. Experimentally determined, (13 * 2.5) x (17 * 2.5) -->
<Size x="32.5" y="42.5"/>
<Anchors>
<Anchor point="CENTER"/>
</Anchors>
</Texture>
</Layer>
<Layer level="HIGHLIGHT">
<Texture parentKey="Highlight" file="Interface/WorldMap/UI-QuestPoi-NumberIcons" alphaMode="ADD">
<Size x="89" y="90"/>
<Anchors>
<Anchor point="CENTER" />
</Anchors>
<TexCoords left="0.625" right="0.750" top="0.875" bottom="1"/>
</Texture>
</Layer>
</Layers>
</Frame>
</Ui>
......@@ -584,7 +584,7 @@ function SocialPrefillItemText(itemLink, earned)
SocialPostFrame.lastItemID = itemID;
SocialPostFrame.lastPrefilledText = prefillText;
SocialRenderItem(itemLink);
SocialRenderItem(itemID);
end
function SocialItemButton_OnClick(self)
......@@ -614,10 +614,10 @@ function SocialItemButton_OnLeave(self)
GameTooltip_Hide();
end
function SocialRenderItem(itemLink)
function SocialRenderItem(itemID)
local tooltip = OffScreenFrame.ItemTooltip;
tooltip:SetOwner(OffScreenFrame, "ANCHOR_PRESERVE");
tooltip:SetHyperlink(itemLink);
tooltip:SetOwnedItemByID(itemID);
UpdateOffScreenFrame(OffScreenFrame, SOCIAL_OFFSCREEN_STATE_SHOW_ITEM);
TakeOffscreenSnapshot(tooltip, SOCIAL_IMAGE_TYPE_ITEM, SOCIAL_ITEM_REMOVE_BUTTON);
......
......@@ -144,7 +144,6 @@ function WorldMapMixin:AddStandardDataProviders()
self:AddDataProvider(CreateFromMixins(SelectableGraveyardDataProviderMixin));
self:AddDataProvider(CreateFromMixins(AreaPOIDataProviderMixin));
self:AddDataProvider(CreateFromMixins(MapIndicatorQuestDataProviderMixin));
self:AddDataProvider(CreateFromMixins(WaypointDataProviderMixin));
if IsGMClient() then
self:AddDataProvider(CreateFromMixins(WorldMap_DebugDataProviderMixin));
......
......@@ -15,7 +15,8 @@ function AlertFrameSystems_Register()
WorldQuestCompleteAlertSystem = AlertFrame:AddSimpleAlertFrameSubSystem("WorldQuestCompleteAlertFrameTemplate", WorldQuestCompleteAlertFrame_SetUp, WorldQuestCompleteAlertFrame_Coalesce);
LegendaryItemAlertSystem = AlertFrame:AddSimpleAlertFrameSubSystem("LegendaryItemAlertFrameTemplate", LegendaryItemAlertFrame_SetUp);
NewPetAlertSystem = AlertFrame:AddQueuedAlertFrameSubSystem("NewPetAlertFrameTemplate", NewPetAlertFrame_SetUp);
NewMountAlertSystem = AlertFrame:AddQueuedAlertFrameSubSystem("NewMountAlertFrameTemplate", NewMountAlertFrame_SetUp);
NewMountAlertSystem = AlertFrame:AddQueuedAlertFrameSubSystem("NewMountAlertFrameTemplate", NewMountAlertFrame_SetUp);
NewToyAlertSystem = AlertFrame:AddQueuedAlertFrameSubSystem("NewToyAlertFrameTemplate", NewToyAlertFrame_SetUp);
end
-- [[ GuildChallengeAlertFrame ]] --
......@@ -1118,4 +1119,29 @@ function NewMountAlertFrameMixin:OnClick(button, down)
SetCollectionsJournalShown(true, COLLECTIONS_JOURNAL_TAB_INDEX_MOUNTS);
MountJournal_SelectByMountID(self.mountID);
end
-- [[ NewToyAlertFrame ]] --
function NewToyAlertFrame_SetUp(frame, toyID)
frame:SetUp(toyID);
end
NewToyAlertFrameMixin = CreateFromMixins(ItemAlertFrameMixin);
function NewToyAlertFrameMixin:SetUp(toyID)
self.toyID = toyID;
local itemID, toyName, icon, isFavorite, hasFanfare, itemQuality = C_ToyBox.GetToyInfo(self.toyID);
self:SetUpDisplay(icon, itemQuality, toyName, YOU_EARNED_LABEL);
end
function NewToyAlertFrameMixin:OnClick(button, down)
if AlertFrame_OnClick(self, button, down) then
return;
end
CollectionsJournal_LoadUI();
ToyBox.autoPageToCollectedToyID = self.toyID;
SetCollectionsJournalShown(true, COLLECTIONS_JOURNAL_TAB_INDEX_TOYS);
end
\ No newline at end of file
......@@ -2596,4 +2596,17 @@
</Layer>
</Layers>
</ContainedAlertFrame>
<ContainedAlertFrame name="NewToyAlertFrameTemplate" parent="UIParent" hidden="true" frameStrata="DIALOG" virtual="true" mixin="NewToyAlertFrameMixin" inherits="ItemAlertFrameTemplate">
<Layers>
<Layer level="BACKGROUND" textureSubLevel="1">
<Texture parentKey="Background" atlas="LootToast-MoreAwesome" useAtlasSize="true">
<Anchors>
<Anchor point="CENTER"/>
</Anchors>
</Texture>
</Layer>
</Layers>
</ContainedAlertFrame>
</Ui>
......@@ -440,6 +440,7 @@ function AlertFrameMixin:OnLoad()
self:RegisterEvent("QUEST_LOOT_RECEIVED");
self:RegisterEvent("NEW_PET_ADDED");
self:RegisterEvent("NEW_MOUNT_ADDED");
self:RegisterEvent("NEW_TOY_ADDED");
end
function AlertFrameMixin:OnEvent(event, ...)
......@@ -605,6 +606,9 @@ function AlertFrameMixin:OnEvent(event, ...)
-- May be invasion reward
InvasionAlertSystem:AddCoalesceData(questID, rewardItemLink, texture);
end
elseif ( event == "NEW_TOY_ADDED") then