Exemplo n.º 1
0
        private static string GetItemInfo(ItemRemakeInfo info, IRemakeString str)
        {
            var sb   = new StringBuilder();
            var body = info.GetBodySummary(str);

            if (body.Length > 0)
            {
                sb.AppendLine(body);
            }

            var fabric = info.GetFabricSummary(str);

            if (fabric.Length > 0)
            {
                sb.AppendLine(fabric);
            }

            return(sb.ToString());
        }
Exemplo n.º 2
0
    public void SelectItem(ItemFilter itemF, int id, UI_SearchItem sItem)
    {
        if (id == Item.NONE)
        {
            return;
        }
        if (ItemExtensions.IsInternalItem((ushort)id))
        {
            if (!InternalItemWarning.gameObject.activeInHierarchy)
            {
                InternalItemWarning.gameObject.SetActive(true);
            }
            else
            {
                InternalItemWarning.Start();
            }
        }
        SetController.FCount.text = id.ToString();
        ItemSelectedName.text     = sItem.RawValue;
        switch (itemF)
        {
        case ItemFilter.Recipes:
            CurrentItemID = RECIPEITEM;
            break;

        case ItemFilter.Fossils:
            CurrentItemID = FOSSILITEM;
            break;

        case ItemFilter.MsgBottle:
            CurrentItemID = MESSAGEBOTTLEITEM;
            break;

        default:
            CurrentItemID             = id;
            SetController.FCount.text = 0.ToString();
            break;
        }

        CurrentSelectedIndex = spawnedObjects.IndexOf(sItem);
        if (ItemInfo.GetItemKind(Convert.ToUInt16(CurrentItemID)).IsFlower())
        {
            FlowerButtonRoot.SetActive(true);
        }
        else
        {
            FlowerController.ResetToZero();
            FlowerButtonRoot.SetActive(false);
        }

        /*if (new Item((ushort)id).IsMoneyTree())
         *  TreeButtonRoot.gameObject.SetActive(true);
         * else
         *  TreeButtonRoot.gameObject.SetActive(false);*///uncomment this if you want star tree editor again for whatever reason

        short remakeIndex = ItemRemakeUtil.GetRemakeIndex(Convert.ToUInt16(CurrentItemID));

        if (remakeIndex < 0)
        {
            SetController.CreateBody(new string[0]);
            SetController.CreateFabric(new string[0]);
        }
        else
        {
            ItemRemakeInfo itemRemakeInfo = ItemRemakeInfoData.List[remakeIndex];
            string         bodySummary    = itemRemakeInfo.GetBodySummary(GameInfo.Strings, false);
            if (bodySummary.Length != 0)
            {
                string[] values = bodySummary.Split(new string[3]
                {
                    "\r\n",
                    "\r",
                    "\n"
                }, StringSplitOptions.None);
                SetController.CreateBody(values);
            }
            else
            {
                SetController.CreateBody(new string[0]);
            }
            string fabricSummary = itemRemakeInfo.GetFabricSummary(GameInfo.Strings, false, false);
            if (fabricSummary.Length != 0)
            {
                string[] values2 = fabricSummary.Split(new string[3]
                {
                    "\r\n",
                    "\r",
                    "\n"
                }, StringSplitOptions.None);
                SetController.CreateFabric(values2);
            }
            else
            {
                SetController.CreateFabric(new string[0]);
            }
        }
        if (currentAnimationFuction != null)
        {
            StopCoroutine(currentAnimationFuction);
        }
        currentAnimationFuction = StartCoroutine(sendSelectorToSelected());

        UpdateSprite();
    }
Exemplo n.º 3
0
    public void SelectItem(ItemFilter itemF, int id, UI_SearchItem sItem)
    {
        if (id == Item.NONE)
        {
            return;
        }
        SetController.FCount.text = id.ToString();
        ItemSelectedName.text     = sItem.RawValue;
        switch (itemF)
        {
        case ItemFilter.Recipes:
            CurrentItemID = RECIPEITEM;
            break;

        case ItemFilter.Fossils:
            CurrentItemID = FOSSILITEM;
            break;

        case ItemFilter.MsgBottle:
            CurrentItemID = MESSAGEBOTTLEITEM;
            break;

        default:
            CurrentItemID             = id;
            SetController.FCount.text = 0.ToString();
            break;
        }
        CurrentSelectedIndex = spawnedObjects.IndexOf(sItem);
        if (ItemInfo.GetItemKind(Convert.ToUInt16(CurrentItemID)).IsFlower())
        {
            FlowerButtonRoot.SetActive(true);
        }
        else
        {
            FlowerController.ResetToZero();
            FlowerButtonRoot.SetActive(false);
        }
        short remakeIndex = ItemRemakeUtil.GetRemakeIndex(Convert.ToUInt16(CurrentItemID));

        if (remakeIndex < 0)
        {
            SetController.CreateBody(new string[0]);
            SetController.CreateFabric(new string[0]);
        }
        else
        {
            ItemRemakeInfo itemRemakeInfo = ItemRemakeInfoData.List[remakeIndex];
            string         bodySummary    = itemRemakeInfo.GetBodySummary(GameInfo.Strings, tryGetDescriptor: false);
            if (bodySummary.Length != 0)
            {
                string[] values = bodySummary.Split(new string[3]
                {
                    "\r\n",
                    "\r",
                    "\n"
                }, StringSplitOptions.None);
                SetController.CreateBody(values);
            }
            else
            {
                SetController.CreateBody(new string[0]);
            }
            string fabricSummary = itemRemakeInfo.GetFabricSummary(GameInfo.Strings, tryGetDescriptor: false);
            if (fabricSummary.Length != 0)
            {
                string[] values2 = fabricSummary.Split(new string[3]
                {
                    "\r\n",
                    "\r",
                    "\n"
                }, StringSplitOptions.None);
                SetController.CreateFabric(values2);
            }
            else
            {
                SetController.CreateFabric(new string[0]);
            }
        }
        if (currentAnimationFuction != null)
        {
            StopCoroutine(currentAnimationFuction);
        }
        currentAnimationFuction = StartCoroutine(sendSelectorToSelected());
    }