Description:
Add close button to budget window.
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r57:4ea323b6edbe -

1 NO CONTENT: modified file, binary diff hidden
1 NO CONTENT: modified file, binary diff hidden
@@ -26,11 +26,19
26 26 this.y = start_y;
27 27 }
28 28
29 public void update(MouseState mouseCur, Budget budget)
29 public bool update(MouseState mouseCur, Budget budget)
30 30 {
31 31 this.budget = budget;
32 32
33 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 42 && MathUtils.Between(mouseCur.X, x, 700+x)
35 43 && MathUtils.Between(mouseCur.Y, y, 500 + y))
36 44 {
@@ -46,14 +54,15
46 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 }
53 this.mouseStart = new Vector2(mouseCur.X, mouseCur.Y);
58 this.mouseStart = new Vector2(mouseCur.X, mouseCur.Y);
54 59
55 60 this.mousePrev = mouseCur;
56 61
62 // Console.Write(mouseCur.ToString());
63
64 return true;
65
57 66 }
58 67
59 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 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 101 batch.DrawString(font, String.Format("Starting Funds.........${0:}", this.budget.money), new Vector2(x, bar_height * 2 + y), Color.Black);
90 102
91 103 batch.DrawString(font, String.Format("REVENUE", this.budget.upkeep), new Vector2(x, bar_height * 4 + y), Color.Black);
@@ -411,7 +411,7
411 411
412 412 if (this.showBudget)
413 413 {
414 this.budgetWindow.update(mouseCur, this.simulation.latestBudget);
414 this.showBudget = this.budgetWindow.update(mouseCur, this.simulation.latestBudget);
415 415 }
416 416
417 417
You need to be logged in to leave comments. Login now