示例#1
0
 public HashSet <UIBase> LoadObjects()
 {
     input.text.SetText("");
     input.valueAction = SubmitInput;
     input.StartTyping();
     output.SetText("");
     return(UIObjects);
 }
    public virtual void SetContent(string _text)
    {
        if (!inited)
        {
            Init();
        }

        textbox.SetText(_text);
    }
示例#3
0
        public void UpdateInventoryItems()
        {
            Random        rnd = new Random();
            List <UIItem> b   = new List <UIItem>();

            for (int index = 0; index < WorldData.player.Data.inventory.GetSet().Count; index++)
            {
                int  ind = index;
                Item it  = WorldData.player.Data.inventory.GetSet()[ind];
                //b.Add(new UIItem(() => {
                //	description.SetText(it.Name);

                /*
                 * if (it is IConsumable) {
                 *      Player.MCObject.Data.inventory.GetSet()[ind] -= 1;
                 *      Player.MCObject.Data.inventory.CleanupInventory();
                 *      UpdateInventoryItems();
                 * } else if (it is IEquippable) {
                 *      Player.MCObject.Data.inventory.EquipItem(ind);
                 *      UpdateInventoryItems();
                 * }
                 */
                //}, "button"));
                Texture texture = TextureManager.TextureNames.DEFAULT;
                UIItem  i       = new UIItem(texture, it)
                {
                    NineSliceRendering = false
                };
                i.SetButtonAction(() => {
                    description.SetText(it.Name);
                    items.SelectGridItem(ind);
                });
                b.Add(i);
            }
            items.SetGridItems(b.ToArray());
        }
 public override void Setup()
 {
     textBox.Setup();
     textBox.SetText(displayText);
 }