public void AddToolbarItem(ToolbarItem item) { item.Parent = this; item.IsVisible = false; _items.Add(item); AddGuiComponent(item); }
private void LoadGui() { GuiSystem.Load(GraphicsDevice); PrioritySystem.CreatePriorityBoxes(); GuiSystem.AddGuiComponent(new ResourceLimitWindow(new Vector2(0, 0))); Toolbar toolbar = new Toolbar(); ToolbarItem food = new ToolbarItem(ToolbarItemType.Food, _cursor); ToolbarItem crop = new ToolbarItem(ToolbarItemType.Crop, _cursor); food.AddToolbarItem(crop); ToolbarItem indoorSquare = new ToolbarItem(ToolbarItemType.IndoorCrop, _cursor); food.AddToolbarItem(indoorSquare); ToolbarItem pasturing = new ToolbarItem(ToolbarItemType.Pasturing, _cursor); food.AddToolbarItem(pasturing); ToolbarItem mine = new ToolbarItem(ToolbarItemType.Mine, _cursor); ToolbarItem industry = new ToolbarItem(ToolbarItemType.Industry, _cursor); ToolbarItem sawmill = new ToolbarItem(ToolbarItemType.Sawmill, _cursor); industry.AddToolbarItem(sawmill); ToolbarItem carpenter = new ToolbarItem(ToolbarItemType.Carpenter, _cursor); industry.AddToolbarItem(carpenter); ToolbarItem mason = new ToolbarItem(ToolbarItemType.Mason, _cursor); industry.AddToolbarItem(mason); ToolbarItem furnis = new ToolbarItem(ToolbarItemType.Furnace, _cursor); industry.AddToolbarItem(furnis); ToolbarItem equipment = new ToolbarItem(ToolbarItemType.Equiptment, _cursor); ToolbarItem kitchen = new ToolbarItem(ToolbarItemType.Kitchen, _cursor); equipment.AddToolbarItem(kitchen); ToolbarItem toolsmith = new ToolbarItem(ToolbarItemType.Toolsmith, _cursor); equipment.AddToolbarItem(toolsmith); ToolbarItem brewery = new ToolbarItem(ToolbarItemType.Brewery, _cursor); equipment.AddToolbarItem(brewery); ToolbarItem weaver = new ToolbarItem(ToolbarItemType.Weaver, _cursor); equipment.AddToolbarItem(weaver); ToolbarItem bed = new ToolbarItem(ToolbarItemType.Bed, _cursor); equipment.AddToolbarItem(bed); ToolbarItem eletricity = new ToolbarItem(ToolbarItemType.Electronics, _cursor); ToolbarItem battery = new ToolbarItem(ToolbarItemType.Battery, _cursor); eletricity.AddToolbarItem(battery); ToolbarItem coalPower = new ToolbarItem(ToolbarItemType.CoalPower, _cursor); eletricity.AddToolbarItem(coalPower); ToolbarItem electricBike = new ToolbarItem(ToolbarItemType.ElectricBik, _cursor); eletricity.AddToolbarItem(electricBike); toolbar.AddToolbarItem(mine); toolbar.AddToolbarItem(food); toolbar.AddToolbarItem(industry); toolbar.AddToolbarItem(equipment); toolbar.AddToolbarItem(eletricity); toolbar.RecalculateToolbarItems(); GuiSystem.AddGuiComponent(toolbar); }
public void AddToolbarItem(ToolbarItem item) { AddGuiComponent(item); _items.Add(item); }