Commit 46d53f88 authored by TOM_RUS's avatar TOM_RUS
Browse files

WOW-26926patch8.0.1_Beta

parent fa6b1c21
......@@ -304,6 +304,15 @@ local Club =
{ Name = "errorCode", Type = "string", Nilable = true },
},
},
{
Name = "GetGuildClubId",
Type = "Function",
Returns =
{
{ Name = "guildClubId", Type = "string", Nilable = true },
},
},
{
Name = "GetInfoFromLastCommunityChatLine",
Type = "Function",
......@@ -946,7 +955,15 @@ local Club =
Payload =
{
{ Name = "clubId", Type = "string", Nilable = false },
{ Name = "clubName", Type = "string", Nilable = true },
},
},
{
Name = "ClubRemovedMessage",
Type = "Event",
LiteralName = "CLUB_REMOVED_MESSAGE",
Payload =
{
{ Name = "clubName", Type = "string", Nilable = false },
{ Name = "clubRemovedReason", Type = "ClubRemovedReason", Nilable = false },
},
},
......@@ -1090,14 +1107,15 @@ local Club =
{
Name = "ClubType",
Type = "Enumeration",
NumValues = 3,
NumValues = 4,
MinValue = 0,
MaxValue = 2,
MaxValue = 3,
Fields =
{
{ Name = "BattleNet", Type = "ClubType", EnumValue = 0 },
{ Name = "Character", Type = "ClubType", EnumValue = 1 },
{ Name = "Guild", Type = "ClubType", EnumValue = 2 },
{ Name = "Other", Type = "ClubType", EnumValue = 3 },
},
},
{
......
......@@ -20,6 +20,20 @@ local GuildInfo =
{ Name = "rankOrder", Type = "number", Nilable = false },
},
},
{
Name = "GuildControlGetRankFlags",
Type = "Function",
Arguments =
{
{ Name = "rankOrder", Type = "number", Nilable = false },
},
Returns =
{
{ Name = "permissions", Type = "table", InnerType = "bool", Nilable = false },
},
},
{
Name = "IsGuildRankAssignmentAllowed",
Type = "Function",
......
local MapOverlay =
{
Name = "MapOverlayInfo",
Type = "System",
Namespace = "C_MapOverlayInfo",
Functions =
{
{
Name = "GetMapOverlays",
Type = "Function",
Arguments =
{
{ Name = "uiMapID", Type = "number", Nilable = false },
},
Returns =
{
{ Name = "overlayInfo", Type = "table", InnerType = "UiMapOverlayInfo", Nilable = false },
},
},
},
Events =
{
},
Tables =
{
{
Name = "UiMapOverlayHitRect",
Type = "Structure",
Fields =
{
{ Name = "top", Type = "number", Nilable = false },
{ Name = "bottom", Type = "number", Nilable = false },
{ Name = "left", Type = "number", Nilable = false },
{ Name = "right", Type = "number", Nilable = false },
},
},
{
Name = "UiMapOverlayInfo",
Type = "Structure",
Fields =
{
{ Name = "textureWidth", Type = "number", Nilable = false },
{ Name = "textureHeight", Type = "number", Nilable = false },
{ Name = "offsetX", Type = "number", Nilable = false },
{ Name = "offsetY", Type = "number", Nilable = false },
{ Name = "isShownByMouseOver", Type = "bool", Nilable = false },
{ Name = "fileDataIDs", Type = "table", InnerType = "number", Nilable = false },
{ Name = "hitRect", Type = "UiMapOverlayHitRect", Nilable = false },
},
},
},
};
APIDocumentation:AddDocumentationTable(MapOverlay);
\ No newline at end of file
......@@ -48,6 +48,20 @@ local MythicPlusInfo =
{ Name = "endOfRunRewardLevel", Type = "number", Nilable = false },
},
},
{
Name = "GetRewardLevelFromKeystoneLevel",
Type = "Function",
Arguments =
{
{ Name = "keystoneLevel", Type = "number", Nilable = false },
},
Returns =
{
{ Name = "rewardLevel", Type = "number", Nilable = true },
},
},
{
Name = "GetSeasonBestForMap",
Type = "Function",
......
local Warfront =
{
Name = "Warfront",
Type = "System",
Namespace = "C_Warfront",
Functions =
{
{
Name = "GetPlayerConditionInfo",
Type = "Function",
Arguments =
{
{ Name = "id", Type = "number", Nilable = false },
},
Returns =
{
{ Name = "isValid", Type = "bool", Nilable = false },
{ Name = "failureText", Type = "string", Nilable = false },
},
},
{
Name = "GetResourceInfo",
Type = "Function",
Arguments =
{
{ Name = "resourceType", Type = "WarfrontResourceType", Nilable = false },
},
Returns =
{
{ Name = "resourceInfo", Type = "ResourceInfo", Nilable = false },
},
},
{
Name = "GetWorldStateValue",
Type = "Function",
Arguments =
{
{ Name = "id", Type = "number", Nilable = false },
},
Returns =
{
{ Name = "value", Type = "number", Nilable = false },
},
},
{
Name = "InWarfront",
Type = "Function",
Returns =
{
{ Name = "inWarfront", Type = "bool", Nilable = false },
},
},
},
Events =
{
{
Name = "WarfrontUpdate",
Type = "Event",
LiteralName = "WARFRONT_UPDATE",
},
},
Tables =
{
{
Name = "WarfrontResourceType",
Type = "Enumeration",
NumValues = 3,
MinValue = 0,
MaxValue = 2,
Fields =
{
{ Name = "Iron", Type = "WarfrontResourceType", EnumValue = 0 },
{ Name = "Lumber", Type = "WarfrontResourceType", EnumValue = 1 },
{ Name = "Essence", Type = "WarfrontResourceType", EnumValue = 2 },
},
},
{
Name = "ResourceInfo",
Type = "Structure",
Fields =
{
{ Name = "resourceType", Type = "WarfrontResourceType", Nilable = false },
{ Name = "name", Type = "string", Nilable = false },
{ Name = "description", Type = "string", Nilable = false },
{ Name = "quantity", Type = "number", Nilable = false },
{ Name = "maxQuantity", Type = "number", Nilable = false },
},
},
},
};
APIDocumentation:AddDocumentationTable(Warfront);
\ No newline at end of file
......@@ -1657,8 +1657,8 @@ function AchievementObjectives_DisplayProgressiveAchievement (objectivesFrame, i
miniAchievement.icon:SetTexture(iconpath);
if ( index == 1 ) then
miniAchievement:SetPoint("TOPLEFT", objectivesFrame, "TOPLEFT", -4, -4);
elseif ( index == 7 ) then
miniAchievement:SetPoint("TOPLEFT", miniTable[1], "BOTTOMLEFT", 0, -8);
elseif ( mod(index, 6) == 1 ) then
miniAchievement:SetPoint("TOPLEFT", miniTable[index - 6], "BOTTOMLEFT", 0, -8);
else
miniAchievement:SetPoint("TOPLEFT", miniTable[index-1], "TOPRIGHT", 4, 0);
end
......
......@@ -465,9 +465,6 @@ local CALENDAR_CALENDARTYPE_TOOLTIP_NAMEFORMAT = {
["RAID_LOCKOUT"] = {
[""] = CALENDAR_EVENTNAME_FORMAT_RAID_LOCKOUT,
},
["RAID_RESET"] = {
[""] = CALENDAR_EVENTNAME_FORMAT_RAID_RESET,
},
};
local CALENDAR_CALENDARTYPE_NAMEFORMAT = {
["PLAYER"] = {
......@@ -494,9 +491,6 @@ local CALENDAR_CALENDARTYPE_NAMEFORMAT = {
["RAID_LOCKOUT"] = {
[""] = CALENDAR_EVENTNAME_FORMAT_RAID_LOCKOUT,
},
["RAID_RESET"] = {
[""] = CALENDAR_EVENTNAME_FORMAT_RAID_RESET,
},
};
local CALENDAR_CALENDARTYPE_TEXTURES = {
["PLAYER"] = {
......@@ -522,9 +516,6 @@ local CALENDAR_CALENDARTYPE_TEXTURES = {
-- [""] = "",
},
["RAID_LOCKOUT"] = {
-- [""] = "",
},
["RAID_RESET"] = {
-- [""] = "",
},
};
......@@ -571,12 +562,6 @@ local CALENDAR_CALENDARTYPE_TCOORDS = {
top = 0.0,
bottom = 1.0,
},
["RAID_RESET"] = {
left = 0.0,
right = 1.0,
top = 0.0,
bottom = 1.0,
},
};
local CALENDAR_CALENDARTYPE_COLORS = {
-- ["PLAYER"] = ,
......@@ -585,7 +570,6 @@ local CALENDAR_CALENDARTYPE_COLORS = {
["SYSTEM"] = YELLOW_FONT_COLOR,
["HOLIDAY"] = HIGHLIGHT_FONT_COLOR,
["RAID_LOCKOUT"] = HIGHLIGHT_FONT_COLOR,
["RAID_RESET"] = HIGHLIGHT_FONT_COLOR,
};
local CALENDAR_CALENDARTYPE_COLORS_TOOLTIP = {
......@@ -647,7 +631,6 @@ end
local CALENDAR_FILTER_CVARS = {
{text = CALENDAR_FILTER_DARKMOON, cvar = "calendarShowDarkmoon" },
{text = CALENDAR_FILTER_RAID_LOCKOUTS, cvar = "calendarShowLockouts" },
{text = CALENDAR_FILTER_RAID_RESETS, cvar = "calendarShowResets" },
{text = CALENDAR_FILTER_WEEKLY_HOLIDAYS, cvar = "calendarShowWeeklyHolidays" },
{text = CALENDAR_FILTER_BATTLEGROUND, cvar = "calendarShowBattlegrounds" },
};
......@@ -1142,7 +1125,7 @@ function CalendarFrame_OnEvent(self, event, ...)
local calendarType = ...;
if ( calendarType == "HOLIDAY" ) then
CalendarFrame_ShowEventFrame(CalendarViewHolidayFrame);
elseif ( calendarType == "RAID_RESET" or calendarType == "RAID_LOCKOUT" ) then
elseif ( calendarType == "RAID_LOCKOUT" ) then
CalendarFrame_ShowEventFrame(CalendarViewRaidFrame);
else
-- for now, it could only be a player-created type
......@@ -1633,7 +1616,7 @@ function CalendarFrame_UpdateDayEvents(index, day, monthOffset, selectedEventInd
eventButtonText1:ClearAllPoints();
eventButtonText1:SetAllPoints(eventButton);
eventButtonText1:Show();
elseif ( event.calendarType == "RAID_LOCKOUT" or event.calendarType == "RAID_RESET" ) then
elseif ( event.calendarType == "RAID_LOCKOUT" ) then
eventButtonText2:Hide();
-- Lockouts pass in a title string; resets pass in a string key
local title = GetDungeonNameWithDifficulty(eventTitle, event.difficultyName);
......@@ -2212,7 +2195,7 @@ function CalendarDayContextMenu_Initialize(self, flags, dayButton, eventButton)
local needSpacer = false;
if ( showDay ) then
UIMenu_AddButton(self, CALENDAR_CREATE_EVENT, nil, CalendarDayContextMenu_CreateEvent);
-- add guild selections if the player has a guild
if ( CanEditGuildEvent() ) then
UIMenu_AddButton(self, CALENDAR_CREATE_GUILD_EVENT, nil, CalendarDayContextMenu_CreateGuildEvent);
......@@ -2540,7 +2523,7 @@ function CalendarDayButton_OnEnter(self)
eventTime = GameTime_GetFormattedTime(event.startTime.hour, event.startTime.minute, true);
end
eventColor = _CalendarFrame_GetEventColor(event.calendarType, event.modStatus, event.inviteStatus, true);
if ( event.calendarType == "RAID_RESET" or event.calendarType == "RAID_LOCKOUT" ) then
if ( event.calendarType == "RAID_LOCKOUT" ) then
title = GetDungeonNameWithDifficulty(title, event.difficultyName);
end
GameTooltip:AddDoubleLine(
......@@ -2827,24 +2810,16 @@ function CalendarViewRaidFrame_OnShow(self)
CalendarViewRaidFrame_Update();
end
function CalendarViewRaidFrame_OnHide(self)
end
function CalendarViewRaidFrame_Update()
local indexInfo = C_Calendar.GetEventIndex();
local raidInfo = C_Calendar.GetRaidInfo(indexInfo.offsetMonths, indexInfo.monthDay, indexInfo.eventIndex);
if ( raidInfo.calendarType == "RAID_LOCKOUT" ) then
local raidInfo = indexInfo and C_Calendar.GetRaidInfo(indexInfo.offsetMonths, indexInfo.monthDay, indexInfo.eventIndex);
if raidInfo and raidInfo.calendarType == "RAID_LOCKOUT" then
local name = GetDungeonNameWithDifficulty(raidInfo.name, raidInfo.difficultyName);
CalendarTitleFrame_SetText(CalendarViewRaidTitleFrame, name);
CalendarViewRaidDescription:SetFormattedText(CALENDAR_RAID_LOCKOUT_DESCRIPTION, name, GameTime_GetFormattedTime(raidInfo.time.hour, raidInfo.time.minute, true));
else
-- calendarType should be "RAID_RESET"
CalendarTitleFrame_SetText(CalendarViewRaidTitleFrame, RAID);
CalendarViewRaidDescription:SetFormattedText(CALENDAR_RAID_RESET_DESCRIPTION, RAID, GameTime_GetFormattedTime(raidInfo.time.hour, raidInfo.time.minute, true));
end
end
-- Calendar Event Templates
function CalendarEventCloseButton_OnClick(self)
......@@ -3176,7 +3151,7 @@ function CalendarViewEventFrame_Update()
CalendarViewEventTypeName:SetPoint("TOPLEFT", CalendarViewEventCommunityName, "BOTTOMLEFT")
if ( eventInfo.calendarType == "GUILD_EVENT" ) then
CalendarViewEventCommunityName:SetTextColor(GREEN_FONT_COLOR:GetRGB())
else
else
CalendarViewEventCommunityName:SetTextColor(NORMAL_FONT_COLOR:GetRGB())
end
else
......@@ -3719,7 +3694,7 @@ function CalendarCreateEventFrame_Update()
else
CalendarCreateEventDateLabel:SetPoint("TOPLEFT", CalendarCreateEventIcon, "TOPRIGHT", 5, 0)
end
local calendarType = C_Calendar.EventGetCalendarType();
CalendarCreateEventCommunityDropDown:SetShown(calendarType == "COMMUNITY_EVENT");
......@@ -3827,7 +3802,7 @@ function CalendarCreateEventFrame_Update()
CalendarCreateEventTextureName:SetPoint("TOPLEFT", CalendarCreateEventIcon, "TOPRIGHT", 5, 0)
CalendarCreateEventCommunityName:Hide();
end
if ( eventInfo.calendarType == "GUILD_ANNOUNCEMENT" ) then
CalendarTitleFrame_SetText(CalendarCreateEventTitleFrame, CALENDAR_EDIT_ANNOUNCEMENT);
-- guild wide events don't have invites
......@@ -3838,7 +3813,7 @@ function CalendarCreateEventFrame_Update()
else
if ( eventInfo.calendarType == "GUILD_EVENT" ) then
CalendarTitleFrame_SetText(CalendarCreateEventTitleFrame, CALENDAR_EDIT_GUILD_EVENT);
elseif ( eventInfo.calendarType == "COMMUNITY_EVENT" ) then
elseif ( eventInfo.calendarType == "COMMUNITY_EVENT" ) then
CalendarTitleFrame_SetText(CalendarCreateEventTitleFrame, CALENDAR_EDIT_COMMUNITY_EVENT);
else
CalendarTitleFrame_SetText(CalendarCreateEventTitleFrame, CALENDAR_EDIT_EVENT);
......@@ -4578,9 +4553,9 @@ function CalendarCreateEventMassInviteButton_OnUpdate(self)
end
function CalendarCreateEventMassInviteButton_Update()
local clubs = C_Club.GetSubscribedClubs()
if (#clubs > 0) then
CalendarCreateEventMassInviteButton:Enable();
else
......@@ -4830,7 +4805,7 @@ function CalendarMassInviteCommunityDropDown_OnClick(self, clubId)
if(clubInfo == nil) then
return;
end
UIDropDownMenu_SetSelectedValue(CalendarMassInviteCommunityDropDown, self:GetText());
CalendarMassInviteFrame.selectedClubId = clubId;
CalendarMassInvite_Update();
......@@ -5041,7 +5016,7 @@ function CalendarEventPickerScrollFrame_Update()
buttonTime:Hide();
buttonTitle:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT");
else
if ( event.calendarType == "RAID_RESET" or event.calendarType == "RAID_LOCKOUT" ) then
if ( event.calendarType == "RAID_LOCKOUT" ) then
title = GetDungeonNameWithDifficulty(title, event.difficultyName);
end
buttonTime:SetText(GameTime_GetFormattedTime(date.hour, date.minute, true));
......
......@@ -686,7 +686,6 @@
<Scripts>
<OnLoad function="CalendarViewRaidFrame_OnLoad"/>
<OnShow function="CalendarViewRaidFrame_OnShow"/>
<OnHide function="CalendarViewRaidFrame_OnHide"/>
</Scripts>
</Frame>
......@@ -1148,7 +1147,7 @@
ScrollingEdit_OnTextChanged(self, self:GetParent());
C_Calendar.EventSetDescription(self:GetText());
CalendarCreateEventCreateButton_Update();
</OnTextChanged>
</OnTextChanged>
<OnCursorChanged function="ScrollingEdit_OnCursorChanged"/>
<OnUpdate>
ScrollingEdit_OnUpdate(self, elapsed, self:GetParent());
......
local NUM_REWARDS_PER_MEDAL = 2;
local MAXIMUM_REWARDS_LEVEL = 15;
local MAX_PER_ROW = 9;
local MAX_PER_ROW = 9;
local function CreateFrames(self, array, num, template)
while (#self[array] < num) do
......@@ -14,21 +14,73 @@ end
local function ReanchorFrames(frames, anchorPoint, anchor, relativePoint, width, spacing, distance)
local num = #frames;
local fullWidth = (width * num) + (spacing * (num - 1));
local numButtons = math.min(MAX_PER_ROW, num);
local fullWidth = (width * numButtons) + (spacing * (numButtons - 1));
local halfWidth = fullWidth / 2;
local numRows = math.floor((num + MAX_PER_ROW - 1) / MAX_PER_ROW) - 1;
local fullDistance = numRows * frames[1]:GetHeight() + (numRows + 1) * distance;
-- First frame
frames[1]:ClearAllPoints();
frames[1]:SetPoint(anchorPoint, anchor, relativePoint, -halfWidth, 5);
frames[1]:SetPoint(anchorPoint, anchor, relativePoint, -halfWidth, fullDistance);
-- first row
for i = 2, math.min(MAX_PER_ROW, #frames) do
frames[i]:SetPoint("LEFT", frames[i-1], "RIGHT", spacing, 0);
end
-- n-rows after
if (num > MAX_PER_ROW) then
local calculateWidth = fullWidth / num;
for i = 2, #frames do
frames[i]:SetWidth(calculateWidth);
frames[i]:SetPoint("LEFT", frames[i-1], "RIGHT", 0, 0);
local currentExtraRow = 0;
local finished = false;
repeat
local setFirst = false;
for i = (MAX_PER_ROW + (MAX_PER_ROW * currentExtraRow)) + 1, (MAX_PER_ROW + (MAX_PER_ROW * currentExtraRow)) + MAX_PER_ROW do
if (not frames[i]) then
finished = true;
break;
end
if (not setFirst) then
frames[i]:SetPoint("TOPLEFT", frames[i - (MAX_PER_ROW + (MAX_PER_ROW * currentExtraRow))], "BOTTOMLEFT", 0, -distance);
setFirst = true;
else
frames[i]:SetPoint("LEFT", frames[i-1], "RIGHT", spacing, 0);
end
end
currentExtraRow = currentExtraRow + 1;
until finished;
end
end
local function LineUpFrames(frames, anchorPoint, anchor, relativePoint, width)
local num = #frames;
local distanceBetween = 2;
local spacingWidth = distanceBetween * num;
local widthRemaining = width - spacingWidth;
local halfWidth = width / 2;
local calculateWidth = widthRemaining / num;
-- First frame
frames[1]:ClearAllPoints();
if(frames[1].Icon) then
frames[1].Icon:SetSize(calculateWidth, calculateWidth);
end
frames[1]:SetSize(calculateWidth, calculateWidth);
frames[1]:SetPoint(anchorPoint, anchor, relativePoint, -halfWidth, 5);
for i = 2, #frames do
if(frames[i].Icon) then
frames[i].Icon:SetSize(calculateWidth, calculateWidth);
end
end
frames[i].Icon:SetSize(calculateWidth, calculateWidth);
frames[i]:SetSize(calculateWidth, calculateWidth);
frames[i]:SetPoint("LEFT", frames[i-1], "RIGHT", distanceBetween, 0);
end
end
function ChallengesFrame_OnLoad(self)
......@@ -37,6 +89,7 @@ function ChallengesFrame_OnLoad(self)
self:RegisterEvent("CHALLENGE_MODE_MEMBER_INFO_UPDATED");
self:RegisterEvent("CHALLENGE_MODE_LEADERS_UPDATE");
self:RegisterEvent("CHALLENGE_MODE_COMPLETED");
self:RegisterEvent("CHALLENGE_MODE_RESET");
self.leadersAvailable = false;
self.maps = C_ChallengeMode.GetMapTable();
......@@ -88,17 +141,22 @@ function ChallengesFrame_Update(self)
table.sort(sortedMaps, function(a, b) return a.level > b.level end);
local frameWidth, spacing, distance = 52, 2, 1;
local frameWidth = self.WeeklyInfo:GetWidth()
local num = #sortedMaps;
CreateFrames(self, "DungeonIcons", num, "ChallengesDungeonIconFrameTemplate");
ReanchorFrames(self.DungeonIcons, "BOTTOMLEFT", self, "BOTTOM", frameWidth, spacing, distance);
LineUpFrames(self.DungeonIcons, "BOTTOMLEFT", self, "BOTTOM", frameWidth);
for i = 1, #sortedMaps do
for i = 1, #sortedMaps do
local frame = self.DungeonIcons[i];