public OverlayEconomyState() { // Add the end turn button buttonEndTurn = GuiButton.createButtonWithLabel(MaxOfEmpires.overlayPos.ToPoint(), "End turn", null, "font"); addElement(buttonEndTurn); // Add a label showing whose turn it currently is labelCurrentPlayer = GuiLabel.createNewLabel(new Vector2(buttonEndTurn.Bounds.Right + 2, buttonEndTurn.Bounds.Top + 2), "Current player: ", "font"); addElement(labelCurrentPlayer); // Add a label telling the player how much money they have labelPlayerMoney = GuiLabel.createNewLabel(new Vector2(labelCurrentPlayer.Bounds.Left, labelCurrentPlayer.Bounds.Bottom + 5), "Money: 0G", "font"); addElement(labelPlayerMoney); labelPlayerMoneyPerTurn = GuiLabel.createNewLabel(new Vector2(labelCurrentPlayer.Bounds.Left, labelPlayerMoney.Bounds.Bottom + 5), "Money per turn: 0G", "font"); addElement(labelPlayerMoneyPerTurn); // Add a label telling the player how much population they have labelPlayerPopulation = GuiLabel.createNewLabel(new Vector2(labelCurrentPlayer.Bounds.Left, labelPlayerMoneyPerTurn.Bounds.Bottom + 5), "Free Population: 0", "font"); addElement(labelPlayerPopulation); // Add labels for unit stats listArmySoldiers = GuiList.createNewList(new Point(labelPlayerMoneyPerTurn.Bounds.Location.X, labelPlayerPopulation.Bounds.Bottom + 5), 5, new List <GuiElement>(), 300); listArmySoldiers.addElement(ElementArmySelection.CreateBuildButton(Point.Zero, "1", null, null)); // Add this so that the size is calculated correctly addElement(listArmySoldiers); buildingInfoPosition = new Point(buttonEndTurn.Bounds.Left, listArmySoldiers.Bounds.Bottom + listArmySoldiers.MaxHeight + 5); // Remove this label so that it doesn't display bullshit :) listArmySoldiers.removeElement(0); }
private void UpdateArmyInformation(Army a) { listArmySoldiers.clear(); foreach (string soldierType in a.UnitsAndCounts.Keys) { // Create the label to add to the list StringBuilder sb = new StringBuilder(); sb.Append(Translations.GetTranslation(soldierType)); sb.Append(": "); sb.Append(a.SelectedUnits[soldierType] + "/"); sb.Append(a.UnitsAndCounts[soldierType]); // Add this label to the list listArmySoldiers.addElement(ElementArmySelection.CreateBuildButton(Point.Zero, sb.ToString(), AddSelected(soldierType, a), LowerSelected(soldierType, a))); } }