Commit 7908f490 authored by TOM_RUS's avatar TOM_RUS
Browse files

WOW-29220patch8.1.5_PTR

parent d62c2821
......@@ -31,6 +31,7 @@ BattleNetDocumentation.lua
BattlePetDocumentation.lua
BlackMarketInfoDocumentation.lua
BrowserDocumentation.lua
CVarDocumentation.lua
CalendarDocumentation.lua
ChallengeModeInfoDocumentation.lua
ChatBubblesDocumentation.lua
......
local CVar =
{
Name = "CVarScripts",
Type = "System",
Namespace = "C_CVar",
Functions =
{
{
Name = "GetCVar",
Type = "Function",
Arguments =
{
{ Name = "name", Type = "string", Nilable = false },
},
Returns =
{
{ Name = "value", Type = "string", Nilable = true },
},
},
{
Name = "GetCVarBitfield",
Type = "Function",
Arguments =
{
{ Name = "name", Type = "string", Nilable = false },
{ Name = "index", Type = "number", Nilable = false },
},
Returns =
{
{ Name = "value", Type = "bool", Nilable = true },
},
},
{
Name = "GetCVarBool",
Type = "Function",
Arguments =
{
{ Name = "name", Type = "string", Nilable = false },
},
Returns =
{
{ Name = "value", Type = "bool", Nilable = true },
},
},
{
Name = "GetCVarDefault",
Type = "Function",
Arguments =
{
{ Name = "name", Type = "string", Nilable = false },
},
Returns =
{
{ Name = "defaultValue", Type = "string", Nilable = true },
},
},
{
Name = "RegisterCVar",
Type = "Function",
Arguments =
{
{ Name = "name", Type = "string", Nilable = false },
{ Name = "value", Type = "string", Nilable = true },
},
},
{
Name = "ResetTestCVars",
Type = "Function",
},
{
Name = "SetCVar",
Type = "Function",
Arguments =
{
{ Name = "name", Type = "string", Nilable = false },
{ Name = "value", Type = "string", Nilable = true },
{ Name = "scriptCVar", Type = "string", Nilable = true },
},
Returns =
{
{ Name = "success", Type = "bool", Nilable = false },
},
},
{
Name = "SetCVarBitfield",
Type = "Function",
Arguments =
{
{ Name = "name", Type = "string", Nilable = false },
{ Name = "index", Type = "number", Nilable = false },
{ Name = "value", Type = "bool", Nilable = false },
{ Name = "scriptCVar", Type = "string", Nilable = true },
},
Returns =
{
{ Name = "success", Type = "bool", Nilable = false },
},
},
},
Events =
{
},
Tables =
{
},
};
APIDocumentation:AddDocumentationTable(CVar);
\ No newline at end of file
......@@ -363,7 +363,7 @@ local Calendar =
Arguments =
{
{ Name = "eventIndex", Type = "number", Nilable = false },
{ Name = "inviteIndex", Type = "number", Nilable = false },
},
},
{
......
......@@ -304,6 +304,15 @@ local PvpInfo =
{ Name = "hasArenaSkirmishWinToday", Type = "bool", Nilable = false },
},
},
{
Name = "IsActiveBattlefield",
Type = "Function",
Returns =
{
{ Name = "isActiveBattlefield", Type = "bool", Nilable = false },
},
},
{
Name = "IsBattlegroundEnlistmentBonusActive",
Type = "Function",
......
......@@ -18,3 +18,8 @@ do
CreatePoolCollection = CreateFramePoolCollection;
PoolCollection = FramePoolCollectionMixin;
end
-- PVP changes
do
InActiveBattlefield = C_PvP.IsActiveBattlefield;
end
\ No newline at end of file
......@@ -229,8 +229,19 @@ function FullStoreCardMixin:GetTooltipOffsets()
return x, y, point, rpoint;
end
function FullStoreCardMixin:SetIconStyle(icon, overrideTexture, useSquareBorder)
function FullStoreCardMixin:ShouldShowIcon(entryInfo)
return StoreCardMixin.ShouldShowIcon(self, entryInfo) and entryInfo.sharedData.texture;
end
function FullStoreCardMixin:ShowIcon(displayData)
local icon = displayData.texture or self:GetDefaultIconName();
local shouldShow = displayData.itemID ~= nil;
self.InvisibleMouseOverFrame:SetShown(shouldShow);
self.Icon:ClearAllPoints();
local overrideTexture = displayData.overrideTexture;
local useSquareBorder = bit.band(displayData.flags, Enum.BattlepayDisplayFlag.UseSquareIconBorder) == Enum.BattlepayDisplayFlag.UseSquareIconBorder;
if overrideTexture then
self.IconBorder:Hide();
......@@ -274,10 +285,11 @@ function FullStoreCardMixin:SetIconStyle(icon, overrideTexture, useSquareBorder)
self.IconBorder:SetTexCoord(0.55957031, 0.79589844, 0.26269531, 0.51660156);
self.IconBorder:SetSize(242, 260);
self.IconBorder:SetPoint("TOPLEFT", 4, -4);
end
end
self.IconBorder:Show();
end
self.Icon:Show();
if self.GlowSpin and not overrideTexture then
self.GlowSpin.SpinAnim:Play();
self.GlowSpin:Show();
......@@ -295,12 +307,6 @@ function FullStoreCardMixin:SetIconStyle(icon, overrideTexture, useSquareBorder)
end
end
function FullStoreCardMixin:ShowIcon(displayData)
StoreCardMixin.ShowIcon(self, displayData);
local shouldShow = displayData.itemID ~= nil;
self.InvisibleMouseOverFrame:SetShown(shouldShow);
end
function FullStoreCardMixin:Layout()
self:SetSize(576, 471);
......
......@@ -154,6 +154,43 @@ function VerticalLargeStoreCardMixin:UpdateState()
-- we override the StoreCardMixin:UpdateState here to prevent "selected" functionality in LargeCards
end
function VerticalLargeStoreCardMixin:ShouldShowIcon(entryInfo)
return StoreCardMixin.ShouldShowIcon(self, entryInfo) and not entryInfo.sharedData.overrideBackground;
end
function VerticalLargeStoreCardMixin:SetupDescription(entryInfo)
local description = entryInfo.sharedData.description;
if entryInfo.sharedData.productDecorator == Enum.BattlepayProductDecorator.WoWToken then
description = BLIZZARD_STORE_TOKEN_DESC_30_DAYS;
end
local baseDescription, bullets = description:match("(.-)$bullet(.*)");
if not bullets then
self.Description:SetText(description);
else
local bulletPoints = {};
while bullets ~= nil and bullets ~= "" do
local bullet = bullets:match("(.-)$bullet") or bullets;
bullet = strtrim(bullet, "\n\r");
bullets = bullets:match("$bullet(.*)");
table.insert(bulletPoints, bullet);
end
self.Description:SetJustifyH("LEFT");
if baseDescription ~= "" then
self.Description:SetText(strtrim(baseDescription, "\n\r"));
self.Description:Show();
self.DescriptionBulletPointContainer:SetPoint("TOP", self.Description, "BOTTOM", 0, -3);
else
self.Description:Hide();
self.DescriptionBulletPointContainer:SetPoint("TOP", self.Description, "TOP");
end
self.DescriptionBulletPointContainer:SetContents(bulletPoints);
end
end
function VerticalLargeStoreCardMixin:Layout()
self:SetSize(286, 471);
self.Card:ClearAllPoints();
......
......@@ -67,6 +67,7 @@ local BATTLEPAY_SPLASH_BANNER_TEXT_NEW = 2;
local SEE_YOU_LATER_BUNDLE_PRODUCT_ID = 488;
local DEFAULT_ICON_NAME = "Interface\\Icons\\INV_Misc_Note_02";
--------------------------------------------------
-- DEFAULT STORE CARD MIXIN
StoreCardMixin = {};
......@@ -306,7 +307,33 @@ end
function StoreCardMixin:SetStyle(overrideBackground)
end
function StoreCardMixin:SetIconStyle(icon, overrideTexture, useSquareBorder)
function StoreCardMixin:ShouldShowIcon(entryInfo)
local showAnyModel = self:ShouldShowModel(entryInfo);
local tryToShowTexture = not showAnyModel or bit.band(entryInfo.sharedData.flags, Enum.BattlepayDisplayFlag.CardAlwaysShowsTexture) == Enum.BattlepayDisplayFlag.CardAlwaysShowsTexture;
return tryToShowTexture;
end
function StoreCardMixin:ShouldShowModel(entryInfo)
local hasAnyCard = #entryInfo.sharedData.cards > 0;
local allowShowingModel = bit.band(entryInfo.sharedData.flags, Enum.BattlepayDisplayFlag.CardDoesNotShowModel) ~= Enum.BattlepayDisplayFlag.CardDoesNotShowModel;
local showAnyModel = allowShowingModel and hasAnyCard;
return showAnyModel;
end
function StoreCardMixin:GetDefaultIconName()
return DEFAULT_ICON_NAME;
end
function StoreCardMixin:ShowIcon(displayData)
local icon = displayData.texture or self:GetDefaultIconName();
local overrideTexture = displayData.overrideTexture;
local useSquareBorder = bit.band(displayData.flags, Enum.BattlepayDisplayFlag.UseSquareIconBorder) == Enum.BattlepayDisplayFlag.UseSquareIconBorder;
self.IconBorder:Show();
self.Icon:Show();
self.Icon:ClearAllPoints();
self.Icon:SetPoint("CENTER", self, "TOP", 0, -69);
......@@ -351,19 +378,6 @@ function StoreCardMixin:SetIconStyle(icon, overrideTexture, useSquareBorder)
end
end
function StoreCardMixin:ShowIcon(displayData)
local icon = displayData.texture or "Interface\\Icons\\INV_Misc_Note_02";
local itemID = displayData.itemID;
local overrideTexture = displayData.overrideTexture;
local useSquareBorder = bit.band(displayData.flags, Enum.BattlepayDisplayFlag.UseSquareIconBorder) == Enum.BattlepayDisplayFlag.UseSquareIconBorder;
self.IconBorder:Show();
self.Icon:Show();
self:SetIconStyle(icon, overrideTexture, useSquareBorder)
end
function StoreCardMixin:HideIcon()
self.Icon:Hide();
self.IconBorder:Hide();
......@@ -455,23 +469,18 @@ function StoreCardMixin:UpdateCard(entryID, forceModelUpdate)
self:SetupDescription(entryInfo);
self.Magnifier:Hide();
local hasAnyCard = #entryInfo.sharedData.cards > 0;
local allowShowingModel = bit.band(entryInfo.sharedData.flags, Enum.BattlepayDisplayFlag.CardDoesNotShowModel) ~= Enum.BattlepayDisplayFlag.CardDoesNotShowModel;
local showAnyModel = allowShowingModel and hasAnyCard;
local tryToShowTexture = not showAnyModel or bit.band(entryInfo.sharedData.flags, Enum.BattlepayDisplayFlag.CardAlwaysShowsTexture) == Enum.BattlepayDisplayFlag.CardAlwaysShowsTexture;
if showAnyModel then
if self:ShouldShowModel(entryInfo) then
local showShadows = self:ShouldModelShowShadows();
StoreProductCard_ShowModel(self, entryInfo, showShadows, forceModelUpdate);
else
StoreProductCard_HideModel(self);
end
if tryToShowTexture then
if self:ShouldShowIcon(entryInfo) then
self:ShowIcon(entryInfo.sharedData);
else
self:HideIcon();
end
end
self:SetID(entryID);
self:UpdateState();
......
......@@ -195,10 +195,10 @@ function MediumStoreCardMixin:SetDiscountText(discountPercentage)
self.DiscountText:SetText(BLIZZARD_STORE_BUNDLE_DISCOUNT_BANNER:format(discountPercentage));
end
function MediumStoreCardMixin:SetIconStyle(icon, overrideTexture, useSquareBorder)
StoreCardMixin.SetIconStyle(self, icon, overrideTexture, useSquareBorder);
function MediumStoreCardMixin:ShowIcon(displayData)
StoreCardMixin.ShowIcon(self, displayData)
if overrideTexture then
if displayData.overrideTexture then
self.Icon:ClearAllPoints();
self.Icon:SetPoint("TOPLEFT", self, "TOPLEFT");
end
......
......@@ -3774,10 +3774,10 @@ end
------------------------------------
function VASCharacterSelectionRealmSelector_Callback(value)
SelectedRealm = value;
SelectedCharacter = nil;
UpdateCharacterList();
SelectedCharacter = nil;
RealmAutoCompleteList = nil;
DestinationRealmMapping = {};
local frame = StoreVASValidationFrame.CharacterSelectionFrame;
......
......@@ -162,9 +162,9 @@ function TradeSkillDetailsMixin:RefreshDisplay()
self.Contents.Description:SetText("");
self.Contents.RequirementLabel:SetPoint("TOPLEFT", self.Contents.Description, "BOTTOMLEFT", 0, 0);
local spell = Spell:CreateFromSpellID(self.selectedRecipeID);
self.spellDataLoadedCancelFunc = spell:ContinueWithCancelOnSpellLoad(function()
local recipeDescription = C_TradeSkillUI.GetRecipeDescription(spell:GetSpellID());
local baseSpell = Spell:CreateFromSpellID(TradeSkillFrame_GetBaseRecipeID(self.selectedRecipeID));
self.spellDataLoadedCancelFunc = baseSpell:ContinueWithCancelOnSpellLoad(function()
local recipeDescription = C_TradeSkillUI.GetRecipeDescription(baseSpell:GetSpellID());
if recipeDescription and #recipeDescription > 0 then
self.Contents.Description:SetText(recipeDescription);
self.Contents.RequirementLabel:SetPoint("TOPLEFT", self.Contents.Description, "BOTTOMLEFT", 0, -18);
......
......@@ -87,4 +87,12 @@ function TradeSkillFrame_AreAllSourcesUnfiltered()
end
end
return true;
end
function TradeSkillFrame_GetBaseRecipeID(recipeID)
local info = C_TradeSkillUI.GetRecipeInfo(recipeID);
while info and info.previousRecipeID do
info = C_TradeSkillUI.GetRecipeInfo(info.previousRecipeID);
end
return info and info.recipeID or recipeID;
end
\ No newline at end of file
......@@ -1149,7 +1149,10 @@
</Binding>
<!-- Debug function key bindings -->
<Binding name="TOGGLESTATS" hidden="true" debug="true" category="BINDING_HEADER_DEBUG">
<Binding name="RELOADUI" hidden="true" debug="true" category="BINDING_HEADER_DEBUG">
ReloadUI();
</Binding>
<Binding name="TOGGLESTATS" hidden="true" debug="true" category="BINDING_HEADER_DEBUG">
ToggleStats();
</Binding>
<Binding name="TOGGLETRIS" hidden="true" debug="true" category="BINDING_HEADER_DEBUG">
......
......@@ -5,7 +5,7 @@ function HonorBarMixin:GetPriority()
end
function HonorBarMixin:ShouldBeVisible()
return IsWatchingHonorAsXP() or InActiveBattlefield() or IsInActiveWorldPVP();
return IsWatchingHonorAsXP() or C_PvP.IsActiveBattlefield() or IsInActiveWorldPVP();
end
function HonorBarMixin:Update()
......
......@@ -610,6 +610,11 @@ end
function BonusRollFrame_StartBonusRoll(spellID, text, duration, currencyID, currencyCost, difficultyID)
local frame = BonusRollFrame;
if ( frame:IsShown() and frame.spellID == spellID ) then
return;
end
-- No valid currency data--use the fall back.
if ( currencyID == 0 ) then
currencyID = BONUS_ROLL_REQUIRED_CURRENCY;
......
......@@ -227,13 +227,7 @@ function UpdateMicroButtons()
StoreMicroButton:Show();
HelpMicroButton:Hide();
if ( IsVeteranTrialAccount() ) then
StoreMicroButton.disabledTooltip = ERR_RESTRICTED_ACCOUNT_TRIAL;
StoreMicroButton:Disable();
elseif ( IsTrialAccount() ) then
StoreMicroButton.disabledTooltip = ERR_RESTRICTED_ACCOUNT_TRIAL;
StoreMicroButton:Disable();
elseif ( C_StorePublic.IsDisabledByParentalControls() ) then
if ( C_StorePublic.IsDisabledByParentalControls() ) then
StoreMicroButton.disabledTooltip = BLIZZARD_STORE_ERROR_PARENTAL_CONTROLS;
StoreMicroButton:Disable();
elseif ( IsKioskModeEnabled() ) then
......
......@@ -104,10 +104,10 @@ function OverrideActionBar_UpdateSkin()
-- For now, a vehicle has precedence over override bars (hopefully designers make it so these never conflict)
if ( HasVehicleActionBar() ) then
OverrideActionBar_Setup(UnitVehicleSkin("player"), GetVehicleBarIndex());
OverrideActionBar_UpdateMicroButtons();
else
OverrideActionBar_Setup(GetOverrideBarSkin(), GetOverrideBarIndex());
end
OverrideActionBar_UpdateMicroButtons();
end
function OverrideActionBar_SetSkin(skin)
......
......@@ -21,7 +21,6 @@ function PetStable_OnLoad(self)
-- Set portrait
PortraitFrameTemplate_SetPortraitToAsset(self, "Interface\\Icons\\ability_physical_taunt");
PortraitFrameTemplate_SetTitleFormatted(self, PET_STABLE_TITLE, UnitName("player"));
ButtonFrameTemplate_HideButtonBar(self);
self.Inset:ClearAllPoints();
self.Inset:SetPoint("TOPLEFT", 91, PANEL_INSET_TOP_OFFSET-2);
......@@ -140,6 +139,8 @@ function PetStable_GetPetSlot(buttonID, active)
end
function PetStable_Update(updateModel)
PortraitFrameTemplate_SetTitleFormatted(PetStableFrame, PET_STABLE_TITLE, UnitName("player"));
-- So warlock pets don't show
local hasPetUI, isHunterPet = HasPetUI();
if ( UnitExists("pet") and hasPetUI and not isHunterPet ) then
......
......@@ -281,7 +281,13 @@ function QuestFrameProgressItems_Update()
QuestProgressScrollFrameScrollBar:SetValue(0);
end
function QuestFrameGreetingPanel_OnLoad(self)
self.titleButtonPool = CreateFramePool("BUTTON", self, "QuestTitleButtonTemplate");
end
function QuestFrameGreetingPanel_OnShow()
QuestFrameGreetingPanel.titleButtonPool:ReleaseAll();
QuestFrameRewardPanel:Hide();
QuestFrameProgressPanel:Hide();
QuestFrameDetailPanel:Hide();
......@@ -300,34 +306,37 @@ function QuestFrameGreetingPanel_OnShow()
else
CurrentQuestsText:SetPoint("TOPLEFT", "GreetingText", "BOTTOMLEFT", 0, -10);
CurrentQuestsText:Show();
QuestTitleButton1:SetPoint("TOPLEFT", "CurrentQuestsText", "BOTTOMLEFT", -10, -5);
local lastTitleButton = nil;
for i=1, numActiveQuests do
local questTitleButton = _G["QuestTitleButton"..i];
local questTitleButtonIcon = _G[questTitleButton:GetName() .. "QuestIcon"];
local questTitleButton = QuestFrameGreetingPanel.titleButtonPool:Acquire();
local title, isComplete = GetActiveTitle(i);
if ( IsActiveQuestTrivial(i) ) then
questTitleButton:SetFormattedText(TRIVIAL_QUEST_DISPLAY, title);
questTitleButtonIcon:SetVertexColor(0.75,0.75,0.75);
questTitleButton.Icon:SetVertexColor(0.75,0.75,0.75);
else
questTitleButton:SetFormattedText(NORMAL_QUEST_DISPLAY, title);
questTitleButtonIcon:SetVertexColor(1,1,1);
questTitleButton.Icon:SetVertexColor(1,1,1);
end
if ( isComplete ) then
if ( IsActiveQuestLegendary(i) ) then
questTitleButtonIcon:SetTexture("Interface\\GossipFrame\\ActiveLegendaryQuestIcon");
questTitleButton.Icon:SetTexture("Interface\\GossipFrame\\ActiveLegendaryQuestIcon");
else
questTitleButtonIcon:SetTexture("Interface\\GossipFrame\\ActiveQuestIcon");
questTitleButton.Icon:SetTexture("Interface\\GossipFrame\\ActiveQuestIcon");
end
else
questTitleButtonIcon:SetTexture("Interface\\GossipFrame\\IncompleteQuestIcon");
questTitleButton.Icon:SetTexture("Interface\\GossipFrame\\IncompleteQuestIcon");
end
questTitleButton:SetHeight(questTitleButton:GetTextHeight() + 2);
questTitleButton:SetID(i);
questTitleButton.isActive = 1;
questTitleButton:Show();
if ( i > 1 ) then
questTitleButton:SetPoint("TOPLEFT", "QuestTitleButton"..(i-1),"BOTTOMLEFT", 0, -2)
if ( lastTitleButton ) then
questTitleButton:SetPoint("TOPLEFT", lastTitleButton,"BOTTOMLEFT", 0, -2);
else
questTitleButton:SetPoint("TOPLEFT", "CurrentQuestsText", "BOTTOMLEFT", -10, -5);
end
questTitleButton:Show();
lastTitleButton = questTitleButton;
end
end
if ( numAvailableQuests == 0 ) then
......@@ -342,39 +351,39 @@ function QuestFrameGreetingPanel_OnShow()
AvailableQuestsText:SetPoint("TOPLEFT", "GreetingText", "BOTTOMLEFT", 0, -10);
end
AvailableQuestsText:Show();
_G["QuestTitleButton"..(numActiveQuests + 1)]:SetPoint("TOPLEFT", "AvailableQuestsText", "BOTTOMLEFT", -10, -5);
local lastTitleButton = nil;
for i=(numActiveQuests + 1), (numActiveQuests + numAvailableQuests) do
local questTitleButton = _G["QuestTitleButton"..i];
local questTitleButtonIcon = _G[questTitleButton:GetName() .. "QuestIcon"];
local questTitleButton = QuestFrameGreetingPanel.titleButtonPool:Acquire();
local isTrivial, frequency, isRepeatable, isLegendary = GetAvailableQuestInfo(i - numActiveQuests);
if ( isLegendary ) then
questTitleButtonIcon:SetTexture("Interface\\GossipFrame\\AvailableLegendaryQuestIcon");
questTitleButton.Icon:SetTexture("Interface\\GossipFrame\\AvailableLegendaryQuestIcon");
elseif ( frequency == LE_QUEST_FREQUENCY_DAILY or frequency == LE_QUEST_FREQUENCY_WEEKLY ) then
questTitleButtonIcon:SetTexture("Interface\\GossipFrame\\DailyQuestIcon");
questTitleButton.Icon:SetTexture("Interface\\GossipFrame\\DailyQuestIcon");
elseif ( isRepeatable ) then
questTitleButtonIcon:SetTexture("Interface\\GossipFrame\\DailyActiveQuestIcon");
questTitleButton.Icon:SetTexture("Interface\\GossipFrame\\DailyActiveQuestIcon");
else
questTitleButtonIcon:SetTexture("Interface\\GossipFrame\\AvailableQuestIcon");
questTitleButton.Icon:SetTexture("Interface\\GossipFrame\\AvailableQuestIcon");
end