예제 #1
0
    private void SetItem(IconWithTextController holder, CraftingRecipe recipe)
    {
        if (CraftingRecipesMade.RecipesMade.Contains(recipe.ID))
        {
            string text = $"{recipe.Result.Item.GetName()}\n<size=50%>";
            foreach (var r in recipe.Components)
            {
                text += $"{r.Item.GetName()} - {CT.Inventory.GetAmountOf(r.Item)} / {r.Amount}\n";
            }

            holder.SetData(recipe.Result.Item, 1, text, () => {
                MakeRecipe(recipe);
            }, showText: false);
        }
        else
        {
            string text = $"???\n<size=50%>";
            foreach (var r in recipe.Components)
            {
                text += $"{r.Item.GetName()} - {CT.Inventory.GetAmountOf(r.Item)} / {r.Amount}\n";
            }

            holder.SetData(recipe.Result.Item, 1, text, () => {
                if (MakeRecipe(recipe))
                {
                    CraftingRecipesMade.RecipesMade.Add(recipe.ID);
                    RefreshList();
                }
            }, QuestionMark, false);
        }
    }
예제 #2
0
    private void SetDataBuying(IconWithTextController itc, ShopFollower.SellableItem iid)
    {
        int price = GetBuyingPrice(iid.Item);

        string text = $"{iid.Item.GetName()}\n{price} gold each";

        itc.SetData(iid.Item, iid.Amount, text, () => ItemClickedBuying(iid));
    }
예제 #3
0
    private void SetDataSelling(IconWithTextController itc, InventoryEntry iid)
    {
        string text = iid.Item.GetName() + "\n" + GetSellingPrice(iid.Item) + " gold each";

        itc.SetData(iid.Item, iid.Amount, text, () => ItemClickedSelling(iid));
    }