From 670d88b4c882c8a17be7b3968c4a376a35751d07 Mon Sep 17 00:00:00 2001 From: sonohoshi Date: Mon, 27 Nov 2023 18:05:18 +0900 Subject: [PATCH] add CombinationLoadingScreen.Show() at rune crafting and aura summoning --- nekoyume/Assets/_Scripts/UI/Widget/Rune.cs | 18 +++++++++++ nekoyume/Assets/_Scripts/UI/Widget/Summon.cs | 33 ++++++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/nekoyume/Assets/_Scripts/UI/Widget/Rune.cs b/nekoyume/Assets/_Scripts/UI/Widget/Rune.cs index 05b9dd3ca21..9491fe6f1db 100644 --- a/nekoyume/Assets/_Scripts/UI/Widget/Rune.cs +++ b/nekoyume/Assets/_Scripts/UI/Widget/Rune.cs @@ -1,4 +1,5 @@ using System; +using System.Collections; using System.Collections.Generic; using System.Linq; using System.Numerics; @@ -296,6 +297,7 @@ private void Enhancement() Animator.Play(HashToMaterialUse); ActionManager.Instance.RuneEnhancement(runeId, TryCount.Value); LoadingHelper.RuneEnhancement.Value = true; + StartCoroutine(CoShowLoadingScreen()); } private void Set(RuneItem item) @@ -520,6 +522,22 @@ private void UpdateSlider(RuneItem item) } } + private IEnumerator CoShowLoadingScreen() + { + if (RuneFrontHelper.TryGetRuneIcon(_selectedRuneItem.Row.Id, out var runeIcon)) + { + var loadingScreen = Find(); + loadingScreen.Show(); + loadingScreen.SpeechBubbleWithItem.SetRune(runeIcon); + loadingScreen.SetCloseAction(null); + yield return new WaitForSeconds(.5f); + + var format = L10nManager.Localize("UI_COST_BLOCK"); + var quote = string.Format(format, 1); + loadingScreen.AnimateNPC(CombinationLoadingScreen.SpeechBubbleItemType.Rune, quote); + } + } + // Invoke from TutorialController.PlayAction() by TutorialTargetType public void TutorialActionClickCombinationRuneCombineButton() { diff --git a/nekoyume/Assets/_Scripts/UI/Widget/Summon.cs b/nekoyume/Assets/_Scripts/UI/Widget/Summon.cs index f617346265d..61d121d8f1e 100644 --- a/nekoyume/Assets/_Scripts/UI/Widget/Summon.cs +++ b/nekoyume/Assets/_Scripts/UI/Widget/Summon.cs @@ -1,4 +1,5 @@ using System; +using System.Collections; using System.Collections.Generic; using System.Linq; using Lib9c.Renderers; @@ -6,6 +7,7 @@ using Libplanet.Crypto; using Nekoyume.Action; using Nekoyume.Blockchain; +using Nekoyume.Game; using Nekoyume.Helper; using Nekoyume.L10n; using Nekoyume.Model.Item; @@ -13,6 +15,7 @@ using Nekoyume.Model.State; using Nekoyume.State; using Nekoyume.TableData.Summon; +using Nekoyume.UI.Model; using Nekoyume.UI.Module; using Nekoyume.UI.Scroller; using TMPro; @@ -133,6 +136,7 @@ private void AuraSummonAction(int groupId, int summonCount) ActionManager.Instance.AuraSummon(groupId, summonCount).Subscribe(); LoadingHelper.Summon.Value = new Tuple(summonRow.CostMaterial, totalCost); SetMaterialAssets(); + StartCoroutine(CoShowLoadingScreen(summonRow.Recipes.Select(r => r.Item1).ToList())); } public void OnActionRender(ActionEvaluation eval) @@ -189,6 +193,35 @@ private void SetMaterialAssets() } } + private IEnumerator CoShowLoadingScreen(List recipes) + { + var loadingScreen = Find(); + IEnumerator CoChangeItem() + { + while (isActiveAndEnabled) + { + foreach (var recipe in recipes) + { + loadingScreen.SpeechBubbleWithItem.SetItemMaterial( + new Item(ItemFactory.CreateItem( + TableSheets.Instance.EquipmentItemRecipeSheet[recipe] + .GetResultEquipmentItemRow(), + new ActionRenderHandler.LocalRandom(0))), false); + yield return new WaitForSeconds(.1f); + } + } + } + + loadingScreen.Show(); + loadingScreen.SetCloseAction(null); + StartCoroutine(CoChangeItem()); + yield return new WaitForSeconds(.5f); + + var format = L10nManager.Localize("UI_COST_BLOCK"); + var quote = string.Format(format, 1); + loadingScreen.AnimateNPC(CombinationLoadingScreen.SpeechBubbleItemType.Aura, quote); + } + public static void ButtonSubscribe(SimpleCostButton[] buttons, GameObject gameObject) { foreach (var button in buttons)