Mercurial > hg > openttd
changeset 9614:93067a7ac4de draft
(svn r13670) -Codechange : Merge some very alike events handlers.
author | belugas <belugas@openttd.org> |
---|---|
date | Tue, 01 Jul 2008 00:04:09 +0000 |
parents | 1fbe30ff6587 |
children | 5657445ea7ee |
files | src/toolbar_gui.cpp |
diffstat | 1 files changed, 6 insertions(+), 22 deletions(-) [+] |
line wrap: on
line diff
--- a/src/toolbar_gui.cpp +++ b/src/toolbar_gui.cpp @@ -520,7 +520,7 @@ static void ToolbarZoomInClick(Window *w) { if (DoZoomInOutWindow(ZOOM_IN, FindWindowById(WC_MAIN_WINDOW, 0))) { - w->HandleButtonClick(TBN_ZOOMIN); + w->HandleButtonClick((_game_mode == GM_EDITOR) ? TBSE_ZOOMIN : TBN_ZOOMIN); SndPlayFx(SND_15_BEEP); } } @@ -530,7 +530,7 @@ static void ToolbarZoomOutClick(Window *w) { if (DoZoomInOutWindow(ZOOM_OUT, FindWindowById(WC_MAIN_WINDOW, 0))) { - w->HandleButtonClick(TBN_ZOOMOUT); + w->HandleButtonClick((_game_mode == GM_EDITOR) ? TBSE_ZOOMOUT : TBN_ZOOMOUT); SndPlayFx(SND_15_BEEP); } } @@ -704,22 +704,6 @@ _left_button_clicked = false; } -static void ToolbarScenZoomIn(Window *w) -{ - if (DoZoomInOutWindow(ZOOM_IN, FindWindowById(WC_MAIN_WINDOW, 0))) { - w->HandleButtonClick(TBSE_ZOOMIN); - SndPlayFx(SND_15_BEEP); - } -} - -static void ToolbarScenZoomOut(Window *w) -{ - if (DoZoomInOutWindow(ZOOM_OUT, FindWindowById(WC_MAIN_WINDOW, 0))) { - w->HandleButtonClick(TBSE_ZOOMOUT); - SndPlayFx(SND_15_BEEP); - } -} - static void ToolbarScenGenLand(Window *w) { w->HandleButtonClick(TBSE_LANDGENERATE); @@ -1080,8 +1064,8 @@ ToolbarScenDateBackward, ToolbarScenDateForward, ToolbarScenMapTownDir, - ToolbarScenZoomIn, - ToolbarScenZoomOut, + ToolbarZoomInClick, + ToolbarZoomOutClick, ToolbarScenGenLand, ToolbarScenGenTown, ToolbarScenGenIndustry, @@ -1161,13 +1145,13 @@ case WKC_NUM_PLUS: case WKC_EQUALS: case WKC_SHIFT | WKC_EQUALS: - case WKC_SHIFT | WKC_F5: ToolbarScenZoomIn(this); break; + case WKC_SHIFT | WKC_F5: ToolbarZoomInClick(this); break; /* those following are all fall through */ case WKC_NUM_MINUS: case WKC_MINUS: case WKC_SHIFT | WKC_MINUS: - case WKC_SHIFT | WKC_F6: ToolbarScenZoomOut(this); break; + case WKC_SHIFT | WKC_F6: ToolbarZoomOutClick(this); break; case 'L': ShowEditorTerraformToolbar(); break; case 'M': ShowSmallMap(); break;