intro_gui.c
author celestar
Mon, 01 Jan 2007 16:31:13 +0000
branchcustombridgeheads
changeset 5623 ef2a8a524a95
parent 5352 82a50c80b0c4
child 5642 bfa6074e2833
permissions -rw-r--r--
(svn r7721) [cbh] - Sync with 7607:7720 from trunk
2186
461a2aff3486 (svn r2701) Insert Id tags into all source files
tron
parents: 2163
diff changeset
     1
/* $Id$ */
461a2aff3486 (svn r2701) Insert Id tags into all source files
tron
parents: 2163
diff changeset
     2
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     3
#include "stdafx.h"
1891
92a3b0aa0946 (svn r2397) - CodeChange: rename all "ttd" files to "openttd" files.
Darkvater
parents: 1796
diff changeset
     4
#include "openttd.h"
507
8aa8100b0b22 (svn r815) Include strings.h only in the files which need it.
tron
parents: 206
diff changeset
     5
#include "table/strings.h"
4937
a525d56a8d40 (svn r6924) -Codechange: Give the last (in the widget arrays at least) sprites meaningful names.
Darkvater
parents: 4830
diff changeset
     6
#include "table/sprites.h"
2163
637ec3c361f5 (svn r2673) Include functions.h directly, not globally via openttd.h
tron
parents: 2159
diff changeset
     7
#include "functions.h"
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     8
#include "window.h"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     9
#include "gui.h"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    10
#include "gfx.h"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    11
#include "player.h"
543
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents: 534
diff changeset
    12
#include "network.h"
2159
3b634157c3b2 (svn r2669) Shuffle some more stuff around to reduce dependencies
tron
parents: 1891
diff changeset
    13
#include "variables.h"
3888
7a781a439c30 (svn r4944) Codechange: make _patches_newgame available via settings.h and remove instances of extern Patches _patches_newgame in .c files
rubidium
parents: 3207
diff changeset
    14
#include "settings.h"
4300
687a17c9c557 (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents: 4171
diff changeset
    15
#include "heightmap.h"
687a17c9c557 (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents: 4171
diff changeset
    16
#include "genworld.h"
4830
0ff2a14e90be (svn r6754) -Codechange: Remove some #idef ENABLE_NETWORK specific defines. With networking
Darkvater
parents: 4727
diff changeset
    17
#include "network_gui.h"
5237
c14c97d7030a (svn r7357) -Codechange: new NewGRF set up window which allows modification of NewGRF settings.
peter1138
parents: 4938
diff changeset
    18
#include "newgrf.h"
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    19
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    20
static const Widget _select_game_widgets[] = {
4344
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4308
diff changeset
    21
{    WWT_CAPTION, RESIZE_NONE, 13,   0, 335,   0,  13, STR_0307_OPENTTD,         STR_NULL},
5237
c14c97d7030a (svn r7357) -Codechange: new NewGRF set up window which allows modification of NewGRF settings.
peter1138
parents: 4938
diff changeset
    22
{      WWT_PANEL, RESIZE_NONE, 13,   0, 335,  14, 194, 0x0,                      STR_NULL},
4344
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4308
diff changeset
    23
{ WWT_PUSHTXTBTN, RESIZE_NONE, 12,  10, 167,  22,  33, STR_0140_NEW_GAME,        STR_02FB_START_A_NEW_GAME},
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4308
diff changeset
    24
{ WWT_PUSHTXTBTN, RESIZE_NONE, 12, 168, 325,  22,  33, STR_0141_LOAD_GAME,       STR_02FC_LOAD_A_SAVED_GAME},
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4308
diff changeset
    25
{ WWT_PUSHTXTBTN, RESIZE_NONE, 12,  10, 167,  40,  51, STR_029A_PLAY_SCENARIO,   STR_0303_START_A_NEW_GAME_USING},
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4308
diff changeset
    26
{ WWT_PUSHTXTBTN, RESIZE_NONE, 12, 168, 325,  40,  51, STR_PLAY_HEIGHTMAP,       STR_PLAY_HEIGHTMAP_HINT},
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4308
diff changeset
    27
{ WWT_PUSHTXTBTN, RESIZE_NONE, 12,  10, 167,  58,  69, STR_0220_CREATE_SCENARIO, STR_02FE_CREATE_A_CUSTOMIZED_GAME},
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4308
diff changeset
    28
{ WWT_PUSHTXTBTN, RESIZE_NONE, 12, 168, 325,  58,  69, STR_MULTIPLAYER,          STR_0300_SELECT_MULTIPLAYER_GAME},
1711
786fc0df2b6e (svn r2215) - Feature: Add a temporary mapsize selector to the intro gui. This is sufficient until the real window is designed & coded.
Darkvater
parents: 1625
diff changeset
    29
4938
074f734a91ca (svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents: 4937
diff changeset
    30
{   WWT_IMGBTN_2, RESIZE_NONE, 12,  10,  86,  77, 131, SPR_SELECT_TEMPERATE,     STR_030E_SELECT_TEMPERATE_LANDSCAPE},
074f734a91ca (svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents: 4937
diff changeset
    31
{   WWT_IMGBTN_2, RESIZE_NONE, 12,  90, 166,  77, 131, SPR_SELECT_SUB_ARCTIC,    STR_030F_SELECT_SUB_ARCTIC_LANDSCAPE},
074f734a91ca (svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents: 4937
diff changeset
    32
{   WWT_IMGBTN_2, RESIZE_NONE, 12, 170, 246,  77, 131, SPR_SELECT_SUB_TROPICAL,  STR_0310_SELECT_SUB_TROPICAL_LANDSCAPE},
074f734a91ca (svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents: 4937
diff changeset
    33
{   WWT_IMGBTN_2, RESIZE_NONE, 12, 250, 326,  77, 131, SPR_SELECT_TOYLAND,       STR_0311_SELECT_TOYLAND_LANDSCAPE},
1711
786fc0df2b6e (svn r2215) - Feature: Add a temporary mapsize selector to the intro gui. This is sufficient until the real window is designed & coded.
Darkvater
parents: 1625
diff changeset
    34
4344
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4308
diff changeset
    35
{ WWT_PUSHTXTBTN, RESIZE_NONE, 12,  10, 167, 139, 150, STR_0148_GAME_OPTIONS,    STR_0301_DISPLAY_GAME_OPTIONS},
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4308
diff changeset
    36
{ WWT_PUSHTXTBTN, RESIZE_NONE, 12, 168, 325, 139, 150, STR_01FE_DIFFICULTY,      STR_0302_DISPLAY_DIFFICULTY_OPTIONS},
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4308
diff changeset
    37
{ WWT_PUSHTXTBTN, RESIZE_NONE, 12,  10, 167, 157, 168, STR_CONFIG_PATCHES,       STR_CONFIG_PATCHES_TIP},
5237
c14c97d7030a (svn r7357) -Codechange: new NewGRF set up window which allows modification of NewGRF settings.
peter1138
parents: 4938
diff changeset
    38
{ WWT_PUSHTXTBTN, RESIZE_NONE, 12, 168, 325, 157, 168, STR_NEWGRF_SETTINGS_BUTTON, STR_NULL},
c14c97d7030a (svn r7357) -Codechange: new NewGRF set up window which allows modification of NewGRF settings.
peter1138
parents: 4938
diff changeset
    39
5315
ce659994e392 (svn r7471) -Codechange: Centre the 'quit' button on the main menu.
Darkvater
parents: 5237
diff changeset
    40
{ WWT_PUSHTXTBTN, RESIZE_NONE, 12, 104, 231, 175, 186, STR_0304_QUIT,            STR_0305_QUIT_OPENTTD},
4938
074f734a91ca (svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents: 4937
diff changeset
    41
{   WIDGETS_END},
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    42
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    43
1794
44f9deff97ed (svn r2298) - CodeChange: removed CmdAbuses: CmdSetTownNameType(), CmdStartNewGame(), CmdCreateScenario(), CmdSetNewLandscapeType() and CmdGenRandomNewGame().
Darkvater
parents: 1728
diff changeset
    44
static inline void SetNewLandscapeType(byte landscape)
44f9deff97ed (svn r2298) - CodeChange: removed CmdAbuses: CmdSetTownNameType(), CmdStartNewGame(), CmdCreateScenario(), CmdSetNewLandscapeType() and CmdGenRandomNewGame().
Darkvater
parents: 1728
diff changeset
    45
{
44f9deff97ed (svn r2298) - CodeChange: removed CmdAbuses: CmdSetTownNameType(), CmdStartNewGame(), CmdCreateScenario(), CmdSetNewLandscapeType() and CmdGenRandomNewGame().
Darkvater
parents: 1728
diff changeset
    46
	_opt_newgame.landscape = landscape;
44f9deff97ed (svn r2298) - CodeChange: removed CmdAbuses: CmdSetTownNameType(), CmdStartNewGame(), CmdCreateScenario(), CmdSetNewLandscapeType() and CmdGenRandomNewGame().
Darkvater
parents: 1728
diff changeset
    47
	InvalidateWindowClasses(WC_SELECT_GAME);
44f9deff97ed (svn r2298) - CodeChange: removed CmdAbuses: CmdSetTownNameType(), CmdStartNewGame(), CmdCreateScenario(), CmdSetNewLandscapeType() and CmdGenRandomNewGame().
Darkvater
parents: 1728
diff changeset
    48
}
44f9deff97ed (svn r2298) - CodeChange: removed CmdAbuses: CmdSetTownNameType(), CmdStartNewGame(), CmdCreateScenario(), CmdSetNewLandscapeType() and CmdGenRandomNewGame().
Darkvater
parents: 1728
diff changeset
    49
1711
786fc0df2b6e (svn r2215) - Feature: Add a temporary mapsize selector to the intro gui. This is sufficient until the real window is designed & coded.
Darkvater
parents: 1625
diff changeset
    50
static void SelectGameWndProc(Window *w, WindowEvent *e)
786fc0df2b6e (svn r2215) - Feature: Add a temporary mapsize selector to the intro gui. This is sufficient until the real window is designed & coded.
Darkvater
parents: 1625
diff changeset
    51
{
786fc0df2b6e (svn r2215) - Feature: Add a temporary mapsize selector to the intro gui. This is sufficient until the real window is designed & coded.
Darkvater
parents: 1625
diff changeset
    52
	switch (e->event) {
4719
413b21513ef7 (svn r6631) -Codechange: Use accessors for click_state.
belugas
parents: 4634
diff changeset
    53
	case WE_CREATE: LowerWindowWidget(w, _opt_newgame.landscape + 8); break;
413b21513ef7 (svn r6631) -Codechange: Use accessors for click_state.
belugas
parents: 4634
diff changeset
    54
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    55
	case WE_PAINT:
4727
ba5bae41b004 (svn r6639) -CodeChange : Conversion of SetWidgetLoweredState to SetWindowWidgetLoweredState, in order to follow pre-established standard
belugas
parents: 4721
diff changeset
    56
		SetWindowWidgetLoweredState(w, 8,  _opt_newgame.landscape == LT_NORMAL);
ba5bae41b004 (svn r6639) -CodeChange : Conversion of SetWidgetLoweredState to SetWindowWidgetLoweredState, in order to follow pre-established standard
belugas
parents: 4721
diff changeset
    57
		SetWindowWidgetLoweredState(w, 9,  _opt_newgame.landscape == LT_HILLY);
ba5bae41b004 (svn r6639) -CodeChange : Conversion of SetWidgetLoweredState to SetWindowWidgetLoweredState, in order to follow pre-established standard
belugas
parents: 4721
diff changeset
    58
		SetWindowWidgetLoweredState(w, 10, _opt_newgame.landscape == LT_DESERT);
ba5bae41b004 (svn r6639) -CodeChange : Conversion of SetWidgetLoweredState to SetWindowWidgetLoweredState, in order to follow pre-established standard
belugas
parents: 4721
diff changeset
    59
		SetWindowWidgetLoweredState(w, 11, _opt_newgame.landscape == LT_CANDY);
1500
228f77e88adf (svn r2004) - Fix: [ 1149487 ] Autosave ignoring settings
Darkvater
parents: 1390
diff changeset
    60
		SetDParam(0, STR_6801_EASY + _opt_newgame.diff_level);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    61
		DrawWindowWidgets(w);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    62
		break;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    63
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    64
	case WE_CLICK:
4634
897461a3e9ca (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4548
diff changeset
    65
		switch (e->we.click.widget) {
4300
687a17c9c557 (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents: 4171
diff changeset
    66
		case 2: ShowGenerateLandscape(); break;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    67
		case 3: ShowSaveLoadDialog(SLD_LOAD_GAME); break;
4300
687a17c9c557 (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents: 4171
diff changeset
    68
		case 4: ShowSaveLoadDialog(SLD_LOAD_SCENARIO); break;
687a17c9c557 (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents: 4171
diff changeset
    69
		case 5: ShowSaveLoadDialog(SLD_LOAD_HEIGHTMAP); break;
687a17c9c557 (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents: 4171
diff changeset
    70
		case 6: ShowCreateScenario(); break;
687a17c9c557 (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents: 4171
diff changeset
    71
		case 7:
105
44e894da0fef (svn r106) New network core (by sign_de)
dominik
parents: 74
diff changeset
    72
			if (!_network_available) {
2749
46aba09ca365 (svn r3294) - Fix: use INVALID_STRING_ID instead of -1.
Darkvater
parents: 2725
diff changeset
    73
				ShowErrorMessage(INVALID_STRING_ID, STR_NETWORK_ERR_NOTAVAILABLE, 0, 0);
4077
d3022f976946 (svn r5391) Miscellaneous, mostly bracing and whitespace, nothing spectacular
tron
parents: 3888
diff changeset
    74
			} else {
172
8d8b3383470d (svn r173) -Network: [1023231] Debug Code + ErrorBoxes + Load Game/Scenario. Added some more desync debug code and replaced some of the error() calls with some better error boxes. Hopefully find desyncs easier (sign_de)
darkvater
parents: 161
diff changeset
    75
				ShowNetworkGameWindow();
4077
d3022f976946 (svn r5391) Miscellaneous, mostly bracing and whitespace, nothing spectacular
tron
parents: 3888
diff changeset
    76
			}
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    77
			break;
4300
687a17c9c557 (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents: 4171
diff changeset
    78
		case 8: case 9: case 10: case 11:
4719
413b21513ef7 (svn r6631) -Codechange: Use accessors for click_state.
belugas
parents: 4634
diff changeset
    79
			RaiseWindowWidget(w, _opt_newgame.landscape + 8);
4634
897461a3e9ca (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4548
diff changeset
    80
			SetNewLandscapeType(e->we.click.widget - 8);
4300
687a17c9c557 (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents: 4171
diff changeset
    81
			break;
687a17c9c557 (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents: 4171
diff changeset
    82
		case 12: ShowGameOptions(); break;
687a17c9c557 (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents: 4171
diff changeset
    83
		case 13: ShowGameDifficulty(); break;
687a17c9c557 (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents: 4171
diff changeset
    84
		case 14: ShowPatchesSelection(); break;
5352
82a50c80b0c4 (svn r7523) -Feature: Add the possibility to change the newgrf configuration of a running game.
Darkvater
parents: 5315
diff changeset
    85
		case 15: ShowNewGRFSettings(true, true, false, &_grfconfig_newgame); break;
5237
c14c97d7030a (svn r7357) -Codechange: new NewGRF set up window which allows modification of NewGRF settings.
peter1138
parents: 4938
diff changeset
    86
		case 16: HandleExitGameRequest(); break;
129
df1a60bc0d70 (svn r130) Change: hotkey for console is Backquote (the key left to '1', regardless of keyboard layout
dominik
parents: 126
diff changeset
    87
		}
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    88
		break;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    89
	}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    90
}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    91
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    92
static const WindowDesc _select_game_desc = {
5237
c14c97d7030a (svn r7357) -Codechange: new NewGRF set up window which allows modification of NewGRF settings.
peter1138
parents: 4938
diff changeset
    93
	WDP_CENTER, WDP_CENTER, 336, 195,
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    94
	WC_SELECT_GAME,0,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    95
	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    96
	_select_game_widgets,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    97
	SelectGameWndProc
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    98
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    99
1093
e8d26c7dc42f (svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents: 867
diff changeset
   100
void ShowSelectGameWindow(void)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   101
{
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   102
	AllocateWindowDesc(&_select_game_desc);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   103
}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   104
5623
ef2a8a524a95 (svn r7721) [cbh] - Sync with 7607:7720 from trunk
celestar
parents: 5352
diff changeset
   105
static void AskExitGameCallback(Window *w, bool confirmed)
ef2a8a524a95 (svn r7721) [cbh] - Sync with 7607:7720 from trunk
celestar
parents: 5352
diff changeset
   106
{
ef2a8a524a95 (svn r7721) [cbh] - Sync with 7607:7720 from trunk
celestar
parents: 5352
diff changeset
   107
	if (confirmed) _exit_game = true;
ef2a8a524a95 (svn r7721) [cbh] - Sync with 7607:7720 from trunk
celestar
parents: 5352
diff changeset
   108
}
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   109
5623
ef2a8a524a95 (svn r7721) [cbh] - Sync with 7607:7720 from trunk
celestar
parents: 5352
diff changeset
   110
void AskExitGame(void)
2639
8a7342eb3a78 (svn r3181) -Bracing
tron
parents: 2631
diff changeset
   111
{
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   112
#if defined(_WIN32)
534
17ab2f22ff74 (svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents: 507
diff changeset
   113
		SetDParam(0, STR_0133_WINDOWS);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   114
#elif defined(__APPLE__)
534
17ab2f22ff74 (svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents: 507
diff changeset
   115
		SetDParam(0, STR_0135_OSX);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   116
#elif defined(__BEOS__)
534
17ab2f22ff74 (svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents: 507
diff changeset
   117
		SetDParam(0, STR_OSNAME_BEOS);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   118
#elif defined(__MORPHOS__)
534
17ab2f22ff74 (svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents: 507
diff changeset
   119
		SetDParam(0, STR_OSNAME_MORPHOS);
867
581154a08a78 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 810
diff changeset
   120
#elif defined(__AMIGA__)
587
2fa4963eb92c (svn r1007) Remove the last SET_DPARAM (:
tron
parents: 569
diff changeset
   121
		SetDParam(0, STR_OSNAME_AMIGAOS);
810
7c51ba5a4368 (svn r1281) -Fix: the OS/2 is now finished. Fixes:
truelight
parents: 774
diff changeset
   122
#elif defined(__OS2__)
7c51ba5a4368 (svn r1281) -Fix: the OS/2 is now finished. Fixes:
truelight
parents: 774
diff changeset
   123
		SetDParam(0, STR_OSNAME_OS2);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   124
#else
534
17ab2f22ff74 (svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents: 507
diff changeset
   125
		SetDParam(0, STR_0134_UNIX);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   126
#endif
5623
ef2a8a524a95 (svn r7721) [cbh] - Sync with 7607:7720 from trunk
celestar
parents: 5352
diff changeset
   127
	ShowQuery(
ef2a8a524a95 (svn r7721) [cbh] - Sync with 7607:7720 from trunk
celestar
parents: 5352
diff changeset
   128
		STR_00C7_QUIT,
ef2a8a524a95 (svn r7721) [cbh] - Sync with 7607:7720 from trunk
celestar
parents: 5352
diff changeset
   129
		STR_00CA_ARE_YOU_SURE_YOU_WANT_TO,
ef2a8a524a95 (svn r7721) [cbh] - Sync with 7607:7720 from trunk
celestar
parents: 5352
diff changeset
   130
		NULL,
ef2a8a524a95 (svn r7721) [cbh] - Sync with 7607:7720 from trunk
celestar
parents: 5352
diff changeset
   131
		AskExitGameCallback
ef2a8a524a95 (svn r7721) [cbh] - Sync with 7607:7720 from trunk
celestar
parents: 5352
diff changeset
   132
	);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   133
}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   134
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   135
5623
ef2a8a524a95 (svn r7721) [cbh] - Sync with 7607:7720 from trunk
celestar
parents: 5352
diff changeset
   136
static void AskExitToGameMenuCallback(Window *w, bool confirmed)
2639
8a7342eb3a78 (svn r3181) -Bracing
tron
parents: 2631
diff changeset
   137
{
5623
ef2a8a524a95 (svn r7721) [cbh] - Sync with 7607:7720 from trunk
celestar
parents: 5352
diff changeset
   138
	if (confirmed) _switch_mode = SM_MENU;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   139
}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   140
1093
e8d26c7dc42f (svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents: 867
diff changeset
   141
void AskExitToGameMenu(void)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   142
{
5623
ef2a8a524a95 (svn r7721) [cbh] - Sync with 7607:7720 from trunk
celestar
parents: 5352
diff changeset
   143
	ShowQuery(
ef2a8a524a95 (svn r7721) [cbh] - Sync with 7607:7720 from trunk
celestar
parents: 5352
diff changeset
   144
		STR_0161_QUIT_GAME,
ef2a8a524a95 (svn r7721) [cbh] - Sync with 7607:7720 from trunk
celestar
parents: 5352
diff changeset
   145
		(_game_mode != GM_EDITOR) ? STR_ABANDON_GAME_QUERY : STR_QUIT_SCENARIO_QUERY,
ef2a8a524a95 (svn r7721) [cbh] - Sync with 7607:7720 from trunk
celestar
parents: 5352
diff changeset
   146
		NULL,
ef2a8a524a95 (svn r7721) [cbh] - Sync with 7607:7720 from trunk
celestar
parents: 5352
diff changeset
   147
		AskExitToGameMenuCallback
ef2a8a524a95 (svn r7721) [cbh] - Sync with 7607:7720 from trunk
celestar
parents: 5352
diff changeset
   148
	);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   149
}