Skip to content

Commit

Permalink
Update show patrol popup at room entering
Browse files Browse the repository at this point in the history
  • Loading branch information
tyrosine1153 committed Oct 17, 2023
1 parent c980c5d commit 6156fe7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
8 changes: 8 additions & 0 deletions nekoyume/Assets/_Scripts/Game/Entrance/RoomEntering.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ namespace Nekoyume.Game.Entrance
public class RoomEntering : MonoBehaviour
{
private const int EventReleaseNotePopupLimitClearedStageId = 20;
private const int PatrolRewardPopupLimitClearedStageId = 20;

private void Start()
{
Expand Down Expand Up @@ -93,6 +94,13 @@ private IEnumerator Act()
{
var clearedStageId = worldInfo.TryGetLastClearedStageId(out var id) ? id : 1;

var patrolRewardPopup = Widget.Find<PatrolRewardPopup>();
if (patrolRewardPopup.CanClaim &&
clearedStageId > PatrolRewardPopupLimitClearedStageId)
{
patrolRewardPopup.Show();
}

var eventReleaseNotePopup = Widget.Find<EventReleaseNotePopup>();
if (eventReleaseNotePopup.HasUnread &&
clearedStageId > EventReleaseNotePopupLimitClearedStageId)
Expand Down
4 changes: 2 additions & 2 deletions nekoyume/Assets/_Scripts/UI/MainCanvas.cs
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,8 @@ public IEnumerator CreateSecondWidgets()
yield return null;
_secondWidgets.Add(Widget.Create<ArenaBoard>());
yield return null;
_secondWidgets.Add(Widget.Create<PatrolRewardPopup>());
yield return null;
_secondWidgets.Add(Widget.Create<EventReleaseNotePopup>());
yield return null;

Expand Down Expand Up @@ -379,8 +381,6 @@ public IEnumerator CreateSecondWidgets()
yield return null;
_secondWidgets.Add(Widget.Create<ShopListPopup>());
yield return null;
_secondWidgets.Add(Widget.Create<PatrolRewardPopup>());
yield return null;

// tooltip
_secondWidgets.Add(Widget.Create<EquipmentTooltip>());
Expand Down
3 changes: 3 additions & 0 deletions nekoyume/Assets/_Scripts/UI/Widget/Popup/PatrolRewardPopup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ private class RewardData
private Address _currentAvatarAddress;
private bool _initialized;

public bool CanClaim =>
PatrolReward.PatrolTime.Value >= PatrolReward.Interval && !Claiming.Value;

protected override void Awake()
{
base.Awake();
Expand Down

0 comments on commit 6156fe7

Please sign in to comment.