Skip to content

Commit

Permalink
fix item id
Browse files Browse the repository at this point in the history
  • Loading branch information
eugene-doobu committed Jan 8, 2025
1 parent 5480bf8 commit 2da251d
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions nekoyume/Assets/_Scripts/UI/Module/PatrolRewardModule.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Nekoyume.ApiClient;
using Nekoyume.Blockchain;
using Nekoyume.Helper;
using Nekoyume.L10n;
using Nekoyume.State;
Expand Down Expand Up @@ -63,7 +60,6 @@ public void SetData()
}

SetIntervalText(PatrolReward.Interval);
// SetPatrolTime(PatrolReward.PatrolTime.Value, PatrolReward.Interval); // 구독하고 있으니 필요 없지 않나?
}

#region UI
Expand Down Expand Up @@ -102,25 +98,16 @@ private void SetIntervalText(long interval)
gaugeUnitText2.text = interval.BlockRangeToTimeSpanString();
}

public static string TimeSpanToString(TimeSpan time)
{
var hourExist = time.TotalHours >= 1;
var minuteExist = time.Minutes >= 1;
var hourText = hourExist ? $"{(int)time.TotalHours}h " : string.Empty;
var minuteText = minuteExist || !hourExist ? $"{time.Minutes}m" : string.Empty;
return $"{hourText}{minuteText}";
}

private static Sprite GetSprite(PatrolRewardModel reward)
{
if (reward.ItemId != null)
if (reward.ItemId != null && reward.ItemId != 0)
{
return SpriteHelper.GetItemIcon(reward.ItemId.Value);
}

return !string.IsNullOrEmpty(reward.Currency) ? SpriteHelper.GetFavIcon(reward.Currency) : null;
}

#endregion
#endregion UI
}
}

0 comments on commit 2da251d

Please sign in to comment.