Skip to content

Commit

Permalink
add tool tip for FavList
Browse files Browse the repository at this point in the history
  • Loading branch information
jonny-jeahyunchoi committed Nov 22, 2024
1 parent ca86e89 commit 997d0fb
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions nekoyume/Assets/_Scripts/UI/Widget/Popup/SeasonPassPremiumPopup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ private void ProcessProduct(InAppPurchaseServiceClient.ProductSchema product, Ba
for (var i = 0; i < product.FavList.Count && index < rewards.Length; i++, index++)
{
rewards[index].ItemViewSetCurrencyData(product.FavList[i].Ticker, product.FavList[i].Amount);
AddToolTip(rewards[index], product.FavList[i].Ticker, product.FavList[i].Amount);
}

for (var i = 0; i < product.FungibleItemList.Count && index < rewards.Length; i++, index++)
Expand All @@ -247,6 +248,7 @@ private void AddToolTip(BaseItemView itemView, int itemId)
{
if (itemView.TryGetComponent<SeasonPassPremiumItemView>(out var seasonPassPremiumItemView))
{
seasonPassPremiumItemView.TooltipButton.onClick.RemoveAllListeners();
var itemSheetData = Game.Game.instance.TableSheets.ItemSheet[itemId];
if (seasonPassPremiumItemView.TooltipButton.onClick.GetPersistentEventCount() < 1)
{
Expand All @@ -266,6 +268,22 @@ private void AddToolTip(BaseItemView itemView, int itemId)
}
}

private void AddToolTip(BaseItemView itemView, string ticker, decimal amount)
{
if (itemView.TryGetComponent<SeasonPassPremiumItemView>(out var seasonPassPremiumItemView))
{
seasonPassPremiumItemView.TooltipButton.onClick.RemoveAllListeners();
if (seasonPassPremiumItemView.TooltipButton.onClick.GetPersistentEventCount() < 1)
{
seasonPassPremiumItemView.TooltipButton.onClick.AddListener(() =>
{
Find<FungibleAssetTooltip>().Show(ticker, amount.ToCurrencyNotation(), null);
});
}
}
}


private void RefreshIcons(SeasonPassServiceClient.UserSeasonPassSchema seasonPassInfo)
{
if (seasonPassInfo == null)
Expand Down

0 comments on commit 997d0fb

Please sign in to comment.