Skip to content

Commit

Permalink
8.3.0 (33084)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ketho committed Jan 18, 2020
1 parent 5e88046 commit ebb38d3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
19 changes: 13 additions & 6 deletions AddOns/Blizzard_AlliedRacesUI/Blizzard_AlliedRacesFrameUI.lua
Expand Up @@ -146,6 +146,10 @@ function AlliedRacesBulletFrameMixin:SetUp(achievementID, criteriaIndex, objecti
local BULLET_SPACING = 14;
local TEXT_ANCHOR_POINT_X = 27; -- from XML
local criteriaString, criteriaType, completed, quantity, reqQuantity, charName, flags, assetID, quantityString = GetAchievementCriteriaInfo(achievementID, criteriaIndex);
local _, _, _, achievementCompleted = GetAchievementInfo(achievementID);

completed = completed or achievementCompleted;

if (criteriaString and criteriaString ~= "") then
self.achievementID = achievementID;
self.criteriaIndex = criteriaIndex;
Expand Down Expand Up @@ -177,19 +181,22 @@ end
function AlliedRacesBulletFrameMixin:OnEnter()
GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
local criteriaString, criteriaType, criteriaCompleted, quantity, reqQuantity, charName, flags, assetID, quantityString = GetAchievementCriteriaInfo(self.achievementID, self.criteriaIndex);

local achievementID = self.achievementID;
local _, _, _, overallAchievementCompleted = GetAchievementInfo(achievementID);
local criteriaAchievementCompleted, month, day, year;

if criteriaCompleted then
if criteriaCompleted or overallAchievementCompleted then
-- check if the criteria is an achievement to use its completion date, otherwise try main achievement in case it's all complete
local achievementID = self.achievementID;
if AchievementUtil.IsCriteriaAchievementEarned(self.achievementID, self.criteriaIndex) then
achievementID = assetID;
_, _, _, criteriaAchievementCompleted, month, day, year = GetAchievementInfo(achievementID); --Grab the criteria completed info if we have earned it.
end
local id, name, points, achievementCompleted, month, day, year = GetAchievementInfo(achievementID);
if achievementCompleted then
if (criteriaAchieveCompleted) then
local completionDate = FormatShortDate(day, month, year);
GameTooltip_AddColoredLine(GameTooltip, CRITERIA_COMPLETED_DATE:format(completionDate), HIGHLIGHT_FONT_COLOR);
else
GameTooltip_AddColoredLine(GameTooltip, CRITERIA_COMPLETED, HIGHLIGHT_FONT_COLOR);
else
GameTooltip_AddColoredLine(GameTooltip, CRITERIA_COMPLETED, HIGHLIGHT_FONT_COLOR);
end
else
GameTooltip_SetTitle(GameTooltip, CRITERIA_NOT_COMPLETED, DISABLED_FONT_COLOR);
Expand Down
Expand Up @@ -141,10 +141,10 @@
</Texture>

<FontString parentKey="Text" inherits="Number14FontWhite" justifyH="LEFT" maxLines="1">
<Size x="0" y="1"/>
<Anchors>
<Anchor point="TOP"/>
<Anchor point="LEFT" relativeKey="$parent.Icon" relativePoint="RIGHT" x="4" y="-1"/>
<Anchor point="BOTTOMRIGHT"/>
<Anchor point="RIGHT" x="1"/>
</Anchors>
</FontString>
</Layer>
Expand Down

0 comments on commit ebb38d3

Please sign in to comment.