Skip to content

Commit

Permalink
Merge pull request #6915 from planetarium/feature/world-boss-fe-qa2
Browse files Browse the repository at this point in the history
Feature/world boss fe qa2
  • Loading branch information
eugene-doobu authored Mar 4, 2025
2 parents 5de5f66 + 58e3093 commit 12960f8
Show file tree
Hide file tree
Showing 6 changed files with 186 additions and 9 deletions.
138 changes: 138 additions & 0 deletions nekoyume/Assets/Resources/UI/Prefabs/UI_WorldBossDetail.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -9767,6 +9767,7 @@ RectTransform:
- {fileID: 7644466086119102246}
- {fileID: 8517378932449840340}
- {fileID: 7439634360647800081}
- {fileID: 9150990823094070913}
m_Father: {fileID: 6622272727240834826}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
Expand Down Expand Up @@ -14617,6 +14618,7 @@ MonoBehaviour:
- {fileID: 245066099996370167}
- {fileID: 1463323137200925030}
claimButton: {fileID: 2845927084220769327}
loadingIndicator: {fileID: 4732326752874114235}
--- !u!1 &1558876350121021388
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -154619,6 +154621,142 @@ RectTransform:
type: 3}
m_PrefabInstance: {fileID: 7663093498983080199}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &7944574180012577957
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 6223522880479349195}
m_Modifications:
- target: {fileID: 1206425615335586340, guid: 79ca869aa9be842b09fd026333ae8bf7,
type: 3}
propertyPath: m_Pivot.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 1206425615335586340, guid: 79ca869aa9be842b09fd026333ae8bf7,
type: 3}
propertyPath: m_Pivot.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 1206425615335586340, guid: 79ca869aa9be842b09fd026333ae8bf7,
type: 3}
propertyPath: m_RootOrder
value: 4
objectReference: {fileID: 0}
- target: {fileID: 1206425615335586340, guid: 79ca869aa9be842b09fd026333ae8bf7,
type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1206425615335586340, guid: 79ca869aa9be842b09fd026333ae8bf7,
type: 3}
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1206425615335586340, guid: 79ca869aa9be842b09fd026333ae8bf7,
type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1206425615335586340, guid: 79ca869aa9be842b09fd026333ae8bf7,
type: 3}
propertyPath: m_AnchorMin.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1206425615335586340, guid: 79ca869aa9be842b09fd026333ae8bf7,
type: 3}
propertyPath: m_SizeDelta.x
value: 54
objectReference: {fileID: 0}
- target: {fileID: 1206425615335586340, guid: 79ca869aa9be842b09fd026333ae8bf7,
type: 3}
propertyPath: m_SizeDelta.y
value: 18
objectReference: {fileID: 0}
- target: {fileID: 1206425615335586340, guid: 79ca869aa9be842b09fd026333ae8bf7,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1206425615335586340, guid: 79ca869aa9be842b09fd026333ae8bf7,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1206425615335586340, guid: 79ca869aa9be842b09fd026333ae8bf7,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1206425615335586340, guid: 79ca869aa9be842b09fd026333ae8bf7,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1206425615335586340, guid: 79ca869aa9be842b09fd026333ae8bf7,
type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 1206425615335586340, guid: 79ca869aa9be842b09fd026333ae8bf7,
type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 1206425615335586340, guid: 79ca869aa9be842b09fd026333ae8bf7,
type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 1206425615335586340, guid: 79ca869aa9be842b09fd026333ae8bf7,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 150
objectReference: {fileID: 0}
- target: {fileID: 1206425615335586340, guid: 79ca869aa9be842b09fd026333ae8bf7,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -22
objectReference: {fileID: 0}
- target: {fileID: 1206425615335586340, guid: 79ca869aa9be842b09fd026333ae8bf7,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1206425615335586340, guid: 79ca869aa9be842b09fd026333ae8bf7,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1206425615335586340, guid: 79ca869aa9be842b09fd026333ae8bf7,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3453229590426712094, guid: 79ca869aa9be842b09fd026333ae8bf7,
type: 3}
propertyPath: m_Name
value: IndicatorAnimation
objectReference: {fileID: 0}
- target: {fileID: 3453229590426712094, guid: 79ca869aa9be842b09fd026333ae8bf7,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 79ca869aa9be842b09fd026333ae8bf7, type: 3}
--- !u!1 &4732326752874114235 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 3453229590426712094, guid: 79ca869aa9be842b09fd026333ae8bf7,
type: 3}
m_PrefabInstance: {fileID: 7944574180012577957}
m_PrefabAsset: {fileID: 0}
--- !u!224 &9150990823094070913 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 1206425615335586340, guid: 79ca869aa9be842b09fd026333ae8bf7,
type: 3}
m_PrefabInstance: {fileID: 7944574180012577957}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &8288301857607568860
PrefabInstance:
m_ObjectHideFlags: 0
Expand Down
3 changes: 3 additions & 0 deletions nekoyume/Assets/_Scripts/Blockchain/ActionRenderHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3477,6 +3477,9 @@ private static void ResponseClaimWorldBossReward((ActionEvaluation<ClaimWorldBos
var avatarAddress = Game.Game.instance.States.CurrentAvatarState.address;
WorldBossStates.Set(eval.OutputState, eval.BlockIndex, avatarAddress).Forget();

var worldBossReward = Widget.Find<WorldBossDetail>();
worldBossReward.OnRenderSeasonReward();

if (eval.Exception is not null)
{
NcDebug.Log(eval.Exception.Message);
Expand Down
7 changes: 7 additions & 0 deletions nekoyume/Assets/_Scripts/UI/Module/Item/BaseItemView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,16 @@ public void ItemViewSetCurrencyData(string ticker, decimal amount)
_disposables.DisposeAllAndClear();
gameObject.SetActive(true);
ClearItem();

ItemImage.overrideSprite = SpriteHelper.GetFavIcon(ticker);
CountText.text = ((BigInteger)amount).ToCurrencyNotation();
GradeImage.sprite = SpriteHelper.GetItemBackground(Util.GetTickerGrade(ticker));

touchHandler.OnClick.Subscribe(_ =>
{
var tooltip = Widget.Find<FungibleAssetTooltip>();
tooltip.Show(ticker, CountText.text, null);
}).AddTo(_disposables);
}

public bool ItemViewSetCurrencyData(int favId, decimal amount)
Expand Down
20 changes: 14 additions & 6 deletions nekoyume/Assets/_Scripts/UI/Module/WorldBoss/WorldBossReward.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Libplanet.Action.State;
using JetBrains.Annotations;
using Libplanet.Crypto;
using Nekoyume.Extensions;
using Nekoyume.Game.Controller;
using Nekoyume.Helper;
using Nekoyume.L10n;
using Nekoyume.Model.State;
using Nekoyume.State;
using Nekoyume.TableData;
using TMPro;
using UnityEngine;

Expand All @@ -26,7 +22,7 @@ public enum ToggleType
{
SeasonRanking,
BossBattle,
BattleGrade
BattleGrade,
}

[Serializable]
Expand All @@ -52,6 +48,8 @@ private struct CategoryToggle
private readonly ReactiveProperty<ToggleType> _selectedItemSubType = new();
private Address _cachedAvatarAddress;

private WorldBossSeasonReward SeasonReward => categoryToggles.First(t => t.Type == ToggleType.SeasonRanking).Item as WorldBossSeasonReward;

protected void Awake()
{
foreach (var categoryToggle in categoryToggles)
Expand Down Expand Up @@ -170,5 +168,15 @@ private void UpdateTitle()
? L10nManager.Localize("UI_REWARDS")
: $"{L10nManager.Localize("UI_PREVIOUS")} {L10nManager.Localize("UI_REWARDS")}";
}

public void OnRenderSeasonReward()
{
if (SeasonReward == null)
{
return;
}

SeasonReward.OnRender();
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Linq;
using System.Linq;
using Nekoyume.Blockchain;
using Nekoyume.Helper;
using Nekoyume.L10n;
Expand Down Expand Up @@ -30,13 +29,17 @@ public class WorldBossSeasonReward : WorldBossRewardItem
[SerializeField]
private ConditionalButton claimButton;

[SerializeField]
private GameObject loadingIndicator;

private void Awake()
{
claimButton.OnSubmitSubject
.Subscribe(_ => OnClickClaimButton())
.AddTo(gameObject);

claimButton.OnClickDisabledSubject
claimButton.OnClickSubject
.Where(_ => !claimButton.IsSubmittable)
.Subscribe(_ => OnClickDisableClaimButton())
.AddTo(gameObject);
}
Expand Down Expand Up @@ -119,6 +122,8 @@ private void OnClickClaimButton()
ActionManager.Instance.ClaimWorldBossReward().Subscribe();
claimButton.SetCondition(() => false);
claimButton.UpdateObjects();

loadingIndicator.SetActive(true);
}

private void OnClickDisableClaimButton()
Expand All @@ -128,5 +133,10 @@ private void OnClickDisableClaimButton()
L10nManager.Localize("UI_BOSS_SEASON_REWARD_CANNOT_CLAIM_INFO"),
NotificationCell.NotificationType.Information);
}

public void OnRender()
{
loadingIndicator.SetActive(false);
}
}
}
11 changes: 11 additions & 0 deletions nekoyume/Assets/_Scripts/UI/Widget/WorldBossDetail.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,17 @@ private void UpdateView(ToggleType toggleType)
}
}

public void OnRenderSeasonReward()
{
var worldBossReward = categoryToggles.FirstOrDefault(x => x.Type == ToggleType.Reward).Item as WorldBossReward;
if (worldBossReward == null)
{
return;
}

worldBossReward.OnRenderSeasonReward();
}

// Invoke from TutorialController.PlayAction() by TutorialTargetType
public void TutorialActionClickWorldBossRewardsButton()
{
Expand Down

0 comments on commit 12960f8

Please sign in to comment.