Bypass the Protocol Selection Screen
Posted: Sat Oct 09, 2010 7:26 pm
It's a small cosmetic change, but it's small changes like this that add a layer of polish to the end result, and end up giving a more professional impression.
By default when you use the Multiplayer menus you get a screen allowing you to select IPX, TCP/IP, etc. However, if only one protocol is available on your PC there's no reason why you can't just go directly to the next menu instead. Well now you can. Replace your M_Menu_Net_f with this lot:
I don't suppose too many older hands use the Multiplayer menus, but this should add some user-friendliness for those who are new and/or are uncomfortable with the console.
By default when you use the Multiplayer menus you get a screen allowing you to select IPX, TCP/IP, etc. However, if only one protocol is available on your PC there's no reason why you can't just go directly to the next menu instead. Well now you can. Replace your M_Menu_Net_f with this lot:
Code: Select all
qboolean m_net_recursive = false;
void M_Menu_Net_f (void)
{
qboolean m_net_direct = false;
IN_Deactivate (vid.type == MODE_WINDOWED);
// either go direct to the appropriate menu or use the protocol selection menu.
// the protocol selection menu will only show if 2 or more protocols are available.
// it also shows if none are available to inform the user of this fact.
// note that serial counts as 2 protocols - modem and direct connect.
if (!serialAvailable && !ipxAvailable && !tcpipAvailable) m_net_direct = false;
if (serialAvailable && !ipxAvailable && !tcpipAvailable) m_net_direct = false;
if (!serialAvailable && ipxAvailable && !tcpipAvailable) m_net_direct = true;
if (!serialAvailable && !ipxAvailable && tcpipAvailable) m_net_direct = true;
if (m_net_direct)
{
if (!m_net_recursive)
{
// automatically select the correct protocol and go to the appropriate menu
m_net_recursive = true;
m_net_cursor = ipxAvailable ? 2 : 3;
M_Menu_LanConfig_f ();
return;
}
else
{
m_net_recursive = false;
M_Menu_MultiPlayer_f ();
return;
}
}
else m_net_recursive = false;
key_dest = key_menu;
m_state = m_net;
m_entersound = true;
m_net_items = 4;
if (m_net_cursor >= m_net_items)
m_net_cursor = 0;
m_net_cursor--;
M_Net_Key (K_DOWNARROW);
}