Exemplo n.º 1
0
        private void RefreshQueue()
        {
            m_queueGrid.Clear();
            int i = 0;

            foreach (var queueItem in m_selectedAssembler.Queue)
            {
                m_textCache.Clear()
                .Append((int)queueItem.Amount)
                .Append('x');

                var item = new MyGuiControlGrid.Item(
                    icon: queueItem.Blueprint.Icon,
                    toolTip: queueItem.Blueprint.DisplayNameText,
                    userData: queueItem);
                item.AddText(text: m_textCache, textAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_BOTTOM);

                if (MyFakes.SHOW_PRODUCTION_QUEUE_ITEM_IDS)
                {
                    m_textCache.Clear()
                    .Append((int)queueItem.ItemId);

                    item.AddText(text: m_textCache, textAlign: MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_TOP);
                }

                m_queueGrid.Add(item);
                ++i;
            }

            m_queueGrid.RowsCount = Math.Max(1 + (i / m_queueGrid.ColumnsCount), QUEUE_GRID_ROWS);
            RefreshProgress();
        }
Exemplo n.º 2
0
        private void RefreshBlueprints()
        {
            if (m_blueprintButtonGroup.SelectedButton == null)
            {
                return;
            }

            var blueprintClass = m_blueprintButtonGroup.SelectedButton.UserData as MyBlueprintClassDefinition;

            Debug.Assert(blueprintClass != null);
            if (blueprintClass == null)
            {
                return;
            }

            m_blueprintsGrid.Clear();
            int i = 0;

            foreach (var blueprint in blueprintClass)
            {
                var item = new MyGuiControlGrid.Item(
                    icon: blueprint.Icon,
                    toolTip: blueprint.DisplayNameText,
                    userData: blueprint);
                m_blueprintsGrid.Add(item);
                ++i;
            }

            m_blueprintsGrid.RowsCount = Math.Max(1 + (i / m_blueprintsGrid.ColumnsCount), BLUEPRINT_GRID_ROWS);
            RefreshBlueprintGridColors();
        }
Exemplo n.º 3
0
        private void RefreshInventory()
        {
            m_inventoryGrid.Clear();
            foreach (var item in m_selectedAssembler.OutputInventory.GetItems())
            {
                m_inventoryGrid.Add(MyGuiControlInventoryOwner.CreateInventoryGridItem(item));
            }
            int itemCount = m_selectedAssembler.OutputInventory.GetItems().Count;

            m_inventoryGrid.RowsCount = Math.Max(1 + (itemCount / m_inventoryGrid.ColumnsCount), INVENTORY_GRID_ROWS);
        }