Exemplo n.º 1
0
        public PresserWidget(IInventory inventory, T component, string path)
        {
            m_componentFurnace = component;
            WidgetsManager.LoadWidgetContents(this, this, ContentManager.Get <XElement>(path));
            m_inventoryGrid = Children.Find <GridPanelWidget>("InventoryGrid");
            m_furnaceGrid   = Children.Find <GridPanelWidget>("FurnaceGrid");
            m_fire          = Children.Find <FireWidget>("Fire");
            m_progress      = Children.Find <ValueBarWidget>("Progress");
            m_resultSlot    = Children.Find <InventorySlotWidget>("ResultSlot");
            int num = 6, y, x;
            InventorySlotWidget inventorySlotWidget;

            for (y = 0; y < m_inventoryGrid.RowsCount; y++)
            {
                for (x = 0; x < m_inventoryGrid.ColumnsCount; x++)
                {
                    inventorySlotWidget = new InventorySlotWidget();
                    inventorySlotWidget.AssignInventorySlot(inventory, num++);
                    m_inventoryGrid.Children.Add(inventorySlotWidget);
                    m_inventoryGrid.SetWidgetCell(inventorySlotWidget, new Point2(x, y));
                }
            }
            num = 0;
            for (y = 0; y < m_furnaceGrid.RowsCount; y++)
            {
                for (x = 0; x < m_furnaceGrid.ColumnsCount; x++)
                {
                    inventorySlotWidget = new InventorySlotWidget();
                    inventorySlotWidget.AssignInventorySlot(component, num++);
                    m_furnaceGrid.Children.Add(inventorySlotWidget);
                    m_furnaceGrid.SetWidgetCell(inventorySlotWidget, new Point2(x, y));
                }
            }
            m_resultSlot.AssignInventorySlot(component, component.ResultSlotIndex);
        }
Exemplo n.º 2
0
        public ElectricFurnaceWidget(IInventory inventory, ComponentElectricFurnace componentFurnace)
        {
            m_componentFurnace = componentFurnace;
            WidgetsManager.LoadWidgetContents(this, this, ContentManager.Get <XElement>("Widgets/ElectricFurnaceWidget"));
            m_inventoryGrid   = Children.Find <GridPanelWidget>("InventoryGrid");
            m_furnaceGrid     = Children.Find <GridPanelWidget>("FurnaceGrid");
            m_fire            = Children.Find <FireWidget>("Fire");
            m_progress        = Children.Find <ValueBarWidget>("Progress");
            m_resultSlot      = Children.Find <InventorySlotWidget>("ResultSlot");
            m_remainsSlot     = Children.Find <InventorySlotWidget>("RemainsSlot");
            m_circuitSlot     = Children.Find <InventorySlotWidget>("CircuitSlot");
            m_acceptsDropsBox = Children.Find <CheckboxWidget>("AcceptsElectBox");
            m_circuit2Slot    = Children.Find <InventorySlotWidget>("Circuit2Slot");
            int num = 6, y, x;
            InventorySlotWidget inventorySlotWidget;

            for (y = 0; y < m_inventoryGrid.RowsCount; y++)
            {
                for (x = 0; x < m_inventoryGrid.ColumnsCount; x++)
                {
                    inventorySlotWidget = new InventorySlotWidget();
                    inventorySlotWidget.AssignInventorySlot(inventory, num++);
                    m_inventoryGrid.Children.Add(inventorySlotWidget);
                    m_inventoryGrid.SetWidgetCell(inventorySlotWidget, new Point2(x, y));
                }
            }
            num = 0;
            for (y = 0; y < m_furnaceGrid.RowsCount; y++)
            {
                for (x = 0; x < m_furnaceGrid.ColumnsCount; x++)
                {
                    inventorySlotWidget = new InventorySlotWidget();
                    inventorySlotWidget.AssignInventorySlot(componentFurnace, num++);
                    m_furnaceGrid.Children.Add(inventorySlotWidget);
                    m_furnaceGrid.SetWidgetCell(inventorySlotWidget, new Point2(x, y));
                }
            }
            m_resultSlot.AssignInventorySlot(componentFurnace, componentFurnace.ResultSlotIndex);
            m_remainsSlot.AssignInventorySlot(componentFurnace, componentFurnace.RemainsSlotIndex);
            m_circuitSlot.AssignInventorySlot(componentFurnace, componentFurnace.Cir1SlotIndex);
            m_circuit2Slot.AssignInventorySlot(componentFurnace, componentFurnace.Cir2SlotIndex);
        }
        public SmeltingRecipeWidget()
        {
            XElement node = ContentManager.Get <XElement>("Widgets/SmeltingRecipe");

            LoadContents(this, node);
            m_nameWidget        = Children.Find <LabelWidget>("SmeltingRecipeWidget.Name");
            m_descriptionWidget = Children.Find <LabelWidget>("SmeltingRecipeWidget.Description");
            m_gridWidget        = Children.Find <GridPanelWidget>("SmeltingRecipeWidget.Ingredients");
            m_fireWidget        = Children.Find <FireWidget>("SmeltingRecipeWidget.Fire");
            m_resultWidget      = Children.Find <CraftingRecipeSlotWidget>("SmeltingRecipeWidget.Result");
            for (int i = 0; i < m_gridWidget.RowsCount; i++)
            {
                for (int j = 0; j < m_gridWidget.ColumnsCount; j++)
                {
                    CraftingRecipeSlotWidget widget = new CraftingRecipeSlotWidget();
                    m_gridWidget.Children.Add(widget);
                    m_gridWidget.SetWidgetCell(widget, new Point2(j, i));
                }
            }
        }
Exemplo n.º 4
0
        public BlastFurnaceWidget(IInventory inventory, ComponentBlastFurnace componentFurnace)
        {
            m_componentFurnace = componentFurnace;
            WidgetsManager.LoadWidgetContents(this, this, ContentManager.Get <XElement>("Widgets/BlastFurnaceWidget"));
            m_inventoryGrid = Children.Find <GridPanelWidget>("InventoryGrid");
            m_furnaceGrid   = Children.Find <GridPanelWidget>("FurnaceGrid");
            m_fire          = Children.Find <FireWidget>("Fire");
            m_progress      = Children.Find <ValueBarWidget>("Progress");
            m_resultSlot    = Children.Find <InventorySlotWidget>("ResultSlot");
            m_remainsSlot   = Children.Find <InventorySlotWidget>("RemainsSlot");
            m_remainsSlot2  = Children.Find <InventorySlotWidget>("RemainsSlot2");
            m_remainsSlot3  = Children.Find <InventorySlotWidget>("RemainsSlot3");
            int num = 6, y, x;
            InventorySlotWidget inventorySlotWidget;

            for (y = 0; y < m_inventoryGrid.RowsCount; y++)
            {
                for (x = 0; x < m_inventoryGrid.ColumnsCount; x++)
                {
                    inventorySlotWidget = new InventorySlotWidget();
                    inventorySlotWidget.AssignInventorySlot(inventory, num++);
                    m_inventoryGrid.Children.Add(inventorySlotWidget);
                    m_inventoryGrid.SetWidgetCell(inventorySlotWidget, new Point2(x, y));
                }
            }
            num = 0;
            for (y = 0; y < m_furnaceGrid.RowsCount; y++)
            {
                for (x = 0; x < m_furnaceGrid.ColumnsCount; x++)
                {
                    inventorySlotWidget = new InventorySlotWidget();
                    inventorySlotWidget.AssignInventorySlot(componentFurnace, num++);
                    m_furnaceGrid.Children.Add(inventorySlotWidget);
                    m_furnaceGrid.SetWidgetCell(inventorySlotWidget, new Point2(x, y));
                }
            }
            m_resultSlot.AssignInventorySlot(componentFurnace, 8);
            m_remainsSlot.AssignInventorySlot(componentFurnace, 9);
            m_remainsSlot2.AssignInventorySlot(componentFurnace, 10);
            m_remainsSlot3.AssignInventorySlot(componentFurnace, 11);
        }
Exemplo n.º 5
0
        public FurnaceWidget(IInventory inventory, ComponentFurnace componentFurnace)
        {
            m_componentFurnace = componentFurnace;
            XElement node = ContentManager.Get <XElement>("Widgets/FurnaceWidget");

            LoadContents(this, node);
            m_inventoryGrid = Children.Find <GridPanelWidget>("InventoryGrid");
            m_furnaceGrid   = Children.Find <GridPanelWidget>("FurnaceGrid");
            m_fire          = Children.Find <FireWidget>("Fire");
            m_progress      = Children.Find <ValueBarWidget>("Progress");
            m_resultSlot    = Children.Find <InventorySlotWidget>("ResultSlot");
            m_remainsSlot   = Children.Find <InventorySlotWidget>("RemainsSlot");
            m_fuelSlot      = Children.Find <InventorySlotWidget>("FuelSlot");
            int num = 10;

            for (int i = 0; i < m_inventoryGrid.RowsCount; i++)
            {
                for (int j = 0; j < m_inventoryGrid.ColumnsCount; j++)
                {
                    InventorySlotWidget inventorySlotWidget = new InventorySlotWidget();
                    inventorySlotWidget.AssignInventorySlot(inventory, num++);
                    m_inventoryGrid.Children.Add(inventorySlotWidget);
                    m_inventoryGrid.SetWidgetCell(inventorySlotWidget, new Point2(j, i));
                }
            }
            num = 0;
            for (int k = 0; k < m_furnaceGrid.RowsCount; k++)
            {
                for (int l = 0; l < m_furnaceGrid.ColumnsCount; l++)
                {
                    InventorySlotWidget inventorySlotWidget2 = new InventorySlotWidget();
                    inventorySlotWidget2.AssignInventorySlot(componentFurnace, num++);
                    m_furnaceGrid.Children.Add(inventorySlotWidget2);
                    m_furnaceGrid.SetWidgetCell(inventorySlotWidget2, new Point2(l, k));
                }
            }
            m_fuelSlot.AssignInventorySlot(componentFurnace, componentFurnace.FuelSlotIndex);
            m_resultSlot.AssignInventorySlot(componentFurnace, componentFurnace.ResultSlotIndex);
            m_remainsSlot.AssignInventorySlot(componentFurnace, componentFurnace.RemainsSlotIndex);
        }
Exemplo n.º 6
0
        //protected readonly InventorySlotWidget m_remainsSlot;

        //protected readonly InventorySlotWidget m_resultSlot;

        public FireBoxWidget(IInventory inventory, T component, string path)
        {
            m_componentFurnace = component;
            WidgetsManager.LoadWidgetContents(this, this, ContentManager.Get <XElement>(path));
            m_inventoryGrid = Children.Find <GridPanelWidget>("InventoryGrid");
            m_fire          = Children.Find <FireWidget>("Fire");
            m_progress      = Children.Find <ValueBarWidget>("Progress");
            m_fuelSlot      = Children.Find <InventorySlotWidget>("FuelSlot");
            int num = 6;

            for (int i = 0; i < m_inventoryGrid.RowsCount; i++)
            {
                for (int j = 0; j < m_inventoryGrid.ColumnsCount; j++)
                {
                    var inventorySlotWidget = new InventorySlotWidget();
                    inventorySlotWidget.AssignInventorySlot(inventory, num++);
                    m_inventoryGrid.Children.Add(inventorySlotWidget);
                    m_inventoryGrid.SetWidgetCell(inventorySlotWidget, new Point2(j, i));
                }
            }
            m_fuelSlot.AssignInventorySlot(component, component.FuelSlotIndex);
        }