Skip to content

Commit

Permalink
11.0.2 (56421)
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Aug 30, 2024
1 parent 9dc03db commit a8545cf
Show file tree
Hide file tree
Showing 16 changed files with 145 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,22 @@ local SharedTraits =

Functions =
{
{
Name = "CanEditConfig",
Type = "Function",
Documentation = { "Returns whether the player can make changes to the specified talent config." },

Arguments =
{
{ Name = "configID", Type = "number", Nilable = false },
},

Returns =
{
{ Name = "canEdit", Type = "bool", Nilable = false },
{ Name = "errorMessage", Type = "cstring", Nilable = false, Documentation = { "If canEdit is false, this will be filled out with text explaining why the player can not make changes." } },
},
},
{
Name = "CanPurchaseRank",
Type = "Function",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ local Actor_X_ModelID = {
[82709] = "nightborne",
[86343] = "magharorc",
[86342] = "magharorc",
[121634] = "earthendwarf",
[121635] = "earthendwarf-female",
};

function AlliedRacesFrameMixin:UpdateModel(modelID)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
<CheckButton parentKey="AlliedRacesMaleButton" mixin="AlliedRacesMaleButtonMixin">
<Size x="35" y="35"/>
<Anchors>
<Anchor point="TOPRIGHT" relativeKey="$parent.ModelScene" relativePoint="TOPRIGHT" x="-10" y="-15"/>
<Anchor point="TOPRIGHT" x="-10" y="-15"/>
</Anchors>
<NormalTexture atlas="AlliedRace-UnlockingFrame-Male"/>
<CheckedTexture atlas="AlliedRace-UnlockingFrame-GenderSelectionGlow"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ end

function AuctionHouseCommoditiesSellFrameMixin:GetDepositAmount()
local item = self:GetItem();
if not item then
if not item or not item:IsValid() then
return 0;
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ end

function AuctionHouseSellFrameMixin:CanPostItem()
local item = self:GetItem();
if item == nil then
if item == nil or not item:IsValid() then
return false, AUCTION_HOUSE_SELL_FRAME_ERROR_ITEM;
end

Expand Down
55 changes: 27 additions & 28 deletions Interface/AddOns/Blizzard_ChallengesUI/Blizzard_ChallengesUI.lua
Original file line number Diff line number Diff line change
Expand Up @@ -506,44 +506,43 @@ function ChallengesDungeonIconMixin:SetUp(mapInfo, isFirst)
end
end

local function AddAffixScoreToTooltip(affixInfo)
GameTooltip_AddBlankLineToTooltip(GameTooltip);
GameTooltip_AddNormalLine(GameTooltip, LFG_LIST_BEST_RUN);
GameTooltip_AddColoredLine(GameTooltip, MYTHIC_PLUS_POWER_LEVEL:format(affixInfo.level), HIGHLIGHT_FONT_COLOR);

local displayZeroHours = affixInfo.durationSec >= SECONDS_PER_HOUR;
local durationText = SecondsToClock(affixInfo.durationSec, displayZeroHours);

if affixInfo.overTime then
local overtimeText = DUNGEON_SCORE_OVERTIME_TIME:format(durationText);
GameTooltip_AddColoredLine(GameTooltip, overtimeText, LIGHTGRAY_FONT_COLOR);
else
GameTooltip_AddColoredLine(GameTooltip, durationText, HIGHLIGHT_FONT_COLOR);
end
end

function ChallengesDungeonIconMixin:OnEnter()
local name = C_ChallengeMode.GetMapUIInfo(self.mapID);
GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
GameTooltip:SetText(name, 1, 1, 1);

local inTimeInfo, overtimeInfo = C_MythicPlus.GetSeasonBestForMap(self.mapID);
local affixScores, overAllScore = C_MythicPlus.GetSeasonBestAffixScoreInfoForMap(self.mapID);
local isOverTimeRun = false;

local seasonBestDurationSec, seasonBestLevel, members;
local affixScores, overallScore = C_MythicPlus.GetSeasonBestAffixScoreInfoForMap(self.mapID);

if(overAllScore and (inTimeInfo or overtimeInfo)) then
local color = C_ChallengeMode.GetSpecificDungeonOverallScoreRarityColor(overAllScore);
if(not color) then
color = HIGHLIGHT_FONT_COLOR;
end
GameTooltip_AddNormalLine(GameTooltip, DUNGEON_SCORE_TOTAL_SCORE:format(color:WrapTextInColorCode(overAllScore)), GREEN_FONT_COLOR);
if overallScore and (inTimeInfo or overtimeInfo) then
local color = C_ChallengeMode.GetSpecificDungeonOverallScoreRarityColor(overallScore) or HIGHLIGHT_FONT_COLOR;
local overallText = DUNGEON_SCORE_TOTAL_SCORE:format(color:WrapTextInColorCode(overallScore));
GameTooltip_AddNormalLine(GameTooltip, overallText, GREEN_FONT_COLOR);
end

if(affixScores and #affixScores > 0) then
for _, affixInfo in ipairs(affixScores) do
GameTooltip_AddBlankLineToTooltip(GameTooltip);
GameTooltip_AddNormalLine(GameTooltip, DUNGEON_SCORE_BEST_AFFIX:format(affixInfo.name));
GameTooltip_AddColoredLine(GameTooltip, MYTHIC_PLUS_POWER_LEVEL:format(affixInfo.level), HIGHLIGHT_FONT_COLOR);
if(affixInfo.overTime) then
if(affixInfo.durationSec >= SECONDS_PER_HOUR) then
GameTooltip_AddColoredLine(GameTooltip, DUNGEON_SCORE_OVERTIME_TIME:format(SecondsToClock(affixInfo.durationSec, true)), LIGHTGRAY_FONT_COLOR);
else
GameTooltip_AddColoredLine(GameTooltip, DUNGEON_SCORE_OVERTIME_TIME:format(SecondsToClock(affixInfo.durationSec, false)), LIGHTGRAY_FONT_COLOR);
end
else
if(affixInfo.durationSec >= SECONDS_PER_HOUR) then
GameTooltip_AddColoredLine(GameTooltip, SecondsToClock(affixInfo.durationSec, true), HIGHLIGHT_FONT_COLOR);
else
GameTooltip_AddColoredLine(GameTooltip, SecondsToClock(affixInfo.durationSec, false), HIGHLIGHT_FONT_COLOR);
end
end
if affixScores then
local fastestAffixScore = TableUtil.FindMin(affixScores, function(affixScore)
return affixScore.durationSec;
end);

if fastestAffixScore then
AddAffixScoreToTooltip(fastestAffixScore);
end
end

Expand Down
19 changes: 15 additions & 4 deletions Interface/AddOns/Blizzard_ChatFrameBase/Mainline/ChatFrame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4942,6 +4942,13 @@ function ChatEdit_SetLastToldTarget(name, chatType)
ChatEdit_LastToldType = chatType;
end

local chatTypesThatRequireTellTarget =
{
BN_WHISPER = true,
WHISPER = true,
SMART_WHISPER = true,
};

function ChatEdit_UpdateHeader(editBox)
if IsMacroEditBox(editBox) then
return;
Expand All @@ -4952,6 +4959,11 @@ function ChatEdit_UpdateHeader(editBox)
return;
end

local tellTarget = editBox:GetAttribute("tellTarget");
if not tellTarget and chatTypesThatRequireTellTarget[type] then
return;
end

local info;
if ( type == "VOICE_TEXT" and VoiceTranscription_GetChatTypeAndInfo ) then
-- This can occur after loading ChatFrame.lua and before loading VoiceChatTranscriptionFrame.lua due to loading screen event signals, so nil check is required before calling the function.
Expand All @@ -4970,18 +4982,17 @@ function ChatEdit_UpdateHeader(editBox)
--BN_WHISPER FIXME
if ( type == "SMART_WHISPER" ) then
--If we have a bnetIDAccount or this name, it's a BN whisper.
if ( BNet_GetBNetIDAccount(editBox:GetAttribute("tellTarget")) ) then
if ( BNet_GetBNetIDAccount(tellTarget) ) then
editBox:SetAttribute("chatType", "BN_WHISPER");
else
editBox:SetAttribute("chatType", "WHISPER");
end
ChatEdit_UpdateHeader(editBox);
return;
elseif ( type == "WHISPER" ) then
header:SetFormattedText(CHAT_WHISPER_SEND, editBox:GetAttribute("tellTarget"));
header:SetFormattedText(CHAT_WHISPER_SEND, tellTarget);
elseif ( type == "BN_WHISPER" ) then
local name = editBox:GetAttribute("tellTarget");
header:SetFormattedText(CHAT_BN_WHISPER_SEND, name);
header:SetFormattedText(CHAT_BN_WHISPER_SEND, tellTarget);
elseif ( type == "EMOTE" ) then
header:SetFormattedText(CHAT_EMOTE_SEND, UnitName("player"));
elseif ( type == "CHANNEL" ) then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,24 +108,24 @@ function CommentatorNamePlateMixin:ApplyLossOfControlAtIndex(index)
end

function CommentatorNamePlateMixin:SetPointsByPixelUtil()
self.healthBar:ClearAllPoints();
PixelUtil.SetSize(self.healthBar, 190, barHeight);
PixelUtil.SetPoint(self.healthBar, "LEFT", self, "LEFT", 0, -10);
self.HealthBarsContainer:ClearAllPoints();
PixelUtil.SetSize(self.HealthBarsContainer, 190, barHeight);
PixelUtil.SetPoint(self.HealthBarsContainer, "LEFT", self, "LEFT", 0, -10);

self.healthBar:SetFrameLevel(self:GetFrameLevel() - 1);
self.HealthBarsContainer:SetFrameLevel(self:GetFrameLevel() - 1);

self.overAbsorbGlow:ClearAllPoints();
PixelUtil.SetPoint(self.overAbsorbGlow, "BOTTOMLEFT", self.healthBar, "BOTTOMRIGHT", -8, -1);
PixelUtil.SetPoint(self.overAbsorbGlow, "TOPLEFT", self.healthBar, "TOPRIGHT", -8, 1);
PixelUtil.SetPoint(self.overAbsorbGlow, "BOTTOMLEFT", self.HealthBarsContainer, "BOTTOMRIGHT", -8, -1);
PixelUtil.SetPoint(self.overAbsorbGlow, "TOPLEFT", self.HealthBarsContainer, "TOPRIGHT", -8, 1);
PixelUtil.SetHeight(self.overAbsorbGlow, 8);

self.overHealAbsorbGlow:ClearAllPoints();
--PixelUtil.SetPoint(self.overHealAbsorbGlow, "BOTTOMRIGHT", self.healthBar, "BOTTOMLEFT", 2, -1);
--PixelUtil.SetPoint(self.overHealAbsorbGlow, "TOPRIGHT", self.healthBar, "TOPLEFT", 2, 1);
--PixelUtil.SetPoint(self.overHealAbsorbGlow, "BOTTOMRIGHT", self.HealthBarsContainer, "BOTTOMLEFT", 2, -1);
--PixelUtil.SetPoint(self.overHealAbsorbGlow, "TOPRIGHT", self.HealthBarsContainer, "TOPLEFT", 2, 1);
--PixelUtil.SetWidth(self.overHealAbsorbGlow, 8);

PixelUtil.SetWidth(self.castBar, 170, barHeight);
PixelUtil.SetPoint(self.castBar, "TOP", self.healthBar, "BOTTOM", 0, -6);
PixelUtil.SetPoint(self.castBar, "TOP", self.HealthBarsContainer, "BOTTOM", 0, -6);

self.castBar.Text:ClearAllPoints();
local iconSize = barHeight + 2;
Expand All @@ -139,7 +139,7 @@ function CommentatorNamePlateMixin:SetPointsByPixelUtil()
self.castBar.border:UpdateSizes();

self.ClassIcon:ClearAllPoints();
PixelUtil.SetPoint(self.ClassIcon, "RIGHT", self.healthBar, "LEFT", 0, 0);
PixelUtil.SetPoint(self.ClassIcon, "RIGHT", self.HealthBarsContainer, "LEFT", 0, 0);

self.CCIcon:ClearAllPoints();
PixelUtil.SetPoint(self.CCIcon, "CENTER", self.ClassIcon, "CENTER", 0, 0);
Expand Down Expand Up @@ -187,7 +187,7 @@ end

function CommentatorNamePlateMixin:SetBorderColors()
local color = C_Commentator.GetTeamColorByUnit(self.unit);
self.healthBar.border:SetVertexColor(color.r, color.g, color.b, color.a);
self.HealthBarsContainer.border:SetVertexColor(color.r, color.g, color.b, color.a);
self.castBar.border:SetVertexColor(color.r, color.g, color.b, color.a);
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,18 @@ function DelvesDifficultyPickerFrameMixin:CheckForActiveDelveAndUpdate()
if C_DelvesUI.HasActiveDelve() then
local activeDelveGossip = C_GossipInfo.GetActiveDelveGossip();

self:SetSelectedLevel(activeDelveGossip.orderIndex);
self:SetSelectedOption(activeDelveGossip);
self:UpdateWidgets(activeDelveGossip.gossipOptionID);
-- Prefer active delve gossip (from walk in party)
if activeDelveGossip and activeDelveGossip.orderIndex and activeDelveGossip.gossipOptionID then
self:SetSelectedLevel(activeDelveGossip.orderIndex);
self:SetSelectedOption(activeDelveGossip);
self:UpdateWidgets(activeDelveGossip.gossipOptionID);
elseif self.selectedOption and self.selectedOption.orderIndex and self.selectedOption.gossipOptionID then
-- If active delve gossip is empty, player probably entered and then left. Fall back on the last selected tier/gossip,
-- which should match the active delve gossip
self:SetSelectedLevel(self.selectedOption.orderIndex);
self:SetSelectedOption(self.selectedOption);
self:UpdateWidgets(self.selectedOption.gossipOptionID);
end
self.DelveRewardsContainerFrame:SetRewards();
self.Dropdown:Update();
self.Dropdown:SetEnabled(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,13 @@ function GenericTraitFrameMixin:GetFrameLevelForButton(nodeInfo)
return TotalFrameLevelSpread - scaledYOffset;
end

function GenericTraitFrameMixin:IsLocked()
-- Overrides TalentFrameBaseMixin.

local canEditTalents, errorMessage = C_Traits.CanEditConfig(self:GetConfigID());
return not canEditTalents, errorMessage;
end

function GenericTraitFrameMixin:PurchaseRank(nodeID)
if self:ShouldShowConfirmation() then
local referenceKey = self;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ end

function NamePlateBaseMixin:GetPreferredInsets()
local frame = self.UnitFrame;
local health = frame.HealthBarsContainer;
local health = frame.HealthBarsContainer.healthBar;

local left = health:GetLeft() - frame:GetLeft();
local right = frame:GetRight() - health:GetRight();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ function Class_HunterStableWatcher:PET_STABLE_SHOW()
self:Complete();
return;
end
self:ShowPointerTutorial(NPEV2_HUNTER_STABLE_PET, "LEFT", PetStableStabledPet5, 10, 0, nil, "LEFT");
self:ShowPointerTutorial(NPEV2_HUNTER_STABLE_PET, "LEFT", StableFrame.ActivePetList.PetButton5, 10, 0, nil, "LEFT");
end

function Class_HunterStableWatcher:PET_STABLE_CLOSED()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ PlayerSpellsFrameMixin = {};
local PLAYER_SPELLS_HELP_SYSTEM = "PlayerSpellsHelpSystem"

local PlayerSpellsFrameEvents = {
"PLAYER_LEAVING_WORLD",
};

local PlayerSpellsFrameUnitEvents = {
Expand Down Expand Up @@ -78,6 +79,9 @@ function PlayerSpellsFrameMixin:OnEvent(event)
if event == "PLAYER_SPECIALIZATION_CHANGED" then
self:UpdateTabs();
self:UpdatePortrait();
elseif event == "PLAYER_LEAVING_WORLD" then
-- There's a lot of player spell info thrashing while exiting/re-entering world, avoid displaying during it
self:Hide();
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,29 @@
local Templates = {
["HEADER"] = { template = "SpellBookHeaderTemplate", initFunc = SpellBookHeaderMixin.Init },
["SPELL"] = { template = "SpellBookItemTemplate", initFunc = SpellBookItemMixin.Init, resetFunc = SpellBookItemMixin.Reset },
}
};

-- Events that should always be listened to
local SpellBookLifetimeEvents = {
"PLAYER_ENTERING_WORLD",
"PLAYER_LEAVING_WORLD",
};
-- Events that should only be listened to while in the world (avoided while entering/exiting it)
local SpellBookInWorldEvents = {
"LEARNED_SPELL_IN_SKILL_LINE",
"USE_GLYPH",
"ACTIVATE_GLYPH",
"CANCEL_GLYPH_CAST",
};

-- Events that should only be listened to while already visible
local SpellBookWhileVisibleEvents = {
"SPELLS_CHANGED",
"DISPLAY_SIZE_CHANGED",
"UI_SCALE_CHANGED",
}
};
local SpellBookWhileVisibleUnitEvents = {
"PLAYER_SPECIALIZATION_CHANGED",
}
};

SpellBookFrameMixin = CreateFromMixins(SpellBookFrameTutorialsMixin, SpellBookSearchMixin);

Expand Down Expand Up @@ -111,7 +117,11 @@ function SpellBookFrameMixin:OnHide()
end

function SpellBookFrameMixin:OnEvent(event, ...)
if event == "SPELLS_CHANGED" then
if event =="PLAYER_ENTERING_WORLD" then
FrameUtil.RegisterFrameForEvents(self, SpellBookInWorldEvents);
elseif event =="PLAYER_LEAVING_WORLD" then
FrameUtil.UnregisterFrameForEvents(self, SpellBookInWorldEvents);
elseif event == "SPELLS_CHANGED" then
self:UpdateAllSpellData();
elseif event == "PLAYER_SPECIALIZATION_CHANGED" then
local resetCurrentPage = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ function TalentSelectionChoiceMixin:OnClick(button)

selectionChoiceFrame:SetSelectedEntryID(self:GetEntryID());
end
else
elseif not self:GetTalentFrame():IsLocked() then
local baseButton = self:GetBaseButton();
if baseButton and self:IsGhosted() then
baseButton:ClearCascadeRepurchaseHistory();
Expand Down
30 changes: 30 additions & 0 deletions Interface/AddOns/Blizzard_SharedXMLBase/TableUtil.lua
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,36 @@ function TableUtil.Transform(tbl, op)
return result;
end

-- Returns the value in a table deemed smallest by evaluating each value returned by the op function parameter.
-- The return of the op function must return a number.
function TableUtil.FindMin(tbl, op)
local result = nil;
local min = math.huge;
for k, v in pairs(tbl) do
local value = op(v);
if value < min then
min = value;
result = v;
end
end
return result;
end

-- Returns the value in a table deemed largest by evaluating each value returned by the op function parameter.
-- The return of the op function must return a number.
function TableUtil.FindMax(tbl, op)
local result = nil;
local max = -math.huge;
for k, v in pairs(tbl) do
local value = op(v);
if value > max then
max = value;
result = v;
end
end
return result;
end

function ContainsIf(tbl, pred)
for k, v in pairs(tbl) do
if (pred(v)) then
Expand Down

0 comments on commit a8545cf

Please sign in to comment.