intro_gui.c
author Darkvater
Mon, 21 Feb 2005 18:59:54 +0000
changeset 1390 53a5713cf3f9
parent 1093 e8d26c7dc42f
child 1500 228f77e88adf
permissions -rw-r--r--
(svn r1894) - Codechange: cleaned up the console a bit, wholly unified handling of text with that of editboxes
- Codechange: Introduction of Textbuf struct which not only holds physical data as length but also pixel-constrains (width) and information about the caret
- Codechange: Move Clipboard function to OS specific file. Currently only Windows has clipboard actions
- Feature: Editboxes, console and exit screen also accept the numeric-enter as a yes
- Feature: Navigation through text with cursor keys is possible, as well as arbitrary insertion (also paste) and deletion; both backspace and del keys. Functions DeleteTextBufferChar, InsertTextBufferChar and InsertTextBufferClipboard handle input and deletion. Navigation is done through MoveTextBufferPos.
- Fix: OTTD crash when opening 'add server' editbox
- CodeChange: fix up some stringwidth calculations in gfx.c. You can get the width in pixels of a character by calling GetCharacterWidth().
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     1
#include "stdafx.h"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     2
#include "ttd.h"
507
8aa8100b0b22 (svn r815) Include strings.h only in the files which need it.
tron
parents: 206
diff changeset
     3
#include "table/strings.h"
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     4
#include "window.h"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     5
#include "gui.h"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     6
#include "viewport.h"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     7
#include "gfx.h"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     8
#include "player.h"
129
df1a60bc0d70 (svn r130) Change: hotkey for console is Backquote (the key left to '1', regardless of keyboard layout
dominik
parents: 126
diff changeset
     9
#include "command.h"
126
152df0cc4ac2 (svn r127) New feature: ingame console. (sign_de)
dominik
parents: 105
diff changeset
    10
#include "console.h"
543
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents: 534
diff changeset
    11
#include "network.h"
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    12
543
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents: 534
diff changeset
    13
extern void SwitchMode(int new_mode);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    14
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    15
/*
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    16
static void ShowSelectTutorialWindow()
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    17
{
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    18
}
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
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    21
static const Widget _select_game_widgets[] = {
867
581154a08a78 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 810
diff changeset
    22
{    WWT_CAPTION,   RESIZE_NONE,    13,     0,   335,     0,    13, STR_0307_OPENTTD,				STR_NULL},
581154a08a78 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 810
diff changeset
    23
{     WWT_IMGBTN,   RESIZE_NONE,    13,     0,   335,    14,   196, 0x0,											STR_NULL},
581154a08a78 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 810
diff changeset
    24
{ WWT_PUSHTXTBTN,   RESIZE_NONE,    12,    10,   167,    22,    33, STR_0140_NEW_GAME,				STR_02FB_START_A_NEW_GAME},
581154a08a78 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 810
diff changeset
    25
{ WWT_PUSHTXTBTN,   RESIZE_NONE,    12,   168,   325,    22,    33, STR_0141_LOAD_GAME,			STR_02FC_LOAD_A_SAVED_GAME},
581154a08a78 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 810
diff changeset
    26
//{ WWT_PUSHTXTBTN,   RESIZE_NONE,    12,    10,   167,   177,   188, STR_0142_TUTORIAL_DEMONSTRATION, STR_02FD_VIEW_DEMONSTRATIONS_TUTORIALS},
581154a08a78 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 810
diff changeset
    27
{ WWT_PUSHTXTBTN,   RESIZE_NONE,    12,    10,   167,   177,   188, STR_CONFIG_PATCHES,			STR_CONFIG_PATCHES_TIP},
581154a08a78 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 810
diff changeset
    28
{ WWT_PUSHTXTBTN,   RESIZE_NONE,    12,    10,   167,    40,    51, STR_0220_CREATE_SCENARIO,STR_02FE_CREATE_A_CUSTOMIZED_GAME},
581154a08a78 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 810
diff changeset
    29
{ WWT_PUSHTXTBTN,   RESIZE_NONE,    12,    10,   167,   136,   147, STR_SINGLE_PLAYER,				STR_02FF_SELECT_SINGLE_PLAYER_GAME},
581154a08a78 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 810
diff changeset
    30
{ WWT_PUSHTXTBTN,   RESIZE_NONE,    12,   168,   325,   136,   147, STR_MULTIPLAYER,					STR_0300_SELECT_MULTIPLAYER_GAME},
581154a08a78 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 810
diff changeset
    31
{ WWT_PUSHTXTBTN,   RESIZE_NONE,    12,    10,   167,   159,   170, STR_0148_GAME_OPTIONS,		STR_0301_DISPLAY_GAME_OPTIONS},
581154a08a78 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 810
diff changeset
    32
{ WWT_PUSHTXTBTN,   RESIZE_NONE,    12,   168,   325,   159,   170, STR_01FE_DIFFICULTY,			STR_0302_DISPLAY_DIFFICULTY_OPTIONS},
581154a08a78 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 810
diff changeset
    33
{ WWT_PUSHTXTBTN,   RESIZE_NONE,    12,   168,   325,    40,    51, STR_029A_PLAY_SCENARIO,	STR_0303_START_A_NEW_GAME_USING},
581154a08a78 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 810
diff changeset
    34
{ WWT_PUSHTXTBTN,   RESIZE_NONE,    12,   168,   325,   177,   188, STR_0304_QUIT,						STR_0305_QUIT_OPENTTD},
581154a08a78 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 810
diff changeset
    35
{    WWT_PANEL_2,   RESIZE_NONE,    12,    10,    85,    69,   122, 0x1312,									STR_030E_SELECT_TEMPERATE_LANDSCAPE},
581154a08a78 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 810
diff changeset
    36
{    WWT_PANEL_2,   RESIZE_NONE,    12,    90,   165,    69,   122, 0x1314,									STR_030F_SELECT_SUB_ARCTIC_LANDSCAPE},
581154a08a78 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 810
diff changeset
    37
{    WWT_PANEL_2,   RESIZE_NONE,    12,   170,   245,    69,   122, 0x1316,									STR_0310_SELECT_SUB_TROPICAL_LANDSCAPE},
581154a08a78 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 810
diff changeset
    38
{    WWT_PANEL_2,   RESIZE_NONE,    12,   250,   325,    69,   122, 0x1318,									STR_0311_SELECT_TOYLAND_LANDSCAPE},
176
84990c4b9212 (svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents: 172
diff changeset
    39
{   WIDGETS_END},
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    40
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    41
543
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents: 534
diff changeset
    42
extern void HandleOnEditText(WindowEvent *e);
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
    43
extern void HandleOnEditTextCancel(void);
543
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents: 534
diff changeset
    44
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    45
static void SelectGameWndProc(Window *w, WindowEvent *e) {
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    46
	switch(e->event) {
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    47
	case WE_PAINT:
543
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents: 534
diff changeset
    48
		w->click_state = (w->click_state & ~(0xC0) & ~(0xF << 12)) | (1 << (_new_opt.landscape+12)) | (1<<6);
534
17ab2f22ff74 (svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents: 507
diff changeset
    49
		SetDParam(0, STR_6801_EASY + _new_opt.diff_level);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    50
		DrawWindowWidgets(w);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    51
		break;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    52
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    53
	case WE_CLICK:
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    54
		switch(e->click.widget) {
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    55
		case 2: DoCommandP(0, 0, 0, NULL, CMD_START_NEW_GAME); break;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    56
		case 3: ShowSaveLoadDialog(SLD_LOAD_GAME); break;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    57
		case 4: ShowPatchesSelection(); break;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    58
		case 5: DoCommandP(0, InteractiveRandom(), 0, NULL, CMD_CREATE_SCENARIO); break;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    59
		case 7:
774
258c11431acb (svn r1240) -Fix: OpenTTD once again compiles if ENABLE_NETWORK is disabled.
darkvater
parents: 770
diff changeset
    60
		#ifdef ENABLE_NETWORK
105
44e894da0fef (svn r106) New network core (by sign_de)
dominik
parents: 74
diff changeset
    61
			if (!_network_available) {
774
258c11431acb (svn r1240) -Fix: OpenTTD once again compiles if ENABLE_NETWORK is disabled.
darkvater
parents: 770
diff changeset
    62
				ShowErrorMessage(-1, STR_NETWORK_ERR_NOTAVAILABLE, 0, 0);
258c11431acb (svn r1240) -Fix: OpenTTD once again compiles if ENABLE_NETWORK is disabled.
darkvater
parents: 770
diff changeset
    63
			} 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
    64
				ShowNetworkGameWindow();
774
258c11431acb (svn r1240) -Fix: OpenTTD once again compiles if ENABLE_NETWORK is disabled.
darkvater
parents: 770
diff changeset
    65
		#else
258c11431acb (svn r1240) -Fix: OpenTTD once again compiles if ENABLE_NETWORK is disabled.
darkvater
parents: 770
diff changeset
    66
			ShowErrorMessage(-1 ,STR_NETWORK_ERR_NOTAVAILABLE, 0, 0);
258c11431acb (svn r1240) -Fix: OpenTTD once again compiles if ENABLE_NETWORK is disabled.
darkvater
parents: 770
diff changeset
    67
		#endif /* ENABLE_NETWORK */
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    68
			break;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    69
		case 8: ShowGameOptions(); break;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    70
		case 9: ShowGameDifficulty(); break;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    71
		case 10:ShowSaveLoadDialog(SLD_LOAD_SCENARIO); break;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    72
		case 11:AskExitGame(); break;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    73
		case 12: case 13: case 14: case 15:
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    74
			DoCommandP(0, e->click.widget - 12, 0, NULL, CMD_SET_NEW_LANDSCAPE_TYPE);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    75
			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
    76
		}
df1a60bc0d70 (svn r130) Change: hotkey for console is Backquote (the key left to '1', regardless of keyboard layout
dominik
parents: 126
diff changeset
    77
	case WE_KEYPRESS:
df1a60bc0d70 (svn r130) Change: hotkey for console is Backquote (the key left to '1', regardless of keyboard layout
dominik
parents: 126
diff changeset
    78
		switch(e->keypress.keycode) {
df1a60bc0d70 (svn r130) Change: hotkey for console is Backquote (the key left to '1', regardless of keyboard layout
dominik
parents: 126
diff changeset
    79
		case WKC_BACKQUOTE: IConsoleSwitch(); break;
df1a60bc0d70 (svn r130) Change: hotkey for console is Backquote (the key left to '1', regardless of keyboard layout
dominik
parents: 126
diff changeset
    80
		}
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    81
		break;
543
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents: 534
diff changeset
    82
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents: 534
diff changeset
    83
	case WE_ON_EDIT_TEXT: HandleOnEditText(e); break;
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents: 534
diff changeset
    84
	case WE_ON_EDIT_TEXT_CANCEL: HandleOnEditTextCancel(); break;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    85
	}
543
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents: 534
diff changeset
    86
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    87
}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    88
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    89
static const WindowDesc _select_game_desc = {
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    90
	WDP_CENTER, WDP_CENTER, 336, 197,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    91
	WC_SELECT_GAME,0,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    92
	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    93
	_select_game_widgets,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    94
	SelectGameWndProc
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    95
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    96
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
    97
void ShowSelectGameWindow(void)
0
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
	AllocateWindowDesc(&_select_game_desc);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   100
}
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
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   103
// p1 = mode
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   104
//    0 - start new game
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   105
//    1 - close new game dialog
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   106
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   107
int32 CmdStartNewGame(int x, int y, uint32 flags, uint32 p1, uint32 p2)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   108
{
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   109
	if (!(flags & DC_EXEC))
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   110
		return 0;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   111
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   112
	switch(p1) {
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   113
	case 0: // show select game window
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   114
		AskForNewGameToStart();
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   115
		break;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   116
	case 1: // close select game window
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   117
		DeleteWindowById(WC_SAVELOAD, 0);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   118
		break;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   119
	}
193
0a7025304867 (svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents: 176
diff changeset
   120
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   121
	return 0;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   122
}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   123
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   124
int32 CmdGenRandomNewGame(int x, int y, uint32 flags, uint32 p1, uint32 p2)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   125
{
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   126
	if (!(flags & DC_EXEC))
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   127
		return 0;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   128
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   129
	// this forces stuff into test mode.
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   130
	_docommand_recursive = 0;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   131
206
7f8c26d8526b (svn r207) -Codechange: randomizer handling
signde
parents: 193
diff changeset
   132
	_random_seeds[0][0] = p1;
7f8c26d8526b (svn r207) -Codechange: randomizer handling
signde
parents: 193
diff changeset
   133
	_random_seeds[0][1] = p2;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   134
543
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents: 534
diff changeset
   135
	SwitchMode(SM_NEWGAME);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   136
	return 0;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   137
}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   138
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   139
int32 CmdLoadGame(int x, int y, uint32 flags, uint32 p1, uint32 p2)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   140
{
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   141
	if (!(flags & DC_EXEC))
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   142
		return 0;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   143
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   144
//	ShowSaveLoadDialog(0);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   145
	return 0;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   146
}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   147
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   148
int32 CmdCreateScenario(int x, int y, uint32 flags, uint32 p1, uint32 p2)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   149
{
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   150
	if (!(flags & DC_EXEC))
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   151
		return 0;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   152
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   153
	_switch_mode = SM_EDITOR;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   154
	return 0;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   155
}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   156
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   157
int32 CmdSetSinglePlayer(int x, int y, uint32 flags, uint32 p1, uint32 p2)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   158
{
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   159
	printf("CmdSetSinglePlayer\n");
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   160
	return 0;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   161
}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   162
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   163
int32 CmdStartScenario(int x, int y, uint32 flags, uint32 p1, uint32 p2)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   164
{
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   165
	if (!(flags & DC_EXEC))
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   166
		return 0;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   167
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   168
	// this forces stuff into test mode.
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   169
	_docommand_recursive = 0;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   170
206
7f8c26d8526b (svn r207) -Codechange: randomizer handling
signde
parents: 193
diff changeset
   171
	_random_seeds[0][0] = p1;
7f8c26d8526b (svn r207) -Codechange: randomizer handling
signde
parents: 193
diff changeset
   172
	_random_seeds[0][1] = p2;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   173
543
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents: 534
diff changeset
   174
	SwitchMode(SM_START_SCENARIO);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   175
	return 0;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   176
}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   177
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   178
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   179
static const Widget _ask_abandon_game_widgets[] = {
867
581154a08a78 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 810
diff changeset
   180
{    WWT_TEXTBTN,   RESIZE_NONE,     4,     0,    10,     0,    13, STR_00C5,			STR_NULL},
581154a08a78 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 810
diff changeset
   181
{    WWT_CAPTION,   RESIZE_NONE,     4,    11,   179,     0,    13, STR_00C7_QUIT,	STR_NULL},
581154a08a78 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 810
diff changeset
   182
{     WWT_IMGBTN,   RESIZE_NONE,     4,     0,   179,    14,    91, 0x0,						STR_NULL},
581154a08a78 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 810
diff changeset
   183
{    WWT_TEXTBTN,   RESIZE_NONE,    12,    25,    84,    72,    83, STR_00C9_NO,		STR_NULL},
581154a08a78 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 810
diff changeset
   184
{    WWT_TEXTBTN,   RESIZE_NONE,    12,    95,   154,    72,    83, STR_00C8_YES,	STR_NULL},
176
84990c4b9212 (svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents: 172
diff changeset
   185
{   WIDGETS_END},
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   186
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   187
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   188
static void AskAbandonGameWndProc(Window *w, WindowEvent *e) {
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   189
	switch(e->event) {
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   190
	case WE_PAINT:
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   191
		DrawWindowWidgets(w);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   192
#if defined(_WIN32)
534
17ab2f22ff74 (svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents: 507
diff changeset
   193
		SetDParam(0, STR_0133_WINDOWS);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   194
#elif defined(__APPLE__)
534
17ab2f22ff74 (svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents: 507
diff changeset
   195
		SetDParam(0, STR_0135_OSX);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   196
#elif defined(__BEOS__)
534
17ab2f22ff74 (svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents: 507
diff changeset
   197
		SetDParam(0, STR_OSNAME_BEOS);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   198
#elif defined(__MORPHOS__)
534
17ab2f22ff74 (svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents: 507
diff changeset
   199
		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
   200
#elif defined(__AMIGA__)
587
2fa4963eb92c (svn r1007) Remove the last SET_DPARAM (:
tron
parents: 569
diff changeset
   201
		SetDParam(0, STR_OSNAME_AMIGAOS);
810
7c51ba5a4368 (svn r1281) -Fix: the OS/2 is now finished. Fixes:
truelight
parents: 774
diff changeset
   202
#elif defined(__OS2__)
7c51ba5a4368 (svn r1281) -Fix: the OS/2 is now finished. Fixes:
truelight
parents: 774
diff changeset
   203
		SetDParam(0, STR_OSNAME_OS2);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   204
#else
534
17ab2f22ff74 (svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents: 507
diff changeset
   205
		SetDParam(0, STR_0134_UNIX);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   206
#endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   207
		DrawStringMultiCenter(0x5A, 0x26, STR_00CA_ARE_YOU_SURE_YOU_WANT_TO, 178);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   208
		return;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   209
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   210
	case WE_CLICK:
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   211
		switch(e->click.widget) {
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   212
		case 3:
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   213
			DeleteWindow(w);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   214
			break;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   215
		case 4:
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   216
			_exit_game = true;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   217
			break;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   218
		}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   219
		break;
161
74453c59315c (svn r162) -Feature: when exit game window pops up, 'Enter' quits the game
darkvater
parents: 129
diff changeset
   220
	case WE_KEYPRESS: /* Exit game on pressing 'Enter' */
1390
53a5713cf3f9 (svn r1894) - Codechange: cleaned up the console a bit, wholly unified handling of text with that of editboxes
Darkvater
parents: 1093
diff changeset
   221
		if (e->keypress.keycode == WKC_RETURN || e->keypress.keycode == WKC_NUM_ENTER)
161
74453c59315c (svn r162) -Feature: when exit game window pops up, 'Enter' quits the game
darkvater
parents: 129
diff changeset
   222
			_exit_game = true;
193
0a7025304867 (svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents: 176
diff changeset
   223
		break;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   224
	}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   225
}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   226
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   227
static const WindowDesc _ask_abandon_game_desc = {
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   228
	WDP_CENTER, WDP_CENTER, 180, 92,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   229
	WC_ASK_ABANDON_GAME,0,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   230
	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_STD_BTN | WDF_UNCLICK_BUTTONS,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   231
	_ask_abandon_game_widgets,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   232
	AskAbandonGameWndProc
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   233
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   234
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
   235
void AskExitGame(void)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   236
{
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   237
	AllocateWindowDescFront(&_ask_abandon_game_desc, 0);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   238
}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   239
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   240
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   241
static const Widget _ask_quit_game_widgets[] = {
867
581154a08a78 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 810
diff changeset
   242
{    WWT_TEXTBTN,   RESIZE_NONE,     4,     0,    10,     0,    13, STR_00C5,						STR_NULL},
581154a08a78 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 810
diff changeset
   243
{    WWT_CAPTION,   RESIZE_NONE,     4,    11,   179,     0,    13, STR_0161_QUIT_GAME,	STR_NULL},
581154a08a78 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 810
diff changeset
   244
{     WWT_IMGBTN,   RESIZE_NONE,     4,     0,   179,    14,    91, 0x0,									STR_NULL},
581154a08a78 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 810
diff changeset
   245
{    WWT_TEXTBTN,   RESIZE_NONE,    12,    25,    84,    72,    83, STR_00C9_NO,					STR_NULL},
581154a08a78 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 810
diff changeset
   246
{    WWT_TEXTBTN,   RESIZE_NONE,    12,    95,   154,    72,    83, STR_00C8_YES,				STR_NULL},
176
84990c4b9212 (svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents: 172
diff changeset
   247
{   WIDGETS_END},
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   248
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   249
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   250
static void AskQuitGameWndProc(Window *w, WindowEvent *e) {
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   251
	switch(e->event) {
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   252
	case WE_PAINT:
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   253
		DrawWindowWidgets(w);
193
0a7025304867 (svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents: 176
diff changeset
   254
		DrawStringMultiCenter(0x5A, 0x26,
0a7025304867 (svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents: 176
diff changeset
   255
			_game_mode != GM_EDITOR ? STR_0160_ARE_YOU_SURE_YOU_WANT_TO :
0a7025304867 (svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents: 176
diff changeset
   256
				STR_029B_ARE_YOU_SURE_YOU_WANT_TO,
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   257
			178);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   258
		return;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   259
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   260
	case WE_CLICK:
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   261
		switch(e->click.widget) {
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   262
		case 3:
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   263
			DeleteWindow(w);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   264
			break;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   265
		case 4:
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   266
			_switch_mode = SM_MENU;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   267
			break;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   268
		}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   269
		break;
661
a0bdbdffb06a (svn r1095) -Fix: scenario editor road-build-gui works again altough shortcuts are screwed.
darkvater
parents: 654
diff changeset
   270
a0bdbdffb06a (svn r1095) -Fix: scenario editor road-build-gui works again altough shortcuts are screwed.
darkvater
parents: 654
diff changeset
   271
	case WE_KEYPRESS: /* Return to main menu on pressing 'Enter' */
a0bdbdffb06a (svn r1095) -Fix: scenario editor road-build-gui works again altough shortcuts are screwed.
darkvater
parents: 654
diff changeset
   272
		if (e->keypress.keycode == WKC_RETURN)
a0bdbdffb06a (svn r1095) -Fix: scenario editor road-build-gui works again altough shortcuts are screwed.
darkvater
parents: 654
diff changeset
   273
			_switch_mode = SM_MENU;
a0bdbdffb06a (svn r1095) -Fix: scenario editor road-build-gui works again altough shortcuts are screwed.
darkvater
parents: 654
diff changeset
   274
		break;
a0bdbdffb06a (svn r1095) -Fix: scenario editor road-build-gui works again altough shortcuts are screwed.
darkvater
parents: 654
diff changeset
   275
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   276
	}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   277
}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   278
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   279
static const WindowDesc _ask_quit_game_desc = {
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   280
	WDP_CENTER, WDP_CENTER, 180, 92,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   281
	WC_QUIT_GAME,0,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   282
	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_STD_BTN | WDF_UNCLICK_BUTTONS,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   283
	_ask_quit_game_widgets,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   284
	AskQuitGameWndProc
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   285
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   286
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   287
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
   288
void AskExitToGameMenu(void)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   289
{
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   290
	AllocateWindowDescFront(&_ask_quit_game_desc, 0);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   291
}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   292
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   293
int32 CmdSetNewLandscapeType(int x, int y, uint32 flags, uint32 p1, uint32 p2)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   294
{
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   295
	if (flags & DC_EXEC) {
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   296
		// XXX: some stuff
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   297
		_new_opt.landscape = p1;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   298
		InvalidateWindowClasses(WC_SELECT_GAME);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   299
	}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   300
	return 0;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   301
}