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); }
public VitalStatsWidget(ComponentPlayer componentPlayer) { m_componentPlayer = componentPlayer; XElement node = ContentManager.Get <XElement>("Widgets/VitalStatsWidget"); LoadContents(this, node); m_titleLabel = Children.Find <LabelWidget>("TitleLabel"); m_healthLink = Children.Find <LinkWidget>("HealthLink"); m_healthValueBar = Children.Find <ValueBarWidget>("HealthValueBar"); m_staminaLink = Children.Find <LinkWidget>("StaminaLink"); m_staminaValueBar = Children.Find <ValueBarWidget>("StaminaValueBar"); m_foodLink = Children.Find <LinkWidget>("FoodLink"); m_foodValueBar = Children.Find <ValueBarWidget>("FoodValueBar"); m_sleepLink = Children.Find <LinkWidget>("SleepLink"); m_sleepValueBar = Children.Find <ValueBarWidget>("SleepValueBar"); m_temperatureLink = Children.Find <LinkWidget>("TemperatureLink"); m_temperatureValueBar = Children.Find <ValueBarWidget>("TemperatureValueBar"); m_wetnessLink = Children.Find <LinkWidget>("WetnessLink"); m_wetnessValueBar = Children.Find <ValueBarWidget>("WetnessValueBar"); m_chokeButton = Children.Find <ButtonWidget>("ChokeButton"); m_strengthLink = Children.Find <LinkWidget>("StrengthLink"); m_strengthLabel = Children.Find <LabelWidget>("StrengthLabel"); m_resilienceLink = Children.Find <LinkWidget>("ResilienceLink"); m_resilienceLabel = Children.Find <LabelWidget>("ResilienceLabel"); m_speedLink = Children.Find <LinkWidget>("SpeedLink"); m_speedLabel = Children.Find <LabelWidget>("SpeedLabel"); m_hungerLink = Children.Find <LinkWidget>("HungerLink"); m_hungerLabel = Children.Find <LabelWidget>("HungerLabel"); m_experienceLink = Children.Find <LinkWidget>("ExperienceLink"); m_experienceValueBar = Children.Find <ValueBarWidget>("ExperienceValueBar"); m_insulationLink = Children.Find <LinkWidget>("InsulationLink"); m_insulationLabel = Children.Find <LabelWidget>("InsulationLabel"); }
public SpawnDialog() { XElement node = ContentManager.Get <XElement>("Dialogs/SpawnDialog"); LoadContents(this, node); m_largeLabelWidget = Children.Find <LabelWidget>("SpawnDialog.LargeLabel"); m_smallLabelWidget = Children.Find <LabelWidget>("SpawnDialog.SmallLabel"); m_progressWidget = Children.Find <ValueBarWidget>("SpawnDialog.Progress"); }
public FractionalTowerWidget(IInventory inventory, ComponentMachine componentFurnace) { m_componentFurnace = componentFurnace; WidgetsManager.LoadWidgetContents(this, this, ContentManager.Get <XElement>("Widgets/FractionalTowerWidget")); m_inventoryGrid = Children.Find <GridPanelWidget>("InventoryGrid"); m_furnaceGrid = Children.Find <GridPanelWidget>("FurnaceGrid"); m_result1 = Children.Find <InventorySlotWidget>("ResultSlot1"); m_result2 = Children.Find <InventorySlotWidget>("ResultSlot2"); m_result3 = Children.Find <InventorySlotWidget>("ResultSlot3"); m_cir1 = Children.Find <InventorySlotWidget>("CircuitSlot1"); m_cir2 = Children.Find <InventorySlotWidget>("CircuitSlot2"); m_acceptsDropsBox = Children.Find <CheckboxWidget>("AcceptsElectBox"); m_progress = Children.Find <ValueBarWidget>("Progress"); 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_result1.AssignInventorySlot(componentFurnace, num++); m_result2.AssignInventorySlot(componentFurnace, num++); m_result3.AssignInventorySlot(componentFurnace, num++); m_cir1.AssignInventorySlot(componentFurnace, num++); m_cir2.AssignInventorySlot(componentFurnace, num++); }
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 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); }
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); }
//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); }
public InventorySlotWidget() { base.Size = new Vector2(72f, 72f); WidgetsList children = Children; Widget[] array = new Widget[7]; BevelledRectangleWidget obj = new BevelledRectangleWidget { BevelSize = -2f, DirectionalLight = 0.15f, CenterColor = Color.Transparent }; BevelledRectangleWidget bevelledRectangleWidget = obj; m_rectangleWidget = obj; array[0] = bevelledRectangleWidget; RectangleWidget obj2 = new RectangleWidget { FillColor = Color.Transparent, OutlineColor = Color.Transparent }; RectangleWidget rectangleWidget = obj2; m_highlightWidget = obj2; array[1] = rectangleWidget; BlockIconWidget obj3 = new BlockIconWidget { HorizontalAlignment = WidgetAlignment.Center, VerticalAlignment = WidgetAlignment.Center, Margin = new Vector2(2f, 2f) }; BlockIconWidget blockIconWidget = obj3; m_blockIconWidget = obj3; array[2] = blockIconWidget; LabelWidget obj4 = new LabelWidget { Font = ContentManager.Get <BitmapFont>("Fonts/Pericles"), FontScale = 1f, HorizontalAlignment = WidgetAlignment.Far, VerticalAlignment = WidgetAlignment.Far, Margin = new Vector2(6f, 2f) }; LabelWidget labelWidget = obj4; m_countWidget = obj4; array[3] = labelWidget; ValueBarWidget obj5 = new ValueBarWidget { LayoutDirection = LayoutDirection.Vertical, HorizontalAlignment = WidgetAlignment.Near, VerticalAlignment = WidgetAlignment.Far, BarsCount = 3, FlipDirection = true, LitBarColor = new Color(32, 128, 0), UnlitBarColor = new Color(24, 24, 24, 64), BarSize = new Vector2(12f, 12f), BarSubtexture = ContentManager.Get <Subtexture>("Textures/Atlas/ProgressBar"), Margin = new Vector2(4f, 4f) }; ValueBarWidget valueBarWidget = obj5; m_healthBarWidget = obj5; array[4] = valueBarWidget; StackPanelWidget obj6 = new StackPanelWidget { Direction = LayoutDirection.Horizontal, HorizontalAlignment = WidgetAlignment.Far, Margin = new Vector2(3f, 3f) }; WidgetsList children2 = obj6.Children; RectangleWidget obj7 = new RectangleWidget { Subtexture = ContentManager.Get <Subtexture>("Textures/Atlas/InteractiveItemOverlay"), Size = new Vector2(13f, 14f), FillColor = new Color(160, 160, 160), OutlineColor = Color.Transparent }; rectangleWidget = obj7; m_interactiveOverlayWidget = obj7; children2.Add(rectangleWidget); WidgetsList children3 = obj6.Children; RectangleWidget obj8 = new RectangleWidget { Subtexture = ContentManager.Get <Subtexture>("Textures/Atlas/EditItemOverlay"), Size = new Vector2(12f, 14f), FillColor = new Color(160, 160, 160), OutlineColor = Color.Transparent }; rectangleWidget = obj8; m_editOverlayWidget = obj8; children3.Add(rectangleWidget); WidgetsList children4 = obj6.Children; RectangleWidget obj9 = new RectangleWidget { Subtexture = ContentManager.Get <Subtexture>("Textures/Atlas/FoodItemOverlay"), Size = new Vector2(11f, 14f), FillColor = new Color(160, 160, 160), OutlineColor = Color.Transparent }; rectangleWidget = obj9; m_foodOverlayWidget = obj9; children4.Add(rectangleWidget); array[5] = obj6; LabelWidget obj10 = new LabelWidget { Text = "Split", Font = ContentManager.Get <BitmapFont>("Fonts/Pericles"), Color = new Color(255, 64, 0), HorizontalAlignment = WidgetAlignment.Near, VerticalAlignment = WidgetAlignment.Near, Margin = new Vector2(2f, 0f) }; labelWidget = obj10; m_splitLabelWidget = obj10; array[6] = labelWidget; children.Add(array); }