예제 #1
0
        private void item_node(int unit_index, int index, List <CommandUINode> nodes)
        {
            Status_Item item = new Status_Item();

            TactileLibrary.Item_Data item_data = unit_index == 0 ?
                                                 actor1.whole_inventory[index] :
                                                 actor2.whole_inventory[index];
            item.set_image(unit_index == 0 ? actor1 : actor2, item_data);

            var node = new ItemUINode("", item, SPACING - 16); //Debug

            node.loc = new Vector2(8, 8) + new Vector2(SPACING * unit_index, index * 16);
            nodes.Add(node);
        }
예제 #2
0
        internal ItemUINode(
            string helpLabel,
            Status_Item text,
            int width)
            : base(helpLabel)
        {
            Text = text;
            Size = new Vector2(width, 16);

            EquippedTag             = new TextSprite();
            EquippedTag.draw_offset = new Vector2(width - 8, 0);
            EquippedTag.SetFont(Tactile.Config.UI_FONT, Global.Content, "White");
            EquippedTag.text    = "$";
            EquippedTag.visible = false;
        }
예제 #3
0
        protected virtual CommandUINode item(string str, int i)
        {
            var item_data = items(i);

            if (!is_valid_item(get_equipment(), i))
            {
                return(null);
            }

            var text = new Status_Item();

            text.set_image(actor(), item_data);
            var text_node = new ItemUINode("", text, this.column_width);

            text_node.loc = item_loc(i);
            return(text_node);
        }
예제 #4
0
        internal StatusItemUINode(
            string helpLabel,
            Func <Game_Unit, ItemState> itemFormula)
            : base(helpLabel)
        {
            ItemFormula = itemFormula;

            Item             = new Status_Item();
            Item.draw_offset = new Vector2(0, 0);

            EquippedTag             = new TextSprite();
            EquippedTag.draw_offset = new Vector2(120, 0);
            EquippedTag.SetFont(Config.UI_FONT, Global.Content, "White");
            EquippedTag.text    = "$";
            EquippedTag.visible = false;

            Size = new Vector2(128, 16);
        }
        internal void refresh_items(List <SupplyItem> supplies, Game_Actor actor)
        {
            var items = new List <Status_Item>();

            for (int i = 0; i < supplies.Count; i++)
            {
                var item = new Status_Item();
                item.set_image(
                    actor, supplies[i].get_item());
            }
            if (items.Count == 0)
            {
                items.Add(new ConvoyItemNothing());
            }

            SupplyList  = supplies;
            ConvoyItems = items;

            set_items(null);

            refresh_face();
        }