mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-11-10 15:22:20 +00:00
Futureproofing mserv address conveyance
This commit is contained in:
parent
93647873de
commit
8548d44109
3 changed files with 36 additions and 2 deletions
33
src/m_menu.c
33
src/m_menu.c
|
@ -8566,6 +8566,15 @@ static void M_DrawConnectMenu(void)
|
|||
V_DrawRightAlignedString(BASEVIDWIDTH - currentMenu->x, currentMenu->y + MP_ConnectMenu[mp_connect_page].alphaKey,
|
||||
highlightflags, va("%u of %d", serverlistpage+1, numPages));
|
||||
|
||||
// Did you change the Server Browser address? Have a little reminder.
|
||||
int mservflags = V_ALLOWLOWERCASE;
|
||||
if (CV_IsSetToDefault(&cv_masterserver))
|
||||
mservflags = mservflags|highlightflags|V_30TRANS;
|
||||
else
|
||||
mservflags = mservflags|warningflags;
|
||||
V_DrawRightAlignedThinString(BASEVIDWIDTH - currentMenu->x, currentMenu->y+10 + MP_ConnectMenu[mp_connect_page].alphaKey,
|
||||
mservflags, cv_masterserver.string);
|
||||
|
||||
// Horizontal line!
|
||||
V_DrawFill(1, currentMenu->y+32, 318, 1, 0);
|
||||
|
||||
|
@ -8802,6 +8811,8 @@ static void M_ConnectMenuModChecks(INT32 choice)
|
|||
M_ConnectMenu(-1);
|
||||
}
|
||||
|
||||
boolean firstDismissedNagThisBoot = true;
|
||||
|
||||
static void M_HandleMasterServerResetChoice(event_t *ev)
|
||||
{
|
||||
INT32 choice = -1;
|
||||
|
@ -8813,7 +8824,16 @@ static void M_HandleMasterServerResetChoice(event_t *ev)
|
|||
if (choice == ' ' || choice == 'y' || choice == KEY_ENTER || choice == gamecontrol[gc_accelerate][0] || choice == gamecontrol[gc_accelerate][1])
|
||||
{
|
||||
CV_Set(&cv_masterserver, cv_masterserver.defaultvalue);
|
||||
CV_Set(&cv_masterserver_nagattempts, cv_masterserver_nagattempts.defaultvalue);
|
||||
S_StartSound(NULL, sfx_s221);
|
||||
} else
|
||||
{
|
||||
if (firstDismissedNagThisBoot) {
|
||||
if (cv_masterserver_nagattempts.value > 0) {
|
||||
CV_SetValue(&cv_masterserver_nagattempts, cv_masterserver_nagattempts.value - 1);
|
||||
}
|
||||
firstDismissedNagThisBoot = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -8822,7 +8842,7 @@ static void M_PreStartServerMenu(INT32 choice)
|
|||
{
|
||||
(void)choice;
|
||||
|
||||
if (!CV_IsSetToDefault(&cv_masterserver))
|
||||
if (!CV_IsSetToDefault(&cv_masterserver) && cv_masterserver_nagattempts.value > 0)
|
||||
{
|
||||
M_StartMessage(M_GetText("Hey! You've changed the Server Browser address.\n\nYou won't be able to host games on the official Server Browser.\nUnless you're from the future, this probably isn't what you want.\n\n\x83Press Accel\x80 to fix this and continue.\x80\nPress any other key to continue anyway.\n"),M_PreStartServerMenuChoice,MM_EVENTHANDLER);
|
||||
return;
|
||||
|
@ -8835,7 +8855,7 @@ static void M_PreConnectMenu(INT32 choice)
|
|||
{
|
||||
(void)choice;
|
||||
|
||||
if (!CV_IsSetToDefault(&cv_masterserver))
|
||||
if (!CV_IsSetToDefault(&cv_masterserver) && cv_masterserver_nagattempts.value > 0)
|
||||
{
|
||||
M_StartMessage(M_GetText("Hey! You've changed the Server Browser address.\n\nYou won't be able to see games from the official Server Browser.\nUnless you're from the future, this probably isn't what you want.\n\n\x83Press Accel\x80 to fix this and continue.\x80\nPress any other key to continue anyway.\n"),M_PreConnectMenuChoice,MM_EVENTHANDLER);
|
||||
return;
|
||||
|
@ -9069,6 +9089,15 @@ static void M_DrawLevelSelectOnly(boolean leftfade, boolean rightfade)
|
|||
static void M_DrawServerMenu(void)
|
||||
{
|
||||
M_DrawLevelSelectOnly(false, false);
|
||||
if (currentMenu == &MP_ServerDef && cv_advertise.value) // Remind players where they're hosting.
|
||||
{
|
||||
int mservflags = V_ALLOWLOWERCASE;
|
||||
if (CV_IsSetToDefault(&cv_masterserver))
|
||||
mservflags = mservflags|highlightflags|V_30TRANS;
|
||||
else
|
||||
mservflags = mservflags|warningflags;
|
||||
V_DrawCenteredThinString(BASEVIDWIDTH/2, BASEVIDHEIGHT-12, mservflags, cv_masterserver.string);
|
||||
}
|
||||
M_DrawGenericMenu();
|
||||
}
|
||||
|
||||
|
|
|
@ -75,6 +75,8 @@ consvar_t cv_masterserver_update_rate = {"masterserver_update_rate", "15", CV_SA
|
|||
|
||||
consvar_t cv_advertise = {"advertise", "No", CV_NETVAR|CV_CALL|CV_NOINIT, CV_YesNo, Advertise_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_masterserver_nagattempts = {"masterserver_nagattempts", "5", CV_SAVE, CV_Unsigned, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
#if defined (MASTERSERVER) && defined (HAVE_THREADS)
|
||||
int ms_QueryId;
|
||||
I_mutex ms_QueryId_mutex;
|
||||
|
@ -98,6 +100,7 @@ void AddMServCommands(void)
|
|||
CV_RegisterVar(&cv_masterserver_timeout);
|
||||
CV_RegisterVar(&cv_masterserver_debug);
|
||||
CV_RegisterVar(&cv_masterserver_token);
|
||||
CV_RegisterVar(&cv_masterserver_nagattempts);
|
||||
CV_RegisterVar(&cv_advertise);
|
||||
CV_RegisterVar(&cv_servername);
|
||||
CV_RegisterVar(&cv_server_contact);
|
||||
|
|
|
@ -61,6 +61,8 @@ extern consvar_t cv_masterserver_token;
|
|||
|
||||
extern consvar_t cv_advertise;
|
||||
|
||||
extern consvar_t cv_masterserver_nagattempts;
|
||||
|
||||
#ifdef HAVE_THREADS
|
||||
extern int ms_QueryId;
|
||||
extern I_mutex ms_QueryId_mutex;
|
||||
|
|
Loading…
Reference in a new issue