Mercurial > hg > openttd
diff src/main_gui.cpp @ 9285:3b3f13cb6db6 draft
(svn r13151) -Codechange: use an enum instead of bool as return type of OnKeyPress/OnCTRLStateChange to make it obvious what the return values mean.
author | rubidium <rubidium@openttd.org> |
---|---|
date | Sat, 17 May 2008 23:11:06 +0000 (2008-05-17) |
parents | 72a6d2e60834 |
children | 686aa69d2fcd |
line wrap: on
line diff
--- a/src/main_gui.cpp +++ b/src/main_gui.cpp @@ -239,34 +239,34 @@ } } - virtual bool OnKeyPress(uint16 key, uint16 keycode) + virtual EventState OnKeyPress(uint16 key, uint16 keycode) { switch (keycode) { case 'Q' | WKC_CTRL: case 'Q' | WKC_META: HandleExitGameRequest(); - return true; + return ES_HANDLED; } /* Disable all key shortcuts, except quit shortcuts when * generating the world, otherwise they create threading * problem during the generating, resulting in random * assertions that are hard to trigger and debug */ - if (IsGeneratingWorld()) return true; + if (IsGeneratingWorld()) return ES_NOT_HANDLED; if (keycode == WKC_BACKQUOTE) { IConsoleSwitch(); - return false; + return ES_HANDLED; } if (keycode == ('B' | WKC_CTRL)) { extern bool _draw_bounding_boxes; _draw_bounding_boxes = !_draw_bounding_boxes; MarkWholeScreenDirty(); - return false; + return ES_HANDLED; } - if (_game_mode == GM_MENU) return true; + if (_game_mode == GM_MENU) return ES_NOT_HANDLED; switch (keycode) { case 'C': @@ -372,9 +372,9 @@ break; #endif - default: return true; + default: return ES_NOT_HANDLED; } - return false; + return ES_HANDLED; } virtual void OnScroll(Point delta)