Skip to content

Commit

Permalink
Merge pull request #3695 from planetarium/bugfix/reddot
Browse files Browse the repository at this point in the history
Fix headmenu inventory to check cleared stage for notification(red-dot)
  • Loading branch information
tyrosine1153 authored Nov 28, 2023
2 parents 624a277 + 74cfc2b commit 1adf3e0
Showing 1 changed file with 39 additions and 3 deletions.
42 changes: 39 additions & 3 deletions nekoyume/Assets/_Scripts/UI/Module/Inventory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -647,13 +647,32 @@ private void UpdateDimmedInventoryItem()

public bool HasNotification()
{
var clearedStageId = States.Instance.CurrentAvatarState
.worldInformation.TryGetLastClearedStageId(out var id) ? id : 1;
var equipments = GetBestEquipments();
foreach (var guid in equipments)
{
var slots = States.Instance.CurrentItemSlotStates.Values;
if (slots.Any(x => !x.Equipments.Exists(x => x == guid)))
foreach (var slotState in slots.Where(x => !x.Equipments.Exists(x => x == guid)))
{
return true;
if (slotState.BattleType == BattleType.Arena)
{
if (clearedStageId >= Game.LiveAsset.GameConfig.RequiredStage.Arena)
{
return true;
}
}
else if (slotState.BattleType == BattleType.Raid)
{
if (clearedStageId >= Game.LiveAsset.GameConfig.RequiredStage.Arena)
{
return true;
}
}
else
{
return true;
}
}
}

Expand All @@ -666,7 +685,24 @@ public bool HasNotification()
var slots = States.Instance.CurrentRuneSlotStates[battleType].GetRuneSlot();
if (!slots.Exists(x => x.RuneId == inventoryItem.RuneState.RuneId))
{
return true;
if (battleType == BattleType.Arena)
{
if (clearedStageId >= Game.LiveAsset.GameConfig.RequiredStage.Arena)
{
return true;
}
}
else if (battleType == BattleType.Raid)
{
if (clearedStageId >= Game.LiveAsset.GameConfig.RequiredStage.Arena)
{
return true;
}
}
else
{
return true;
}
}
}
}
Expand Down

0 comments on commit 1adf3e0

Please sign in to comment.