diff --git a/src/d_clisrv.c b/src/d_clisrv.c index e22624851..02febde12 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -100,6 +100,10 @@ static int map_icon_request_count; // current count of icon requests sent static UINT8 *map_icon_data; static patch_t *map_icon; +// if true, signals the game to only load addons AND gamestate +// instead of fully joining a server +static boolean cl_addonsonly = false; + plrinfo playerinfo[MAXPLAYERS] = {}; SINT8 joinnode = 0; // used for CL_VIEWSERVER @@ -1411,6 +1415,7 @@ static void CL_DrawConnectionStatus(void) // Buttons V_DrawFill(8, BASEVIDHEIGHT - 14, BASEVIDWIDTH - 16, 12, 239); V_DrawThinString(16, BASEVIDHEIGHT - 12, V_ALLOWLOWERCASE, va("[%sESC%s] = Abort", "\x82", "\x80")); + V_DrawCenteredThinString(BASEVIDWIDTH/2, BASEVIDHEIGHT - 12, V_ALLOWLOWERCASE, va("[%sSPACE%s] = Load Addons", "\x82", "\x80")); V_DrawRightAlignedThinString(BASEVIDWIDTH - 12, BASEVIDHEIGHT - 12, V_ALLOWLOWERCASE, va("[%sENTER%s] = Join", "\x82", "\x80")); } else if (filedownload.current != -1) @@ -2553,7 +2558,7 @@ static boolean CL_ServerConnectionSearchTicker(tic_t *asksent) return true; } - cl_mode = (cv_serverinfoscreen.value) ? CL_VIEWSERVER : CL_CHECKFILES; + cl_mode = cv_serverinfoscreen.value ? CL_VIEWSERVER : CL_CHECKFILES; } else { @@ -2574,6 +2579,17 @@ static boolean CL_ServerConnectionSearchTicker(tic_t *asksent) return true; } +static void FreeMapIcon(void) +{ + if (map_icon != NULL) + Patch_Free(map_icon); + map_icon = NULL; + if (map_icon_data != NULL) + Z_Free(map_icon_data); + map_icon_data = NULL; + map_icon_request_count = 0; +} + /** Called by CL_ConnectToServer * * \param tmpsave The name of the gamestate file??? @@ -2598,7 +2614,7 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic case CL_ASKFULLFILELIST: if (cl_lastcheckedfilecount == UINT16_MAX) // All files retrieved - cl_mode = (cv_serverinfoscreen.value) ? CL_VIEWSERVER : CL_CHECKFILES; + cl_mode = cv_serverinfoscreen.value ? CL_VIEWSERVER : CL_CHECKFILES; else if (fileneedednum != cl_lastcheckedfilecount || I_GetTime() >= *asksent) { if (CL_AskFileList(fileneedednum)) @@ -2731,7 +2747,19 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic { // Gamestate is now handled within CL_LoadReceivedSavegame() CL_LoadReceivedSavegame(false); - cl_mode = CL_CONNECTED; + + if (cl_addonsonly) + { + // close connection after savegame load + // we want the actual server state + // in case theres some stuff like records to be synched + cl_mode = CL_ABORTED; + } + else + { + cl_mode = CL_CONNECTED; + } + break; } // don't break case continue to CL_CONNECTED else @@ -2745,7 +2773,6 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic case CL_ABORTED: cl_mode = CL_SEARCHING; return false; - } GetPackets(); @@ -2772,24 +2799,21 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic { if (key == KEY_ENTER || key == KEY_JOY1) { + cl_addonsonly = false; cl_mode = CL_CHECKFILES; - if (map_icon != NULL) - Patch_Free(map_icon); - map_icon = NULL; - if (map_icon_data != NULL) - Z_Free(map_icon_data); - map_icon_data = NULL; + FreeMapIcon(); } else if (key == KEY_ESCAPE || key == KEY_JOY1+1) { cl_mode = CL_ABORTED; - if (map_icon != NULL) - Patch_Free(map_icon); - map_icon = NULL; - if (map_icon_data != NULL) - Z_Free(map_icon_data); - map_icon_data = NULL; - map_icon_request_count = 0; + cl_addonsonly = false; + FreeMapIcon(); + } + else if (key == KEY_SPACE || key == KEY_JOY1+2) + { + cl_addonsonly = true; + cl_mode = CL_CHECKFILES; + FreeMapIcon(); } } @@ -2798,6 +2822,7 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic { CONS_Printf(M_GetText("Network game synchronization aborted.\n")); CL_AbortConnection(); + cl_addonsonly = false; return false; } diff --git a/src/m_menu.c b/src/m_menu.c index 79879032e..ca408dc79 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -186,8 +186,8 @@ static INT16 itemOn = 1; // menu item skull is on, Hack by Tails 09-18-2002 static INT16 skullAnimCounter = 10; // skull animation counter static boolean interpTimerHackAllow = 0; -static UINT8 setupcontrolplayer; -static INT32 (*setupcontrols)[2]; // pointer to the gamecontrols of the player being edited +static UINT8 setupcontrolplayer; +static INT32 (*setupcontrols)[2]; // pointer to the gamecontrols of the player being edited // shhh... what am I doing... nooooo! static INT32 vidm_testingmode = 0; @@ -201,8 +201,8 @@ static char setupm_ip[64]; static textinput_t setupm_input_ip; -static fixed_t multi_tics; -static state_t *multi_state; +static fixed_t multi_tics; +static state_t *multi_state; // this is set before entering the MultiPlayer setup menu, // for either player 1 or 2 @@ -1024,9 +1024,9 @@ boolean M_Responder(event_t *ev) //case KEY_JOY1 + 2: ch = KEY_ENTER; break; - /*case KEY_JOY1 + 3: // Brake can function as 'n' for message boxes now. - ch = 'n'; - break;*/ + /*case KEY_JOY1 + 3: // Brake can function as 'n' for message boxes now. + ch = 'n'; + break;*/ case KEY_MOUSE1 + 1: //case KEY_JOY1 + 1: ch = KEY_BACKSPACE; @@ -1305,12 +1305,21 @@ boolean M_Responder(event_t *ev) { playback_last_menu_interaction_leveltime = leveltime; // Flip left/right with up/down for the playback menu, since it's a horizontal icon row. + switch (ch) { - case KEY_LEFTARROW: ch = KEY_UPARROW; break; - case KEY_UPARROW: ch = KEY_RIGHTARROW; break; - case KEY_RIGHTARROW: ch = KEY_DOWNARROW; break; - case KEY_DOWNARROW: ch = KEY_LEFTARROW; break; + case KEY_LEFTARROW: + ch = KEY_UPARROW; + break; + case KEY_UPARROW: + ch = KEY_RIGHTARROW; + break; + case KEY_RIGHTARROW: + ch = KEY_DOWNARROW; + break; + case KEY_DOWNARROW: + ch = KEY_LEFTARROW; + break; // arbitrary keyboard shortcuts because fuck you @@ -1361,7 +1370,8 @@ boolean M_Responder(event_t *ev) G_AdjustView(4, 1, true); break; - default: break; + default: + break; } } @@ -1486,6 +1496,7 @@ boolean M_Responder(event_t *ev) } return false; + break; default: CON_Responder(ev); @@ -10041,7 +10052,6 @@ static void M_DrawVideoMode(void) va("Wait %d second%s", testtime, (testtime > 1) ? "s" : "")); M_CentreText(OP_VideoModeDef.y + 158, "or press ESC to return"); - } else {