diff options
author | tron <tron@openttd.org> | 2005-11-13 14:54:09 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2005-11-13 14:54:09 +0000 |
commit | 4a14a586e2f457d38e9fede1a494478105a8acfd (patch) | |
tree | 0bcf189f35802c7769cd23e20ed58a18b59d9b2e /intro_gui.c | |
parent | ee15e3de13643b2d09abcc5424bf8e2d916cff75 (diff) | |
download | openttd-4a14a586e2f457d38e9fede1a494478105a8acfd.tar.xz |
(svn r3173) Use the trinary operator and switch to improve readability
Also align short cases nicely
Diffstat (limited to 'intro_gui.c')
-rw-r--r-- | intro_gui.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/intro_gui.c b/intro_gui.c index 299393f2d..08a7fdbfe 100644 --- a/intro_gui.c +++ b/intro_gui.c @@ -107,8 +107,8 @@ static void SelectGameWndProc(Window *w, WindowEvent *e) case WE_DROPDOWN_SELECT: /* Mapsize selection */ switch (e->dropdown.button) { - case 11: _patches.map_x = e->dropdown.index + 6; break; - case 13: _patches.map_y = e->dropdown.index + 6; break; + case 11: _patches.map_x = e->dropdown.index + 6; break; + case 13: _patches.map_y = e->dropdown.index + 6; break; } SetWindowDirty(w); break; @@ -177,18 +177,19 @@ static void AskAbandonGameWndProc(Window *w, WindowEvent *e) { return; case WE_CLICK: - switch(e->click.widget) { - case 3: - DeleteWindow(w); - break; - case 4: - _exit_game = true; - break; + switch (e->click.widget) { + case 3: DeleteWindow(w); break; + case 4: _exit_game = true; break; } break; + case WE_KEYPRESS: /* Exit game on pressing 'Enter' */ - if (e->keypress.keycode == WKC_RETURN || e->keypress.keycode == WKC_NUM_ENTER) - _exit_game = true; + switch (e->keypress.keycode) { + case WKC_RETURN: + case WKC_NUM_ENTER: + _exit_game = true; + break; + } break; } } |