Description:
Move over more input handling.
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r160:1ad8dee9e756 -

@@ -7,7 +7,7
7
7
8 namespace isometricparkfna.Engines {
8 namespace isometricparkfna.Engines {
9
9
10 [Receives(typeof(ToggleWindowMessage))]
10 [Receives(typeof(ToggleWindowMessage), typeof(ToggleVisibilityMessage))]
11 class GameBridgeEngine : Engine
11 class GameBridgeEngine : Engine
12 {
12 {
13
13
@@ -37,11 +37,19
37 break;
37 break;
38
38
39 }
39 }
40
41
42 }
40 }
43
41 foreach (ref readonly var visibilityMessage in ReadMessages<ToggleVisibilityMessage>())
44
42 {
43
44 switch (visibilityMessage.Element) {
45 case Element.Grid:
46 game.showGrid = !game.showGrid;
47 break;
48 case Element.Trees:
49 game.showTrees = !game.showTrees;
50 break;
51 }
52 }
45
53
46 }
54 }
47 }
55 }
@@ -9,7 +9,7
9
9
10
10
11
11
12 [Sends(typeof(ToggleWindowMessage))]
12 [Sends(typeof(ToggleWindowMessage), typeof(ToggleVisibilityMessage))]
13 public class InputEngine : Engine
13 public class InputEngine : Engine
14 {
14 {
15 private KeyboardState keyboardPrev;
15 private KeyboardState keyboardPrev;
@@ -44,8 +44,17
44 SendMessage(new ToggleWindowMessage{Window = Window.News});
44 SendMessage(new ToggleWindowMessage{Window = Window.News});
45
45
46 }
46 }
47 if (keyboardCur.IsKeyDown(Keys.G) && keyboardPrev.IsKeyUp(Keys.G))
48 {
49 SendMessage(new ToggleVisibilityMessage{Element = Element.Grid});
47
50
51 }
52 #if DEBUG
53 if (keyboardCur.IsKeyDown(Keys.T) && keyboardPrev.IsKeyUp(Keys.T))
54 {
55 SendMessage(new ToggleVisibilityMessage{Element = Element.Trees});
48
56
57 }
49 #endif
58 #endif
50 #endregion misc_keys
59 #endregion misc_keys
51
60
@@ -380,18 +380,6
380 System.Console.WriteLine("Quitting");
380 System.Console.WriteLine("Quitting");
381 Environment.Exit(0);
381 Environment.Exit(0);
382 }
382 }
383 if (keyboardCur.IsKeyDown(Keys.G) && keyboardPrev.IsKeyUp(Keys.G))
384 {
385 this.showGrid = !this.showGrid;
386
387 }
388 #if DEBUG
389 if (keyboardCur.IsKeyDown(Keys.T) && keyboardPrev.IsKeyUp(Keys.T))
390 {
391 this.showTrees = !this.showTrees;
392
393 }
394 #endif
395 if (keyboardCur.IsKeyDown(Keys.C) && keyboardPrev.IsKeyUp(Keys.C))
383 if (keyboardCur.IsKeyDown(Keys.C) && keyboardPrev.IsKeyUp(Keys.C))
396 {
384 {
397 this.camera.Jump(Vector2.Zero);
385 this.camera.Jump(Vector2.Zero);
You need to be logged in to leave comments. Login now