mirror of
https://github.com/jmarshall23/CnC_Remastered_Collection.git
synced 2026-08-12 08:00:55 +02:00
Map command can now be called from anywhere in the main menu UI
This commit is contained in:
@@ -1096,6 +1096,10 @@ void Console_Tick(void);
|
||||
typedef void (*xcommand_t) (void);
|
||||
void Cmd_AddCommand(char* cmd_name, xcommand_t function);
|
||||
|
||||
|
||||
#include <setjmp.h>
|
||||
extern jmp_buf select_game_jump;
|
||||
|
||||
/*
|
||||
** Achievement event. ST - 11/11/2019 11:39AM
|
||||
*/
|
||||
|
||||
@@ -446,6 +446,9 @@ bool Init_Game(int , char * [])
|
||||
extern bool Get_Broadcast_Addresses (void);
|
||||
#endif
|
||||
|
||||
|
||||
jmp_buf select_game_jump;
|
||||
|
||||
/***********************************************************************************************
|
||||
* Select_Game -- The game's main menu *
|
||||
* *
|
||||
@@ -515,6 +518,13 @@ bool Select_Game(bool fade)
|
||||
int cdcheck = 0;
|
||||
bool cs = Is_Counterstrike_Installed();
|
||||
#endif
|
||||
|
||||
setjmp(select_game_jump);
|
||||
|
||||
if (Scen.warpIntoMap) {
|
||||
Scen.warpIntoMap = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
// #ifndef DVD // Denzil - We want the menu screen ajw No we don't
|
||||
// if (Special.IsFromInstall) {
|
||||
|
||||
@@ -734,7 +734,6 @@ int Main_Menu(unsigned long )
|
||||
bool display = true;
|
||||
bool process = true;
|
||||
while (process) {
|
||||
|
||||
#ifdef WIN32
|
||||
/*
|
||||
** If we have just received input focus again after running in the background then
|
||||
|
||||
@@ -186,6 +186,7 @@ ScenarioClass::ScenarioClass(void) :
|
||||
memset(GlobalFlags, '\0', sizeof(GlobalFlags));
|
||||
memset(Views, '\0', sizeof(Views));
|
||||
// jmarshall
|
||||
warpIntoMap = false;
|
||||
Cmd_AddCommand("map", Cmd_Map);
|
||||
// jmarshall end
|
||||
}
|
||||
@@ -3759,6 +3760,7 @@ void Cmd_Map(void) {
|
||||
Console_Printf("usage: map <map_name>\n");
|
||||
return;
|
||||
}
|
||||
|
||||
Scen.warpIntoMap = true;
|
||||
Start_Scenario(Cmd_Argv(1));
|
||||
longjmp(select_game_jump, 1);
|
||||
}
|
||||
@@ -327,6 +327,7 @@ class ScenarioClass {
|
||||
bool bOtherProposesDraw; // True if the other player in a 2-player game has a draw offer extended.
|
||||
#endif
|
||||
|
||||
bool warpIntoMap;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user