Esempio n. 1
0
        public void Show(
            EquipmentItemRecipeSheet.Row row,
            bool ignoreShowAnimation = false)
        {
            if (row is null)
            {
                var sb = new StringBuilder($"[{nameof(CelebratesPopup)}]");
                sb.Append($"Argument {nameof(row)} is null.");
                Debug.LogError(sb.ToString());
                return;
            }

            titleText.text     = L10nManager.Localize("UI_NEW_EQUIPMENT_RECIPE");
            continueText.alpha = 0f;

            recipeCellView.Set(row);

            menuContainer.SetActive(false);
            questRewards.SetActive(false);
            recipeCellView.Show();

            _rewards = null;

            AppearNPC(ignoreShowAnimation, NPCAnimation.Type.Emotion_01);
            base.Show(ignoreShowAnimation);
            PlayEffects();
        }
Esempio n. 2
0
        public override void SetData(
            EquipmentItemRecipeSheet.Row row,
            int?subRecipeId,
            bool checkInventory = true
            )
        {
            var equipmentSheet = Game.Game.instance.TableSheets.EquipmentItemSheet;

            if (!equipmentSheet.TryGetValue(row.ResultEquipmentId, out var equipmentRow))
            {
                Debug.LogWarning($"Equipment ID not found : {row.ResultEquipmentId}");
                return;
            }

            if (subRecipeId.HasValue)
            {
                optionView.Show(equipmentRow.GetLocalizedName(), subRecipeId.Value);
                optionView.SetDimmed(false);
            }
            else
            {
                optionView.Hide();
            }
            base.SetData(row, subRecipeId, checkInventory);
        }
        public void SetData(EquipmentItemRecipeSheet.Row recipeRow)
        {
            gameObject.SetActive(true);
            confirmArea.SetActive(false);
            equipmentOptionRecipe.Show(recipeRow);

            optionAlphaTweener.PlayDelayed(0.2f);
            optionYTweener.PlayTween();
        }
Esempio n. 4
0
        public static void ModifyCombinationSlotEquipment(
            TableSheets tableSheets,
            EquipmentItemRecipeSheet.Row row,
            CombinationPanel panel,
            Address slotAddress,
            int?subRecipeId
            )
        {
            // When the layer is covered, additionally set the block height to prevent state updates until the actual state comes in.
            var blockIndex         = Game.Game.instance.Agent.BlockIndex + 100;
            var requiredBlockIndex = row.RequiredBlockIndex + blockIndex;

            if (subRecipeId.HasValue)
            {
                var subRow =
                    tableSheets.EquipmentItemSubRecipeSheet.Values.First(r => r.Id == subRecipeId);
                requiredBlockIndex += subRow.RequiredBlockIndex;
            }

            var equipRow =
                tableSheets.EquipmentItemSheet.Values.First(i => i.Id == row.ResultEquipmentId);
            var equipment = ItemFactory.CreateItemUsable(equipRow, Guid.Empty, requiredBlockIndex);
            var materials = new Dictionary <Material, int>();

            foreach (var(material, count) in panel.materialPanel.MaterialList)
            {
                materials[material] = count;
            }

            var result = new CombinationConsumable.ResultModel
            {
                // id: When applying the local layer for the first time, if the id is the default, the notification is not applied.
                id          = Guid.NewGuid(),
                actionPoint = panel.CostAP,
                gold        = panel.CostNCG,
                materials   = materials,
                itemUsable  = equipment,
                recipeId    = row.Id,
                subRecipeId = subRecipeId,
                itemType    = ItemType.Equipment,
            };
            var modifier  = new CombinationSlotBlockIndexAndResultModifier(result, blockIndex, requiredBlockIndex);
            var slotState = States.Instance.CombinationSlotStates[slotAddress];

            LocalLayer.Instance.Set(slotState.address, modifier);
            States.Instance.CombinationSlotStates[slotAddress] = modifier.Modify(slotState);
            CombinationSlotStateSubject.OnNext(slotState);
        }
Esempio n. 5
0
        public static void ModifyCombinationSlotEquipment(
            TableSheets tableSheets,
            EquipmentItemRecipeSheet.Row row,
            CombinationPanel panel,
            int slotIndex,
            int?subRecipeId
            )
        {
            var slotAddress = States.Instance.CurrentAvatarState.address.Derive(
                string.Format(
                    CultureInfo.InvariantCulture,
                    CombinationSlotState.DeriveFormat,
                    slotIndex
                    )
                );

            ModifyCombinationSlotEquipment(tableSheets, row, panel, slotAddress, subRecipeId);
        }
Esempio n. 6
0
        public void SetData(EquipmentItemRecipeSheet.Row recipeRow, int?subRecipeId = null)
        {
            recipeCellView.Set(recipeRow);
            materialPanel.SetData(recipeRow, subRecipeId);
            Enable();
            var requiredBlockIndex = recipeRow.RequiredBlockIndex;

            if (subRecipeId.HasValue)
            {
                var subSheet = Game.Game.instance.TableSheets.EquipmentItemSubRecipeSheet;
                if (subSheet.TryGetValue((int)subRecipeId, out var subRecipe))
                {
                    requiredBlockIndex += subRecipe.RequiredBlockIndex;
                }
            }
            RequiredBlockIndexSubject.OnNext(requiredBlockIndex);
            stateType = Combination.StateType.CombineEquipment;
        }