160
161
extern void exit_game_objects(eGrid *grid);
172
// initial setup menu
173
void sg_StartupPlayerMenu()
175
uMenu firstSetup("$first_setup", false);
176
firstSetup.SetBot(-.2);
178
uMenuItemExit e2(&firstSetup, "$menuitem_accept", "$menuitem_accept_help");
180
ePlayer * player = ePlayer::PlayerConfig(0);
183
gConnection connection = gDSL;
185
uMenuItemSelection<gConnection> net(&firstSetup, "$first_setup_net", "$first_setup_net_help", connection );
188
net.NewChoice( "$first_setup_leave", "$first_setup_leave_help", gLeave );
191
net.NewChoice( "$first_setup_net_dialup", "$first_setup_net_dialup_help", gDialup );
192
net.NewChoice( "$first_setup_net_isdn", "$first_setup_net_isdn_help", gISDN );
193
net.NewChoice( "$first_setup_net_dsl", "$first_setup_net_dsl_help", gDSL );
195
tString keyboardTemplate("keys_cursor.cfg");
196
uMenuItemSelection<tString> k(&firstSetup, "$first_setup_keys", "$first_setup_keys_help", keyboardTemplate );
199
k.NewChoice( "$first_setup_leave", "$first_setup_leave_help", tString("") );
202
k.NewChoice( "$first_setup_keys_cursor", "$first_setup_keys_cursor_help", tString("keys_cursor.cfg") );
203
k.NewChoice( "$first_setup_keys_wasd", "$first_setup_keys_wasd_help", tString("keys_wasd.cfg") );
204
k.NewChoice( "$first_setup_keys_zqsd", "$first_setup_keys_zqsd_help", tString("keys_zqsd.cfg") );
205
k.NewChoice( "$first_setup_keys_cursor_single", "$first_setup_keys_cursor_single_help", tString("keys_cursor_single.cfg") );
206
// k.NewChoice( "$first_setup_keys_both", "$first_setup_keys_both_help", tString("keys_twohand.cfg") );
207
k.NewChoice( "$first_setup_keys_x", "$first_setup_keys_x_help", tString("keys_x.cfg") );
209
tColor leave(0,0,0,0);
211
uMenuItemSelection<tColor> c(&firstSetup,
212
"$first_setup_color",
213
"$first_setup_color_help",
219
c.NewChoice( "$first_setup_leave", "$first_setup_leave_help", leave );
222
c.NewChoice( "$first_setup_color_red", "", tColor(1,0,0) );
223
c.NewChoice( "$first_setup_color_blue", "", tColor(0,0,1) );
224
c.NewChoice( "$first_setup_color_green", "", tColor(0,1,0) );
225
c.NewChoice( "$first_setup_color_yellow", "", tColor(1,1,0) );
226
c.NewChoice( "$first_setup_color_orange", "", tColor(1,.5,0) );
227
c.NewChoice( "$first_setup_color_purple", "", tColor(.5,0,1) );
228
c.NewChoice( "$first_setup_color_magenta", "", tColor(1,0,1) );
229
c.NewChoice( "$first_setup_color_cyan", "", tColor(0,1,1) );
230
c.NewChoice( "$first_setup_color_white", "", tColor(1,1,1) );
231
c.NewChoice( "$first_setup_color_dark", "", tColor(0,0,0) );
235
for(int i=tRandomizer::GetInstance().Get(4); i>=0; --i)
241
uMenuItemString n(&firstSetup,
246
uMenuItemExit e(&firstSetup, "$menuitem_accept", "$menuitem_accept_help");
250
// apply network rates
270
if( ! (color == leave) )
272
player->rgb[0] = color.r_*15;
273
player->rgb[1] = color.g_*15;
274
player->rgb[2] = color.b_*15;
277
// load keyboard layout
278
if( keyboardTemplate.Len() > 1 )
281
if( tConfItemBase::OpenFile( s, keyboardTemplate, tConfItemBase::Config ) )
283
tCurrentAccessLevel level( tAccessLevel_Owner, true );
284
tConfItemBase::ReadFile( s );
162
289
#ifndef DEDICATED
163
290
static void welcome(){
164
291
bool textOutBack = sr_textOut;
278
404
rSysDep::SwapGL();
282
// catch some keyboard input
284
uInputProcessGuard inputProcessGuard;
285
while (su_GetSDLInput(tEvent)) ;
288
timeout = tSysTimeFloat() + 10;
291
uInputProcessGuard inputProcessGuard;
292
while((!su_GetSDLInput(tEvent) || tEvent.type!=SDL_KEYDOWN) &&
293
tSysTimeFloat() < timeout){
295
sr_ResetRenderState(true);
296
rViewport::s_viewportFullscreen.Select();
302
uMenu::GenericBackground();
311
DisplayText(0,.8,h,tOutput("$welcome_message_heading"), sr_fontError);
316
rTextField c(-.8,.6, h, sr_fontError);
319
c << tOutput("$welcome_message_intro");
323
c << tOutput("$welcome_message_vendor") << gl_vendor << '\n';
324
c << tOutput("$welcome_message_renderer") << gl_renderer << '\n';
325
c << tOutput("$welcome_message_version") << gl_version << '\n';
329
c << tOutput("$welcome_message_finish");
406
sr_textOut = textOutBack;
407
sg_StartupLanguageMenu();
409
sr_textOut = textOutBack;
410
sg_StartupPlayerMenu();
414
sr_textOut = textOutBack;
415
uMenu::Message( tOutput("$welcome_message_heading"), tOutput("$welcome_message"), 300 );
417
// start a first single player game
418
sg_currentSettings->speedFactor = -2;
419
sg_currentSettings->autoNum = 0;
420
sr_textOut = textOutBack;
421
sg_SinglePlayerGame();
422
sg_currentSettings->autoNum = 1;
423
sg_currentSettings->speedFactor = 0;
425
sr_textOut = textOutBack;
426
uMenu::Message( tOutput("$welcome_message_2_heading"), tOutput("$welcome_message_2"), 300 );
338
428
sr_textOut = textOutBack;