Commit b1584f7d authored by TOM_RUS's avatar TOM_RUS

WOW-32712patch8.3.0_PTR

parent 727a78bf
......@@ -745,10 +745,6 @@ local PvpInfo =
Name = "PostMatchItemRewardUpdate",
Type = "Event",
LiteralName = "POST_MATCH_ITEM_REWARD_UPDATE",
Payload =
{
{ Name = "reward", Type = "PVPPostMatchItemReward", Nilable = false },
},
},
{
Name = "PvpBrawlInfoUpdated",
......
......@@ -162,10 +162,10 @@ function AuctionHouseBuyDialogMixin:SetState(buyState)
local buyNowEnabled = false;
local okayShown = false;
local notificationText = nil;
local notificationFontObject = Number13FontYellow;
local notificationFontObject = GameFontNormal;
local showNotificationIcon = false;
local notificationAnchor = { "CENTER" };
local dialogHeight = 95;
local dialogHeight = 100;
if buyState == BuyState.WaitingForQuote then
itemDisplayShown = true;
buyNowShown = true;
......@@ -183,9 +183,9 @@ function AuctionHouseBuyDialogMixin:SetState(buyState)
notificationAnchor = { "BOTTOM", self.OkayButton, "TOP", 0, 13 };
elseif buyState == BuyState.PriceUnavailable then
okayShown = true;
dialogHeight = 80;
dialogHeight = 85;
notificationText = AUCTION_HOUSE_DIALOG_PRICE_UNAVAILABLE;
notificationFontObject = Number13FontWhite;
notificationFontObject = GameFontNormal;
local topOffset = 20;
local bottomOffset = self.OkayButton:GetTop() - self:GetBottom();
......
......@@ -68,7 +68,7 @@
</Anchors>
<Layers>
<Layer level="OVERLAY">
<FontString parentKey="ItemText" inherits="Number13FontWhite" justifyH="CENTER">
<FontString parentKey="ItemText" inherits="Number15FontWhite" justifyH="CENTER">
<Anchors>
<Anchor point="TOP"/>
</Anchors>
......
......@@ -269,7 +269,7 @@ function AuctionHouseItemSellFrameMixin:UpdatePostState()
AuctionHouseSellFrameMixin.UpdatePostState(self);
local bidPrice, buyoutPrice = self:GetPrice();
if bidPrice and buyoutPrice and buyoutPrice < bidPrice then
if bidPrice and buyoutPrice and buyoutPrice <= bidPrice then
self.PriceInput:SetLabelColor(RED_FONT_COLOR);
self.PriceInput:SetErrorShown(true);
else
......@@ -327,7 +327,7 @@ function AuctionHouseItemSellFrameMixin:CanPostItem()
return false, AUCTION_HOUSE_SELL_FRAME_ERROR_PRICE;
end
if bidPrice and buyoutPrice and buyoutPrice < bidPrice then
if bidPrice and buyoutPrice and buyoutPrice <= bidPrice then
return false, AUCTION_HOUSE_SELL_FRAME_ERROR_BUYOUT;
end
......
......@@ -189,9 +189,7 @@ function AuctionHouseTableCellFavoriteMixin:OnEvent()
end
function AuctionHouseTableCellFavoriteMixin:OnLineEnter()
if C_AuctionHouse.CanSetFavorite() then
self.FavoriteButton:LockTexture();
end
self.FavoriteButton:LockTexture();
end
function AuctionHouseTableCellFavoriteMixin:OnLineLeave()
......@@ -214,13 +212,22 @@ function AuctionHouseTableCellFavoriteButtonMixin:OnClick()
end
function AuctionHouseTableCellFavoriteButtonMixin:OnEnter()
self.HighlightTexture:SetAlpha(C_AuctionHouse.CanSetFavorite() and 1.0 or 0);
if not C_AuctionHouse.CanSetFavorite() then
self:LockTexture();
local row = self:GetParent():GetParent();
ExecuteFrameScript(row, "OnEnter");
GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
GameTooltip_AddErrorLine(GameTooltip, AUCTION_HOUSE_FAVORITES_MAXED_TOOLTIP);
GameTooltip:Show();
else
local row = self:GetParent():GetParent();
ExecuteFrameScript(row, "OnEnter");
end
end
function AuctionHouseTableCellFavoriteButtonMixin:OnLeave()
GameTooltip_Hide();
self:UnlockTexture();
local row = self:GetParent():GetParent();
ExecuteFrameScript(row, "OnLeave");
end
......@@ -238,7 +245,6 @@ function AuctionHouseTableCellFavoriteButtonMixin:SetFavoriteState(isFavorite)
local defaultTexture = self.textureLocked and "auctionhouse-icon-favorite-off" or nil;
self.NormalTexture:SetAtlas(isFavorite and "auctionhouse-icon-favorite" or defaultTexture);
self.HighlightTexture:SetAtlas(isFavorite and "auctionhouse-icon-favorite" or "auctionhouse-icon-favorite-off");
self.HighlightTexture:SetBlendMode(isFavorite and "ADD" or "ADD");
self.HighlightTexture:SetAlpha(isFavorite and 0.2 or 0.4);
end
......@@ -560,7 +566,6 @@ function AuctionHouseTableCellItemDisplayMixin:UpdateDisplay(itemKey, itemKeyInf
self.Icon:Show();
local noneAvailable = self.rowData.totalQuantity == 0;
self.Text:SetAlpha(noneAvailable and 0.5 or 1.0);
self.Icon:SetAlpha(noneAvailable and 0.5 or 1.0);
end
......@@ -902,7 +907,7 @@ function AuctionHouseTableBuilder.GetItemBuyListLayout(owner, itemList)
tableBuilder:AddFillColumn(owner, 0, 1.0, STANDARD_PADDING, 0, nil, "AuctionHouseTableCellItemQuantityLeftTemplate");
tableBuilder:AddFixedWidthColumn(owner, 0, 24, 0, 0, nil, "AuctionHouseTableCellExtraInfoTemplate");
tableBuilder:AddFixedWidthColumn(owner, 0, 100, STANDARD_PADDING, STANDARD_PADDING, nil, "AuctionHouseTableCellOwnersTemplate");
tableBuilder:AddFixedWidthColumn(owner, 0, 100, STANDARD_PADDING, STANDARD_PADDING, nil, "AuctionHouseTableCellTimeLeftBandTemplate");
end
return LayoutItemBuyListTableBuilder;
......@@ -935,4 +940,4 @@ function AuctionHouseTableBuilder.GetItemSellListLayout(owner, itemList, isEquip
end
return LayoutItemSellListTableBuilder;
end
end
\ No newline at end of file
......@@ -81,7 +81,7 @@
<OnLeave method="OnLeave"/>
</Scripts>
<NormalTexture parentKey="NormalTexture" atlas="auctionhouse-icon-favorite"/>
<HighlightTexture parentKey="HighlightTexture" atlas="auctionhouse-icon-favorite-off"/>
<HighlightTexture parentKey="HighlightTexture" atlas="auctionhouse-icon-favorite-off" alphaMode="ADD"/>
</Button>
</Frames>
<Scripts>
......
......@@ -71,15 +71,15 @@ local AZERITE_ESSENCE_FRAME_EVENTS = {
local MILESTONE_LOCATIONS = {
[1] = { left = 238, top = -235 },
[2] = { left = 110, top = -292 },
[2] = { left = 101, top = -270 },
[3] = { left = 155, top = -349 },
[4] = { left = 237, top = -375 },
[5] = { left = 321, top = -349 },
[6] = { left = 372, top = -277 },
[7] = { left = 372, top = -191 },
[8] = { left = 322, top = -121 },
[9] = { left = 238, top = -92 },
[10] = { left = 156, top = -121 },
[4] = { left = 247, top = -375 },
[5] = { left = 336, top = -337 },
[6] = { left = 377, top = -250 },
[7] = { left = 356, top = -156 },
[8] = { left = 278, top = -99 },
[9] = { left = 179, top = -106 },
[10] = { left = 111, top = -174 },
[11] = { left = 103, top = -191 },
};
......
......@@ -216,7 +216,7 @@ function WardrobeTransmogFrame_UpdateSlotButton(slotButton)
slotButton.NoItemTexture:Hide();
else
local tag = TRANSMOG_INVALID_CODES[cannotTransmogrifyReason];
if ( tag == "NO_ITEM" or tag == "INVALID_SLOT_FOR_RACE") then
if ( tag == "NO_ITEM" or tag == "SLOT_FOR_RACE") then
slotButton.Icon:SetTexture(defaultTexture);
else
slotButton.Icon:SetTexture(texture);
......@@ -335,12 +335,6 @@ function WardrobeTransmogFrame_UpdateWeaponModel(slot)
-- check existing equipped on model. we don't want to update it if the same because the hand will open/close.
local existingAppearanceSourceID, existingIllustionSourceID = actor:GetSlotTransmogSources(slotID);
if ( existingAppearanceSourceID ~= appearanceSourceID or existingIllustionSourceID ~= illusionSourceID ) then
-- don't specify a slot when applying or removing ranged weapons because of bows
local categoryID = C_TransmogCollection.GetAppearanceSourceInfo(appearanceSourceID);
local existingCategoryID = C_TransmogCollection.GetAppearanceSourceInfo(existingAppearanceSourceID);
if ( WardrobeUtils_IsCategoryRanged(categoryID) or WardrobeUtils_IsCategoryRanged(existingCategoryID) ) then
slot = nil;
end
if slot and ( WardrobeTransmogFrame.ModelScene.creatureDisplayID == nil ) then
actor:TryOn(appearanceSourceID, slot, illusionSourceID);
end
......@@ -742,6 +736,10 @@ local SET_MODEL_PAN_AND_ZOOM_LIMITS = {
["KulTiran3"] = { maxZoom = 2.22368383407593, panMaxLeft = -0.43183308839798, panMaxRight = 0.445900857448578, panMaxTop = -0.303212702274323, panMaxBottom = -2.49550628662109 },
["ZandalariTroll2"] = { maxZoom = 2.1710512638092, panMaxLeft = -0.487841755151749, panMaxRight = 0.561356604099274, panMaxTop = -0.385127544403076, panMaxBottom = -2.78562784194946 },
["ZandalariTroll3"] = { maxZoom = 3.32894563674927, panMaxLeft = -0.376705944538116, panMaxRight = 0.488780438899994, panMaxTop = -0.20890490710735, panMaxBottom = -2.67064166069031 },
["Mechagnome3"] = { maxZoom = 2.9605259895325, panMaxLeft = -0.29900181293488, panMaxRight = 0.35779395699501, panMaxTop = -0.076380833983421, panMaxBottom = -0.99909907579422 },
["Mechagnome2"] = { maxZoom = 2.8552639484406, panMaxLeft = -0.2777853012085, panMaxRight = 0.29651582241058, panMaxTop = -0.095201380550861, panMaxBottom = -1.0263166427612 },
["Vulpera2"] = { maxZoom = 2.4605259895325, panMaxLeft = -0.31328883767128, panMaxRight = 0.39014467597008, panMaxTop = -0.089733943343162, panMaxBottom = -1.3402827978134 },
["Vulpera3"] = { maxZoom = 2.9605259895325, panMaxLeft = -0.26144406199455, panMaxRight = 0.30945864319801, panMaxTop = -0.07625275105238, panMaxBottom = -1.2928194999695 },
};
function WardrobeCollectionFrame_SetContainer(parent)
......
local GUILD_CARDS_PER_PAGE = 3;
local LOAD_PAGES_IN_ADVANCE = 1;
local REQUEST_GUILD_CARDS_NUM = 21;
local REQUEST_GUILD_CARDS_NUM = 21;
local REQUEST_TO_JOIN_HEIGHT = 420;
local REQUEST_TO_JOIN_TEXT_HEIGHT = 14;
local MAX_DESCRIPTION_HEIGHT = 150;
......@@ -335,7 +335,7 @@ function ClubFinderRequestToJoinMixin:Initialize()
self:SetHeight((REQUEST_TO_JOIN_HEIGHT + extraFrameHeight) - (extraHeight));
self.ClubDescription:ClearAllPoints();
self.ClubDescription:SetPoint("BOTTOM", self.ClubName, "BOTTOM", 0, -usedHeight);
self.ClubDescription:SetPoint("BOTTOM", self.ClubName, "BOTTOM", 0, -(usedHeight + 2));
self.MessageFrame:ClearAllPoints();
self.MessageFrame:SetPoint("BOTTOM", self.ClubDescription, "BOTTOM", 0, -85);
......@@ -1741,11 +1741,11 @@ function ClubFinderGuildCardsBaseMixin:RefreshLayout(cardPage)
end
else
if (self.requestedPage and not self.newRequest) then
self:SetSearchingState();
else
self:SetSearchingState();
else
self.PreviousPage:Hide();
self.NextPage:Hide();
end
end
end
if(cardPage <= 1) then
......
......@@ -559,7 +559,7 @@
<FontString parentKey="ClubName" inherits="GameFontGreen">
<Size x="300" y="0"/>
<Anchors>
<Anchor point="BOTTOM" relativeKey="$parent.DialogLabel" relativePoint="BOTTOM" x="0" y="-15" />
<Anchor point="TOP" relativeKey="$parent.DialogLabel" relativePoint="BOTTOM" x="0" y="-6" />
</Anchors>
</FontString>
<FontString parentKey="ClubDescription" wordwrap="true" inherits="GameFontNormal">
......
......@@ -49,3 +49,30 @@ do
end
end
end
-- Deprecated a bunch of ContainerFrame global constants that don't need to be global
-- Addon developers: if you need these, make local versions of them
do
MAX_CONTAINER_ITEMS = 36;
NUM_CONTAINER_COLUMNS = 4;
ROWS_IN_BG_TEXTURE = 6;
MAX_BG_TEXTURES = 2;
BG_TEXTURE_HEIGHT = 512;
CONTAINER_WIDTH = 192;
CONTAINER_SPACING = 0;
VISIBLE_CONTAINER_SPACING = 3;
MINIMUM_CONTAINER_OFFSET_X = 10;
CONTAINER_SCALE = 0.75;
BACKPACK_MONEY_OFFSET_DEFAULT = -231;
BACKPACK_MONEY_HEIGHT_OFFSET_PER_EXTRA_ROW = 41;
BACKPACK_BASE_HEIGHT = 255;
BACKPACK_HEIGHT_OFFSET_PER_EXTRA_ROW = 43;
BACKPACK_DEFAULT_TOPHEIGHT = 255;
BACKPACK_EXTENDED_TOPHEIGHT = 226;
BACKPACK_BASE_SIZE = 16;
FIRST_BACKPACK_BUTTON_OFFSET_BASE = -225;
FIRST_BACKPACK_BUTTON_OFFSET_PER_EXTRA_ROW = 41;
CONTAINER_BOTTOM_TEXTURE_DEFAULT_HEIGHT = 10;
CONTAINER_BOTTOM_TEXTURE_DEFAULT_TOP_COORD = 0.330078125;
CONTAINER_BOTTOM_TEXTURE_DEFAULT_BOTTOM_COORD = 0.349609375;
end
......@@ -18,22 +18,6 @@ local function OnTalentButtonReleased(pool, button)
button:OnReleased()
end
StaticPopupDialogs["ORDER_HALL_TALENT_RESEARCH"] = {
text = "%s";
button1 = ACCEPT,
button2 = CANCEL,
OnAccept = function(self)
PlaySound(SOUNDKIT.UI_ORDERHALL_TALENT_SELECT, nil, SOUNDKIT_ALLOW_DUPLICATES);
C_Garrison.ResearchTalent(self.data.id, self.data.rank);
if (not self.data.hasTime) then
self.data.button:GetParent():SetResearchingTalentID(self.data.id);
end
end,
timeout = 0,
exclusive = 1,
hideOnEscape = 1
};
local CHOICE_BACKGROUND_OFFSET_Y = 10;
local BACKGROUND_WITH_INSET_OFFSET_Y = 0;
local BACKGROUND_NO_INSET_OFFSET_Y = 44;
......@@ -55,6 +39,8 @@ TalentTreeLayoutOptions[Enum.GarrTalentTreeType.Tiers] = {
minimumWidth = 336,
canHaveBackButton = true,
singleCost = false,
researchSoundStandard = SOUNDKIT.UI_ORDERHALL_TALENT_SELECT,
researchSoundMajor = SOUNDKIT.UI_ORDERHALL_TALENT_SELECT,
};
TalentTreeLayoutOptions[Enum.GarrTalentTreeType.Classic] = {
......@@ -68,6 +54,41 @@ TalentTreeLayoutOptions[Enum.GarrTalentTreeType.Classic] = {
minimumWidth = 336,
canHaveBackButton = false,
singleCost = true,
researchSoundStandard = SOUNDKIT.UI_ORDERHALL_TITAN_MINOR_TALENT_SELECT,
researchSoundMajor = SOUNDKIT.UI_ORDERHALL_TITAN_MAJOR_TALENT_SELECT,
};
local function GetResearchSoundForTalentType(talentType)
local garrTalentTreeID = C_Garrison.GetCurrentGarrTalentTreeID();
if garrTalentTreeID then
local talentTreeType = C_Garrison.GetGarrisonTalentTreeType(garrTalentTreeID);
local layoutOptions = TalentTreeLayoutOptions[talentTreeType];
if layoutOptions then
if talentType == Enum.GarrTalentType.Major then
return layoutOptions.researchSoundMajor;
else
return layoutOptions.researchSoundStandard;
end
end
end
return SOUNDKIT.UI_ORDERHALL_TALENT_SELECT;
end
StaticPopupDialogs["ORDER_HALL_TALENT_RESEARCH"] = {
text = "%s";
button1 = ACCEPT,
button2 = CANCEL,
OnAccept = function(self)
local soundKitID = GetResearchSoundForTalentType(self.data.talentType);
PlaySound(soundKitID, nil, SOUNDKIT_ALLOW_DUPLICATES);
C_Garrison.ResearchTalent(self.data.id, self.data.rank);
if (not self.data.hasTime) then
self.data.button:GetParent():SetResearchingTalentID(self.data.id);
end
end,
timeout = 0,
exclusive = 1,
hideOnEscape = 1
};
OrderHallTalentFrameMixin = { }
......@@ -489,10 +510,7 @@ function OrderHallTalentFrameMixin:RefreshAllData()
local shouldDisplayAsAvailable = canDisplayAsAvailable and talent.hasInstantResearch;
-- Show as available: this is a new tier which you don't have any talents from or and old tier that you could change.
-- Note: For instant talents, to support the Chromie UI, we display as available even when another talent is researching (Jeff wants it this way).
if (isAvailable) then
borderAtlas = BORDER_ATLAS_AVAILABLE;
elseif (shouldDisplayAsAvailable) then
if (isAvailable or shouldDisplayAsAvailable) then
if ( currentTierResearchableTalentCount < currentTierTotalTalentCount and talentTreeType == Enum.GarrTalentTreeType.Tiers ) then
talentFrame.AlphaIconOverlay:Show();
talentFrame.AlphaIconOverlay:SetAlpha(0.5);
......@@ -743,9 +761,10 @@ function GarrisonTalentButtonMixin:OnClick()
elseif (hasTime) then
str = string.format(ORDER_HALL_RESEARCH_CONFIRMATION_NO_COST, self.talent.name, SecondsToTime(self.talent.researchDuration, false, true));
end
StaticPopup_Show("ORDER_HALL_TALENT_RESEARCH", str, nil, { id = self.talent.id, rank = self.talent.talentRank + 1, hasTime = hasTime, button = self });
StaticPopup_Show("ORDER_HALL_TALENT_RESEARCH", str, nil, { id = self.talent.id, rank = self.talent.talentRank + 1, hasTime = hasTime, button = self, talentType = self.talent.type });
else
PlaySound(SOUNDKIT.UI_ORDERHALL_TALENT_SELECT, nil, SOUNDKIT_ALLOW_DUPLICATES);
local soundKitID = GetResearchSoundForTalentType(self.talent.type);
PlaySound(soundKitID, nil, SOUNDKIT_ALLOW_DUPLICATES);
C_Garrison.ResearchTalent(self.talent.id, self.talent.talentRank + 1);
self:GetParent():SetResearchingTalentID(self.talent.id);
end
......
......@@ -225,7 +225,7 @@ function PTR_IssueReporter.CreateReports()
local bonusIDs = {}
local results = ""
local numberOfBonusIDs = elements[14]
if numberOfBonusIDs > 0 then
if (numberOfBonusIDs) and (tonumber(numberOfBonusIDs)) and (tonumber(numberOfBonusIDs) > 0) then
for i=15, 15 + numberOfBonusIDs do
table.insert(bonusIDs,elements[i])
end
......
......@@ -217,7 +217,12 @@ function PVPMatchResultsMixin:BeginShow()
ShowUIPanel(self);
end
function PVPMatchResultsMixin:DisplayRewards()
if self.hasDisplayedRewards or not self.haveConquestData or not self.hasRewardTimerElapsed then
if self.hasDisplayedRewards or not self.hasRewardTimerElapsed then
return;
end
local conquestQuestID = select(3, PVPGetConquestLevelInfo());
if conquestQuestID ~= 0 and not self.haveConquestData then
return;
end
self.hasDisplayedRewards = true;
......
UIWidgetTemplateTooltipFrameMixin = {}
function UIWidgetTemplateTooltipFrameMixin:OnLoad()
self:EnableMouse(true);
end
function UIWidgetTemplateTooltipFrameMixin:Setup(widgetContainer)
self:EnableMouse(not widgetContainer.disableWidgetTooltips);
self:SetMouseClickEnabled(false);
end
......@@ -88,7 +91,7 @@ function UIWidgetTemplateTooltipFrameMixin:SetEnabledState(enabledState)
self:SetFontColor();
end
UIWidgetBaseTemplateMixin = {}
UIWidgetBaseTemplateMixin = CreateFromMixins(UIWidgetTemplateTooltipFrameMixin);
function UIWidgetBaseTemplateMixin:OnLoad()
UIWidgetTemplateTooltipFrameMixin.OnLoad(self);
......@@ -158,6 +161,7 @@ end
-- Override with any custom behaviour that you need to perform when this widget is updated. Make sure you still call the base though because it handles animations
function UIWidgetBaseTemplateMixin:Setup(widgetInfo, widgetContainer)
UIWidgetTemplateTooltipFrameMixin.Setup(self, widgetContainer);
self.widgetContainer = widgetContainer;
self:AnimIn();
end
......@@ -168,9 +172,10 @@ function UIWidgetBaseTemplateMixin:OnReset()
self:ClearAllPoints();
end
UIWidgetBaseResourceTemplateMixin = {}
UIWidgetBaseResourceTemplateMixin = CreateFromMixins(UIWidgetTemplateTooltipFrameMixin);
function UIWidgetBaseResourceTemplateMixin:Setup(resourceInfo)
function UIWidgetBaseResourceTemplateMixin:Setup(widgetContainer, resourceInfo)
UIWidgetTemplateTooltipFrameMixin.Setup(self, widgetContainer);
self.Text:SetTextColor(NORMAL_FONT_COLOR:GetRGB());
self.Text:SetText(resourceInfo.text);
......@@ -181,9 +186,10 @@ function UIWidgetBaseResourceTemplateMixin:Setup(resourceInfo)
self:SetHeight(self.Icon:GetHeight());
end
UIWidgetBaseCurrencyTemplateMixin = {}
UIWidgetBaseCurrencyTemplateMixin = CreateFromMixins(UIWidgetTemplateTooltipFrameMixin);
function UIWidgetBaseCurrencyTemplateMixin:Setup(currencyInfo, enabledState, tooltipEnabledState)
function UIWidgetBaseCurrencyTemplateMixin:Setup(widgetContainer, currencyInfo, enabledState, tooltipEnabledState)
UIWidgetTemplateTooltipFrameMixin.Setup(self, widgetContainer);
self.Text:SetText(currencyInfo.text);
self:SetTooltip(currencyInfo.tooltip, GetTextColorForEnabledState(tooltipEnabledState or enabledState));
self.Icon:SetTexture(currencyInfo.iconFileID);
......@@ -207,7 +213,7 @@ function UIWidgetBaseCurrencyTemplateMixin:Setup(currencyInfo, enabledState, too
self:SetHeight(self.Icon:GetHeight());
end
UIWidgetBaseSpellTemplateMixin = {}
UIWidgetBaseSpellTemplateMixin = CreateFromMixins(UIWidgetTemplateTooltipFrameMixin);
local iconSizes =
{
......@@ -220,7 +226,8 @@ local function GetIconSize(iconSizeType)
return iconSizes[iconSizeType] and iconSizes[iconSizeType] or iconSizes[Enum.SpellDisplayIconSizeType.Large];
end
function UIWidgetBaseSpellTemplateMixin:Setup(spellInfo, enabledState, width)
function UIWidgetBaseSpellTemplateMixin:Setup(widgetContainer, spellInfo, enabledState, width)
UIWidgetTemplateTooltipFrameMixin.Setup(self, widgetContainer);
local name, _, icon = GetSpellInfo(spellInfo.spellID);
self.Icon:SetTexture(icon);
self.Icon:SetDesaturated(enabledState == Enum.WidgetEnabledState.Disabled);
......@@ -281,15 +288,16 @@ function UIWidgetBaseSpellTemplateMixin:OnEnter()
end
end
UIWidgetBaseColoredTextMixin = {}
UIWidgetBaseColoredTextMixin = {};
function UIWidgetBaseColoredTextMixin:SetEnabledState(enabledState)
SetTextColorForEnabledState(self, enabledState);
end
UIWidgetBaseStatusBarTemplateMixin = {}
UIWidgetBaseStatusBarTemplateMixin = CreateFromMixins(UIWidgetTemplateTooltipFrameMixin);
function UIWidgetBaseStatusBarTemplateMixin:Setup(barMin, barMax, barValue, barValueTextType, tooltip, overrideBarText, overrideBarTextShownType)
function UIWidgetBaseStatusBarTemplateMixin:Setup(widgetContainer, barMin, barMax, barValue, barValueTextType, tooltip, overrideBarText, overrideBarTextShownType)
UIWidgetTemplateTooltipFrameMixin.Setup(self, widgetContainer);
barValue = Clamp(barValue, barMin, barMax);
self:SetMinMaxValues(barMin, barMax);
......@@ -361,9 +369,10 @@ function UIWidgetBaseStatusBarTemplateMixin:UpdateBarText()
end
end
UIWidgetBaseStateIconTemplateMixin = {}
UIWidgetBaseStateIconTemplateMixin = CreateFromMixins(UIWidgetTemplateTooltipFrameMixin);
function UIWidgetBaseStateIconTemplateMixin:Setup(textureKitID, textureKitFormatter, captureIconInfo)
function UIWidgetBaseStateIconTemplateMixin:Setup(widgetContainer, textureKitID, textureKitFormatter, captureIconInfo)
UIWidgetTemplateTooltipFrameMixin.Setup(self, widgetContainer);
if captureIconInfo.iconState == Enum.IconState.ShowState1 then
SetupTextureKitOnFrameByID(textureKitID, self.Icon, "%s-"..textureKitFormatter.."-state1", TextureKitConstants.SetVisiblity, TextureKitConstants.UseAtlasSize);
self:SetTooltip(captureIconInfo.state1Tooltip);
......@@ -383,7 +392,7 @@ function UIWidgetBaseStateIconTemplateMixin:Setup(textureKitID, textureKitFormat
return iconShown;
end
UIWidgetBaseTextureAndTextTemplateMixin = {}
UIWidgetBaseTextureAndTextTemplateMixin = CreateFromMixins(UIWidgetTemplateTooltipFrameMixin);
local textFontSizes =
{
......@@ -403,7 +412,8 @@ function UIWidgetBaseTextureAndTextTemplateMixin:OnLoad()
self.Text:SetFontObjectsToTry();
end
function UIWidgetBaseTextureAndTextTemplateMixin:Setup(text, tooltip, frameTextureKitID, textureKitID, textSizeType, layoutIndex)
function UIWidgetBaseTextureAndTextTemplateMixin:Setup(widgetContainer, text, tooltip, frameTextureKitID, textureKitID, textSizeType, layoutIndex)
UIWidgetTemplateTooltipFrameMixin.Setup(self, widgetContainer);
self.layoutIndex = layoutIndex;
local textureKitAppend = "";
......@@ -423,7 +433,7 @@ function UIWidgetBaseTextureAndTextTemplateMixin:Setup(text, tooltip, frameTextu
self:MarkDirty(); -- The widget needs to resize based on whether the textures are shown or hidden
end
UIWidgetBaseControlZoneTemplateMixin = {}
UIWidgetBaseControlZoneTemplateMixin = CreateFromMixins(UIWidgetTemplateTooltipFrameMixin);
function UIWidgetBaseControlZoneTemplateMixin:OnLoad()
UIWidgetTemplateTooltipFrameMixin.OnLoad(self);
......@@ -517,7 +527,8 @@ function UIWidgetBaseControlZoneTemplateMixin:UpdateAnimations(zoneInfo, zoneIsG
end
end
function UIWidgetBaseControlZoneTemplateMixin:Setup(zoneIndex, zoneMode, leadingEdgeType, dangerFlashType, zoneInfo, lastVals, textureKitID)
function UIWidgetBaseControlZoneTemplateMixin:Setup(widgetContainer, zoneIndex, zoneMode, leadingEdgeType, dangerFlashType, zoneInfo, lastVals, textureKitID)
UIWidgetTemplateTooltipFrameMixin.Setup(self, widgetContainer);
local textureKit = GetUITextureKitInfo(textureKitID);
if not textureKit then
self:Hide();
......
......@@ -20,7 +20,7 @@ function UIWidgetTemplateCaptureZoneMixin:Setup(widgetInfo, widgetContainer)
local zoneInfo = widgetInfo.zoneInfo;
local lastVals = (self.lastVals.state == zoneInfo.state) and self.lastVals or nil;
self.Zone:Setup(1, widgetInfo.mode, widgetInfo.leadingEdgeType, widgetInfo.dangerFlashType, zoneInfo, lastVals, widgetInfo.textureKitID);
self.Zone:Setup(widgetContainer, 1, widgetInfo.mode, widgetInfo.leadingEdgeType, widgetInfo.dangerFlashType, zoneInfo, lastVals, widgetInfo.textureKitID);
self.lastVals = zoneInfo;
self:Layout();
......
......@@ -14,10 +14,10 @@ function UIWidgetTemplateDoubleStateIconRowMixin:Setup(widgetInfo, widgetContain
self.iconPool:ReleaseAll();
local leftAligned = true;
local biggestLeftHeight, totalLeftWidth = self:SetupIcons(widgetInfo.leftIcons, widgetInfo.textureKitID, leftAligned);
local biggestLeftHeight, totalLeftWidth = self:SetupIcons(widgetContainer, widgetInfo.leftIcons, widgetInfo.textureKitID, leftAligned);
local rightAligned = false;
local biggestRightHeight, totalRightWidth = self:SetupIcons(widgetInfo.rightIcons, widgetInfo.textureKitID, rightAligned);
local biggestRightHeight, totalRightWidth = self:SetupIcons(widgetContainer, widgetInfo.rightIcons, widgetInfo.textureKitID, rightAligned);
local biggestHeight = math.max(biggestLeftHeight, biggestRightHeight);
biggestHeight = math.max(biggestHeight, 1);
......@@ -30,7 +30,7 @@ function UIWidgetTemplateDoubleStateIconRowMixin:Setup(widgetInfo, widgetContain
self:SetHeight(biggestHeight);
end
function UIWidgetTemplateDoubleStateIconRowMixin:SetupIcons(icons, textureKitID, leftAlign)
function UIWidgetTemplateDoubleStateIconRowMixin:SetupIcons(widgetContainer, icons, textureKitID, leftAlign)
local previousIconFrame;
local biggestHeight = 0;
local totalWidth = 0;
......@@ -51,7 +51,7 @@ function UIWidgetTemplateDoubleStateIconRowMixin:SetupIcons(icons, textureKitID,
for index, iconInfo in ipairs(icons) do
local iconFrame = self.iconPool:Acquire();
local iconShowing = iconFrame:Setup(textureKitID, textureKitFormatter..index, iconInfo);
local iconShowing = iconFrame:Setup(widgetContainer, textureKitID, textureKitFormatter..index, iconInfo);
if iconShowing then
if previousIconFrame then
......
......@@ -50,8 +50,8 @@ function UIWidgetTemplateDoubleStatusBarMixin:Setup(widgetInfo, widgetContainer)
self.LeftBar:SetWidth(barWidth);
self.RightBar:SetWidth(barWidth);
self.LeftBar:Setup(widgetInfo.leftBarMin, widgetInfo.leftBarMax, widgetInfo.leftBarValue, widgetInfo.barValueTextType, widgetInfo.leftBarTooltip);
self.RightBar:Setup(widgetInfo.rightBarMin, widgetInfo.rightBarMax, widgetInfo.rightBarValue, widgetInfo.barValueTextType, widgetInfo.rightBarTooltip);