diff --git a/Interface/AddOns/Blizzard_AccountStore/Blizzard_AccountStoreCardTemplates.lua b/Interface/AddOns/Blizzard_AccountStore/Blizzard_AccountStoreCardTemplates.lua index 4fa6794d3..6a7ee76eb 100644 --- a/Interface/AddOns/Blizzard_AccountStore/Blizzard_AccountStoreCardTemplates.lua +++ b/Interface/AddOns/Blizzard_AccountStore/Blizzard_AccountStoreCardTemplates.lua @@ -149,6 +149,8 @@ function AccountStoreBaseCardMixin:SetItemID(itemID) if isRefundable then self.BuyButton:SetText(PLUNDERSTORE_REFUND_BUTTON_TEXT); + elseif isOwned then + self.BuyButton:SetText(PLUNDERSTORE_ALREADY_OWNED_TOOLTIP); else self.BuyButton:SetText(AccountStoreUtil.FormatCurrencyDisplay(itemInfo.price, itemInfo.currencyID)); end diff --git a/Interface/AddOns/Blizzard_AccountStore/Blizzard_AccountStoreUtil.lua b/Interface/AddOns/Blizzard_AccountStore/Blizzard_AccountStoreUtil.lua index 17e639299..b0e601d86 100644 --- a/Interface/AddOns/Blizzard_AccountStore/Blizzard_AccountStoreUtil.lua +++ b/Interface/AddOns/Blizzard_AccountStore/Blizzard_AccountStoreUtil.lua @@ -46,7 +46,7 @@ function AccountStoreUtil.IsCurrencyAtWarningThreshold(accountStoreCurrencyID) return false; end -function AccountStoreUtil.FormatCurrencyDisplayWithWarning(accountStoreCurrencyID, currencyAmount) +function AccountStoreUtil.FormatCurrencyDisplayWithWarning(accountStoreCurrencyID, currencyAmount, hideIcon) local currencyInfo = C_AccountStore.GetCurrencyInfo(accountStoreCurrencyID); if not currencyInfo then return ""; @@ -57,17 +57,27 @@ function AccountStoreUtil.FormatCurrencyDisplayWithWarning(accountStoreCurrencyI end currencyAmount = BreakUpLargeNumbers(currencyAmount or currencyInfo.amount); + local showWarning = false; if currencyInfo.maxQuantity then if currencyInfo.amount >= currencyInfo.maxQuantity then currencyAmount = RED_FONT_COLOR:WrapTextInColorCode(currencyAmount); - return PrependWarning(AppendIcon(currencyAmount)); + showWarning = true; elseif currencyInfo.amount >= (currencyInfo.maxQuantity * AccountStoreWarningThresholdPercentage) then currencyAmount = NORMAL_FONT_COLOR:WrapTextInColorCode(currencyAmount); - return PrependWarning(AppendIcon(currencyAmount)); + showWarning = true; end end + + local currencyText = currencyAmount; + if not hideIcon then + currencyText = AppendIcon(currencyText); + end + + if showWarning then + currencyText = PrependWarning(currencyText); + end - return AppendIcon(currencyAmount); + return currencyText; end function AccountStoreUtil.AddCurrencyTotalTooltip(tooltip, accountStoreCurrencyID) @@ -102,7 +112,7 @@ function AccountStoreUtil.ShowDisabledItemInfoTooltip(frame, itemInfo) if itemInfo.status == Enum.AccountStoreItemStatus.Refundable then tooltip:SetText(PLUNDERSTORE_REFUNDABLE_TOOLTIP); elseif itemInfo.status == Enum.AccountStoreItemStatus.Owned then - tooltip:SetText(PLUNDERSTORE_ALREADY_OWNED_TOOLTIP); + tooltip:SetText(HIGHLIGHT_FONT_COLOR:WrapTextInColorCode(AccountStoreUtil.FormatCurrencyDisplay(itemInfo.price, itemInfo.currencyID))); else tooltip:SetText(PLUNDERSTORE_INSUFFICIENT_FUNDS_TOOLTIP); end diff --git a/Interface/AddOns/Blizzard_EndOfMatchUI/Blizzard_EndOfMatchUI.lua b/Interface/AddOns/Blizzard_EndOfMatchUI/Blizzard_EndOfMatchUI.lua index ee821a7b8..b7c1ce6ec 100644 --- a/Interface/AddOns/Blizzard_EndOfMatchUI/Blizzard_EndOfMatchUI.lua +++ b/Interface/AddOns/Blizzard_EndOfMatchUI/Blizzard_EndOfMatchUI.lua @@ -189,9 +189,11 @@ function MatchDetailFrameMixin:Init(type, description, value, iconAtlas) self:Show(); if type == Enum.MatchDetailType.PlunderAcquired then + C_AccountStore.RequestStoreFrontInfoUpdate(Constants.AccountStoreConsts.PlunderstormStoreFrontID); local accountStoreCurrencyID = C_AccountStore.GetCurrencyIDForStore(Constants.AccountStoreConsts.PlunderstormStoreFrontID); if value and accountStoreCurrencyID then - value = AccountStoreUtil.FormatCurrencyDisplayWithWarning(accountStoreCurrencyID, value); + local hideIcon = true; + value = AccountStoreUtil.FormatCurrencyDisplayWithWarning(accountStoreCurrencyID, value, hideIcon); end self.Description:SetText(description); diff --git a/Interface/AddOns/Blizzard_UnitFrame/UnitFrame.lua b/Interface/AddOns/Blizzard_UnitFrame/UnitFrame.lua index 12b3ba93c..c690a5bb3 100644 --- a/Interface/AddOns/Blizzard_UnitFrame/UnitFrame.lua +++ b/Interface/AddOns/Blizzard_UnitFrame/UnitFrame.lua @@ -388,6 +388,11 @@ end function UnitFrame_UpdateTooltip (self) GameTooltip_SetDefaultAnchor(GameTooltip, self); if ( GameTooltip:SetUnit(self.unit, self.hideStatusOnTooltip) ) then + -- Should be moved to line data in a future revision. + GameTooltip_AddBlankLineToTooltip(GameTooltip); + GameTooltip_AddInstructionLine(GameTooltip, UNIT_POPUP_RIGHT_CLICK); + GameTooltip:Show(); + self.UpdateTooltip = UnitFrame_UpdateTooltip; else self.UpdateTooltip = nil;