public GoodsPanel(DwarfGUI gui, GUIComponent parent, Faction faction) : base(gui, parent) { LocalBounds = parent.GlobalBounds; Faction = faction; GridLayout layout = new GridLayout(GUI, this, 8, 4); Tabs = new TabSelector(GUI, layout, 4) { WidthSizeMode = SizeMode.Fit }; layout.SetComponentPosition(Tabs, 0, 0, 4, 8); TotalMoney = new Label(GUI, layout, "Total Money: " + Faction.Economy.CurrentMoney.ToString("C"), GUI.DefaultFont) { ToolTip = "Total amount of money in our treasury", WordWrap = true }; TotalMoney.OnUpdate += TotalMoney_OnUpdate; layout.SetComponentPosition(TotalMoney, 3, 0, 1, 1); SpaceLabel = new Label(GUI, layout, "Space: " + Faction.ComputeStockpileSpace() + "/" + Faction.ComputeStockpileCapacity(), GUI.DefaultFont) { ToolTip = "Space left in our stockpiles", WordWrap = true }; layout.SetComponentPosition(SpaceLabel, 2, 0, 1, 1); SpaceLabel.OnUpdate += SpaceLabel_OnUpdate; layout.UpdateSizes(); CreateBuyTab(); CreateSellTab(); Tabs.SetTab("Buy"); }
public GoodsPanel(DwarfGUI gui, GUIComponent parent, Faction faction) : base(gui, parent) { LocalBounds = parent.GlobalBounds; Faction = faction; GridLayout layout = new GridLayout(GUI, this, 8, 4); Tabs = new TabSelector(GUI, layout, 4) { WidthSizeMode = SizeMode.Fit }; layout.SetComponentPosition(Tabs, 0, 0, 4, 8); TotalMoney = new Label(GUI, layout, "Total Money: " + Faction.Economy.CurrentMoney.ToString("C"), GUI.DefaultFont) { ToolTip = "Total amount of money in our treasury", WordWrap = true }; TotalMoney.OnUpdate += TotalMoney_OnUpdate; layout.SetComponentPosition(TotalMoney, 3, 0, 1, 1); SpaceLabel = new Label(GUI, layout, "Space: " + Faction.ComputeStockpileSpace() + "/" + Faction.ComputeStockpileCapacity(), GUI.DefaultFont) { ToolTip = "Space left in our stockpiles", WordWrap = true }; layout.SetComponentPosition(SpaceLabel, 2, 0, 1, 1); SpaceLabel.OnUpdate += SpaceLabel_OnUpdate; layout.UpdateSizes(); CreateBuyTab(); CreateSellTab(); Tabs.SetTab("Buy"); }
public TradePanel(DwarfGUI gui, GUIComponent parent, Faction faction, Faction otherFaction, List <ResourceAmount> resources) : base(gui, parent) { World = faction.World; Resources = resources; GoodsSent = new List <ResourceAmount>(); GoodsReceived = new List <ResourceAmount>(); LocalBounds = parent.GlobalBounds; Faction = faction; OtherFaction = otherFaction; Layout = new GridLayout(GUI, this, 10, 4); SpaceLabel = new Label(GUI, Layout, "Space: " + Faction.ComputeStockpileSpace() + "/" + Faction.ComputeStockpileCapacity(), GUI.DefaultFont) { ToolTip = "Space left in our stockpiles", WordWrap = true }; Layout.SetComponentPosition(SpaceLabel, 1, 9, 1, 1); SpaceLabel.OnUpdate += SpaceLabel_OnUpdate; Layout.UpdateSizes(); CreateSelector(); }
void SpaceLabel_OnUpdate() { SpaceLabel.Text = "Space: " + Faction.ComputeStockpileSpace() + "/" + Faction.ComputeStockpileCapacity(); }
public TradePanel(DwarfGUI gui, GUIComponent parent, Faction faction, Faction otherFaction) : base(gui, parent) { GoodsSent = new List<ResourceAmount>(); GoodsReceived = new List<ResourceAmount>(); LocalBounds = parent.GlobalBounds; Faction = faction; OtherFaction = otherFaction; Layout = new GridLayout(GUI, this, 10, 4); SpaceLabel = new Label(GUI, Layout, "Space: " + Faction.ComputeStockpileSpace() + "/" + Faction.ComputeStockpileCapacity(), GUI.DefaultFont) { ToolTip = "Space left in our stockpiles", WordWrap = true }; Layout.SetComponentPosition(SpaceLabel, 2, 9, 1, 1); SpaceLabel.OnUpdate += SpaceLabel_OnUpdate; Layout.UpdateSizes(); CreateSelector(); }