Added net error menu
This commit is contained in:
parent
aaa480ff63
commit
0adb5afcf7
2 changed files with 28 additions and 1 deletions
|
@ -243,7 +243,8 @@ typedef struct _menus_ {
|
|||
#define MENU_PREFERENCES 18
|
||||
#define MENU_SPEED_SETTINGS 19
|
||||
#define MENU_GAME_OPTIONS 20
|
||||
#define MENU_MAX 20 /// highest available menu id (for ccl)
|
||||
#define MENU_NET_ERROR 21
|
||||
#define MENU_MAX 21 /// highest available menu id (for ccl)
|
||||
|
||||
/// FIXME: FILL IN THIS TABLE!!!!
|
||||
|
||||
|
|
|
@ -723,6 +723,19 @@ local Menuitem NetMultiClientMenuItems[] = {
|
|||
#endif
|
||||
};
|
||||
|
||||
local Menuitem NetErrorMenuItems[] = {
|
||||
#ifdef __GNUC__
|
||||
{ MI_TYPE_TEXT, 144, 11, 0, LargeFont, NULL, NULL,
|
||||
{ text:{ "Error:", MI_TFLAGS_CENTERED} } },
|
||||
{ MI_TYPE_TEXT, 144, 38, 0, LargeFont, NULL, NULL,
|
||||
{ text:{ NULL, MI_TFLAGS_CENTERED} } },
|
||||
{ MI_TYPE_BUTTON, 92, 80, MenuButtonSelected, LargeFont, NULL, NULL,
|
||||
{ button:{ "~!OK", 106, 27, MBUTTON_GM_HALF, EndMenu, 'o'} } },
|
||||
#else
|
||||
{ 0 }
|
||||
#endif
|
||||
};
|
||||
|
||||
/**
|
||||
** Items for the Connecting Network Menu
|
||||
*/
|
||||
|
@ -1133,6 +1146,16 @@ global Menu Menus[] = {
|
|||
GameOptionsMenuItems,
|
||||
NULL,
|
||||
},
|
||||
{
|
||||
// Net Errors Menu
|
||||
(640-288)/2,
|
||||
260,
|
||||
288, 128,
|
||||
ImagePanel4,
|
||||
2, 3,
|
||||
NetErrorMenuItems,
|
||||
NULL,
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
|
@ -2216,6 +2239,9 @@ local void JoinNetGameMenu(void)
|
|||
|
||||
ServerHostBuf[EnterServerIPMenuItems[1].d.input.nch] = 0; // Now finally here is the address
|
||||
if (NetworkSetupServerAddress(ServerHostBuf, NetworkServerText) != 0) {
|
||||
NetErrorMenuItems[1].d.text.text = "Unable to lookup host.";
|
||||
ProcessMenu(MENU_NET_ERROR, 1);
|
||||
StartMenusSetBackground(NULL);
|
||||
return;
|
||||
}
|
||||
NetworkInitClientConnect();
|
||||
|
|
Loading…
Add table
Reference in a new issue