Commit be164f63 authored by TOM_RUS's avatar TOM_RUS
Browse files

WOW-29418patch8.1.5_PTR

parent c1e5ba06
......@@ -864,15 +864,6 @@ local Club =
{ Name = "settings", Type = "table", InnerType = "ClubStreamNotificationSetting", Nilable = false },
},
},
{
Name = "SetCommunityID",
Type = "Function",
Arguments =
{
{ Name = "communityID", Type = "number", Nilable = false },
},
},
{
Name = "SetFavorite",
Type = "Function",
......
......@@ -67,6 +67,20 @@ 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",
......
......@@ -2,10 +2,121 @@ local SocialInfo =
{
Name = "SocialInfo",
Type = "System",
Namespace = "C_SocialInfo",
Namespace = "C_Social",
Functions =
{
{
Name = "GetLastAchievement",
Type = "Function",
Returns =
{
{ Name = "achievementID", Type = "number", Nilable = false },
{ Name = "achievementName", Type = "string", Nilable = false },
{ Name = "achievementDesc", Type = "string", Nilable = false },
{ Name = "iconFileID", Type = "number", Nilable = false },
},
},
{
Name = "GetLastItem",
Type = "Function",
Returns =
{
{ Name = "itemID", Type = "number", Nilable = false },
{ Name = "itemName", Type = "string", Nilable = false },
{ Name = "iconFileID", Type = "number", Nilable = false },
{ Name = "itemQuality", Type = "number", Nilable = false },
{ Name = "itemLevel", Type = "number", Nilable = false },
{ Name = "itemLinkString", Type = "string", Nilable = false },
},
},
{
Name = "GetLastScreenshotIndex",
Type = "Function",
Returns =
{
{ Name = "screenShotIndex", Type = "number", Nilable = false },
},
},
{
Name = "GetMaxTweetLength",
Type = "Function",
Returns =
{
{ Name = "maxTweetLength", Type = "number", Nilable = false },
},
},
{
Name = "GetScreenshotInfoByIndex",
Type = "Function",
Arguments =
{
{ Name = "index", Type = "number", Nilable = false },
},
Returns =
{
{ Name = "screenWidth", Type = "number", Nilable = false },
{ Name = "screenHeight", Type = "number", Nilable = false },
},
},
{
Name = "GetTweetLength",
Type = "Function",
Arguments =
{
{ Name = "tweetText", Type = "string", Nilable = false },
},
Returns =
{
{ Name = "tweetLength", Type = "number", Nilable = false },
},
},
{
Name = "IsSocialEnabled",
Type = "Function",
Returns =
{
{ Name = "isEnabled", Type = "bool", Nilable = false },
},
},
{
Name = "TwitterCheckStatus",
Type = "Function",
Documentation = { "Not allowed to be called by addons" },
},
{
Name = "TwitterConnect",
Type = "Function",
Documentation = { "Not allowed to be called by addons" },
},
{
Name = "TwitterGetMSTillCanPost",
Type = "Function",
Returns =
{
{ Name = "msTimeLeft", Type = "number", Nilable = false },
},
},
{
Name = "TwitterPostMessage",
Type = "Function",
Documentation = { "Not allowed to be called by addons" },
Arguments =
{
{ Name = "message", Type = "string", Nilable = false },
},
},
},
Events =
......
......@@ -6,6 +6,29 @@ local ToyBoxInfo =
Functions =
{
{
Name = "ClearFanfare",
Type = "Function",
Arguments =
{
{ Name = "itemID", Type = "number", Nilable = false },
},
},
{
Name = "NeedsFanfare",
Type = "Function",
Arguments =
{
{ Name = "itemID", Type = "number", Nilable = false },
},
Returns =
{
{ Name = "needsFanfare", Type = "bool", Nilable = false },
},
},
},
Events =
......@@ -18,6 +41,7 @@ local ToyBoxInfo =
{
{ Name = "itemID", Type = "number", Nilable = true },
{ Name = "isNew", Type = "bool", Nilable = true },
{ Name = "hasFanfare", Type = "bool", Nilable = true },
},
},
},
......
......@@ -472,6 +472,7 @@ local UIWidgetManager =
{ Name = "rightBarValue", Type = "number", Nilable = false },
{ Name = "barValueTextType", Type = "StatusBarValueTextType", Nilable = false },
{ Name = "text", Type = "string", Nilable = false },
{ Name = "barWidth", Type = "number", Nilable = false },
{ Name = "textureKitID", Type = "number", Nilable = false },
{ Name = "hasTimer", Type = "bool", Nilable = false },
{ Name = "orderIndex", Type = "number", Nilable = false },
......
......@@ -197,6 +197,20 @@ local Unit =
{ Name = "maxPower", Type = "number", Nilable = false },
},
},
{
Name = "UnitPvpClassification",
Type = "Function",
Arguments =
{
{ Name = "unit", Type = "string", Nilable = false },
},
Returns =
{
{ Name = "classification", Type = "PvpUnitClassification", Nilable = true },
},
},
{
Name = "UnitSex",
Type = "Function",
......@@ -1222,6 +1236,27 @@ local Unit =
{ Name = "NumPowerTypes", Type = "PowerType", EnumValue = 19 },
},
},
{
Name = "PvpUnitClassification",
Type = "Enumeration",
NumValues = 11,
MinValue = 0,
MaxValue = 10,
Fields =
{
{ Name = "FlagCarrierHorde", Type = "PvpUnitClassification", EnumValue = 0 },
{ Name = "FlagCarrierAlliance", Type = "PvpUnitClassification", EnumValue = 1 },
{ Name = "FlagCarrierNeutral", Type = "PvpUnitClassification", EnumValue = 2 },
{ Name = "CartRunnerHorde", Type = "PvpUnitClassification", EnumValue = 3 },
{ Name = "CartRunnerAlliance", Type = "PvpUnitClassification", EnumValue = 4 },
{ Name = "AssassinHorde", Type = "PvpUnitClassification", EnumValue = 5 },
{ Name = "AssassinAlliance", Type = "PvpUnitClassification", EnumValue = 6 },
{ Name = "OrbCarrierBlue", Type = "PvpUnitClassification", EnumValue = 7 },
{ Name = "OrbCarrierGreen", Type = "PvpUnitClassification", EnumValue = 8 },
{ Name = "OrbCarrierOrange", Type = "PvpUnitClassification", EnumValue = 9 },
{ Name = "OrbCarrierPurple", Type = "PvpUnitClassification", EnumValue = 10 },
},
},
},
};
......
......@@ -83,7 +83,6 @@ function CollectionsWrappedModelSceneMixin:StartUnwrapAnimation(OnFinishedCallba
end
end)
C_Timer.After(1.6, function()
self.isUnwrapping = nil;
if OnFinishedCallback then
......@@ -199,4 +198,59 @@ function CollectionsPagingMixin:Update()
else
self.NextPageButton:Enable();
end
end
\ No newline at end of file
end
--------------------------------------------------
-- TOY FANFARE MIXIN - overwrites portions of CollectionsWrappedModelSceneMixin
ToyWrappedModelSceneMixin = CreateFromMixins(CollectionsWrappedModelSceneMixin);
function ToyWrappedModelSceneMixin:PrepareForFanfare(needsFanFare)
self.needsFanFare = needsFanFare;
local wrappedActor = self:GetActorByTag("wrapped");
if wrappedActor then
wrappedActor:SetModelByCreatureDisplayID(COLLECTIONS_FANFARE_CREATURE_DISPLAY_ID);
if self:NeedsFanfare() then
wrappedActor:Show();
if not self:IsUnwrapAnimating() then
wrappedActor:SetAnimation(0);
wrappedActor:SetAlpha(1);
end
else
wrappedActor:Hide();
end
end
end
function ToyWrappedModelSceneMixin:StartUnwrapAnimation(OnFinishedCallback)
if not self:NeedsFanfare() or self:IsUnwrapAnimating() then
return;
end
local wrappedActor = self:GetActorByTag("wrapped");
if wrappedActor then
self.isUnwrapping = true;
self.needsFanFare = false;
self.UnwrapAnim.WrappedAnim:SetTarget(wrappedActor);
self.UnwrapAnim:Play();
wrappedActor:SetAnimation(148);
PlaySound(SOUNDKIT.UI_STORE_UNWRAP);
C_Timer.After(0.8, function()
for actor in self:EnumerateActiveActors() do
actor:SetSpellVisualKit(73393, true);
end
end)
C_Timer.After(3.0, function()
self.isUnwrapping = nil;
if OnFinishedCallback then
OnFinishedCallback();
end
end)
end
end
......@@ -56,7 +56,7 @@
<TexCoords left="0.063" right="0.938" top="0.063" bottom="0.917"/>
</Texture>
<Texture parentKey="slotFrameUncollectedInnerGlow" setAllPoints="true" alpha=".18" hidden="true" atlas="collections-itemborder-uncollected-innerglow" useAtlasSize="true">
<Texture parentKey="slotFrameUncollectedInnerGlow" setAllPoints="true" alpha="0.18" hidden="true" atlas="collections-itemborder-uncollected-innerglow" useAtlasSize="true">
<Anchors>
<Anchor point="CENTER" x="0" y="2"/>
</Anchors>
......@@ -122,6 +122,14 @@
</Layers>
</Frame>
</Frames>
<Animations>
<AnimationGroup parentKey="IconFadeIn" setToFinalAlpha="true">
<Alpha childKey="iconTexture" startDelay="1.0" fromAlpha="0" toAlpha="1" duration="0.75" order="1"/>
<Alpha childKey="slotFrameCollected" startDelay="1.0" fromAlpha="0" toAlpha="1" duration="0.75" order="1"/>
</AnimationGroup>
</Animations>
<Scripts>
<OnEvent function="CollectionsButton_OnEvent"/>
......@@ -143,7 +151,7 @@
<Anchor point="CENTER" x="0" y="1"/>
</Anchors>
</PushedTexture>
<HighlightTexture file="Interface\Buttons\ButtonHilight-Square" alphaMode="ADD">
<HighlightTexture parentKey="HighlightTexture" file="Interface\Buttons\ButtonHilight-Square" alphaMode="ADD">
<Size x="48" y="48"/>
<Anchors>
<Anchor point="CENTER" x="0" y="2"/>
......
local TOYS_PER_PAGE = 18;
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.newToys = UIParent.newToys or {};
self.fanfareToys = {};
self.fanfarePool = CreateFramePool("MODELSCENE", self, "ToySpellButtonFanfareModelSceneTemplate");
ToyBox_UpdatePages();
ToyBox_UpdateProgressBar(self);
......@@ -11,6 +15,7 @@ function ToyBox_OnLoad(self)
UIDropDownMenu_Initialize(self.toyOptionsMenu, ToyBoxOptionsMenu_Init, "MENU");
self:RegisterEvent("TOYS_UPDATED");
self:RegisterEvent("UI_MODEL_SCENE_INFO_UPDATED");
self.OnPageChanged = function(userAction)
PlaySound(SOUNDKIT.IG_ABILITY_PAGE_TURN);
......@@ -18,7 +23,7 @@ function ToyBox_OnLoad(self)
end
end
function ToyBox_OnEvent(self, event, itemID, new)
function ToyBox_OnEvent(self, event, itemID, new, fanfare)
if ( event == "TOYS_UPDATED" ) then
if (new) then
self.mostRecentCollectedToyID = itemID;
......@@ -27,6 +32,10 @@ function ToyBox_OnEvent(self, event, itemID, new)
end
end
if fanfare then
self.fanfareToys[itemID] = true;
end
ToyBox_UpdatePages();
ToyBox_UpdateProgressBar(self);
ToyBox_UpdateButtons();
......@@ -34,7 +43,10 @@ function ToyBox_OnEvent(self, event, itemID, new)
if (new) then
self.newToys[itemID] = true;
end
elseif event == "UI_MODEL_SCENE_INFO_UPDATED" then
ToyBox_UpdateButtons();
end
end
function ToyBox_OnShow(self)
......@@ -142,8 +154,36 @@ function ToySpellButton_OnClick(self, button)
ToyBox_ShowToyDropdown(self.itemID, self, 0, 0);
end
else
UseToy(self.itemID);
if ( ToyBox.fanfareToys[self.itemID] ~= nil ) then
ToyBox.fanfareToys[self.itemID] = false;
if ( self.modelScene ) then
local function OnFinishedCallback()
C_ToyBoxInfo.ClearFanfare(self.itemID);
ToySpellButton_UpdateButton(self);
end
self.modelScene:StartUnwrapAnimation(OnFinishedCallback);
ToySpellButton_FadeInIcon(self);
end
else
UseToy(self.itemID);
end
end
end
function ToySpellButton_FadeInIcon(self)
self.iconTexture:SetAlpha(0.0);
self.slotFrameCollected:SetAlpha(0.0);
self.iconTexture:Show();
self.slotFrameCollected:Show();
local function ShowHighlightTexture()
self.HighlightTexture:Show();
end
self.IconFadeIn:SetScript("OnFinished", ShowHighlightTexture);
self.IconFadeIn:Play();
end
function ToySpellButton_OnModifiedClick(self, button)
......@@ -180,64 +220,94 @@ function ToySpellButton_UpdateButton(self)
self:Show();
local itemID, toyName, icon = C_ToyBox.GetToyInfo(self.itemID);
if (itemID == nil or toyName == nil) then
local itemID, toyName, icon, isFavorite, hasFanfare = C_ToyBox.GetToyInfo(self.itemID);
if (itemID == nil) or (toyName == nil) then
return;
end
if ToyBox.fanfareToys[itemID] == nil and hasFanfare then
ToyBox.fanfareToys[itemID] = true;
end
if string.len(toyName) == 0 then
toyName = itemID;
end
iconTexture:SetTexture(icon);
iconTextureUncollected:SetTexture(icon);
iconTextureUncollected:SetDesaturated(true);
toyString:SetText(toyName);
toyString:Show();
if (ToyBox.newToys[self.itemID] ~= nil) then
toyNewString:Show();
toyNewGlow:Show();
else
if not ToyBox.newToys[self.itemID] then
toyNewString:Hide();
toyNewGlow:Hide();
end
if (C_ToyBox.GetIsFavorite(itemID)) then
iconFavoriteTexture:Show();
else
iconFavoriteTexture:Hide();
toyNewString:Show();
toyNewGlow:Show();
end
if (PlayerHasToy(self.itemID)) then
iconTexture:Show();
iconTextureUncollected:Hide();
toyString:SetTextColor(1, 0.82, 0, 1);
toyString:SetShadowColor(0, 0, 0, 1);
slotFrameCollected:Show();
slotFrameUncollected:Hide();
slotFrameUncollectedInnerGlow:Hide();
if(ToyBox.firstCollectedToyID == 0) then
ToyBox.firstCollectedToyID = self.itemID;
iconTexture:SetTexture(icon);
iconTextureUncollected:SetTexture(icon);
iconTextureUncollected:SetDesaturated(true);
if not ToyBox.fanfareToys[itemID] then
if self.modelScene then
ToyBox.fanfarePool:Release(self.modelScene);
self.modelScene = nil;
end
if (ToyBox.firstCollectedToyID == self.itemID and not ToyBox.favoriteHelpBox:IsVisible() and not GetCVarBitfield("closedInfoFrames", LE_FRAME_TUTORIAL_TOYBOX_FAVORITE)) then
ToyBox.favoriteHelpBox:Show();
ToyBox.favoriteHelpBox:SetPoint("TOPLEFT", self, "BOTTOMLEFT", -5, -20);
if (PlayerHasToy(self.itemID)) then
iconTexture:Show();
iconTextureUncollected:Hide();
toyString:SetTextColor(1, 0.82, 0, 1);
toyString:SetShadowColor(0, 0, 0, 1);
slotFrameCollected:Show();
slotFrameUncollected:Hide();
slotFrameUncollectedInnerGlow:Hide();
if(ToyBox.firstCollectedToyID == 0) then
ToyBox.firstCollectedToyID = self.itemID;
end
if (ToyBox.firstCollectedToyID == self.itemID and not ToyBox.favoriteHelpBox:IsVisible() and not GetCVarBitfield("closedInfoFrames", LE_FRAME_TUTORIAL_TOYBOX_FAVORITE)) then
ToyBox.favoriteHelpBox:Show();
ToyBox.favoriteHelpBox:SetPoint("TOPLEFT", self, "BOTTOMLEFT", -5, -20);
end
else
iconTexture:Hide();
iconTextureUncollected:Show();
toyString:SetTextColor(0.33, 0.27, 0.20, 1);
toyString:SetShadowColor(0, 0, 0, 0.33);
slotFrameCollected:Hide();
slotFrameUncollected:Show();
slotFrameUncollectedInnerGlow:Show();
end
if (C_ToyBox.GetIsFavorite(itemID)) then
iconFavoriteTexture:Show();
else
iconFavoriteTexture:Hide();
end
CollectionsSpellButton_UpdateCooldown(self);
else
iconTexture:Hide();
iconTextureUncollected:Show();
toyString:SetTextColor(0.33, 0.27, 0.20, 1);
toyString:SetShadowColor(0, 0, 0, 0.33);
slotFrameCollected:Hide();
slotFrameUncollected:Show();
slotFrameUncollectedInnerGlow:Show();
-- we are presenting fanfare
if not self.modelScene then
self.modelScene = ToyBox.fanfarePool:Acquire();
self.modelScene:SetParent(self);
self.modelScene:ClearAllPoints();
self.modelScene:SetPoint("CENTER");
end
if self.modelScene then
iconTexture:Hide();
slotFrameCollected:Hide();
slotFrameUncollected:Hide();
iconTextureUncollected:Hide();
toyString:SetTextColor(1, 0.82, 0, 1);
self.cooldown:Hide();
self.HighlightTexture:Hide();
self.modelScene:TransitionToModelSceneID(TOY_FANFARE_MODEL_SCENE, CAMERA_TRANSITION_TYPE_IMMEDIATE, CAMERA_MODIFICATION_TYPE_MAINTAIN, true);
self.modelScene:PrepareForFanfare(true);
self.modelScene:Show();
end
end
CollectionsSpellButton_UpdateCooldown(self);
toyString:SetText(toyName);
toyString:Show();