summaryrefslogtreecommitdiff
path: root/main_gui.c
diff options
context:
space:
mode:
authorbelugas <belugas@openttd.org>2006-07-28 21:51:00 +0000
committerbelugas <belugas@openttd.org>2006-07-28 21:51:00 +0000
commitecc89d596597d7e450b69370233d6f23fa5728cf (patch)
tree4a45bd28895269309999ea98b29f0c87389e361c /main_gui.c
parente1654fa0171ea37be93e72ec7ef51d6b2543a6d7 (diff)
downloadopenttd-ecc89d596597d7e450b69370233d6f23fa5728cf.tar.xz
(svn r5626) CodeChange : Remove the global _make_screenshot and implement a more flexible mechanism
Simplification of the handling of the main_gui menus, Removal of repetitions and Hiding the internals of screenshots. Thanks to glx, Rubidium and Truelight for pointers
Diffstat (limited to 'main_gui.c')
-rw-r--r--main_gui.c29
1 files changed, 20 insertions, 9 deletions
diff --git a/main_gui.c b/main_gui.c
index 8a23a7203..581bfe8e8 100644
--- a/main_gui.c
+++ b/main_gui.c
@@ -28,6 +28,7 @@
#include "variables.h"
#include "train.h"
#include "unmovable_map.h"
+#include "screenshot.h"
#include "network_data.h"
#include "network_client.h"
@@ -403,14 +404,24 @@ static void MenuClickNewspaper(int index)
}
}
+static void MenuClickSmallScreenshot(void)
+{
+ SetScreenshotType(SC_VIEWPORT);
+}
+
+static void MenuClickWorldScreenshot(void)
+{
+ SetScreenshotType(SC_WORLD);
+}
+
static void MenuClickHelp(int index)
{
switch (index) {
- case 0: PlaceLandBlockInfo(); break;
- case 2: IConsoleSwitch(); break;
- case 3: _make_screenshot = 1; break;
- case 4: _make_screenshot = 2; break;
- case 5: ShowAboutWindow(); break;
+ case 0: PlaceLandBlockInfo(); break;
+ case 2: IConsoleSwitch(); break;
+ case 3: MenuClickSmallScreenshot(); break;
+ case 4: MenuClickWorldScreenshot(); break;
+ case 5: ShowAboutWindow(); break;
}
}
@@ -1894,8 +1905,8 @@ static void MainToolbarWndProc(Window *w, WindowEvent *e)
case WKC_SHIFT | WKC_F10:ShowBuildAirToolbar(); break;
case WKC_SHIFT | WKC_F11: ShowBuildTreesToolbar(); break;
case WKC_SHIFT | WKC_F12: ShowMusicWindow(); break;
- case WKC_CTRL | 'S': _make_screenshot = 1; break;
- case WKC_CTRL | 'G': _make_screenshot = 2; break;
+ case WKC_CTRL | 'S': MenuClickSmallScreenshot(); break;
+ case WKC_CTRL | 'G': MenuClickWorldScreenshot(); break;
case WKC_CTRL | WKC_ALT | 'C': if (!_networking) ShowCheatWindow(); break;
case 'A': ShowBuildRailToolbar(_last_built_railtype, 4); break; /* Invoke Autorail */
case 'L': ShowTerraformToolbar(); break;
@@ -2095,8 +2106,8 @@ static void ScenEditToolbarWndProc(Window *w, WindowEvent *e)
case WKC_F9: ToolbarScenPlaceSign(w); break;
case WKC_F10: ShowMusicWindow(); break;
case WKC_F11: PlaceLandBlockInfo(); break;
- case WKC_CTRL | 'S': _make_screenshot = 1; break;
- case WKC_CTRL | 'G': _make_screenshot = 2; break;
+ case WKC_CTRL | 'S': MenuClickSmallScreenshot(); break;
+ case WKC_CTRL | 'G': MenuClickWorldScreenshot(); break;
case 'L': ShowEditorTerraformToolBar(); break;
}
break;