diff --git a/nekoyume/Assets/Plugins/StateViewer/Editor/StateViewerWindow.cs b/nekoyume/Assets/Plugins/StateViewer/Editor/StateViewerWindow.cs index 70138809b47..869d2140f84 100644 --- a/nekoyume/Assets/Plugins/StateViewer/Editor/StateViewerWindow.cs +++ b/nekoyume/Assets/Plugins/StateViewer/Editor/StateViewerWindow.cs @@ -129,7 +129,7 @@ private void OnGUI() return null; } - return _ncg ??= Game.instance.States?.GoldBalanceState?.Gold.Currency; + return _ncg ??= Game.instance.States?.NCG; } public TableSheets? GetTableSheets() @@ -167,7 +167,7 @@ private void InitializeStateProxy() _stateProxy.RegisterAlias("me", states.CurrentAvatarState.address); } - _ncg = states.GoldBalanceState.Gold.Currency; + _ncg = states.NCG; } } } diff --git a/nekoyume/Assets/_Scripts/Blockchain/ActionHandler.cs b/nekoyume/Assets/_Scripts/Blockchain/ActionHandler.cs index fc7698024a6..c387f95a9dd 100644 --- a/nekoyume/Assets/_Scripts/Blockchain/ActionHandler.cs +++ b/nekoyume/Assets/_Scripts/Blockchain/ActionHandler.cs @@ -23,7 +23,6 @@ namespace Nekoyume.Blockchain public abstract class ActionHandler { public bool Pending { get; set; } - public Currency GoldCurrency { get; internal set; } public abstract void Start(ActionRenderer renderer); @@ -51,7 +50,7 @@ protected GoldBalanceState GetGoldBalanceState(ActionEvaluation evaluation return StateGetter.GetGoldBalanceState( agentAddress, - GoldCurrency, + States.Instance.NCG, evaluation.OutputState); } @@ -80,7 +79,7 @@ protected GoldBalanceState GetGoldBalanceState(ActionEvaluation evaluation return (stakeAddr, null, new FungibleAssetValue(), 0, null, null); } - var balance = await agent.GetBalanceAsync(stakeAddr, GoldCurrency); + var balance = await agent.GetBalanceAsync(stakeAddr, States.Instance.NCG); var sheetAddrArr = new[] { Addresses.GetSheetAddress( diff --git a/nekoyume/Assets/_Scripts/Blockchain/ActionManager.cs b/nekoyume/Assets/_Scripts/Blockchain/ActionManager.cs index 3d1803f94dd..9124954631f 100644 --- a/nekoyume/Assets/_Scripts/Blockchain/ActionManager.cs +++ b/nekoyume/Assets/_Scripts/Blockchain/ActionManager.cs @@ -318,9 +318,7 @@ public IObservable> EventDungeonBattle( ? TableSheets.Instance.EventScheduleSheet.TryGetValue( eventScheduleId, out var scheduleRow) - ? scheduleRow.GetDungeonTicketCost( - numberOfTicketPurchases, - States.Instance.GoldBalanceState.Gold.Currency) + ? scheduleRow.GetDungeonTicketCost(numberOfTicketPurchases, States.Instance.NCG) .GetQuantityString(true) : "0" : "0", diff --git a/nekoyume/Assets/_Scripts/Blockchain/ActionRenderHandler.cs b/nekoyume/Assets/_Scripts/Blockchain/ActionRenderHandler.cs index 18ca11338b6..2d80f56347c 100644 --- a/nekoyume/Assets/_Scripts/Blockchain/ActionRenderHandler.cs +++ b/nekoyume/Assets/_Scripts/Blockchain/ActionRenderHandler.cs @@ -2943,7 +2943,7 @@ private void ResponseUnloadFromMyGarages(ActionEvaluation e balanceAddr, value.Currency, states); - if (value.Currency.Equals(GoldCurrency)) + if (value.Currency.Equals(States.Instance.NCG)) { var goldState = new GoldBalanceState(balanceAddr, balance); gameStates.SetGoldBalanceState(goldState); diff --git a/nekoyume/Assets/_Scripts/Blockchain/Agent.cs b/nekoyume/Assets/_Scripts/Blockchain/Agent.cs index e9f1af6db35..c0c055d0d46 100644 --- a/nekoyume/Assets/_Scripts/Blockchain/Agent.cs +++ b/nekoyume/Assets/_Scripts/Blockchain/Agent.cs @@ -461,17 +461,23 @@ await InitAsync( PreloadEndedAsync += async () => { // 에이전트의 상태를 한 번 동기화 한다. - var goldCurrency = new GoldCurrencyState( - (Dictionary)await GetStateAsync(GoldCurrencyState.Address) - ).Currency; - ActionRenderHandler.Instance.GoldCurrency = goldCurrency; + if (await GetStateAsync(GoldCurrencyState.Address) is Dictionary goldDict) + { + var goldCurrencyState = new GoldCurrencyState(goldDict); + States.Instance.SetGoldCurrencyState(goldCurrencyState); + } + else + { + throw new FailedToInstantiateStateException(); + } + var ncg = States.Instance.NCG; await States.Instance.SetAgentStateAsync( await GetStateAsync(Address) is Dictionary agentDict ? new AgentState(agentDict) : new AgentState(Address)); States.Instance.SetGoldBalanceState(new GoldBalanceState(Address, - await GetBalanceAsync(Address, goldCurrency))); + await GetBalanceAsync(Address, ncg))); States.Instance.SetCrystalBalance( await GetBalanceAsync(Address, CrystalCalculator.CRYSTAL)); @@ -497,13 +503,13 @@ await GetStateAsync(Address) is Dictionary agentDict } else { - var balance = new FungibleAssetValue(goldCurrency); + var balance = new FungibleAssetValue(ncg); var level = 0; var stakeRegularFixedRewardSheet = new StakeRegularFixedRewardSheet(); var stakeRegularRewardSheet = new StakeRegularRewardSheet(); try { - balance = await GetBalanceAsync(stakeAddr, goldCurrency); + balance = await GetBalanceAsync(stakeAddr, ncg); var sheetAddrArr = new[] { Addresses.GetSheetAddress( diff --git a/nekoyume/Assets/_Scripts/Blockchain/BlockRenderHandler.cs b/nekoyume/Assets/_Scripts/Blockchain/BlockRenderHandler.cs index 288236cb80a..56455a17996 100644 --- a/nekoyume/Assets/_Scripts/Blockchain/BlockRenderHandler.cs +++ b/nekoyume/Assets/_Scripts/Blockchain/BlockRenderHandler.cs @@ -79,7 +79,7 @@ private static async UniTaskVoid UpdateWhenEveryBlockRenderBeginningAsync() FungibleAssetValue garage; try { - var ncg = States.Instance.GoldBalanceState.Gold.Currency; + var ncg = States.Instance.NCG; var favArr = await Task.WhenAll( agent.GetBalanceAsync(agentState.address, ncg), agent.GetBalanceAsync(agentState.address, Currencies.Crystal), diff --git a/nekoyume/Assets/_Scripts/Blockchain/RPCAgent.cs b/nekoyume/Assets/_Scripts/Blockchain/RPCAgent.cs index 22db613aaf0..39d726eac40 100644 --- a/nekoyume/Assets/_Scripts/Blockchain/RPCAgent.cs +++ b/nekoyume/Assets/_Scripts/Blockchain/RPCAgent.cs @@ -546,21 +546,26 @@ private IEnumerator CoJoin(Action callback) // 에이전트의 상태를 한 번 동기화 한다. var currencyTask = Task.Run(async () => { - var goldCurrency = new GoldCurrencyState( - (Dictionary)await GetStateAsync(GoldCurrencyState.Address) - ).Currency; - ActionRenderHandler.Instance.GoldCurrency = goldCurrency; - await States.Instance.SetAgentStateAsync( await GetStateAsync(Address) is Dictionary agentDict ? new AgentState(agentDict) : new AgentState(Address)); + var ncg = States.Instance.NCG; States.Instance.SetGoldBalanceState( new GoldBalanceState( Address, - await GetBalanceAsync(Address, goldCurrency))); + await GetBalanceAsync(Address, ncg))); States.Instance.SetCrystalBalance( await GetBalanceAsync(Address, Currencies.Crystal)); + if (await GetStateAsync(GoldCurrencyState.Address) is Dictionary goldDict) + { + var goldCurrencyState = new GoldCurrencyState(goldDict); + States.Instance.SetGoldCurrencyState(goldCurrencyState); + } + else + { + throw new FailedToInstantiateStateException(); + } if (await GetStateAsync(GameConfigState.Address) is Dictionary configDict) { @@ -584,13 +589,13 @@ await GetStateAsync(Address) is Dictionary agentDict } else { - var balance = new FungibleAssetValue(goldCurrency); + var balance = new FungibleAssetValue(ncg); var level = 0; var stakeRegularFixedRewardSheet = new StakeRegularFixedRewardSheet(); var stakeRegularRewardSheet = new StakeRegularRewardSheet(); try { - balance = await GetBalanceAsync(stakeAddr, goldCurrency); + balance = await GetBalanceAsync(stakeAddr, ncg); var sheetAddrArr = new[] { Addresses.GetSheetAddress( diff --git a/nekoyume/Assets/_Scripts/Extensions/LocalizationExtensions.cs b/nekoyume/Assets/_Scripts/Extensions/LocalizationExtensions.cs index ed60e764548..73460c514f8 100644 --- a/nekoyume/Assets/_Scripts/Extensions/LocalizationExtensions.cs +++ b/nekoyume/Assets/_Scripts/Extensions/LocalizationExtensions.cs @@ -215,10 +215,10 @@ await Game.Game.instance.MarketServiceClient.GetProductInfo( var price = item?.Price ?? fav?.Price ?? 0; var tax = decimal.Divide(price, 100) * Buy.TaxRate; var tp = price - tax; - var currency = States.Instance.GoldBalanceState.Gold.Currency; + var ncg = States.Instance.NCG; var majorUnit = (int)tp; var minorUnit = (int)((tp - majorUnit) * 100); - var fungibleAsset = new FungibleAssetValue(currency, majorUnit, minorUnit); + var fungibleAsset = new FungibleAssetValue(ncg, majorUnit, minorUnit); return L10nManager.Localize("UI_SELLER_MAIL_FORMAT", fungibleAsset, sellProductName); case UnloadFromMyGaragesRecipientMail unloadFromMyGaragesRecipientMail: @@ -698,8 +698,7 @@ public static string GetPaymentFormatText(this FungibleAssetValue asset, BigInteger cost) { // NCG - if (asset.Currency.Equals( - Game.Game.instance.States.GoldBalanceState.Gold.Currency)) + if (asset.Currency.Equals(States.Instance.NCG)) { var ncgText = L10nManager.Localize("UI_NCG"); return L10nManager.Localize( diff --git a/nekoyume/Assets/_Scripts/Helper/PetFrontHelper.cs b/nekoyume/Assets/_Scripts/Helper/PetFrontHelper.cs index 672c082ebe9..f12a7de6cd2 100644 --- a/nekoyume/Assets/_Scripts/Helper/PetFrontHelper.cs +++ b/nekoyume/Assets/_Scripts/Helper/PetFrontHelper.cs @@ -91,7 +91,8 @@ public static bool HasNotification(int id) return false; } - var ncgCost = States.Instance.GoldBalanceState.Gold.Currency * nextCost.NcgQuantity; + var ncg = States.Instance.NCG; + var ncgCost = ncg * nextCost.NcgQuantity; var soulStoneCost = PetHelper.GetSoulstoneCurrency(TableSheets.Instance.PetSheet[id].SoulStoneTicker) * nextCost.SoulStoneQuantity; diff --git a/nekoyume/Assets/_Scripts/State/LocalLayerModifier.cs b/nekoyume/Assets/_Scripts/State/LocalLayerModifier.cs index df536236d37..4ffcac8bd6b 100644 --- a/nekoyume/Assets/_Scripts/State/LocalLayerModifier.cs +++ b/nekoyume/Assets/_Scripts/State/LocalLayerModifier.cs @@ -53,10 +53,7 @@ public static void ModifyAgentGold(Address agentAddress, BigInteger gold) return; } - var fav = new FungibleAssetValue( - States.Instance.GoldBalanceState.Gold.Currency, - gold, - 0); + var fav = new FungibleAssetValue(States.Instance.NCG, gold, 0); ModifyAgentGoldAsync(agentAddress, fav).Forget(); } diff --git a/nekoyume/Assets/_Scripts/State/States.cs b/nekoyume/Assets/_Scripts/State/States.cs index 40c4a0db5e5..f1010ac85f7 100644 --- a/nekoyume/Assets/_Scripts/State/States.cs +++ b/nekoyume/Assets/_Scripts/State/States.cs @@ -29,13 +29,17 @@ namespace Nekoyume.State { /// - /// 클라이언트가 참조할 상태를 포함한다. - /// 체인의 상태를 Setter를 통해서 받은 후, 로컬의 상태로 필터링해서 사용한다. + /// The blockchain state for game client. + /// - Set blockchain state by setter methods here. + /// - The blockchain state modified by in setter methods. + /// - Get modified blockchain state by getter methods here. /// public class States { public static States Instance => Game.Game.instance.States; + public GoldCurrencyState GoldCurrencyState { get; private set; } + public Currency NCG => GoldCurrencyState.Currency; public AgentState AgentState { get; private set; } public GoldBalanceState GoldBalanceState { get; private set; } @@ -104,6 +108,11 @@ public States() #region Setter + public void SetGoldCurrencyState(GoldCurrencyState state) + { + GoldCurrencyState = state; + } + /// /// 에이전트 상태를 할당한다. /// 로컬 세팅을 거친 상태가 최종적으로 할당된다. diff --git a/nekoyume/Assets/_Scripts/State/Subjects/AgentStateSubject.cs b/nekoyume/Assets/_Scripts/State/Subjects/AgentStateSubject.cs index 232fa167ba7..41f0307028a 100644 --- a/nekoyume/Assets/_Scripts/State/Subjects/AgentStateSubject.cs +++ b/nekoyume/Assets/_Scripts/State/Subjects/AgentStateSubject.cs @@ -30,7 +30,7 @@ static AgentStateSubject() public static void OnNextGold(FungibleAssetValue gold) { - if (gold.Currency.Equals(States.Instance.GoldBalanceState.Gold.Currency)) + if (gold.Currency.Equals(States.Instance.NCG)) { _gold.OnNext(gold); } diff --git a/nekoyume/Assets/_Scripts/UI/Model/ItemCountAndPricePopup.cs b/nekoyume/Assets/_Scripts/UI/Model/ItemCountAndPricePopup.cs index 100bd6a2b11..1278620ffd3 100644 --- a/nekoyume/Assets/_Scripts/UI/Model/ItemCountAndPricePopup.cs +++ b/nekoyume/Assets/_Scripts/UI/Model/ItemCountAndPricePopup.cs @@ -14,7 +14,7 @@ public class ItemCountAndPricePopup : ItemCountPopup public ItemCountAndPricePopup() { - var currency = States.Instance.GoldBalanceState.Gold.Currency; + var currency = States.Instance.NCG; Price = new ReactiveProperty(new FungibleAssetValue(currency, 10, 0)); } diff --git a/nekoyume/Assets/_Scripts/UI/Shop/CartView.cs b/nekoyume/Assets/_Scripts/UI/Shop/CartView.cs index bad5407dd14..861aa157555 100644 --- a/nekoyume/Assets/_Scripts/UI/Shop/CartView.cs +++ b/nekoyume/Assets/_Scripts/UI/Shop/CartView.cs @@ -68,8 +68,9 @@ public void UpdateCart(List selectedItems, System.Action onClick) return; } + var ncg = States.Instance.NCG; var sortedItems = selectedItems.Where(x => !x.Expired.Value).ToList(); - var price = new FungibleAssetValue(States.Instance.GoldBalanceState.Gold.Currency, 0 ,0); + var price = new FungibleAssetValue(ncg, 0 ,0); for (var i = 0; i < cartItems.Count; i++) { if (i < sortedItems.Count) @@ -77,7 +78,7 @@ public void UpdateCart(List selectedItems, System.Action onClick) var p = sortedItems[i].ItemBase is not null ? (BigInteger)sortedItems[i].Product.Price : (BigInteger)sortedItems[i].FungibleAssetProduct.Price; - price += p * States.Instance.GoldBalanceState.Gold.Currency; + price += p * ncg; cartItems[i].gameObject.SetActive(true); cartItems[i].Set(sortedItems[i], (item) => { diff --git a/nekoyume/Assets/_Scripts/UI/Widget/BattlePreparation.cs b/nekoyume/Assets/_Scripts/UI/Widget/BattlePreparation.cs index bd9c3a2b6d4..55a7b9a4dc9 100644 --- a/nekoyume/Assets/_Scripts/UI/Widget/BattlePreparation.cs +++ b/nekoyume/Assets/_Scripts/UI/Widget/BattlePreparation.cs @@ -426,7 +426,7 @@ private void OnClickBattle() var cost = RxProps.EventScheduleRowForDungeon.Value .GetDungeonTicketCost( RxProps.EventDungeonInfo.Value?.NumberOfTicketPurchases ?? 0, - States.Instance.GoldBalanceState.Gold.Currency); + States.Instance.NCG); var purchasedCount = RxProps.EventDungeonInfo.Value?.NumberOfTicketPurchases ?? 0; Find().Show( diff --git a/nekoyume/Assets/_Scripts/UI/Widget/Menu.cs b/nekoyume/Assets/_Scripts/UI/Widget/Menu.cs index baa4da02ddd..5b283f3d6be 100644 --- a/nekoyume/Assets/_Scripts/UI/Widget/Menu.cs +++ b/nekoyume/Assets/_Scripts/UI/Widget/Menu.cs @@ -768,10 +768,7 @@ protected override void Update() { ( states.AgentState.address, - new FungibleAssetValue( - states.GoldBalanceState.Gold.Currency, - 9, - 99) + new FungibleAssetValue(states.NCG, 9, 99) ), (states.CurrentAvatarState.address, 99 * Currencies.Crystal), }, diff --git a/nekoyume/Assets/_Scripts/UI/Widget/Popup/BattleResultPopup.cs b/nekoyume/Assets/_Scripts/UI/Widget/Popup/BattleResultPopup.cs index e29ff3c4dfa..5d1a172ad38 100644 --- a/nekoyume/Assets/_Scripts/UI/Widget/Popup/BattleResultPopup.cs +++ b/nekoyume/Assets/_Scripts/UI/Widget/Popup/BattleResultPopup.cs @@ -248,7 +248,7 @@ private IEnumerator OnClickNext() var cost = RxProps.EventScheduleRowForDungeon.Value .GetDungeonTicketCost( RxProps.EventDungeonInfo.Value?.NumberOfTicketPurchases ?? 0, - States.Instance.GoldBalanceState.Gold.Currency); + States.Instance.NCG); var purchasedCount = RxProps.EventDungeonInfo.Value?.NumberOfTicketPurchases ?? 0; @@ -295,7 +295,7 @@ private IEnumerator OnClickRepeat() var cost = RxProps.EventScheduleRowForDungeon.Value .GetDungeonTicketCost( RxProps.EventDungeonInfo.Value?.NumberOfTicketPurchases ?? 0, - States.Instance.GoldBalanceState.Gold.Currency); + States.Instance.NCG); var purchasedCount = RxProps.EventDungeonInfo.Value?.NumberOfTicketPurchases ?? 0; diff --git a/nekoyume/Assets/_Scripts/UI/Widget/Popup/MailPopup.cs b/nekoyume/Assets/_Scripts/UI/Widget/Popup/MailPopup.cs index ba0ec01cf49..fb996bf3fba 100644 --- a/nekoyume/Assets/_Scripts/UI/Widget/Popup/MailPopup.cs +++ b/nekoyume/Assets/_Scripts/UI/Widget/Popup/MailPopup.cs @@ -519,7 +519,7 @@ public async void Read(ProductSellerMail productSellerMail) var avatarAddress = States.Instance.CurrentAvatarState.address; var agentAddress = States.Instance.AgentState.address; var (_, itemProduct, favProduct) = await Game.Game.instance.MarketServiceClient.GetProductInfo(productSellerMail.ProductId); - var currency = States.Instance.GoldBalanceState.Gold.Currency; + var currency = States.Instance.NCG; var price = itemProduct?.Price ?? favProduct.Price; var fav = new FungibleAssetValue(currency, (int)price, 0); var taxedPrice = fav.DivRem(100, out _) * Action.Buy.TaxRate; diff --git a/nekoyume/Assets/_Scripts/UI/Widget/Popup/PetEnhancementPopup.cs b/nekoyume/Assets/_Scripts/UI/Widget/Popup/PetEnhancementPopup.cs index 30e7f82a50a..b2b3ab671d4 100644 --- a/nekoyume/Assets/_Scripts/UI/Widget/Popup/PetEnhancementPopup.cs +++ b/nekoyume/Assets/_Scripts/UI/Widget/Popup/PetEnhancementPopup.cs @@ -226,7 +226,7 @@ private void SetObjectByTargetLevel(int petId, int currentLevel, int targetLevel } soulStoneCostText.text = soulStone.ToString(); - var ncgCost = States.Instance.GoldBalanceState.Gold.Currency * ncg; + var ncgCost = States.Instance.NCG * ncg; var soulStoneCost = PetHelper.GetSoulstoneCurrency(_petRow.SoulStoneTicker) * soulStone; diff --git a/nekoyume/Assets/_Scripts/UI/Widget/RaidPreparation.cs b/nekoyume/Assets/_Scripts/UI/Widget/RaidPreparation.cs index ad47b42ef99..a4f0d038994 100644 --- a/nekoyume/Assets/_Scripts/UI/Widget/RaidPreparation.cs +++ b/nekoyume/Assets/_Scripts/UI/Widget/RaidPreparation.cs @@ -373,7 +373,7 @@ private void ShowTicketPurchasePopup(long currentBlockIndex) var avatarState = States.Instance.CurrentAvatarState; var raiderState = WorldBossStates.GetRaiderState(avatarState.address); - var cur = States.Instance.GoldBalanceState.Gold.Currency; + var cur = States.Instance.NCG; var cost = WorldBossHelper.CalculateTicketPrice(row, raiderState, cur); var balance = States.Instance.GoldBalanceState; Find().Show( diff --git a/nekoyume/Assets/_Scripts/UI/Widget/ShopBuy.cs b/nekoyume/Assets/_Scripts/UI/Widget/ShopBuy.cs index dba039ccd2f..c46b0c59ea1 100644 --- a/nekoyume/Assets/_Scripts/UI/Widget/ShopBuy.cs +++ b/nekoyume/Assets/_Scripts/UI/Widget/ShopBuy.cs @@ -178,11 +178,11 @@ private void ShowBuyPopup(List models) { if (model.ItemBase is not null) { - sumPrice += (BigInteger)model.Product.Price * States.Instance.GoldBalanceState.Gold.Currency; + sumPrice += (BigInteger)model.Product.Price * States.Instance.NCG; } else { - sumPrice += (BigInteger)model.FungibleAssetProduct.Price * States.Instance.GoldBalanceState.Gold.Currency; + sumPrice += (BigInteger)model.FungibleAssetProduct.Price * States.Instance.NCG; } } @@ -207,7 +207,7 @@ private void Buy(List models) { var productInfos = new List(); var avatarAddress = States.Instance.CurrentAvatarState.address; - var currency = States.Instance.GoldBalanceState.Gold.Currency; + var currency = States.Instance.NCG; foreach (var model in models) { var itemProduct = model.Product; diff --git a/nekoyume/Assets/_Scripts/UI/Widget/ShopSell.cs b/nekoyume/Assets/_Scripts/UI/Widget/ShopSell.cs index 76ba36d47dd..3e488b2b0cf 100644 --- a/nekoyume/Assets/_Scripts/UI/Widget/ShopSell.cs +++ b/nekoyume/Assets/_Scripts/UI/Widget/ShopSell.cs @@ -298,7 +298,7 @@ private void ShowSell(InventoryItem model) } var data = SharedModel.ItemCountableAndPricePopup.Value; - var currency = States.Instance.GoldBalanceState.Gold.Currency; + var currency = States.Instance.NCG; data.Price.Value = new FungibleAssetValue(currency, Shop.MinimumPrice, 0); data.UnitPrice.Value = new FungibleAssetValue(currency, Shop.MinimumPrice, 0); data.Count.Value = 1; @@ -343,7 +343,7 @@ private void ShowReRegisterProductPopup(ShopItem model, bool chargeAp) // 판매 var unitPrice = price / model.Product.Quantity; var majorUnit = (int)unitPrice; var minorUnit = (int)((unitPrice - majorUnit) * 100); - var currency = States.Instance.GoldBalanceState.Gold.Currency; + var currency = States.Instance.NCG; data.UnitPrice.Value = new FungibleAssetValue(currency, majorUnit, minorUnit); data.ProductId.Value = model.Product.ProductId; @@ -367,7 +367,7 @@ private void ShowReRegisterProductPopup(ShopItem model, bool chargeAp) // 판매 var unitPrice = price / model.FungibleAssetProduct.Quantity; var majorUnit = (int)unitPrice; var minorUnit = (int)((unitPrice - majorUnit) * 100); - var currency = States.Instance.GoldBalanceState.Gold.Currency; + var currency = States.Instance.NCG; data.UnitPrice.Value = new FungibleAssetValue(currency, majorUnit, minorUnit); data.ProductId.Value = model.FungibleAssetProduct.ProductId; @@ -470,7 +470,7 @@ private async void SubscribeCancelProductRegistration(bool chargeAp) } var avatarAddress = States.Instance.CurrentAvatarState.address; - var goldCurrency = States.Instance.GoldBalanceState.Gold.Currency; + var goldCurrency = States.Instance.NCG; var oneLineSystemInfos = new List<(string name, int count)>(); var productInfos = new List(); @@ -556,7 +556,7 @@ private void ShowRetrievePopup(ShopItem model, bool chargeAp) // 판매 취소 SharedModel.ItemCountAndPricePopup.Value.CountEnabled.Value = true; SharedModel.ItemCountAndPricePopup.Value.ProductId.Value = productId; SharedModel.ItemCountAndPricePopup.Value.Price.Value = (BigInteger)price * - States.Instance.GoldBalanceState.Gold.Currency; + States.Instance.NCG; SharedModel.ItemCountAndPricePopup.Value.PriceInteractable.Value = false; SharedModel.ItemCountAndPricePopup.Value.ChargeAp.Value = chargeAp; var itemCount = (int)quantity; @@ -703,7 +703,7 @@ private void SubscribeReRegisterProduct(Model.ItemCountableAndPricePopup data) private static (IProductInfo, IRegisterInfo) GetReRegisterInfo(Guid productId, int newPrice) { var avatarAddress = States.Instance.CurrentAvatarState.address; - var goldCurrency = States.Instance.GoldBalanceState.Gold.Currency; + var goldCurrency = States.Instance.NCG; var itemProduct = ReactiveShopState.GetSellItemProduct(productId); if (itemProduct is not null) { diff --git a/nekoyume/Assets/_Scripts/UI/Widget/Tooltip/FungibleAssetTooltip.cs b/nekoyume/Assets/_Scripts/UI/Widget/Tooltip/FungibleAssetTooltip.cs index 787d5cbf188..36972f5a8db 100644 --- a/nekoyume/Assets/_Scripts/UI/Widget/Tooltip/FungibleAssetTooltip.cs +++ b/nekoyume/Assets/_Scripts/UI/Widget/Tooltip/FungibleAssetTooltip.cs @@ -115,7 +115,7 @@ public void Show( registerButton.gameObject.SetActive(false); buy.gameObject.SetActive(true); sell.gameObject.SetActive(false); - buy.Set((BigInteger)item.FungibleAssetProduct.Price * States.Instance.GoldBalanceState.Gold.Currency, + buy.Set((BigInteger)item.FungibleAssetProduct.Price * States.Instance.NCG, ()=> { onBuy?.Invoke(); diff --git a/nekoyume/Assets/_Scripts/UI/Widget/Tooltip/ItemTooltip.cs b/nekoyume/Assets/_Scripts/UI/Widget/Tooltip/ItemTooltip.cs index 38fa74b681b..2e8a1eae9af 100644 --- a/nekoyume/Assets/_Scripts/UI/Widget/Tooltip/ItemTooltip.cs +++ b/nekoyume/Assets/_Scripts/UI/Widget/Tooltip/ItemTooltip.cs @@ -238,7 +238,7 @@ public virtual void Show( if (item.Product.Legacy) { buy.Set(item.Product.RegisteredBlockIndex + Order.ExpirationInterval, - (BigInteger)item.Product.Price * States.Instance.GoldBalanceState.Gold.Currency, + (BigInteger)item.Product.Price * States.Instance.NCG, () => { onBuy?.Invoke(); @@ -247,7 +247,7 @@ public virtual void Show( } else { - buy.Set((BigInteger)item.Product.Price * States.Instance.GoldBalanceState.Gold.Currency, + buy.Set((BigInteger)item.Product.Price * States.Instance.NCG, () => { onBuy?.Invoke();