Description:
Add close button to budget window.
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
|
1 | NO CONTENT: modified file, binary diff hidden |
|
NO CONTENT: modified file, binary diff hidden |
|
1 | NO CONTENT: modified file, binary diff hidden |
|
NO CONTENT: modified file, binary diff hidden |
@@ -26,11 +26,19 | |||||
|
26 | this.y = start_y; |
|
26 | this.y = start_y; |
|
27 | } |
|
27 | } |
|
28 |
|
28 | ||
|
29 |
public |
|
29 | public bool update(MouseState mouseCur, Budget budget) |
|
30 | { |
|
30 | { |
|
31 | this.budget = budget; |
|
31 | this.budget = budget; |
|
32 |
|
32 | ||
|
33 | if ((mouseCur.LeftButton == ButtonState.Pressed) |
|
33 | if ((mouseCur.LeftButton == ButtonState.Pressed) |
|
|
34 | && MathUtils.Between(mouseCur.X, 700+x-40, 700+x) | ||
|
|
35 | // && MathUtils.Between(mouseCur.Y, 500+y-20, 500 + y) | ||
|
|
36 | ) { | ||
|
|
37 | |||
|
|
38 | return false; | ||
|
|
39 | |||
|
|
40 | } | ||
|
|
41 | else if ((mouseCur.LeftButton == ButtonState.Pressed) | ||
|
34 | && MathUtils.Between(mouseCur.X, x, 700+x) |
|
42 | && MathUtils.Between(mouseCur.X, x, 700+x) |
|
35 | && MathUtils.Between(mouseCur.Y, y, 500 + y)) |
|
43 | && MathUtils.Between(mouseCur.Y, y, 500 + y)) |
|
36 | { |
|
44 | { |
@@ -46,14 +54,15 | |||||
|
46 | this.y = MathUtils.Clamp(this.y + (int)(this.mouseEnd.Y - this.mouseStart.Y), 0, 400); |
|
54 | this.y = MathUtils.Clamp(this.y + (int)(this.mouseEnd.Y - this.mouseStart.Y), 0, 400); |
|
47 | } |
|
55 | } |
|
48 | } |
|
56 | } |
|
49 | else if (mousePrev.LeftButton == ButtonState.Pressed) |
|
||
|
50 | { |
|
||
|
51 |
|
57 | ||
|
52 | } |
|
58 | this.mouseStart = new Vector2(mouseCur.X, mouseCur.Y); |
|
53 | this.mouseStart = new Vector2(mouseCur.X, mouseCur.Y); |
|
||
|
54 |
|
59 | ||
|
55 | this.mousePrev = mouseCur; |
|
60 | this.mousePrev = mouseCur; |
|
56 |
|
61 | ||
|
|
62 | // Console.Write(mouseCur.ToString()); | ||
|
|
63 | |||
|
|
64 | return true; | ||
|
|
65 | |||
|
57 | } |
|
66 | } |
|
58 |
|
67 | ||
|
59 | public void draw(SpriteBatch batch) |
|
68 | public void draw(SpriteBatch batch) |
@@ -83,9 +92,12 | |||||
|
83 | } |
|
92 | } |
|
84 | } |
|
93 | } |
|
85 |
|
94 | ||
|
|
95 | FilledRectangle.drawFilledRectangle(batch, new Rectangle(x + 700 - 20, y+bar_height, 20, 20), Color.LightGray); | ||
|
|
96 | Vector2 dimensions = font.MeasureString("X"); | ||
|
|
97 | batch.DrawString(font, "X", new Vector2(x+700 -20 + (dimensions.X/2), y+bar_height), Color.Black); | ||
|
|
98 | |||
|
86 | batch.DrawString(font, String.Format("BUDGET REPORT FOR {0:MMMMM yyyy}", this.budget.DateTime), new Vector2(x, bar_height * 1 + y), Color.Black); |
|
99 | batch.DrawString(font, String.Format("BUDGET REPORT FOR {0:MMMMM yyyy}", this.budget.DateTime), new Vector2(x, bar_height * 1 + y), Color.Black); |
|
87 |
|
100 | ||
|
88 |
|
|||
|
89 | batch.DrawString(font, String.Format("Starting Funds.........${0:}", this.budget.money), new Vector2(x, bar_height * 2 + y), Color.Black); |
|
101 | batch.DrawString(font, String.Format("Starting Funds.........${0:}", this.budget.money), new Vector2(x, bar_height * 2 + y), Color.Black); |
|
90 |
|
102 | ||
|
91 | batch.DrawString(font, String.Format("REVENUE", this.budget.upkeep), new Vector2(x, bar_height * 4 + y), Color.Black); |
|
103 | batch.DrawString(font, String.Format("REVENUE", this.budget.upkeep), new Vector2(x, bar_height * 4 + y), Color.Black); |
You need to be logged in to leave comments.
Login now