Description:
Unify row appearance.
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r594:d94695edb9ce -

@@ -69,12 +69,12
69 69 }
70 70
71 71 public String line_format(String name, decimal first, decimal second) {
72 int between_name_col = 6;
73 int between_cols = 4;
72 int between_name_col = 20 - name.Length;
73 int between_cols = 6;
74 74 var first_formatted = String.Format("${0:}", first).PadLeft(6, '.');
75 75 var second_formatted = String.Format("${0:}", second).PadLeft(6, '.');
76 76
77 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);
77 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);
78 78
79 79 return formatted;
80 80 }
@@ -115,13 +115,13
115 115 batch.DrawString(font, String.Format("REVENUE", this.budget.upkeep), new Vector2(x, bar_height * 4 + y), Color.Black);
116 116 batch.DrawString(font, line_format("Subsidy", this.budget.subsidy, this.previous_budget.subsidy), new Vector2(x, bar_height * 5 + y), Color.Black);
117 117 batch.DrawString(font, line_format("Contracts", this.budget.contracts, this.previous_budget.contracts), new Vector2(x, bar_height * 6 + y), Color.Black);
118 batch.DrawString(font, String.Format("Misc...................${0:}....${1:}", this.budget.misc, this.previous_budget.misc), new Vector2(x, bar_height * 7 + y), Color.Black);
118 batch.DrawString(font, line_format("Misc", this.budget.misc, this.previous_budget.misc), new Vector2(x, bar_height * 7 + y), Color.Black);
119 119
120 batch.DrawString(font, String.Format("EXPENSES", this.budget.upkeep), new Vector2(x, bar_height * 10 + y), Color.Black);
121 batch.DrawString(font, String.Format("Upkeep.................${0:}....${1:}", this.budget.upkeep, this.previous_budget.upkeep), new Vector2(x, bar_height * 11 + y), Color.Black);
122 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);
123 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);
124 batch.DrawString(font, String.Format("Enforcement............${0:}....${1:}", this.budget.enforcement, this.previous_budget.enforcement), new Vector2(x, bar_height * 14 + y), Color.Black);
120 batch.DrawString(font, "EXPENSES", new Vector2(x, bar_height * 10 + y), Color.Black);
121 batch.DrawString(font, line_format("Upkeep", this.budget.upkeep, this.previous_budget.upkeep), new Vector2(x, bar_height * 11 + y), Color.Black);
122 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);
123 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);
124 batch.DrawString(font, line_format("Enforcement", this.budget.enforcement, this.previous_budget.enforcement), new Vector2(x, bar_height * 14 + y), Color.Black);
125 125
126 126 Color cashflow_color = Color.Black;
127 127 if (this.budget.cashflow < 0) {
@@ -132,8 +132,8
132 132 final_color = Color.Red;
133 133 }
134 134
135 batch.DrawString(font, String.Format("Cashflow.............${0:}....${1:}", this.budget.cashflow, this.previous_budget.cashflow), new Vector2(x, bar_height * 16 + y), cashflow_color);
136 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);
135 batch.DrawString(font, line_format("Cashflow", this.budget.cashflow, this.previous_budget.cashflow), new Vector2(x, bar_height * 16 + y), cashflow_color);
136 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);
137 137
138 138
139 139 FilledRectangle.drawFilledRectangle(batch, new Rectangle(50, 50, 50, 50), new Color (0, 0,0, 0), 0.99f);
You need to be logged in to leave comments. Login now