MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / MainMultiplayerMenu

Function MainMultiplayerMenu

Descent3/multi_ui.cpp:380–632  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

378#define PXO_NAME "Parallax Online"
379
380int MainMultiplayerMenu() {
381
382 mprintf(0, "Entering MainMultiplayerMenu()\n");
383
384#ifdef USE_DIRECTPLAY
385 Num_directplay_games = 0;
386#endif
387 int exit_menu = 0;
388 int ret = 0;
389 char sznetgame[MAX_NET_DLL_LEN] = "";
390 int netgamelen = MAX_NET_DLL_LEN;
391 int i;
392 uint32_t j;
393
394 for (i = 0; i < MAX_OBJECT_IDS; i++) {
395 if (Object_info[i].type == OBJ_POWERUP) {
396 Object_info[i].multi_allowed = 1;
397 }
398 }
399 for (i = 0; i < MAX_SHIPS; i++) {
400 if (Ships[i].used) {
401
402#ifdef DEMO
403 if (stricmp(Ships[i].name, "pyro-gl") == 0)
404#endif
405 PlayerSetShipPermission(-1, Ships[i].name, 1);
406#ifdef DEMO
407 else
408 PlayerSetShipPermission(-1, Ships[i].name, 0);
409#endif
410 }
411 }
412 // Clear out residual junk
413 MultiFlushAllIncomingBuffers();
414
415 SetScreenMode(SM_MENU);
416
417 Database->read("DefaultNetConn", sznetgame, &netgamelen);
418 if (*sznetgame == '\0') {
419 strcpy(sznetgame, "HEAT.NET");
420 Database->write("DefaultNetConn", sznetgame, strlen(sznetgame) + 1);
421 }
422
423 newuiTiledWindow menu_wnd;
424 newuiListBox *lists;
425 newuiSheet *sheet;
426
427 menu_wnd.Create(TXT_MULTIPLAYER, 0, 0, MAIN_MULTI_MENU_W, MAIN_MULTI_MENU_H);
428 sheet = menu_wnd.GetSheet();
429
430 sheet->NewGroup(TXT_MLTCHOOSETYPE, 25, 0);
431 lists = sheet->AddListBox(256, 128, UID_MULTILB, UILB_NOSORT);
432 lists->RemoveAll();
433
434 sheet->NewGroup(NULL, 75, 145);
435 sheet->AddLongButton(TXT_SETITEMDEFAULT, 0x30);
436
437 sheet->NewGroup(NULL, 55, 160, NEWUI_ALIGN_HORIZ);

Callers 1

MainMenuFunction · 0.70

Calls 15

PlayerSetShipPermissionFunction · 0.85
SetScreenModeFunction · 0.85
DoMessageBoxFunction · 0.85
LoadMultiDLLFunction · 0.85
CallMultiDLLFunction · 0.85
DisplayNetDLLHelpFunction · 0.85
FreeMultiDLLFunction · 0.85
GetSheetMethod · 0.80
NewGroupMethod · 0.80
AddListBoxMethod · 0.80
AddLongButtonMethod · 0.80

Tested by

no test coverage detected