Skip to content

Commit

Permalink
apply EnableEventRewardPopup data
Browse files Browse the repository at this point in the history
  • Loading branch information
eugene-doobu committed Jan 8, 2025
1 parent 9c78d54 commit 4a435d9
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 11 deletions.
3 changes: 3 additions & 0 deletions nekoyume/Assets/_Scripts/UI/Model/EventRewardPopupData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,13 @@ public class Content
public ShortcutHelper.PlaceType[] ShortcutTypes { get; set; }
}

public bool EnableEventRewardPopup { get; set; }
public string TitleL10NKey { get; set; }
public EventReward[] EventRewards { get; set; }

public Content EnabledThorChainContent { get; set; }
public Content DisabledThorChainContent { get; set; }

public bool HasEvent => EnableEventRewardPopup && (EventRewards?.Length ?? 0) > 0;
}
}
4 changes: 2 additions & 2 deletions nekoyume/Assets/_Scripts/UI/Tutorial/TutorialController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ private static int GetCheckPoint(int clearedStageId)
if (checkPoint is 100000 or 101000)
{
// if check point is in patrol reward tutorial, play patrol reward tutorial for event condition
return !LiveAssetManager.instance.EventRewardPopupData.EventRewards.Any()
return !LiveAssetManager.instance.EventRewardPopupData.HasEvent
? 100000
: 101000;
}
Expand All @@ -253,7 +253,7 @@ void Check(int stageIdForTutorial) // ex) 5, 10
// Skip tutorial 7 (portal reward) in K version
}
else if (clearedStageId == 10 &&
LiveAssetManager.instance.EventRewardPopupData.EventRewards.Any())
LiveAssetManager.instance.EventRewardPopupData.HasEvent)
{
// if there is event reward data, play other patrol reward tutorial for event
checkPoint = 101000;
Expand Down
2 changes: 1 addition & 1 deletion nekoyume/Assets/_Scripts/UI/Widget/LobbyMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ public override void Show(bool ignoreShowAnimation = false)
var thorSchedule = LiveAssetManager.instance.ThorSchedule;
thorSeasonButton.gameObject.SetActive(thorSchedule?.IsOpened == true);

var isInEventDate = LiveAssetManager.instance.EventRewardPopupData.EventRewards.Any();
var isInEventDate = LiveAssetManager.instance.EventRewardPopupData.HasEvent;
btnPatrolReward.gameObject.SetActive(!isInEventDate);
btnEventReward.gameObject.SetActive(isInEventDate);
}
Expand Down
17 changes: 10 additions & 7 deletions nekoyume/Assets/_Scripts/UI/Widget/Popup/EventRewardPopup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public bool HasEvent
}

var eventRewardPopupData = liveAssetManager.EventRewardPopupData;
return eventRewardPopupData.EventRewards.Length > 0;
return eventRewardPopupData.HasEvent;
}
}

Expand Down Expand Up @@ -153,8 +153,9 @@ public override void Initialize()

public override void Show(bool ignoreShowAnimation = false)
{
var eventRewards = LiveAssetManager.instance.EventRewardPopupData.EventRewards;
if (eventRewards.Length == 0)
var eventRewardData = LiveAssetManager.instance.EventRewardPopupData;
var eventRewards = eventRewardData.EventRewards;
if (!eventRewardData.HasEvent)
{
NcDebug.LogError("No event rewards.");
return;
Expand Down Expand Up @@ -182,8 +183,9 @@ public override void Show(bool ignoreShowAnimation = false)

public void ShowAsThorChain()
{
var eventRewards = LiveAssetManager.instance.EventRewardPopupData.EventRewards;
if (eventRewards.Length == 0)
var eventRewardData = LiveAssetManager.instance.EventRewardPopupData;
var eventRewards = eventRewardData.EventRewards;
if (!eventRewardData.HasEvent)
{
NcDebug.LogError("No event rewards.");
return;
Expand All @@ -198,8 +200,9 @@ public void ShowAsThorChain()

public void ShowAsPatrolReward()
{
var eventRewards = LiveAssetManager.instance.EventRewardPopupData.EventRewards;
if (eventRewards.Length == 0)
var eventRewardData = LiveAssetManager.instance.EventRewardPopupData;
var eventRewards = eventRewardData.EventRewards;
if (!eventRewardData.HasEvent)
{
NcDebug.LogError("No event rewards.");
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ public void ShowCurrency(CostType costType)

Lobby.Enter(true);
Find<HeaderMenuStatic>().UpdateAssets(HeaderMenuStatic.AssetVisibleState.Main);
var isInEventDate = LiveAssetManager.instance.EventRewardPopupData.EventRewards.Any();
var isInEventDate = LiveAssetManager.instance.EventRewardPopupData.HasEvent;
if (isInEventDate)
{
Find<EventRewardPopup>().Show();
Expand Down

0 comments on commit 4a435d9

Please sign in to comment.