# HG changeset patch # User Alys Brooks # Date 2022-05-25 07:22:56 # Node ID d94695edb9ceb90c13f979d8c83054c572c14b60 # Parent 6a06e61b430cfb1fee7b5b41be482d1f6134e4da Unify row appearance. diff --git a/isometric-park-fna/UI/BudgetWindow.cs b/isometric-park-fna/UI/BudgetWindow.cs --- a/isometric-park-fna/UI/BudgetWindow.cs +++ b/isometric-park-fna/UI/BudgetWindow.cs @@ -69,12 +69,12 @@ } public String line_format(String name, decimal first, decimal second) { - int between_name_col = 6; - int between_cols = 4; + int between_name_col = 20 - name.Length; + int between_cols = 6; var first_formatted = String.Format("${0:}", first).PadLeft(6, '.'); var second_formatted = String.Format("${0:}", second).PadLeft(6, '.'); - var formatted = String.Format("{0,5:}{1:}{2,6:}{3:}{4,6:}", name, new String('.', between_name_col), first_formatted, new String('.', between_cols), second_formatted); + var formatted = String.Format("{0:}{1:}{2,6:}{3:}{4,6:}", name, new String('.', between_name_col), first_formatted, new String('.', between_cols), second_formatted); return formatted; } @@ -115,13 +115,13 @@ batch.DrawString(font, String.Format("REVENUE", this.budget.upkeep), new Vector2(x, bar_height * 4 + y), Color.Black); batch.DrawString(font, line_format("Subsidy", this.budget.subsidy, this.previous_budget.subsidy), new Vector2(x, bar_height * 5 + y), Color.Black); batch.DrawString(font, line_format("Contracts", this.budget.contracts, this.previous_budget.contracts), new Vector2(x, bar_height * 6 + y), Color.Black); - batch.DrawString(font, String.Format("Misc...................${0:}....${1:}", this.budget.misc, this.previous_budget.misc), new Vector2(x, bar_height * 7 + y), Color.Black); + batch.DrawString(font, line_format("Misc", this.budget.misc, this.previous_budget.misc), new Vector2(x, bar_height * 7 + y), Color.Black); - batch.DrawString(font, String.Format("EXPENSES", this.budget.upkeep), new Vector2(x, bar_height * 10 + y), Color.Black); - batch.DrawString(font, String.Format("Upkeep.................${0:}....${1:}", this.budget.upkeep, this.previous_budget.upkeep), new Vector2(x, bar_height * 11 + y), Color.Black); - batch.DrawString(font, String.Format("Tree Planting..........${0:}....${1:}", this.budget.tree_planting, this.previous_budget.tree_planting), new Vector2(x, bar_height * 12 + y), Color.Black); - batch.DrawString(font, String.Format("Tree Clearing..........${0:}....${1:}", this.budget.tree_clearing, this.previous_budget.tree_clearing), new Vector2(x, bar_height * 13 + y), Color.Black); - batch.DrawString(font, String.Format("Enforcement............${0:}....${1:}", this.budget.enforcement, this.previous_budget.enforcement), new Vector2(x, bar_height * 14 + y), Color.Black); + batch.DrawString(font, "EXPENSES", new Vector2(x, bar_height * 10 + y), Color.Black); + batch.DrawString(font, line_format("Upkeep", this.budget.upkeep, this.previous_budget.upkeep), new Vector2(x, bar_height * 11 + y), Color.Black); + batch.DrawString(font, line_format("Tree Planting", this.budget.tree_planting, this.previous_budget.tree_planting), new Vector2(x, bar_height * 12 + y), Color.Black); + batch.DrawString(font, line_format("Tree Clearing", this.budget.tree_clearing, this.previous_budget.tree_clearing), new Vector2(x, bar_height * 13 + y), Color.Black); + batch.DrawString(font, line_format("Enforcement", this.budget.enforcement, this.previous_budget.enforcement), new Vector2(x, bar_height * 14 + y), Color.Black); Color cashflow_color = Color.Black; if (this.budget.cashflow < 0) { @@ -132,8 +132,8 @@ final_color = Color.Red; } - batch.DrawString(font, String.Format("Cashflow.............${0:}....${1:}", this.budget.cashflow, this.previous_budget.cashflow), new Vector2(x, bar_height * 16 + y), cashflow_color); - batch.DrawString(font, String.Format("Ending Funds.........${0:}....${1:}", this.budget.final_money, this.previous_budget.final_money), new Vector2(x, bar_height * 17 + y), final_color); + batch.DrawString(font, line_format("Cashflow", this.budget.cashflow, this.previous_budget.cashflow), new Vector2(x, bar_height * 16 + y), cashflow_color); + batch.DrawString(font, line_format("Ending Funds", this.budget.final_money, this.previous_budget.final_money), new Vector2(x, bar_height * 17 + y), final_color); FilledRectangle.drawFilledRectangle(batch, new Rectangle(50, 50, 50, 50), new Color (0, 0,0, 0), 0.99f);