GameExecutable: Some cleanup and reorder.

Clean clean clean!
This commit is contained in:
zcaliptium 2016-03-31 19:21:46 +03:00
parent cb907fbb87
commit ca5873a2af
4 changed files with 513 additions and 541 deletions

View File

@ -67,3 +67,13 @@ void CConfirmMenu::BeSmall(void)
gm_mgConfirmYes.mg_boxOnScreen = BoxPopupYesSmall(); gm_mgConfirmYes.mg_boxOnScreen = BoxPopupYesSmall();
gm_mgConfirmNo.mg_boxOnScreen = BoxPopupNoSmall(); gm_mgConfirmNo.mg_boxOnScreen = BoxPopupNoSmall();
} }
// return TRUE if handled
BOOL CConfirmMenu::OnKeyDown(int iVKey)
{
if ((iVKey == VK_ESCAPE || iVKey == VK_RBUTTON) && gm_mgConfirmNo.mg_pActivatedFunction != NULL) {
gm_mgConfirmNo.OnActivate();
return TRUE;
}
return CGameMenu::OnKeyDown(iVKey);
}

View File

@ -47,9 +47,6 @@ GameMode _gmMenuGameMode = GM_NONE;
GameMode _gmRunningGameMode = GM_NONE; GameMode _gmRunningGameMode = GM_NONE;
CListHead _lhServers; CListHead _lhServers;
extern BOOL IsCDInDrive(void);
void OnPlayerSelect(void); void OnPlayerSelect(void);
// last tick done // last tick done

View File

@ -100,6 +100,8 @@ static void SizeToResolution(PIX pixSizeI, PIX pixSizeJ, INDEX &iRes)
} }
// ------------------------ CConfirmMenu implementation // ------------------------ CConfirmMenu implementation
#define CMENU _pGUIM->gmConfirmMenu
CTFileName _fnmModSelected; CTFileName _fnmModSelected;
CTString _strModURLSelected; CTString _strModURLSelected;
CTString _strModServerSelected; CTString _strModServerSelected;
@ -114,10 +116,10 @@ void ExitConfirm(void)
{ {
_pConfimedYes = &ExitGame; _pConfimedYes = &ExitGame;
_pConfimedNo = NULL; _pConfimedNo = NULL;
_pGUIM->gmConfirmMenu.gm_mgConfirmLabel.mg_strText = TRANS("ARE YOU SERIOUS?"); CMENU.gm_mgConfirmLabel.mg_strText = TRANS("ARE YOU SERIOUS?");
_pGUIM->gmConfirmMenu.gm_pgmParentMenu = pgmCurrentMenu; CMENU.gm_pgmParentMenu = pgmCurrentMenu;
_pGUIM->gmConfirmMenu.BeLarge(); CMENU.BeLarge();
ChangeToMenu(&_pGUIM->gmConfirmMenu); ChangeToMenu(&CMENU);
} }
void StopCurrentGame(void) void StopCurrentGame(void)
@ -132,10 +134,10 @@ void StopConfirm(void)
{ {
_pConfimedYes = &StopCurrentGame; _pConfimedYes = &StopCurrentGame;
_pConfimedNo = NULL; _pConfimedNo = NULL;
_pGUIM->gmConfirmMenu.gm_mgConfirmLabel.mg_strText = TRANS("ARE YOU SERIOUS?"); CMENU.gm_mgConfirmLabel.mg_strText = TRANS("ARE YOU SERIOUS?");
_pGUIM->gmConfirmMenu.gm_pgmParentMenu = pgmCurrentMenu; CMENU.gm_pgmParentMenu = pgmCurrentMenu;
_pGUIM->gmConfirmMenu.BeLarge(); CMENU.BeLarge();
ChangeToMenu(&_pGUIM->gmConfirmMenu); ChangeToMenu(&CMENU);
} }
void ModLoadYes(void) void ModLoadYes(void)
@ -170,10 +172,10 @@ extern void ModConnectConfirm(void)
CPrintF(TRANS("Server is running a different MOD (%s).\nYou need to reload to connect.\n"), _fnmModSelected); CPrintF(TRANS("Server is running a different MOD (%s).\nYou need to reload to connect.\n"), _fnmModSelected);
_pConfimedYes = &ModConnect; _pConfimedYes = &ModConnect;
_pConfimedNo = NULL; _pConfimedNo = NULL;
_pGUIM->gmConfirmMenu.gm_mgConfirmLabel.mg_strText = TRANS("CHANGE THE MOD?"); CMENU.gm_mgConfirmLabel.mg_strText = TRANS("CHANGE THE MOD?");
_pGUIM->gmConfirmMenu.gm_pgmParentMenu = pgmCurrentMenu; CMENU.gm_pgmParentMenu = pgmCurrentMenu;
_pGUIM->gmConfirmMenu.BeLarge(); CMENU.BeLarge();
ChangeToMenu(&_pGUIM->gmConfirmMenu); ChangeToMenu(&CMENU);
} }
void SaveConfirm(void) void SaveConfirm(void)
@ -181,10 +183,10 @@ void SaveConfirm(void)
extern void OnFileSaveOK(void); extern void OnFileSaveOK(void);
_pConfimedYes = &OnFileSaveOK; _pConfimedYes = &OnFileSaveOK;
_pConfimedNo = NULL; _pConfimedNo = NULL;
_pGUIM->gmConfirmMenu.gm_mgConfirmLabel.mg_strText = TRANS("OVERWRITE?"); CMENU.gm_mgConfirmLabel.mg_strText = TRANS("OVERWRITE?");
_pGUIM->gmConfirmMenu.gm_pgmParentMenu = pgmCurrentMenu; CMENU.gm_pgmParentMenu = pgmCurrentMenu;
_pGUIM->gmConfirmMenu.BeLarge(); CMENU.BeLarge();
ChangeToMenu(&_pGUIM->gmConfirmMenu); ChangeToMenu(&CMENU);
} }
void ExitAndSpawnExplorer(void) void ExitAndSpawnExplorer(void)
@ -199,20 +201,11 @@ void ModNotInstalled(void)
{ {
_pConfimedYes = &ExitAndSpawnExplorer; _pConfimedYes = &ExitAndSpawnExplorer;
_pConfimedNo = NULL; _pConfimedNo = NULL;
_pGUIM->gmConfirmMenu.gm_mgConfirmLabel.mg_strText.PrintF( CMENU.gm_mgConfirmLabel.mg_strText.PrintF(
TRANS("You don't have MOD '%s' installed.\nDo you want to visit its web site?"), (const char*)_fnmModSelected); TRANS("You don't have MOD '%s' installed.\nDo you want to visit its web site?"), (const char*)_fnmModSelected);
_pGUIM->gmConfirmMenu.gm_pgmParentMenu = pgmCurrentMenu; CMENU.gm_pgmParentMenu = pgmCurrentMenu;
_pGUIM->gmConfirmMenu.BeSmall(); CMENU.BeSmall();
ChangeToMenu(&_pGUIM->gmConfirmMenu); ChangeToMenu(&CMENU);
/*
gmDisabledFunction.gm_pgmParentMenu = pgmCurrentMenu;
mgDisabledMenuButton.mg_strText.PrintF(
TRANS("You don't have MOD '%s' installed.\nPlease visit Croteam website for updates."), _fnmModSelected);
mgDisabledTitle.mg_strText = TRANS("MOD REQUIRED");
_strModURLSelected
ChangeToMenu( &gmDisabledFunction);
*/
} }
@ -220,10 +213,10 @@ extern void ModConfirm(void)
{ {
_pConfimedYes = &ModLoadYes; _pConfimedYes = &ModLoadYes;
_pConfimedNo = NULL; _pConfimedNo = NULL;
_pGUIM->gmConfirmMenu.gm_mgConfirmLabel.mg_strText = TRANS("LOAD THIS MOD?"); CMENU.gm_mgConfirmLabel.mg_strText = TRANS("LOAD THIS MOD?");
_pGUIM->gmConfirmMenu.gm_pgmParentMenu = &_pGUIM->gmLoadSaveMenu; CMENU.gm_pgmParentMenu = &_pGUIM->gmLoadSaveMenu;
_pGUIM->gmConfirmMenu.BeLarge(); CMENU.BeLarge();
ChangeToMenu(&_pGUIM->gmConfirmMenu); ChangeToMenu(&CMENU);
} }
void VideoConfirm(void) void VideoConfirm(void)
@ -231,27 +224,27 @@ void VideoConfirm(void)
// FIXUP: keyboard focus lost when going from full screen to window mode // FIXUP: keyboard focus lost when going from full screen to window mode
// due to WM_MOUSEMOVE being sent // due to WM_MOUSEMOVE being sent
_bMouseUsedLast = FALSE; _bMouseUsedLast = FALSE;
_pmgUnderCursor = _pGUIM->gmConfirmMenu.gm_pmgSelectedByDefault; _pmgUnderCursor = CMENU.gm_pmgSelectedByDefault;
_pConfimedYes = NULL; _pConfimedYes = NULL;
void RevertVideoSettings(void); void RevertVideoSettings(void);
_pConfimedNo = RevertVideoSettings; _pConfimedNo = RevertVideoSettings;
_pGUIM->gmConfirmMenu.gm_mgConfirmLabel.mg_strText = TRANS("KEEP THIS SETTING?"); CMENU.gm_mgConfirmLabel.mg_strText = TRANS("KEEP THIS SETTING?");
_pGUIM->gmConfirmMenu.gm_pgmParentMenu = pgmCurrentMenu; CMENU.gm_pgmParentMenu = pgmCurrentMenu;
_pGUIM->gmConfirmMenu.BeLarge(); CMENU.BeLarge();
ChangeToMenu(&_pGUIM->gmConfirmMenu); ChangeToMenu(&CMENU);
} }
void CDConfirm(void(*pOk)(void)) void CDConfirm(void(*pOk)(void))
{ {
_pConfimedYes = pOk; _pConfimedYes = pOk;
_pConfimedNo = NULL; _pConfimedNo = NULL;
_pGUIM->gmConfirmMenu.gm_mgConfirmLabel.mg_strText = TRANS("PLEASE INSERT GAME CD?"); CMENU.gm_mgConfirmLabel.mg_strText = TRANS("PLEASE INSERT GAME CD?");
if (pgmCurrentMenu != &_pGUIM->gmConfirmMenu) { if (pgmCurrentMenu != &CMENU) {
_pGUIM->gmConfirmMenu.gm_pgmParentMenu = pgmCurrentMenu; CMENU.gm_pgmParentMenu = pgmCurrentMenu;
_pGUIM->gmConfirmMenu.BeLarge(); CMENU.BeLarge();
ChangeToMenu(&_pGUIM->gmConfirmMenu); ChangeToMenu(&CMENU);
} }
} }
@ -274,19 +267,11 @@ void ConfirmNo(void)
} }
void InitActionsForConfirmMenu() { void InitActionsForConfirmMenu() {
_pGUIM->gmConfirmMenu.gm_mgConfirmYes.mg_pActivatedFunction = &ConfirmYes; CMENU.gm_mgConfirmYes.mg_pActivatedFunction = &ConfirmYes;
_pGUIM->gmConfirmMenu.gm_mgConfirmNo.mg_pActivatedFunction = &ConfirmNo; CMENU.gm_mgConfirmNo.mg_pActivatedFunction = &ConfirmNo;
} }
// return TRUE if handled #undef CMENU
BOOL CConfirmMenu::OnKeyDown(int iVKey)
{
if (iVKey == VK_ESCAPE || iVKey == VK_RBUTTON) {
ConfirmNo();
return TRUE;
}
return CGameMenu::OnKeyDown(iVKey);
}
// ------------------------ CMainMenu implementation // ------------------------ CMainMenu implementation
#define CMENU _pGUIM->gmMainMenu #define CMENU _pGUIM->gmMainMenu
@ -348,9 +333,7 @@ extern void SetDemoStartStopRecText(void)
CMENU.gm_mgDemoRec.SetText(TRANS("STOP RECORDING")); CMENU.gm_mgDemoRec.SetText(TRANS("STOP RECORDING"));
CMENU.gm_mgDemoRec.mg_strTip = TRANS("stop current recording"); CMENU.gm_mgDemoRec.mg_strTip = TRANS("stop current recording");
CMENU.gm_mgDemoRec.mg_pActivatedFunction = &StopRecordingDemo; CMENU.gm_mgDemoRec.mg_pActivatedFunction = &StopRecordingDemo;
} } else {
else
{
CMENU.gm_mgDemoRec.SetText(TRANS("RECORD DEMO")); CMENU.gm_mgDemoRec.SetText(TRANS("RECORD DEMO"));
CMENU.gm_mgDemoRec.mg_strTip = TRANS("start recording current game"); CMENU.gm_mgDemoRec.mg_strTip = TRANS("start recording current game");
CMENU.gm_mgDemoRec.mg_pActivatedFunction = &StartDemoSaveMenu; CMENU.gm_mgDemoRec.mg_pActivatedFunction = &StartDemoSaveMenu;
@ -399,12 +382,6 @@ void InitActionsForSinglePlayerMenu() {
// ------------------------ CSinglePlayerNewMenu implementation // ------------------------ CSinglePlayerNewMenu implementation
void StartSinglePlayerGame(void) void StartSinglePlayerGame(void)
{ {
/* if (!IsCDInDrive()) {
CDConfirm(StartSinglePlayerGame);
return;
}
*/
_pGame->gm_StartSplitScreenCfg = CGame::SSC_PLAY1; _pGame->gm_StartSplitScreenCfg = CGame::SSC_PLAY1;
_pGame->gm_aiStartLocalPlayers[0] = _pGame->gm_iSinglePlayer; _pGame->gm_aiStartLocalPlayers[0] = _pGame->gm_iSinglePlayer;
@ -420,8 +397,7 @@ void StartSinglePlayerGame(void)
{ {
StopMenus(); StopMenus();
_gmRunningGameMode = GM_SINGLE_PLAYER; _gmRunningGameMode = GM_SINGLE_PLAYER;
} } else {
else {
_gmRunningGameMode = GM_NONE; _gmRunningGameMode = GM_NONE;
} }
} }
@ -998,6 +974,7 @@ void InitActionsForVarMenu() {
} }
#undef CMENU #undef CMENU
// ------------------------ CServersMenu implementation // ------------------------ CServersMenu implementation
extern void RefreshServerList(void) extern void RefreshServerList(void)
{ {
@ -1013,8 +990,7 @@ void SortByColumn(int i)
{ {
if (_pGUIM->gmServersMenu.gm_mgList.mg_iSort == i) { if (_pGUIM->gmServersMenu.gm_mgList.mg_iSort == i) {
_pGUIM->gmServersMenu.gm_mgList.mg_bSortDown = !_pGUIM->gmServersMenu.gm_mgList.mg_bSortDown; _pGUIM->gmServersMenu.gm_mgList.mg_bSortDown = !_pGUIM->gmServersMenu.gm_mgList.mg_bSortDown;
} } else {
else {
_pGUIM->gmServersMenu.gm_mgList.mg_bSortDown = FALSE; _pGUIM->gmServersMenu.gm_mgList.mg_bSortDown = FALSE;
} }
_pGUIM->gmServersMenu.gm_mgList.mg_iSort = i; _pGUIM->gmServersMenu.gm_mgList.mg_iSort = i;
@ -1233,8 +1209,7 @@ extern void SelectPlayersFillMenu(void)
if (bHasPlayers && CMENU.gm_mgSplitScreenCfg.mg_iSelected >= 1) { if (bHasPlayers && CMENU.gm_mgSplitScreenCfg.mg_iSelected >= 1) {
CMENU.gm_mgNotes.mg_strText = TRANS("Make sure you set different controls for each player!"); CMENU.gm_mgNotes.mg_strText = TRANS("Make sure you set different controls for each player!");
} } else {
else {
CMENU.gm_mgNotes.mg_strText = ""; CMENU.gm_mgNotes.mg_strText = "";
} }
} }

View File

@ -33,6 +33,7 @@ extern CTFileName _fnmModSelected;
extern CTString _strModURLSelected; extern CTString _strModURLSelected;
extern CTString _strModServerSelected; extern CTString _strModServerSelected;
void StartVideoOptionsMenu(void) void StartVideoOptionsMenu(void)
{ {
ChangeToMenu(&_pGUIM->gmVideoOptionsMenu); ChangeToMenu(&_pGUIM->gmVideoOptionsMenu);
@ -104,8 +105,465 @@ void StartSinglePlayerNewMenu(void)
ChangeToMenu(&_pGUIM->gmSinglePlayerNewMenu); ChangeToMenu(&_pGUIM->gmSinglePlayerNewMenu);
} }
// game options var settings
void StartVarGameOptions(void)
{
_pGUIM->gmVarMenu.gm_mgTitle.mg_strText = TRANS("GAME OPTIONS");
_pGUIM->gmVarMenu.gm_fnmMenuCFG = CTFILENAME("Scripts\\Menu\\GameOptions.cfg");
ChangeToMenu(&_pGUIM->gmVarMenu);
}
void StartSinglePlayerGameOptions(void)
{
_pGUIM->gmVarMenu.gm_mgTitle.mg_strText = TRANS("GAME OPTIONS");
_pGUIM->gmVarMenu.gm_fnmMenuCFG = CTFILENAME("Scripts\\Menu\\SPOptions.cfg");
ChangeToMenu(&_pGUIM->gmVarMenu);
_pGUIM->gmVarMenu.gm_pgmParentMenu = &_pGUIM->gmSinglePlayerMenu;
}
void StartGameOptionsFromNetwork(void)
{
StartVarGameOptions();
_pGUIM->gmVarMenu.gm_pgmParentMenu = &_pGUIM->gmNetworkStartMenu;
}
void StartGameOptionsFromSplitScreen(void)
{
StartVarGameOptions();
_pGUIM->gmVarMenu.gm_pgmParentMenu = &_pGUIM->gmSplitStartMenu;
}
// rendering options var settings
void StartRenderingOptionsMenu(void)
{
_pGUIM->gmVarMenu.gm_mgTitle.mg_strText = TRANS("RENDERING OPTIONS");
_pGUIM->gmVarMenu.gm_fnmMenuCFG = CTFILENAME("Scripts\\Menu\\RenderingOptions.cfg");
_pGUIM->gmVarMenu.gm_pgmParentMenu = &_pGUIM->gmVideoOptionsMenu;
ChangeToMenu(&_pGUIM->gmVarMenu);
}
void StartCustomizeKeyboardMenu(void)
{
ChangeToMenu(&_pGUIM->gmCustomizeKeyboardMenu);
}
void StartCustomizeAxisMenu(void)
{
ChangeToMenu(&_pGUIM->gmCustomizeAxisMenu);
}
void StartOptionsMenu(void)
{
_pGUIM->gmOptionsMenu.gm_pgmParentMenu = pgmCurrentMenu;
ChangeToMenu(&_pGUIM->gmOptionsMenu);
}
void StartCurrentLoadMenu()
{
if (_gmRunningGameMode == GM_NETWORK) {
void StartNetworkLoadMenu(void);
StartNetworkLoadMenu();
} else if (_gmRunningGameMode == GM_SPLIT_SCREEN) {
void StartSplitScreenLoadMenu(void);
StartSplitScreenLoadMenu();
} else {
void StartSinglePlayerLoadMenu(void);
StartSinglePlayerLoadMenu();
}
}
void StartCurrentSaveMenu()
{
if (_gmRunningGameMode == GM_NETWORK) {
void StartNetworkSaveMenu(void);
StartNetworkSaveMenu();
} else if (_gmRunningGameMode == GM_SPLIT_SCREEN) {
void StartSplitScreenSaveMenu(void);
StartSplitScreenSaveMenu();
} else {
void StartSinglePlayerSaveMenu(void);
StartSinglePlayerSaveMenu();
}
}
void StartCurrentQuickLoadMenu()
{
if (_gmRunningGameMode == GM_NETWORK) {
void StartNetworkQuickLoadMenu(void);
StartNetworkQuickLoadMenu();
} else if (_gmRunningGameMode == GM_SPLIT_SCREEN) {
void StartSplitScreenQuickLoadMenu(void);
StartSplitScreenQuickLoadMenu();
} else {
void StartSinglePlayerQuickLoadMenu(void);
StartSinglePlayerQuickLoadMenu();
}
}
void StartChangePlayerMenuFromOptions(void)
{
_bPlayerMenuFromSinglePlayer = FALSE;
_pGUIM->gmPlayerProfile.gm_piCurrentPlayer = &_pGame->gm_iSinglePlayer;
_pGUIM->gmPlayerProfile.gm_pgmParentMenu = &_pGUIM->gmOptionsMenu;
ChangeToMenu(&_pGUIM->gmPlayerProfile);
}
void StartChangePlayerMenuFromSinglePlayer(void)
{
_iLocalPlayer = -1;
_bPlayerMenuFromSinglePlayer = TRUE;
_pGUIM->gmPlayerProfile.gm_piCurrentPlayer = &_pGame->gm_iSinglePlayer;
_pGUIM->gmPlayerProfile.gm_pgmParentMenu = &_pGUIM->gmSinglePlayerMenu;
ChangeToMenu(&_pGUIM->gmPlayerProfile);
}
void StartControlsMenuFromPlayer(void)
{
_pGUIM->gmControls.gm_pgmParentMenu = &_pGUIM->gmPlayerProfile;
ChangeToMenu(&_pGUIM->gmControls);
}
void StartControlsMenuFromOptions(void)
{
_pGUIM->gmControls.gm_pgmParentMenu = &_pGUIM->gmOptionsMenu;
ChangeToMenu(&_pGUIM->gmControls);
}
void StartHighScoreMenu(void)
{
_pGUIM->gmHighScoreMenu.gm_pgmParentMenu = pgmCurrentMenu;
ChangeToMenu(&_pGUIM->gmHighScoreMenu);
}
void StartSplitScreenGame(void)
{
// _pGame->gm_MenuSplitScreenCfg = (enum CGame::SplitScreenCfg) mgSplitScreenCfg.mg_iSelected;
_pGame->gm_StartSplitScreenCfg = _pGame->gm_MenuSplitScreenCfg;
_pGame->gm_aiStartLocalPlayers[0] = _pGame->gm_aiMenuLocalPlayers[0];
_pGame->gm_aiStartLocalPlayers[1] = _pGame->gm_aiMenuLocalPlayers[1];
_pGame->gm_aiStartLocalPlayers[2] = _pGame->gm_aiMenuLocalPlayers[2];
_pGame->gm_aiStartLocalPlayers[3] = _pGame->gm_aiMenuLocalPlayers[3];
CTFileName fnWorld = _pGame->gam_strCustomLevel;
_pGame->gm_strNetworkProvider = "Local";
CUniversalSessionProperties sp;
_pGame->SetMultiPlayerSession(sp);
if (_pGame->NewGame(fnWorld.FileName(), fnWorld, sp))
{
StopMenus();
_gmRunningGameMode = GM_SPLIT_SCREEN;
} else {
_gmRunningGameMode = GM_NONE;
}
}
void StartNetworkGame(void)
{
// _pGame->gm_MenuSplitScreenCfg = (enum CGame::SplitScreenCfg) mgSplitScreenCfg.mg_iSelected;
_pGame->gm_StartSplitScreenCfg = _pGame->gm_MenuSplitScreenCfg;
_pGame->gm_aiStartLocalPlayers[0] = _pGame->gm_aiMenuLocalPlayers[0];
_pGame->gm_aiStartLocalPlayers[1] = _pGame->gm_aiMenuLocalPlayers[1];
_pGame->gm_aiStartLocalPlayers[2] = _pGame->gm_aiMenuLocalPlayers[2];
_pGame->gm_aiStartLocalPlayers[3] = _pGame->gm_aiMenuLocalPlayers[3];
CTFileName fnWorld = _pGame->gam_strCustomLevel;
_pGame->gm_strNetworkProvider = "TCP/IP Server";
CUniversalSessionProperties sp;
_pGame->SetMultiPlayerSession(sp);
if (_pGame->NewGame(_pGame->gam_strSessionName, fnWorld, sp))
{
StopMenus();
_gmRunningGameMode = GM_NETWORK;
// if starting a dedicated server
if (_pGame->gm_MenuSplitScreenCfg == CGame::SSC_DEDICATED) {
// pull down the console
extern INDEX sam_bToggleConsole;
sam_bToggleConsole = TRUE;
}
} else {
_gmRunningGameMode = GM_NONE;
}
}
void JoinNetworkGame(void)
{
// _pGame->gm_MenuSplitScreenCfg = (enum CGame::SplitScreenCfg) mgSplitScreenCfg.mg_iSelected;
_pGame->gm_StartSplitScreenCfg = _pGame->gm_MenuSplitScreenCfg;
_pGame->gm_aiStartLocalPlayers[0] = _pGame->gm_aiMenuLocalPlayers[0];
_pGame->gm_aiStartLocalPlayers[1] = _pGame->gm_aiMenuLocalPlayers[1];
_pGame->gm_aiStartLocalPlayers[2] = _pGame->gm_aiMenuLocalPlayers[2];
_pGame->gm_aiStartLocalPlayers[3] = _pGame->gm_aiMenuLocalPlayers[3];
_pGame->gm_strNetworkProvider = "TCP/IP Client";
if (_pGame->JoinGame(CNetworkSession(_pGame->gam_strJoinAddress)))
{
StopMenus();
_gmRunningGameMode = GM_NETWORK;
} else {
if (_pNetwork->ga_strRequiredMod != "") {
extern CTFileName _fnmModToLoad;
extern CTString _strModServerJoin;
char strModName[256] = { 0 };
char strModURL[256] = { 0 };
_pNetwork->ga_strRequiredMod.ScanF("%250[^\\]\\%s", &strModName, &strModURL);
_fnmModSelected = CTString(strModName);
_strModURLSelected = strModURL;
if (_strModURLSelected = "") {
_strModURLSelected = "http://www.croteam.com/mods/Old";
}
_strModServerSelected.PrintF("%s:%s", _pGame->gam_strJoinAddress, _pShell->GetValue("net_iPort"));
extern void ModConnectConfirm(void);
ModConnectConfirm();
}
_gmRunningGameMode = GM_NONE;
}
}
// -------- Servers Menu Functions
#define CMENU _pGUIM->gmServersMenu
void StartSelectServerLAN(void)
{
CMENU.m_bInternet = FALSE;
ChangeToMenu(&CMENU);
CMENU.gm_pgmParentMenu = &_pGUIM->gmNetworkJoinMenu;
}
void StartSelectServerNET(void)
{
CMENU.m_bInternet = TRUE;
ChangeToMenu(&CMENU);
CMENU.gm_pgmParentMenu = &_pGUIM->gmNetworkJoinMenu;
}
#undef CMENU
// -------- Levels Menu Functions
#define CMENU _pGUIM->gmLevelsMenu
void StartSelectLevelFromSingle(void)
{
FilterLevels(GetSpawnFlagsForGameType(-1));
_pAfterLevelChosen = StartSinglePlayerNewMenuCustom;
ChangeToMenu(&CMENU);
CMENU.gm_pgmParentMenu = &_pGUIM->gmSinglePlayerMenu;
}
void StartSelectLevelFromSplit(void)
{
FilterLevels(GetSpawnFlagsForGameType(_pGUIM->gmSplitStartMenu.gm_mgGameType.mg_iSelected));
void StartSplitStartMenu(void);
_pAfterLevelChosen = StartSplitStartMenu;
ChangeToMenu(&CMENU);
CMENU.gm_pgmParentMenu = &_pGUIM->gmSplitStartMenu;
}
void StartSelectLevelFromNetwork(void)
{
FilterLevels(GetSpawnFlagsForGameType(_pGUIM->gmNetworkStartMenu.gm_mgGameType.mg_iSelected));
void StartNetworkStartMenu(void);
_pAfterLevelChosen = StartNetworkStartMenu;
ChangeToMenu(&CMENU);
CMENU.gm_pgmParentMenu = &_pGUIM->gmNetworkStartMenu;
}
#undef CMENU
// -------- Players Selection Menu Functions
#define CMENU _pGUIM->gmSelectPlayersMenu
void StartSelectPlayersMenuFromSplit(void)
{
CMENU.gm_bAllowDedicated = FALSE;
CMENU.gm_bAllowObserving = FALSE;
CMENU.gm_mgStart.mg_pActivatedFunction = &StartSplitScreenGame;
CMENU.gm_pgmParentMenu = &_pGUIM->gmSplitStartMenu;
ChangeToMenu(&CMENU);
}
void StartSelectPlayersMenuFromNetwork(void)
{
CMENU.gm_bAllowDedicated = TRUE;
CMENU.gm_bAllowObserving = TRUE;
CMENU.gm_mgStart.mg_pActivatedFunction = &StartNetworkGame;
CMENU.gm_pgmParentMenu = &_pGUIM->gmNetworkStartMenu;
ChangeToMenu(&CMENU);
}
void StartSelectPlayersMenuFromNetworkLoad(void)
{
CMENU.gm_bAllowDedicated = FALSE;
CMENU.gm_bAllowObserving = TRUE;
CMENU.gm_mgStart.mg_pActivatedFunction = &StartNetworkLoadGame;
CMENU.gm_pgmParentMenu = &_pGUIM->gmLoadSaveMenu;
ChangeToMenu(&CMENU);
}
void StartSelectPlayersMenuFromSplitScreenLoad(void)
{
CMENU.gm_bAllowDedicated = FALSE;
CMENU.gm_bAllowObserving = FALSE;
CMENU.gm_mgStart.mg_pActivatedFunction = &StartSplitScreenGameLoad;
CMENU.gm_pgmParentMenu = &_pGUIM->gmLoadSaveMenu;
ChangeToMenu(&CMENU);
}
void StartSelectPlayersMenuFromOpen(void)
{
CMENU.gm_bAllowDedicated = FALSE;
CMENU.gm_bAllowObserving = TRUE;
CMENU.gm_mgStart.mg_pActivatedFunction = &JoinNetworkGame;
CMENU.gm_pgmParentMenu = &_pGUIM->gmNetworkOpenMenu;
ChangeToMenu(&CMENU);
/*if (sam_strNetworkSettings=="")*/ {
void StartNetworkSettingsMenu(void);
StartNetworkSettingsMenu();
_pGUIM->gmLoadSaveMenu.gm_bNoEscape = TRUE;
_pGUIM->gmLoadSaveMenu.gm_pgmParentMenu = &_pGUIM->gmNetworkOpenMenu;
_pGUIM->gmLoadSaveMenu.gm_pgmNextMenu = &CMENU;
}
}
void StartSelectPlayersMenuFromServers(void)
{
CMENU.gm_bAllowDedicated = FALSE;
CMENU.gm_bAllowObserving = TRUE;
CMENU.gm_mgStart.mg_pActivatedFunction = &JoinNetworkGame;
CMENU.gm_pgmParentMenu = &_pGUIM->gmServersMenu;
ChangeToMenu(&CMENU);
/*if (sam_strNetworkSettings=="")*/ {
void StartNetworkSettingsMenu(void);
StartNetworkSettingsMenu();
_pGUIM->gmLoadSaveMenu.gm_bNoEscape = TRUE;
_pGUIM->gmLoadSaveMenu.gm_pgmParentMenu = &_pGUIM->gmServersMenu;
_pGUIM->gmLoadSaveMenu.gm_pgmNextMenu = &CMENU;
}
}
#undef CMENU
// -------- Save/Load Menu Calling Functions
#define CMENU _pGUIM->gmLoadSaveMenu #define CMENU _pGUIM->gmLoadSaveMenu
void StartPlayerModelLoadMenu(void)
{
CMENU.gm_mgTitle.mg_strText = TRANS("CHOOSE MODEL");
CMENU.gm_bAllowThumbnails = TRUE;
CMENU.gm_iSortType = LSSORT_FILEUP;
CMENU.gm_bSave = FALSE;
CMENU.gm_bManage = FALSE;
CMENU.gm_fnmDirectory = CTString("Models\\Player\\");
CMENU.gm_fnmSelected = _strLastPlayerAppearance;
CMENU.gm_fnmExt = CTString(".amc");
CMENU.gm_pAfterFileChosen = &LSLoadPlayerModel;
CMENU.gm_mgNotes.mg_strText = "";
CMENU.gm_pgmParentMenu = &_pGUIM->gmPlayerProfile;
ChangeToMenu(&CMENU);
}
void StartControlsLoadMenu(void)
{
CMENU.gm_mgTitle.mg_strText = TRANS("LOAD CONTROLS");
CMENU.gm_bAllowThumbnails = FALSE;
CMENU.gm_iSortType = LSSORT_FILEUP;
CMENU.gm_bSave = FALSE;
CMENU.gm_bManage = FALSE;
CMENU.gm_fnmDirectory = CTString("Controls\\");
CMENU.gm_fnmSelected = CTString("");
CMENU.gm_fnmExt = CTString(".ctl");
CMENU.gm_pAfterFileChosen = &LSLoadControls;
CMENU.gm_mgNotes.mg_strText = "";
CMENU.gm_pgmParentMenu = &_pGUIM->gmControls;
ChangeToMenu(&CMENU);
}
void StartCustomLoadMenu(void)
{
CMENU.gm_mgTitle.mg_strText = TRANS("ADVANCED OPTIONS");
CMENU.gm_bAllowThumbnails = FALSE;
CMENU.gm_iSortType = LSSORT_NAMEUP;
CMENU.gm_bSave = FALSE;
CMENU.gm_bManage = FALSE;
CMENU.gm_fnmDirectory = CTString("Scripts\\CustomOptions\\");
CMENU.gm_fnmSelected = CTString("");
CMENU.gm_fnmExt = CTString(".cfg");
CMENU.gm_pAfterFileChosen = &LSLoadCustom;
CMENU.gm_mgNotes.mg_strText = "";
CMENU.gm_pgmParentMenu = &_pGUIM->gmOptionsMenu;
ChangeToMenu(&CMENU);
}
void StartAddonsLoadMenu(void)
{
CMENU.gm_mgTitle.mg_strText = TRANS("EXECUTE ADDON");
CMENU.gm_bAllowThumbnails = FALSE;
CMENU.gm_iSortType = LSSORT_NAMEUP;
CMENU.gm_bSave = FALSE;
CMENU.gm_bManage = FALSE;
CMENU.gm_fnmDirectory = CTString("Scripts\\Addons\\");
CMENU.gm_fnmSelected = CTString("");
CMENU.gm_fnmExt = CTString(".ini");
CMENU.gm_pAfterFileChosen = &LSLoadAddon;
CMENU.gm_mgNotes.mg_strText = "";
CMENU.gm_pgmParentMenu = &_pGUIM->gmOptionsMenu;
ChangeToMenu(&CMENU);
}
void StartModsLoadMenu(void)
{
CMENU.gm_mgTitle.mg_strText = TRANS("CHOOSE MOD");
CMENU.gm_bAllowThumbnails = TRUE;
CMENU.gm_iSortType = LSSORT_NAMEUP;
CMENU.gm_bSave = FALSE;
CMENU.gm_bManage = FALSE;
CMENU.gm_fnmDirectory = CTString("Mods\\");
CMENU.gm_fnmSelected = CTString("");
CMENU.gm_fnmExt = CTString(".des");
CMENU.gm_pAfterFileChosen = &LSLoadMod;
CMENU.gm_pgmParentMenu = &_pGUIM->gmMainMenu;
ChangeToMenu(&CMENU);
}
void StartNetworkSettingsMenu(void)
{
CMENU.gm_mgTitle.mg_strText = TRANS("CONNECTION SETTINGS");
CMENU.gm_bAllowThumbnails = FALSE;
CMENU.gm_iSortType = LSSORT_FILEUP;
CMENU.gm_bSave = FALSE;
CMENU.gm_bManage = FALSE;
CMENU.gm_fnmDirectory = CTString("Scripts\\NetSettings\\");
CMENU.gm_fnmSelected = sam_strNetworkSettings;
CMENU.gm_fnmExt = CTString(".ini");
CMENU.gm_pAfterFileChosen = &LSLoadNetSettings;
if (sam_strNetworkSettings == "") {
CMENU.gm_mgNotes.mg_strText = TRANS(
"Before joining a network game,\n"
"you have to adjust your connection parameters.\n"
"Choose one option from the list.\n"
"If you have problems with connection, you can adjust\n"
"these parameters again from the Options menu.\n"
);
} else {
CMENU.gm_mgNotes.mg_strText = "";
}
CMENU.gm_pgmParentMenu = &_pGUIM->gmOptionsMenu;
ChangeToMenu(&CMENU);
}
void StartSinglePlayerQuickLoadMenu(void) void StartSinglePlayerQuickLoadMenu(void)
{ {
_gmMenuGameMode = GM_SINGLE_PLAYER; _gmMenuGameMode = GM_SINGLE_PLAYER;
@ -333,475 +791,7 @@ void StartSplitScreenSaveMenu(void)
#undef CMENU #undef CMENU
// game options var settings // -------- Disabled Menu Calling Function
void StartVarGameOptions(void)
{
_pGUIM->gmVarMenu.gm_mgTitle.mg_strText = TRANS("GAME OPTIONS");
_pGUIM->gmVarMenu.gm_fnmMenuCFG = CTFILENAME("Scripts\\Menu\\GameOptions.cfg");
ChangeToMenu(&_pGUIM->gmVarMenu);
}
void StartSinglePlayerGameOptions(void)
{
_pGUIM->gmVarMenu.gm_mgTitle.mg_strText = TRANS("GAME OPTIONS");
_pGUIM->gmVarMenu.gm_fnmMenuCFG = CTFILENAME("Scripts\\Menu\\SPOptions.cfg");
ChangeToMenu(&_pGUIM->gmVarMenu);
_pGUIM->gmVarMenu.gm_pgmParentMenu = &_pGUIM->gmSinglePlayerMenu;
}
void StartGameOptionsFromNetwork(void)
{
StartVarGameOptions();
_pGUIM->gmVarMenu.gm_pgmParentMenu = &_pGUIM->gmNetworkStartMenu;
}
void StartGameOptionsFromSplitScreen(void)
{
StartVarGameOptions();
_pGUIM->gmVarMenu.gm_pgmParentMenu = &_pGUIM->gmSplitStartMenu;
}
// rendering options var settings
void StartRenderingOptionsMenu(void)
{
_pGUIM->gmVarMenu.gm_mgTitle.mg_strText = TRANS("RENDERING OPTIONS");
_pGUIM->gmVarMenu.gm_fnmMenuCFG = CTFILENAME("Scripts\\Menu\\RenderingOptions.cfg");
_pGUIM->gmVarMenu.gm_pgmParentMenu = &_pGUIM->gmVideoOptionsMenu;
ChangeToMenu(&_pGUIM->gmVarMenu);
}
void StartCustomizeKeyboardMenu(void)
{
ChangeToMenu(&_pGUIM->gmCustomizeKeyboardMenu);
}
void StartCustomizeAxisMenu(void)
{
ChangeToMenu(&_pGUIM->gmCustomizeAxisMenu);
}
void StartOptionsMenu(void)
{
_pGUIM->gmOptionsMenu.gm_pgmParentMenu = pgmCurrentMenu;
ChangeToMenu(&_pGUIM->gmOptionsMenu);
}
void StartCurrentLoadMenu()
{
if (_gmRunningGameMode == GM_NETWORK) {
void StartNetworkLoadMenu(void);
StartNetworkLoadMenu();
} else if (_gmRunningGameMode == GM_SPLIT_SCREEN) {
void StartSplitScreenLoadMenu(void);
StartSplitScreenLoadMenu();
} else {
void StartSinglePlayerLoadMenu(void);
StartSinglePlayerLoadMenu();
}
}
void StartCurrentSaveMenu()
{
if (_gmRunningGameMode == GM_NETWORK) {
void StartNetworkSaveMenu(void);
StartNetworkSaveMenu();
} else if (_gmRunningGameMode == GM_SPLIT_SCREEN) {
void StartSplitScreenSaveMenu(void);
StartSplitScreenSaveMenu();
} else {
void StartSinglePlayerSaveMenu(void);
StartSinglePlayerSaveMenu();
}
}
void StartCurrentQuickLoadMenu()
{
if (_gmRunningGameMode == GM_NETWORK) {
void StartNetworkQuickLoadMenu(void);
StartNetworkQuickLoadMenu();
} else if (_gmRunningGameMode == GM_SPLIT_SCREEN) {
void StartSplitScreenQuickLoadMenu(void);
StartSplitScreenQuickLoadMenu();
} else {
void StartSinglePlayerQuickLoadMenu(void);
StartSinglePlayerQuickLoadMenu();
}
}
void StartChangePlayerMenuFromOptions(void)
{
_bPlayerMenuFromSinglePlayer = FALSE;
_pGUIM->gmPlayerProfile.gm_piCurrentPlayer = &_pGame->gm_iSinglePlayer;
_pGUIM->gmPlayerProfile.gm_pgmParentMenu = &_pGUIM->gmOptionsMenu;
ChangeToMenu(&_pGUIM->gmPlayerProfile);
}
void StartChangePlayerMenuFromSinglePlayer(void)
{
_iLocalPlayer = -1;
_bPlayerMenuFromSinglePlayer = TRUE;
_pGUIM->gmPlayerProfile.gm_piCurrentPlayer = &_pGame->gm_iSinglePlayer;
_pGUIM->gmPlayerProfile.gm_pgmParentMenu = &_pGUIM->gmSinglePlayerMenu;
ChangeToMenu(&_pGUIM->gmPlayerProfile);
}
void StartControlsMenuFromPlayer(void)
{
_pGUIM->gmControls.gm_pgmParentMenu = &_pGUIM->gmPlayerProfile;
ChangeToMenu(&_pGUIM->gmControls);
}
void StartControlsMenuFromOptions(void)
{
_pGUIM->gmControls.gm_pgmParentMenu = &_pGUIM->gmOptionsMenu;
ChangeToMenu(&_pGUIM->gmControls);
}
void StartSelectLevelFromSingle(void)
{
FilterLevels(GetSpawnFlagsForGameType(-1));
_pAfterLevelChosen = StartSinglePlayerNewMenuCustom;
ChangeToMenu(&_pGUIM->gmLevelsMenu);
_pGUIM->gmLevelsMenu.gm_pgmParentMenu = &_pGUIM->gmSinglePlayerMenu;
}
void StartHighScoreMenu(void)
{
_pGUIM->gmHighScoreMenu.gm_pgmParentMenu = pgmCurrentMenu;
ChangeToMenu(&_pGUIM->gmHighScoreMenu);
}
void StartSplitScreenGame(void)
{
// _pGame->gm_MenuSplitScreenCfg = (enum CGame::SplitScreenCfg) mgSplitScreenCfg.mg_iSelected;
_pGame->gm_StartSplitScreenCfg = _pGame->gm_MenuSplitScreenCfg;
_pGame->gm_aiStartLocalPlayers[0] = _pGame->gm_aiMenuLocalPlayers[0];
_pGame->gm_aiStartLocalPlayers[1] = _pGame->gm_aiMenuLocalPlayers[1];
_pGame->gm_aiStartLocalPlayers[2] = _pGame->gm_aiMenuLocalPlayers[2];
_pGame->gm_aiStartLocalPlayers[3] = _pGame->gm_aiMenuLocalPlayers[3];
CTFileName fnWorld = _pGame->gam_strCustomLevel;
_pGame->gm_strNetworkProvider = "Local";
CUniversalSessionProperties sp;
_pGame->SetMultiPlayerSession(sp);
if (_pGame->NewGame(fnWorld.FileName(), fnWorld, sp))
{
StopMenus();
_gmRunningGameMode = GM_SPLIT_SCREEN;
} else {
_gmRunningGameMode = GM_NONE;
}
}
#define CMENU _pGUIM->gmSelectPlayersMenu
void StartSelectPlayersMenuFromSplit(void)
{
CMENU.gm_bAllowDedicated = FALSE;
CMENU.gm_bAllowObserving = FALSE;
CMENU.gm_mgStart.mg_pActivatedFunction = &StartSplitScreenGame;
CMENU.gm_pgmParentMenu = &_pGUIM->gmSplitStartMenu;
ChangeToMenu(&CMENU);
}
#undef CMENU
void StartNetworkGame(void)
{
// _pGame->gm_MenuSplitScreenCfg = (enum CGame::SplitScreenCfg) mgSplitScreenCfg.mg_iSelected;
_pGame->gm_StartSplitScreenCfg = _pGame->gm_MenuSplitScreenCfg;
_pGame->gm_aiStartLocalPlayers[0] = _pGame->gm_aiMenuLocalPlayers[0];
_pGame->gm_aiStartLocalPlayers[1] = _pGame->gm_aiMenuLocalPlayers[1];
_pGame->gm_aiStartLocalPlayers[2] = _pGame->gm_aiMenuLocalPlayers[2];
_pGame->gm_aiStartLocalPlayers[3] = _pGame->gm_aiMenuLocalPlayers[3];
CTFileName fnWorld = _pGame->gam_strCustomLevel;
_pGame->gm_strNetworkProvider = "TCP/IP Server";
CUniversalSessionProperties sp;
_pGame->SetMultiPlayerSession(sp);
if (_pGame->NewGame(_pGame->gam_strSessionName, fnWorld, sp))
{
StopMenus();
_gmRunningGameMode = GM_NETWORK;
// if starting a dedicated server
if (_pGame->gm_MenuSplitScreenCfg == CGame::SSC_DEDICATED) {
// pull down the console
extern INDEX sam_bToggleConsole;
sam_bToggleConsole = TRUE;
}
} else {
_gmRunningGameMode = GM_NONE;
}
}
#define CMENU _pGUIM->gmSelectPlayersMenu
void StartSelectPlayersMenuFromNetwork(void)
{
CMENU.gm_bAllowDedicated = TRUE;
CMENU.gm_bAllowObserving = TRUE;
CMENU.gm_mgStart.mg_pActivatedFunction = &StartNetworkGame;
CMENU.gm_pgmParentMenu = &_pGUIM->gmNetworkStartMenu;
ChangeToMenu(&CMENU);
}
#undef CMENU
void JoinNetworkGame(void)
{
// _pGame->gm_MenuSplitScreenCfg = (enum CGame::SplitScreenCfg) mgSplitScreenCfg.mg_iSelected;
_pGame->gm_StartSplitScreenCfg = _pGame->gm_MenuSplitScreenCfg;
_pGame->gm_aiStartLocalPlayers[0] = _pGame->gm_aiMenuLocalPlayers[0];
_pGame->gm_aiStartLocalPlayers[1] = _pGame->gm_aiMenuLocalPlayers[1];
_pGame->gm_aiStartLocalPlayers[2] = _pGame->gm_aiMenuLocalPlayers[2];
_pGame->gm_aiStartLocalPlayers[3] = _pGame->gm_aiMenuLocalPlayers[3];
_pGame->gm_strNetworkProvider = "TCP/IP Client";
if (_pGame->JoinGame(CNetworkSession(_pGame->gam_strJoinAddress)))
{
StopMenus();
_gmRunningGameMode = GM_NETWORK;
} else {
if (_pNetwork->ga_strRequiredMod != "") {
extern CTFileName _fnmModToLoad;
extern CTString _strModServerJoin;
char strModName[256] = { 0 };
char strModURL[256] = { 0 };
_pNetwork->ga_strRequiredMod.ScanF("%250[^\\]\\%s", &strModName, &strModURL);
_fnmModSelected = CTString(strModName);
_strModURLSelected = strModURL;
if (_strModURLSelected = "") {
_strModURLSelected = "http://www.croteam.com/mods/Old";
}
_strModServerSelected.PrintF("%s:%s", _pGame->gam_strJoinAddress, _pShell->GetValue("net_iPort"));
extern void ModConnectConfirm(void);
ModConnectConfirm();
}
_gmRunningGameMode = GM_NONE;
}
}
#define CMENU _pGUIM->gmSelectPlayersMenu
void StartSelectPlayersMenuFromOpen(void)
{
CMENU.gm_bAllowDedicated = FALSE;
CMENU.gm_bAllowObserving = TRUE;
CMENU.gm_mgStart.mg_pActivatedFunction = &JoinNetworkGame;
CMENU.gm_pgmParentMenu = &_pGUIM->gmNetworkOpenMenu;
ChangeToMenu(&CMENU);
/*if (sam_strNetworkSettings=="")*/ {
void StartNetworkSettingsMenu(void);
StartNetworkSettingsMenu();
_pGUIM->gmLoadSaveMenu.gm_bNoEscape = TRUE;
_pGUIM->gmLoadSaveMenu.gm_pgmParentMenu = &_pGUIM->gmNetworkOpenMenu;
_pGUIM->gmLoadSaveMenu.gm_pgmNextMenu = &CMENU;
}
}
void StartSelectPlayersMenuFromServers(void)
{
CMENU.gm_bAllowDedicated = FALSE;
CMENU.gm_bAllowObserving = TRUE;
CMENU.gm_mgStart.mg_pActivatedFunction = &JoinNetworkGame;
CMENU.gm_pgmParentMenu = &_pGUIM->gmServersMenu;
ChangeToMenu(&CMENU);
/*if (sam_strNetworkSettings=="")*/ {
void StartNetworkSettingsMenu(void);
StartNetworkSettingsMenu();
_pGUIM->gmLoadSaveMenu.gm_bNoEscape = TRUE;
_pGUIM->gmLoadSaveMenu.gm_pgmParentMenu = &_pGUIM->gmServersMenu;
_pGUIM->gmLoadSaveMenu.gm_pgmNextMenu = &CMENU;
}
}
#undef CMENU
void StartSelectServerLAN(void)
{
_pGUIM->gmServersMenu.m_bInternet = FALSE;
ChangeToMenu(&_pGUIM->gmServersMenu);
_pGUIM->gmServersMenu.gm_pgmParentMenu = &_pGUIM->gmNetworkJoinMenu;
}
void StartSelectServerNET(void)
{
_pGUIM->gmServersMenu.m_bInternet = TRUE;
ChangeToMenu(&_pGUIM->gmServersMenu);
_pGUIM->gmServersMenu.gm_pgmParentMenu = &_pGUIM->gmNetworkJoinMenu;
}
void StartSelectLevelFromSplit(void)
{
FilterLevels(GetSpawnFlagsForGameType(_pGUIM->gmSplitStartMenu.gm_mgGameType.mg_iSelected));
void StartSplitStartMenu(void);
_pAfterLevelChosen = StartSplitStartMenu;
ChangeToMenu(&_pGUIM->gmLevelsMenu);
_pGUIM->gmLevelsMenu.gm_pgmParentMenu = &_pGUIM->gmSplitStartMenu;
}
void StartSelectLevelFromNetwork(void)
{
FilterLevels(GetSpawnFlagsForGameType(_pGUIM->gmNetworkStartMenu.gm_mgGameType.mg_iSelected));
void StartNetworkStartMenu(void);
_pAfterLevelChosen = StartNetworkStartMenu;
ChangeToMenu(&_pGUIM->gmLevelsMenu);
_pGUIM->gmLevelsMenu.gm_pgmParentMenu = &_pGUIM->gmNetworkStartMenu;
}
#define CMENU _pGUIM->gmSelectPlayersMenu
void StartSelectPlayersMenuFromSplitScreen(void)
{
CMENU.gm_bAllowDedicated = FALSE;
CMENU.gm_bAllowObserving = FALSE;
//CMENU.gm_mgStart.mg_pActivatedFunction = &StartSplitScreenGame;
CMENU.gm_pgmParentMenu = &_pGUIM->gmSplitScreenMenu;
ChangeToMenu(&CMENU);
}
void StartSelectPlayersMenuFromNetworkLoad(void)
{
CMENU.gm_bAllowDedicated = FALSE;
CMENU.gm_bAllowObserving = TRUE;
CMENU.gm_mgStart.mg_pActivatedFunction = &StartNetworkLoadGame;
CMENU.gm_pgmParentMenu = &_pGUIM->gmLoadSaveMenu;
ChangeToMenu(&CMENU);
}
void StartSelectPlayersMenuFromSplitScreenLoad(void)
{
CMENU.gm_bAllowDedicated = FALSE;
CMENU.gm_bAllowObserving = FALSE;
CMENU.gm_mgStart.mg_pActivatedFunction = &StartSplitScreenGameLoad;
CMENU.gm_pgmParentMenu = &_pGUIM->gmLoadSaveMenu;
ChangeToMenu(&CMENU);
}
#undef CMENU
// save/load menu calling functions
#define CMENU _pGUIM->gmLoadSaveMenu
void StartPlayerModelLoadMenu(void)
{
CMENU.gm_mgTitle.mg_strText = TRANS("CHOOSE MODEL");
CMENU.gm_bAllowThumbnails = TRUE;
CMENU.gm_iSortType = LSSORT_FILEUP;
CMENU.gm_bSave = FALSE;
CMENU.gm_bManage = FALSE;
CMENU.gm_fnmDirectory = CTString("Models\\Player\\");
CMENU.gm_fnmSelected = _strLastPlayerAppearance;
CMENU.gm_fnmExt = CTString(".amc");
CMENU.gm_pAfterFileChosen = &LSLoadPlayerModel;
CMENU.gm_mgNotes.mg_strText = "";
CMENU.gm_pgmParentMenu = &_pGUIM->gmPlayerProfile;
ChangeToMenu(&CMENU);
}
void StartControlsLoadMenu(void)
{
CMENU.gm_mgTitle.mg_strText = TRANS("LOAD CONTROLS");
CMENU.gm_bAllowThumbnails = FALSE;
CMENU.gm_iSortType = LSSORT_FILEUP;
CMENU.gm_bSave = FALSE;
CMENU.gm_bManage = FALSE;
CMENU.gm_fnmDirectory = CTString("Controls\\");
CMENU.gm_fnmSelected = CTString("");
CMENU.gm_fnmExt = CTString(".ctl");
CMENU.gm_pAfterFileChosen = &LSLoadControls;
CMENU.gm_mgNotes.mg_strText = "";
CMENU.gm_pgmParentMenu = &_pGUIM->gmControls;
ChangeToMenu(&CMENU);
}
void StartCustomLoadMenu(void)
{
CMENU.gm_mgTitle.mg_strText = TRANS("ADVANCED OPTIONS");
CMENU.gm_bAllowThumbnails = FALSE;
CMENU.gm_iSortType = LSSORT_NAMEUP;
CMENU.gm_bSave = FALSE;
CMENU.gm_bManage = FALSE;
CMENU.gm_fnmDirectory = CTString("Scripts\\CustomOptions\\");
CMENU.gm_fnmSelected = CTString("");
CMENU.gm_fnmExt = CTString(".cfg");
CMENU.gm_pAfterFileChosen = &LSLoadCustom;
CMENU.gm_mgNotes.mg_strText = "";
CMENU.gm_pgmParentMenu = &_pGUIM->gmOptionsMenu;
ChangeToMenu(&CMENU);
}
void StartAddonsLoadMenu(void)
{
CMENU.gm_mgTitle.mg_strText = TRANS("EXECUTE ADDON");
CMENU.gm_bAllowThumbnails = FALSE;
CMENU.gm_iSortType = LSSORT_NAMEUP;
CMENU.gm_bSave = FALSE;
CMENU.gm_bManage = FALSE;
CMENU.gm_fnmDirectory = CTString("Scripts\\Addons\\");
CMENU.gm_fnmSelected = CTString("");
CMENU.gm_fnmExt = CTString(".ini");
CMENU.gm_pAfterFileChosen = &LSLoadAddon;
CMENU.gm_mgNotes.mg_strText = "";
CMENU.gm_pgmParentMenu = &_pGUIM->gmOptionsMenu;
ChangeToMenu(&CMENU);
}
void StartModsLoadMenu(void)
{
CMENU.gm_mgTitle.mg_strText = TRANS("CHOOSE MOD");
CMENU.gm_bAllowThumbnails = TRUE;
CMENU.gm_iSortType = LSSORT_NAMEUP;
CMENU.gm_bSave = FALSE;
CMENU.gm_bManage = FALSE;
CMENU.gm_fnmDirectory = CTString("Mods\\");
CMENU.gm_fnmSelected = CTString("");
CMENU.gm_fnmExt = CTString(".des");
CMENU.gm_pAfterFileChosen = &LSLoadMod;
CMENU.gm_pgmParentMenu = &_pGUIM->gmMainMenu;
ChangeToMenu(&CMENU);
}
void StartNetworkSettingsMenu(void)
{
CMENU.gm_mgTitle.mg_strText = TRANS("CONNECTION SETTINGS");
CMENU.gm_bAllowThumbnails = FALSE;
CMENU.gm_iSortType = LSSORT_FILEUP;
CMENU.gm_bSave = FALSE;
CMENU.gm_bManage = FALSE;
CMENU.gm_fnmDirectory = CTString("Scripts\\NetSettings\\");
CMENU.gm_fnmSelected = sam_strNetworkSettings;
CMENU.gm_fnmExt = CTString(".ini");
CMENU.gm_pAfterFileChosen = &LSLoadNetSettings;
if (sam_strNetworkSettings == "") {
CMENU.gm_mgNotes.mg_strText = TRANS(
"Before joining a network game,\n"
"you have to adjust your connection parameters.\n"
"Choose one option from the list.\n"
"If you have problems with connection, you can adjust\n"
"these parameters again from the Options menu.\n"
);
} else {
CMENU.gm_mgNotes.mg_strText = "";
}
CMENU.gm_pgmParentMenu = &_pGUIM->gmOptionsMenu;
ChangeToMenu(&CMENU);
}
#undef CMENU
void DisabledFunction(void) void DisabledFunction(void)
{ {
_pGUIM->gmDisabledFunction.gm_pgmParentMenu = pgmCurrentMenu; _pGUIM->gmDisabledFunction.gm_pgmParentMenu = pgmCurrentMenu;