Commit 6cbb7b3e authored by TOM_RUS's avatar TOM_RUS
Browse files

WOW-29281patch8.1.5_PTR

parent 7908f490
......@@ -765,6 +765,11 @@ local Calendar =
{ Name = "monthDay", Type = "number", Nilable = false },
{ Name = "index", Type = "number", Nilable = false },
},
Returns =
{
{ Name = "success", Type = "bool", Nilable = false },
},
},
{
Name = "RemoveEvent",
......@@ -1038,6 +1043,8 @@ local Calendar =
Type = "Structure",
Fields =
{
{ Name = "eventID", Type = "string", Nilable = false },
{ Name = "year", Type = "number", Nilable = false },
{ Name = "month", Type = "number", Nilable = false },
{ Name = "monthDay", Type = "number", Nilable = false },
{ Name = "weekday", Type = "number", Nilable = false },
......@@ -1047,6 +1054,8 @@ local Calendar =
{ Name = "title", Type = "string", Nilable = false },
{ Name = "calendarType", Type = "string", Nilable = false },
{ Name = "texture", Type = "number", Nilable = false },
{ Name = "inviteStatus", Type = "number", Nilable = false },
{ Name = "clubID", Type = "string", Nilable = false },
},
},
{
......
......@@ -74,6 +74,15 @@ local DateAndTime =
{ Name = "date", Type = "CalendarTime", Nilable = false },
},
},
{
Name = "GetServerTimeLocal",
Type = "Function",
Returns =
{
{ Name = "serverTimeLocal", Type = "number", Nilable = false },
},
},
},
Events =
......
......@@ -77,6 +77,20 @@ local EncounterJournal =
{ Name = "hasLoot", Type = "bool", Nilable = false },
},
},
{
Name = "IsEncounterComplete",
Type = "Function",
Arguments =
{
{ Name = "journalEncounterID", Type = "number", Nilable = false },
},
Returns =
{
{ Name = "isEncounterComplete", Type = "bool", Nilable = false },
},
},
},
Events =
......
......@@ -6,6 +6,10 @@ local ItemSocketInfo =
Functions =
{
{
Name = "CompleteSocketing",
Type = "Function",
},
},
Events =
......@@ -15,6 +19,11 @@ local ItemSocketInfo =
Type = "Event",
LiteralName = "SOCKET_INFO_ACCEPT",
},
{
Name = "SocketInfoBindConfirm",
Type = "Event",
LiteralName = "SOCKET_INFO_BIND_CONFIRM",
},
{
Name = "SocketInfoClose",
Type = "Event",
......
......@@ -71,6 +71,20 @@ local UIWidgetManager =
{ Name = "widgetInfo", Type = "DoubleIconAndTextWidgetVisualizationInfo", Nilable = true },
},
},
{
Name = "GetDoubleStateIconRowVisualizationInfo",
Type = "Function",
Arguments =
{
{ Name = "widgetID", Type = "number", Nilable = false },
},
Returns =
{
{ Name = "widgetInfo", Type = "DoubleStateIconRowVisualizationInfo", Nilable = true },
},
},
{
Name = "GetDoubleStatusBarWidgetVisualizationInfo",
Type = "Function",
......@@ -282,12 +296,42 @@ local UIWidgetManager =
{ Name = "Highlight", Type = "WidgetEnabledState", EnumValue = 3 },
},
},
{
Name = "IconState",
Type = "Enumeration",
NumValues = 3,
MinValue = 0,
MaxValue = 2,
Fields =
{
{ Name = "Hidden", Type = "IconState", EnumValue = 0 },
{ Name = "ShowState1", Type = "IconState", EnumValue = 1 },
{ Name = "ShowState2", Type = "IconState", EnumValue = 2 },
},
},
{
Name = "StatusBarValueTextType",
Type = "Enumeration",
NumValues = 7,
MinValue = 0,
MaxValue = 6,
Fields =
{
{ Name = "Hidden", Type = "StatusBarValueTextType", EnumValue = 0 },
{ Name = "Percentage", Type = "StatusBarValueTextType", EnumValue = 1 },
{ Name = "Value", Type = "StatusBarValueTextType", EnumValue = 2 },
{ Name = "Time", Type = "StatusBarValueTextType", EnumValue = 3 },
{ Name = "TimeShowOneLevelOnly", Type = "StatusBarValueTextType", EnumValue = 4 },
{ Name = "ValueOverMax", Type = "StatusBarValueTextType", EnumValue = 5 },
{ Name = "ValueOverMaxNormalized", Type = "StatusBarValueTextType", EnumValue = 6 },
},
},
{
Name = "UIWidgetVisualizationType",
Type = "Enumeration",
NumValues = 14,
NumValues = 15,
MinValue = 0,
MaxValue = 13,
MaxValue = 14,
Fields =
{
{ Name = "IconAndText", Type = "UIWidgetVisualizationType", EnumValue = 0 },
......@@ -304,6 +348,7 @@ local UIWidgetManager =
{ Name = "ScenarioHeaderCurrenciesAndBackground", Type = "UIWidgetVisualizationType", EnumValue = 11 },
{ Name = "TextureWithState", Type = "UIWidgetVisualizationType", EnumValue = 12 },
{ Name = "SpellDisplay", Type = "UIWidgetVisualizationType", EnumValue = 13 },
{ Name = "DoubleStateIconRow", Type = "UIWidgetVisualizationType", EnumValue = 14 },
},
},
{
......@@ -333,23 +378,6 @@ local UIWidgetManager =
{ Name = "Large", Type = "SpellDisplayIconSizeType", EnumValue = 2 },
},
},
{
Name = "StatusBarValueTextType",
Type = "Enumeration",
NumValues = 7,
MinValue = 0,
MaxValue = 6,
Fields =
{
{ Name = "Hidden", Type = "StatusBarValueTextType", EnumValue = 0 },
{ Name = "Percentage", Type = "StatusBarValueTextType", EnumValue = 1 },
{ Name = "Value", Type = "StatusBarValueTextType", EnumValue = 2 },
{ Name = "Time", Type = "StatusBarValueTextType", EnumValue = 3 },
{ Name = "TimeShowOneLevelOnly", Type = "StatusBarValueTextType", EnumValue = 4 },
{ Name = "ValueOverMax", Type = "StatusBarValueTextType", EnumValue = 5 },
{ Name = "ValueOverMaxNormalized", Type = "StatusBarValueTextType", EnumValue = 6 },
},
},
{
Name = "WidgetCurrencyClass",
Type = "Enumeration",
......@@ -406,6 +434,30 @@ local UIWidgetManager =
{ Name = "widgetTag", Type = "string", Nilable = false },
},
},
{
Name = "UIWidgetStateIconInfo",
Type = "Structure",
Fields =
{
{ Name = "iconState", Type = "IconState", Nilable = false },
{ Name = "state1Tooltip", Type = "string", Nilable = false },
{ Name = "state2Tooltip", Type = "string", Nilable = false },
},
},
{
Name = "DoubleStateIconRowVisualizationInfo",
Type = "Structure",
Fields =
{
{ Name = "shownState", Type = "WidgetShownState", Nilable = false },
{ Name = "leftIcons", Type = "table", InnerType = "UIWidgetStateIconInfo", Nilable = false },
{ Name = "rightIcons", Type = "table", InnerType = "UIWidgetStateIconInfo", Nilable = false },
{ Name = "textureKitID", Type = "number", Nilable = false },
{ Name = "hasTimer", Type = "bool", Nilable = false },
{ Name = "orderIndex", Type = "number", Nilable = false },
{ Name = "widgetTag", Type = "string", Nilable = false },
},
},
{
Name = "DoubleStatusBarWidgetVisualizationInfo",
Type = "Structure",
......@@ -418,6 +470,7 @@ local UIWidgetManager =
{ Name = "rightBarMin", Type = "number", Nilable = false },
{ Name = "rightBarMax", Type = "number", Nilable = false },
{ Name = "rightBarValue", Type = "number", Nilable = false },
{ Name = "barValueTextType", Type = "StatusBarValueTextType", Nilable = false },
{ Name = "text", Type = "string", Nilable = false },
{ Name = "textureKitID", Type = "number", Nilable = false },
{ Name = "hasTimer", Type = "bool", Nilable = false },
......
......@@ -211,6 +211,20 @@ local Unit =
{ Name = "sex", Type = "number", Nilable = true },
},
},
{
Name = "UnitTreatAsPlayerForDisplay",
Type = "Function",
Arguments =
{
{ Name = "unit", Type = "string", Nilable = false },
},
Returns =
{
{ Name = "treatAsPlayer", Type = "bool", Nilable = false },
},
},
{
Name = "UnitWidgetSet",
Type = "Function",
......
......@@ -1297,7 +1297,11 @@ function WardrobeItemsCollectionMixin:IsValidWeaponCategoryForSlot(categoryID, s
end
function WardrobeItemsCollectionMixin:SetActiveSlot(slot, transmogType, category, ignorePreviousSlot)
local previousSlot = ignorePreviousSlot and nil or self.activeSlot;
local previousSlot;
if not ignorePreviousSlot then
previousSlot = self.activeSlot;
end
self.activeSlot = slot;
self.transmogType = transmogType;
......
......@@ -17,6 +17,7 @@ ITEM_SOCKETING_DESCRIPTION_MIN_WIDTH = 240;
function ItemSocketingFrame_OnLoad(self)
self:RegisterEvent("SOCKET_INFO_UPDATE");
self:RegisterEvent("SOCKET_INFO_CLOSE");
self:RegisterEvent("SOCKET_INFO_BIND_CONFIRM");
self:RegisterEvent("SOCKET_INFO_ACCEPT");
self:RegisterEvent("SOCKET_INFO_SUCCESS");
self:RegisterEvent("SOCKET_INFO_FAILURE");
......@@ -38,6 +39,8 @@ function ItemSocketingFrame_OnEvent(self, event, ...)
end
elseif ( event == "SOCKET_INFO_CLOSE" ) then
HideUIPanel(ItemSocketingFrame);
elseif ( event == "SOCKET_INFO_BIND_CONFIRM" ) then
StaticPopup_Show("BIND_SOCKET");
elseif ( event == "SOCKET_INFO_ACCEPT" ) then
self.isSocketing = true;
ItemSocketingSocketButton_Disable();
......
......@@ -682,8 +682,8 @@ end
local function TryAddingExpirationWarningLine(module, block, questID)
if ( QuestUtils_ShouldDisplayExpirationWarning(questID) ) then
local timeLeftMinutes = C_TaskQuest.GetQuestTimeLeftMinutes(questID);
local text = "";
if ( timeLeftMinutes and module.tickerSeconds ) then
local text = "";
if ( timeLeftMinutes > 0 ) then
if ( timeLeftMinutes < WORLD_QUESTS_TIME_CRITICAL_MINUTES ) then
local timeString = SecondsToTime(timeLeftMinutes * 60);
......@@ -699,9 +699,9 @@ local function TryAddingExpirationWarningLine(module, block, questID)
end
end
end
module:AddObjective(block, "TimeLeft", text, nil, nil, OBJECTIVE_DASH_STYLE_HIDE, OBJECTIVE_TRACKER_COLOR["TimeLeft"], true);
block.currentLine.Icon:Hide();
end
module:AddObjective(block, "TimeLeft", text, nil, nil, OBJECTIVE_DASH_STYLE_HIDE, OBJECTIVE_TRACKER_COLOR["TimeLeft"], true);
block.currentLine.Icon:Hide();
end
end
......
......@@ -1797,7 +1797,8 @@ end
function PVPConquestBarRewardMixin:OnClick()
if self.questID and self.questID > 0 and IsModifiedClick() then
HandleModifiedItemClick(GetQuestLogItemLink("reward", 1, self.questID));
local itemIndex = QuestUtils_GetBestQualityItemRewardIndex(self.questID);
HandleModifiedItemClick(GetQuestLogItemLink("reward", itemIndex, self.questID));
end
end
......
......@@ -62,13 +62,23 @@ function EncounterJournalPinMixin:Refresh()
else
self.Background:Hide();
end
local complete = C_EncounterJournal.IsEncounterComplete(encounterID);
self.DefeatedOpacity:SetShown(complete);
self.DefeatedOverlay:SetShown(complete);
self.Background:SetDesaturation(complete and 0.7 or 0);
end
function EncounterJournalPinMixin:OnMouseEnter()
if self.tooltipTitle then
GameTooltip:SetOwner(self, "ANCHOR_LEFT");
GameTooltip:SetText(self.tooltipTitle, 1, 1, 1);
GameTooltip:AddLine(self.tooltipText, nil, nil, nil, true);
GameTooltip_SetTitle(GameTooltip, self.tooltipTitle);
if C_EncounterJournal.IsEncounterComplete(self.encounterID) then
GameTooltip_AddColoredLine(GameTooltip, DUNGEON_ENCOUNTER_DEFEATED, RED_FONT_COLOR);
end
GameTooltip_AddNormalLine(GameTooltip, self.tooltipText, true);
GameTooltip:Show();
end
end
......
......@@ -13,7 +13,38 @@
</Anchors>
</Texture>
</Layer>
<Layer level="OVERLAY">
<Texture parentKey="DefeatedOpacity" hidden="true">
<Anchors>
<Anchor point="TOPLEFT" relativeKey="$parent.Background" relativePoint="TOPLEFT" x="-1" y="1"/>
<Anchor point="BOTTOMRIGHT" relativeKey="$parent.Background" relativePoint="BOTTOMRIGHT" x="1" y="-1"/>
</Anchors>
<Color r="0.0" g="0.0" b="0.0" a="0.4"/>
</Texture>
<MaskTexture parentKey="OpacityCircleMask" file="Interface\CharacterFrame\TempPortraitAlphaMask" hWrapMode="CLAMPTOBLACKADDITIVE" vWrapMode="CLAMPTOBLACKADDITIVE">
<Anchors>
<Anchor point="TOPLEFT" relativeKey="$parent.DefeatedOpacity"/>
<Anchor point="BOTTOMRIGHT" relativeKey="$parent.DefeatedOpacity"/>
</Anchors>
<MaskedTextures>
<MaskedTexture childKey="DefeatedOpacity"/>
</MaskedTextures>
</MaskTexture>
</Layer>
</Layers>
<Frames>
<Frame parentKey="DefeatedOverlay" setAllPoints="true">
<Layers>
<Layer level="OVERLAY">
<Texture parentKey="DefeatedCross" atlas="Map-MarkedDefeated" useAtlasSize="true">
<Anchors>
<Anchor point="BOTTOMRIGHT" x="4" y="-4"/>
</Anchors>
</Texture>
</Layer>
</Layers>
</Frame>
</Frames>
<NormalTexture file="Interface\EncounterJournal\UI-EncounterJournalTextures">
<TexCoords left="0.84960938" right="0.97070313" top="0.42871094" bottom="0.48828125"/>
</NormalTexture>
......
......@@ -3975,6 +3975,7 @@ function VASCharacterSelectionCharacterSelector_Callback(value, guildFollowInfo)
SelectedCharacter = value;
GuildMemberAutoCompleteList = nil;
GuildMemberNameToGuid = {};
IsGuildFollow = false;
local frame = StoreVASValidationFrame.CharacterSelectionFrame;
local character = CharacterList[SelectedCharacter];
......
......@@ -296,7 +296,7 @@
</Layer>
</Layers>
<Frames>
<Button parentKey="ResultIcon">
<Button parentKey="ResultIcon" registerForClicks="LeftButtonUp,RightButtonUp">
<KeyValues>
<KeyValue key="hasItem" value="true" type="boolean"/>
</KeyValues>
......
......@@ -184,3 +184,58 @@ UIWidgetBaseColoredTextMixin = {}
function UIWidgetBaseColoredTextMixin:SetEnabledState(enabledState)
SetTextColorForEnabledState(self, enabledState);
end
UIWidgetBaseStatusBarTemplateMixin = {}
function UIWidgetBaseStatusBarTemplateMixin:Setup(barMin, barMax, barValue, barValueTextType)
self:SetMinMaxValues(barMin, barMax);
self:SetValue(barValue);
self.Label:SetShown(barValueTextType ~= Enum.StatusBarValueTextType.Hidden);
local maxTimeCount = self:GetMaxTimeCount(barValueTextType);
if maxTimeCount then
self.Label:SetText(SecondsToTime(barValue, false, true, maxTimeCount, true));
elseif barValueTextType == Enum.StatusBarValueTextType.Value then
self.Label:SetText(barValue);
elseif barValueTextType == Enum.StatusBarValueTextType.ValueOverMax then
self.Label:SetText(FormatFraction(barValue, barMax));
elseif barValueTextType == Enum.StatusBarValueTextType.ValueOverMaxNormalized then
self.Label:SetText(FormatFraction(barValue - barMin, barMax - barMin));
elseif barValueTextType == Enum.StatusBarValueTextType.Percentage then
local barPercent = PercentageBetween(barValue, barMin, barMax);
local barPercentText = FormatPercentage(barPercent, true);
self.Label:SetText(barPercentText);
end
end
function UIWidgetBaseStatusBarTemplateMixin:GetMaxTimeCount(barValueTextType)
if barValueTextType == Enum.StatusBarValueTextType.Time then
return 2;
elseif barValueTextType == Enum.StatusBarValueTextType.TimeShowOneLevelOnly then
return 1;
end
end
UIWidgetBaseStateIconTemplateMixin = {}
function UIWidgetBaseStateIconTemplateMixin:Setup(textureKitID, textureKitFormatter, captureIconInfo)
if captureIconInfo.iconState == Enum.IconState.ShowState1 then
SetupTextureKitOnFrameByID(textureKitID, self.Icon, "%s-"..textureKitFormatter.."-state1", true, true);
self:SetTooltip(captureIconInfo.state1Tooltip);
elseif captureIconInfo.iconState == Enum.IconState.ShowState2 then
SetupTextureKitOnFrameByID(textureKitID, self.Icon, "%s-"..textureKitFormatter.."-state2", true, true);
self:SetTooltip(captureIconInfo.state2Tooltip);
else
self.Icon:Hide();
end
local iconShown = self.Icon:IsShown();
self:SetWidth(self.Icon:GetWidth());
self:SetHeight(self.Icon:GetHeight());
self:SetShown(iconShown);
return iconShown;
end
......@@ -87,4 +87,17 @@
</Layer>
</Layers>
</Frame>
<Frame name="UIWidgetBaseStateIconTemplate" inherits="UIWidgetTemplateTooltipFrame" mixin="UIWidgetBaseStateIconTemplateMixin" virtual="true">
<Layers>
<Layer level="OVERLAY">
<Texture parentKey="Icon">
<Size x="26" y="26"/>
<Anchors>
<Anchor point="TOPLEFT" />
</Anchors>
</Texture>
</Layer>
</Layers>
</Frame>
</Ui>
local function GetDoubleStateIconRowVisInfoData(widgetID)
local widgetInfo = C_UIWidgetManager.GetDoubleStateIconRowVisualizationInfo(widgetID);
if widgetInfo and widgetInfo.shownState ~= Enum.WidgetShownState.Hidden then
return widgetInfo;
end
end
UIWidgetManager:RegisterWidgetVisTypeTemplate(Enum.UIWidgetVisualizationType.DoubleStateIconRow, {frameType = "FRAME", frameTemplate = "UIWidgetTemplateDoubleStateIconRow"}, GetDoubleStateIconRowVisInfoData);
UIWidgetTemplateDoubleStateIconRowMixin = CreateFromMixins(UIWidgetBaseTemplateMixin);
function UIWidgetTemplateDoubleStateIconRowMixin:Setup(widgetInfo)
UIWidgetBaseTemplateMixin.Setup(self, widgetInfo);
self.iconPool:ReleaseAll();
local leftAligned = true;
local biggestLeftHeight, totalLeftWidth = self:SetupIcons(widgetInfo.leftIcons, widgetInfo.textureKitID, leftAligned);
local rightAligned = false;
local biggestRightHeight, totalRightWidth = self:SetupIcons(widgetInfo.rightIcons, widgetInfo.textureKitID, rightAligned);
local biggestHeight = math.max(biggestLeftHeight, biggestRightHeight);
biggestHeight = math.max(biggestHeight, 1);
local totalWidth = totalLeftWidth + totalRightWidth;
totalWidth = math.max(totalWidth, 1);
self:SetWidth(totalWidth);
self:SetHeight(biggestHeight);
end
function UIWidgetTemplateDoubleStateIconRowMixin:SetupIcons(icons, textureKitID, leftAlign)
local previousIconFrame;
local biggestHeight = 0;
local totalWidth = 0;
local anchorPt;
local relAnchorPt;
local textureKitFormatter;
if leftAlign then
anchorPt = "TOPRIGHT";
relAnchorPt = "TOPLEFT";
textureKitFormatter = "leftIcon";
else
anchorPt = "TOPLEFT";
relAnchorPt = "TOPRIGHT";
textureKitFormatter = "rightIcon";
end
for index, captureIconInfo in ipairs(icons) do
local iconFrame = self.iconPool:Acquire();
local iconShowing = iconFrame:Setup(textureKitID, textureKitFormatter..index, captureIconInfo);
if iconShowing then
if previousIconFrame then
iconFrame:SetPoint(anchorPt, previousIconFrame, relAnchorPt, NegateIf(1, leftAlign), 0);
totalWidth = totalWidth + iconFrame:GetWidth() + 1;
else
iconFrame:SetPoint(anchorPt, self, "TOP", NegateIf(7, leftAlign), 0);
totalWidth = totalWidth + iconFrame:GetWidth() + 7;
end
previousIconFrame = iconFrame;
biggestHeight = math.max(biggestHeight, iconFrame:GetHeight());
end
end
return biggestHeight, totalWidth;
end
function UIWidgetTemplateDoubleStateIconRowMixin:OnLoad()
self.iconPool = CreateFramePool("FRAME", self, "UIWidgetBaseStateIconTemplate");
end
function UIWidgetTemplateDoubleStateIconRowMixin:OnReset()
UIWidgetBaseTemplateMixin.OnReset(self);
self.iconPool:ReleaseAll();
end
<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">
<Frame name="UIWidgetTemplateDoubleStateIconRow" inherits="UIWidgetBaseTemplate" virtual="true" mixin="UIWidgetTemplateDoubleStateIconRowMixin">
<Size x="237" y="32"/>
</Frame>
</Ui>
\ No newline at end of file