mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-03-25 12:21:06 +00:00
Merge branch 'lastserverbutton' into 'next'
Add Join Last Server button to Multiplayer Connection Menu See merge request KartKrew/Kart-Public!355
This commit is contained in:
commit
bf6f16e406
3 changed files with 31 additions and 5 deletions
|
@ -382,6 +382,7 @@ static CV_PossibleValue_t kartspeedometer_cons_t[] = {{0, "Off"}, {1, "Kilometer
|
|||
consvar_t cv_kartspeedometer = {"kartdisplayspeed", "Off", CV_SAVE, kartspeedometer_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; // use tics in display
|
||||
static CV_PossibleValue_t kartvoices_cons_t[] = {{0, "Never"}, {1, "Tasteful"}, {2, "Meme"}, {0, NULL}};
|
||||
consvar_t cv_kartvoices = {"kartvoices", "Tasteful", CV_SAVE, kartvoices_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_lastserver = {"lastserver", "", CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_karteliminatelast = {"karteliminatelast", "Yes", CV_NETVAR|CV_CHEAT|CV_CALL|CV_NOSHOWHELP, CV_YesNo, KartEliminateLast_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
|
@ -882,6 +883,7 @@ void D_RegisterClientCommands(void)
|
|||
//CV_RegisterVar(&cv_chasefreelook2);
|
||||
CV_RegisterVar(&cv_showfocuslost);
|
||||
CV_RegisterVar(&cv_pauseifunfocused);
|
||||
CV_RegisterVar(&cv_lastserver);
|
||||
|
||||
// g_input.c
|
||||
CV_RegisterVar(&cv_turnaxis);
|
||||
|
|
|
@ -122,6 +122,7 @@ extern consvar_t cv_kartvoterulechanges;
|
|||
extern consvar_t cv_kartgametypepreference;
|
||||
extern consvar_t cv_kartspeedometer;
|
||||
extern consvar_t cv_kartvoices;
|
||||
extern consvar_t cv_lastserver;
|
||||
|
||||
extern consvar_t cv_karteliminatelast;
|
||||
|
||||
|
|
33
src/m_menu.c
33
src/m_menu.c
|
@ -21,6 +21,8 @@
|
|||
#include "doomdef.h"
|
||||
#include "d_main.h"
|
||||
#include "d_netcmd.h"
|
||||
#include "d_clisrv.h"
|
||||
#include "i_net.h"
|
||||
#include "console.h"
|
||||
#include "r_fps.h"
|
||||
#include "r_local.h"
|
||||
|
@ -399,6 +401,7 @@ static void M_HandleImageDef(INT32 choice);
|
|||
static void M_HandleLevelStats(INT32 choice);
|
||||
#ifndef NONET
|
||||
static void M_HandleConnectIP(INT32 choice);
|
||||
static void M_ConnectLastServer(INT32 choice);
|
||||
#endif
|
||||
static void M_HandleSetupMultiPlayer(INT32 choice);
|
||||
static void M_HandleVideoMode(INT32 choice);
|
||||
|
@ -1012,10 +1015,12 @@ static menuitem_t MP_MainMenu[] =
|
|||
{IT_HEADER, NULL, "Join a game", NULL, 132-24},
|
||||
#ifndef NONET
|
||||
{IT_STRING|IT_CALL, NULL, "Internet server browser...",M_PreConnectMenu, 142-24},
|
||||
{IT_STRING|IT_KEYHANDLER, NULL, "Specify IPv4 address:", M_HandleConnectIP, 150-24},
|
||||
{IT_STRING|IT_CALL, NULL, "Join last server", M_ConnectLastServer, 150-24},
|
||||
{IT_STRING|IT_KEYHANDLER, NULL, "Specify IPv4 address:", M_HandleConnectIP, 158-24},
|
||||
#else
|
||||
{IT_GRAYEDOUT, NULL, "Internet server browser...",NULL, 142-24},
|
||||
{IT_GRAYEDOUT, NULL, "Specify IPv4 address:", NULL, 150-24},
|
||||
{IT_GRAYEDOUT, NULL, "Join last server", NULL, 150-24},
|
||||
{IT_GRAYEDOUT, NULL, "Specify IPv4 address:", NULL, 158-24},
|
||||
#endif
|
||||
//{IT_HEADER, NULL, "Player setup", NULL, 80},
|
||||
//{IT_STRING|IT_CALL, NULL, "Name, character, color...", M_SetupMultiPlayer, 90},
|
||||
|
@ -8639,7 +8644,9 @@ static void M_Connect(INT32 choice)
|
|||
// do not call menuexitfunc
|
||||
M_ClearMenus(false);
|
||||
|
||||
COM_BufAddText(va("connect node %d\n", serverlist[choice-FIRSTSERVERLINE + serverlistpage * SERVERS_PER_PAGE].node));
|
||||
CV_Set(&cv_lastserver, I_GetNodeAddress(serverlist[choice-FIRSTSERVERLINE + serverlistpage * SERVERS_PER_PAGE].node));
|
||||
|
||||
COM_BufAddText(va("connect node %d\n", serverlist[choice-FIRSTSERVERLINE + serverlistpage * SERVERS_PER_PAGE].node));
|
||||
}
|
||||
|
||||
static void M_Refresh(INT32 choice)
|
||||
|
@ -9332,7 +9339,7 @@ Update the maxplayers label...
|
|||
);
|
||||
|
||||
#ifndef NONET
|
||||
y += MP_MainMenu[8].alphaKey;
|
||||
y += MP_MainMenu[9].alphaKey;
|
||||
|
||||
V_DrawFill(x+5, y+4+5, /*16*8 + 6,*/ BASEVIDWIDTH - 2*(x+5), 8+6, 239);
|
||||
|
||||
|
@ -9340,7 +9347,7 @@ Update the maxplayers label...
|
|||
V_DrawString(x+8,y+12, V_ALLOWLOWERCASE, setupm_ip);
|
||||
|
||||
// draw text cursor for name
|
||||
if (itemOn == 8
|
||||
if (itemOn == 9
|
||||
&& skullAnimCounter < 4) //blink cursor
|
||||
V_DrawCharacter(x+8+V_StringWidth(setupm_ip, V_ALLOWLOWERCASE),y+12,'_',false);
|
||||
#endif
|
||||
|
@ -9499,6 +9506,7 @@ static void M_ConnectIP(INT32 choice)
|
|||
|
||||
M_ClearMenus(true);
|
||||
|
||||
CV_Set(&cv_lastserver,setupm_ip);
|
||||
COM_BufAddText(va("connect \"%s\"\n", setupm_ip));
|
||||
|
||||
// A little "please wait" message.
|
||||
|
@ -9510,6 +9518,21 @@ static void M_ConnectIP(INT32 choice)
|
|||
I_FinishUpdate(); // page flip or blit buffer
|
||||
}
|
||||
|
||||
//Join Last server
|
||||
static void M_ConnectLastServer(INT32 choice)
|
||||
{
|
||||
(void)choice;
|
||||
|
||||
if (!*cv_lastserver.string)
|
||||
{
|
||||
M_StartMessage("You haven't previously joined a server.\n", NULL, MM_NOTHING);
|
||||
return;
|
||||
}
|
||||
|
||||
M_ClearMenus(true);
|
||||
COM_BufAddText(va("connect \"%s\"\n", cv_lastserver.string));
|
||||
}
|
||||
|
||||
// Tails 11-19-2002
|
||||
static void M_HandleConnectIP(INT32 choice)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue