diff --git a/MainMenuScreen.cpp b/MainMenuScreen.cpp index 7b53bd35..6bd1583c 100644 --- a/MainMenuScreen.cpp +++ b/MainMenuScreen.cpp @@ -85,11 +85,11 @@ extern BOOLEAN gfLoadGameUponEntry; void ExitMainMenu( ); void MenuButtonCallback(GUI_BUTTON *btn, INT32 reason); +void HandleMainMenuKeyboardInput(); void HandleMainMenuInput(); void HandleMainMenuScreen(); void DisplayAssignmentText(); void ClearMainMenu(); -void HandleHelpScreenInput(); void SelectMainMenuBackGroundRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason ); void SetMainMenuExitScreen( UINT32 uiNewScreen ); void CreateDestroyBackGroundMouseMask( BOOLEAN fCreate ); @@ -177,7 +177,7 @@ UINT32 MainMenuScreenHandle( ) EndFrameBufferRender( ); - HandleMainMenuInput(); + HandleMainMenuKeyboardInput(); HandleMainMenuScreen(); if( gfMainMenuScreenExit ) @@ -420,63 +420,7 @@ void MenuButtonCallback(GUI_BUTTON *btn,INT32 reason) gbHandledMainMenu = bID; RenderMainMenu(); - if( gbHandledMainMenu == NEW_GAME ) - { - giMAXIMUM_NUMBER_OF_PLAYER_SLOTS = CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; - if(is_networked) - { - is_networked = FALSE; - // Snap: UN-Init MP save game directory - if ( !InitSaveDir() ) - { - //if something didnt work, dont even know how to make error code...//hayden - } - }; - - SetMainMenuExitScreen( GAME_INIT_OPTIONS_SCREEN ); - } - else if (gbHandledMainMenu == NEW_MP_GAME) - { - is_networked = TRUE; - - // WANNE - MP: Only reset this here, because otherwise after a MP game ends and a new starts, we would receive the files again. - fClientReceivedAllFiles = FALSE; - - giMAXIMUM_NUMBER_OF_PLAYER_SLOTS = 7; - - // Snap: Re-Init MP save game directory - if ( !InitSaveDir() ) - { - - //if something didnt work, dont even know how to make error code...//hayden - } - - // WANNE: Removed, cause I don't think it is needed if we only want to play a multiplayer game! - // Reload the external gameplay data, because maybe we started a MP game before! - //LoadExternalGameplayData(TABLEDATA_DIRECTORY); - - SetMainMenuExitScreen( MP_JOIN_SCREEN ); // OJW - 20081129 - //SetMainMenuExitScreen( GAME_INIT_OPTIONS_SCREEN ); - } - else if( gbHandledMainMenu == LOAD_GAME ) - { - giMAXIMUM_NUMBER_OF_PLAYER_SLOTS = CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; - if(is_networked) - { - is_networked = FALSE; - // Snap: UN-Init MP save game directory - if ( !InitSaveDir() ) - { - - //if something didnt work, dont even know how to make error code...//hayden - } - } - - if( gfKeyState[ ALT ] ) - gfLoadGameUponEntry = TRUE; - } - - InitDependingGameStyleOptions(); + HandleMainMenuInput(); btn->uiFlags &= (~BUTTON_CLICKED_ON ); } @@ -501,7 +445,7 @@ void MenuButtonMoveCallback(GUI_BUTTON *btn,INT32 reason) } } -void HandleMainMenuInput() +void HandleMainMenuKeyboardInput() { InputAtom InputEvent; @@ -516,14 +460,12 @@ void HandleMainMenuInput() case 'n': gbHandledMainMenu = NEW_GAME; - gfMainMenuScreenExit = TRUE; - SetMainMenuExitScreen( GAME_INIT_OPTIONS_SCREEN ); + HandleMainMenuInput(); break; case 'm': gbHandledMainMenu = NEW_MP_GAME; - gfMainMenuScreenExit = TRUE; - SetMainMenuExitScreen( MP_JOIN_SCREEN ); + HandleMainMenuInput(); break; case 'i': @@ -533,48 +475,95 @@ void HandleMainMenuInput() //#endif case 'c': gbHandledMainMenu = LOAD_GAME; - - if( gfKeyState[ ALT ] ) - gfLoadGameUponEntry = TRUE; - - // WANNE: Some initializing was missing when directly loading last savegame - // form main menu with ALT + C - giMAXIMUM_NUMBER_OF_PLAYER_SLOTS = CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; - InitDependingGameStyleOptions(); - + HandleMainMenuInput(); break; case 'o': gbHandledMainMenu = PREFERENCES; + HandleMainMenuInput(); break; case 's': gbHandledMainMenu = CREDITS; + HandleMainMenuInput(); break; case 'q': - gfMainMenuScreenExit = TRUE; - gfProgramIsRunning = FALSE; + gbHandledMainMenu = QUIT; + HandleMainMenuInput(); break; } } } } -void HandleHelpScreenInput() +void HandleMainMenuInput() { - InputAtom InputEvent; - - // Check for key - while (DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT)) + switch( gbHandledMainMenu ) { - switch( InputEvent.usEvent ) - { - case KEY_UP: - SetMainMenuExitScreen( INIT_SCREEN ); + case NEW_GAME: + giMAXIMUM_NUMBER_OF_PLAYER_SLOTS = CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; + if(is_networked) + { + is_networked = FALSE; + // Snap: UN-Init MP save game directory + if ( !InitSaveDir() ) + { + //if something didnt work, dont even know how to make error code...//hayden + } + }; + + SetMainMenuExitScreen( GAME_INIT_OPTIONS_SCREEN ); + + InitDependingGameStyleOptions(); break; - } + + case NEW_MP_GAME: + is_networked = TRUE; + + // WANNE - MP: Only reset this here, because otherwise after a MP game ends and a new starts, we would receive the files again. + fClientReceivedAllFiles = FALSE; + + giMAXIMUM_NUMBER_OF_PLAYER_SLOTS = 7; + + // Snap: Re-Init MP save game directory + if ( !InitSaveDir() ) + { + + //if something didnt work, dont even know how to make error code...//hayden + } + + // WANNE: Removed, cause I don't think it is needed if we only want to play a multiplayer game! + // Reload the external gameplay data, because maybe we started a MP game before! + //LoadExternalGameplayData(TABLEDATA_DIRECTORY); + + SetMainMenuExitScreen( MP_JOIN_SCREEN ); // OJW - 20081129 + //SetMainMenuExitScreen( GAME_INIT_OPTIONS_SCREEN ); + + InitDependingGameStyleOptions(); + break; + + case LOAD_GAME: + giMAXIMUM_NUMBER_OF_PLAYER_SLOTS = CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; + if(is_networked) + { + is_networked = FALSE; + // Snap: UN-Init MP save game directory + if ( !InitSaveDir() ) + { + + //if something didnt work, dont even know how to make error code...//hayden + } + } + + if( gfKeyState[ ALT ] ) + gfLoadGameUponEntry = TRUE; + + InitDependingGameStyleOptions(); + break; + } + // Buggler: subsequent code execution is in HandleMainMenuScreen() } diff --git a/SaveLoadGame.cpp b/SaveLoadGame.cpp index 695d993d..035c1873 100644 --- a/SaveLoadGame.cpp +++ b/SaveLoadGame.cpp @@ -7430,11 +7430,11 @@ BOOLEAN LoadTacticalStatusFromSavedGame( HWFILE hFile ) gGameExternalOptions.ubGameMaximumNumberOfRebels, gGameExternalOptions.ubGameMaximumNumberOfCivilians}; CHAR16 *errMsgTxt[] = {L"Mercenary / Vehicle", L"Enemy", L"Creature", L"Militia", L"Civilian"}; - errMsgTxt[0] = Additional113Text[2]; - errMsgTxt[1] = Additional113Text[3]; - errMsgTxt[2] = Additional113Text[4]; - errMsgTxt[3] = Additional113Text[5]; - errMsgTxt[4] = Additional113Text[6]; + errMsgTxt[0] = Additional113Text[ERROR_MAX_MERCSVEHICLES]; + errMsgTxt[1] = Additional113Text[ERROR_MAX_ENEMIES]; + errMsgTxt[2] = Additional113Text[ERROR_MAX_CREATURES]; + errMsgTxt[3] = Additional113Text[ERROR_MAX_MILITIA]; + errMsgTxt[4] = Additional113Text[ERROR_MAX_CIVILIANS]; bool needToRejigger = false; for (int idx = OUR_TEAM; idx <= CIV_TEAM; ++idx) diff --git a/Standard Gaming Platform/video.cpp b/Standard Gaming Platform/video.cpp index f6d76782..f6564f96 100644 --- a/Standard Gaming Platform/video.cpp +++ b/Standard Gaming Platform/video.cpp @@ -262,7 +262,7 @@ BOOLEAN InitializeVideoManager(HINSTANCE hInstance, UINT16 usCommandShow, void * // Get a window handle for our application (gotta have on of those) // Don't change this // - if( 1==iScreenMode ) + if( 1==iScreenMode ) // windowed mode { RECT window; DWORD style; @@ -286,9 +286,23 @@ BOOLEAN InitializeVideoManager(HINSTANCE hInstance, UINT16 usCommandShow, void * GetClientRect( hWindow, &window); window.top = window.top; } - else - hWindow = CreateWindowEx(WS_EX_TOPMOST, (LPCSTR) ClassName, "Jagged Alliance 2", WS_POPUP | WS_VISIBLE, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, NULL, NULL, hInstance, NULL); - + else // fullscreen mode + { + // Buggler: Get Primary Desktop Resolution + DWORD dwScreenWidth = ::GetSystemMetrics(SM_CXSCREEN); + DWORD dwScreenHeight = ::GetSystemMetrics(SM_CYSCREEN); + + if (SCREEN_WIDTH > dwScreenWidth || SCREEN_HEIGHT > dwScreenHeight ) + { + CHAR16 sString[ 256 ]; + swprintf( sString, Additional113Text[ADDTEXT_LOWERRES_REQUIRED], dwScreenWidth, dwScreenHeight ); + MessageBoxW( NULL, sString, APPLICATION_NAMEW, MB_ICONEXCLAMATION); + PostQuitMessage(1); + return FALSE; + } + else + hWindow = CreateWindowEx(WS_EX_TOPMOST, (LPCSTR) ClassName, "Jagged Alliance 2", WS_POPUP | WS_VISIBLE, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, NULL, NULL, hInstance, NULL); + } if (hWindow == NULL) { DebugMsg(TOPIC_VIDEO, DBG_LEVEL_0, "Failed to create window frame for Direct Draw"); diff --git a/Tactical/Turn Based Input.cpp b/Tactical/Turn Based Input.cpp index 7e6d9c07..68611a4f 100644 --- a/Tactical/Turn Based Input.cpp +++ b/Tactical/Turn Based Input.cpp @@ -4302,6 +4302,7 @@ void GetKeyboardInput( UINT32 *puiNewEvent ) { if ( CHEATER_CHEAT_LEVEL( ) ) { + // cycle item forward in primary hand if ( InItemDescriptionBox( ) ) { // Swap item in description panel... @@ -4329,6 +4330,23 @@ void GetKeyboardInput( UINT32 *puiNewEvent ) break; case 'W': + if( fAlt ) + { + if ( CHEATER_CHEAT_LEVEL( ) ) + { + // cycle item backward in primary hand + if ( InItemDescriptionBox( ) ) + { + // Swap item in description panel... + CycleItemDescriptionItem( ITEMDESC_START_X, ITEMDESC_START_Y); + + } + else + { + CycleSelectedMercsItem(); + } + } + } break; case 'x': diff --git a/Utils/Text.h b/Utils/Text.h index 6b458ec0..f7cf4c0e 100644 --- a/Utils/Text.h +++ b/Utils/Text.h @@ -2527,6 +2527,12 @@ extern STR16 gszMPMapscreenText[]; enum { ADDTEXT_16BPP_REQUIRED, + ADDTEXT_LOWERRES_REQUIRED, + ERROR_MAX_MERCSVEHICLES, + ERROR_MAX_ENEMIES, + ERROR_MAX_CREATURES, + ERROR_MAX_MILITIA, + ERROR_MAX_CIVILIANS, }; extern STR16 Additional113Text[]; extern STR16 ranks[]; diff --git a/Utils/_ChineseText.cpp b/Utils/_ChineseText.cpp index e0b93b75..407006e4 100644 --- a/Utils/_ChineseText.cpp +++ b/Utils/_ChineseText.cpp @@ -7273,9 +7273,9 @@ STR16 gzFacilityAssignmentStrings[]= STR16 Additional113Text[]= { L"Jagged Alliance 2 v1.13 窗口模式需要一个16bpp或更少的颜色深度。", + L"Jagged Alliance 2 v1.13 fullscreen mode requires to run at your desktop resolution (%d x %d) or less.", // TODO.Translate // WANNE: Savegame slots validation against INI file - L"存盘文件内部读取错误:存盘文件的“%s”数量跟 Ja2_Options.ini 设置的($d)不一致。", //L"Internal error in reading %s slots from Savegame: Number of slots in Savegame (%d) differs from defined slots in ja2_options.ini settings (%d)", L"佣兵 (MAX_NUMBER_PLAYER_MERCS) / 交通工具 (MAX_NUMBER_PLAYER_VEHICLES)", L"敌人 (MAX_NUMBER_ENEMIES_IN_TACTICAL)", L"动物 (MAX_NUMBER_CREATURES_IN_TACTICAL)", diff --git a/Utils/_DutchText.cpp b/Utils/_DutchText.cpp index af09ec3c..d53f9503 100644 --- a/Utils/_DutchText.cpp +++ b/Utils/_DutchText.cpp @@ -7285,10 +7285,10 @@ STR16 gzFacilityAssignmentStrings[]= STR16 Additional113Text[]= { L"Jagged Alliance 2 v1.13 windowed modus vereist een kleurdiepte van 16 bits per pixel.", + L"Jagged Alliance 2 v1.13 fullscreen mode requires to run at your desktop resolution (%d x %d) or less.", // TODO.Translate // TODO.Translate // WANNE: Savegame slots validation against INI file - L"Internal error in reading %s slots from Savegame: Number of slots in Savegame (%d) differs from defined slots in ja2_options.ini settings (%d)", L"Mercenary (MAX_NUMBER_PLAYER_MERCS) / Vehicle (MAX_NUMBER_PLAYER_VEHICLES)", L"Enemy (MAX_NUMBER_ENEMIES_IN_TACTICAL)", L"Creature (MAX_NUMBER_CREATURES_IN_TACTICAL)", diff --git a/Utils/_EnglishText.cpp b/Utils/_EnglishText.cpp index a634e7ae..f6f305b7 100644 --- a/Utils/_EnglishText.cpp +++ b/Utils/_EnglishText.cpp @@ -7273,9 +7273,9 @@ STR16 gzFacilityAssignmentStrings[]= STR16 Additional113Text[]= { L"Jagged Alliance 2 v1.13 windowed mode requires a color depth of 16bpp or less.", + L"Jagged Alliance 2 v1.13 fullscreen mode requires to run at your desktop resolution (%d x %d) or less.", // WANNE: Savegame slots validation against INI file - L"Internal error in reading %s slots from Savegame: Number of slots in Savegame (%d) differs from defined slots in ja2_options.ini settings (%d)", L"Mercenary (MAX_NUMBER_PLAYER_MERCS) / Vehicle (MAX_NUMBER_PLAYER_VEHICLES)", L"Enemy (MAX_NUMBER_ENEMIES_IN_TACTICAL)", L"Creature (MAX_NUMBER_CREATURES_IN_TACTICAL)", diff --git a/Utils/_FrenchText.cpp b/Utils/_FrenchText.cpp index 1eb8686e..5142bbfc 100644 --- a/Utils/_FrenchText.cpp +++ b/Utils/_FrenchText.cpp @@ -7280,9 +7280,9 @@ STR16 gzFacilityAssignmentStrings[]= STR16 Additional113Text[]= { L"Jagged Alliance 2 v1.13 mode fenêtré exige une profondeur de couleur de 16 bit ou moins.", + L"Jagged Alliance 2 v1.13 fullscreen mode requires to run at your desktop resolution (%d x %d) or less.", // TODO.Translate // WANNE: Savegame slots validation against INI file - L"Erreur interne en lisant %s emplacements depuis la sauvegarde : Le nombre d'emplacements dans la sauvegarde (%d) diffère des emplacements définis dans les paramètres de ja2_options.ini (%d)", L"Mercenaires (MAX_NUMBER_PLAYER_MERCS) / Véhicule (MAX_NUMBER_PLAYER_VEHICLES)", L"Ennemis (MAX_NUMBER_ENEMIES_IN_TACTICAL)", L"Créatures (MAX_NUMBER_CREATURES_IN_TACTICAL)", diff --git a/Utils/_GermanText.cpp b/Utils/_GermanText.cpp index cb05fde7..192166ac 100644 --- a/Utils/_GermanText.cpp +++ b/Utils/_GermanText.cpp @@ -7106,9 +7106,9 @@ STR16 gzFacilityAssignmentStrings[]= STR16 Additional113Text[]= { L"Für die korrekte Arbeit im Fenster-Modus benötigt Jagged Alliance 2 v1.13 16-bit Farbmodus.", //Jagged Alliance 2 v1.13 windowed mode requires a color depth of 16bpp or less. + L"Jagged Alliance 2 v1.13 fullscreen mode requires to run at your desktop resolution (%d x %d) or less.", // TODO.Translate // WANNE: Savegame slots validation against INI file - L"Interner Fehler beim Auslesen der %s Slots des zu ladenden Spielstandes: Die Anzahl der Slots im Spielstand (%d) unterscheidet sich mit den definierten Slots in der Datei ja2_options.ini (%d)", L"Söldner (MAX_NUMBER_PLAYER_MERCS) / Fahrzeuge (MAX_NUMBER_PLAYER_VEHICLES)", L"Gegner (MAX_NUMBER_ENEMIES_IN_TACTICAL)", L"Monster (MAX_NUMBER_CREATURES_IN_TACTICAL)", diff --git a/Utils/_ItalianText.cpp b/Utils/_ItalianText.cpp index 28240c23..872e3558 100644 --- a/Utils/_ItalianText.cpp +++ b/Utils/_ItalianText.cpp @@ -7277,10 +7277,10 @@ STR16 gzFacilityAssignmentStrings[]= STR16 Additional113Text[]= { L"Jagged Alliance 2 v1.13 modalità finestra richiede una profondità di colore di 16bpp o meno.", + L"Jagged Alliance 2 v1.13 fullscreen mode requires to run at your desktop resolution (%d x %d) or less.", // TODO.Translate // TODO.Translate // WANNE: Savegame slots validation against INI file - L"Internal error in reading %s slots from Savegame: Number of slots in Savegame (%d) differs from defined slots in ja2_options.ini settings (%d)", L"Mercenary (MAX_NUMBER_PLAYER_MERCS) / Vehicle (MAX_NUMBER_PLAYER_VEHICLES)", L"Enemy (MAX_NUMBER_ENEMIES_IN_TACTICAL)", L"Creature (MAX_NUMBER_CREATURES_IN_TACTICAL)", diff --git a/Utils/_PolishText.cpp b/Utils/_PolishText.cpp index a3e27db1..8829fe5d 100644 --- a/Utils/_PolishText.cpp +++ b/Utils/_PolishText.cpp @@ -7292,10 +7292,10 @@ STR16 gzFacilityAssignmentStrings[]= STR16 Additional113Text[]= { L"Jagged Alliance 2 v1.13 trybie okienkowym wymaga głębi koloru 16-bitowego lub mniej.", + L"Jagged Alliance 2 v1.13 fullscreen mode requires to run at your desktop resolution (%d x %d) or less.", // TODO.Translate // TODO.Translate // WANNE: Savegame slots validation against INI file - L"Internal error in reading %s slots from Savegame: Number of slots in Savegame (%d) differs from defined slots in ja2_options.ini settings (%d)", L"Mercenary (MAX_NUMBER_PLAYER_MERCS) / Vehicle (MAX_NUMBER_PLAYER_VEHICLES)", L"Enemy (MAX_NUMBER_ENEMIES_IN_TACTICAL)", L"Creature (MAX_NUMBER_CREATURES_IN_TACTICAL)", diff --git a/Utils/_RussianText.cpp b/Utils/_RussianText.cpp index 889dbef8..f82bfd70 100644 --- a/Utils/_RussianText.cpp +++ b/Utils/_RussianText.cpp @@ -7276,9 +7276,9 @@ STR16 gzFacilityAssignmentStrings[]= STR16 Additional113Text[]= { L"Для запуска Jagged Alliance 2 v1.13 в оконном режиме требуется установить 16-битное качество цветопередачи экрана", + L"Jagged Alliance 2 v1.13 fullscreen mode requires to run at your desktop resolution (%d x %d) or less.", // TODO.Translate // WANNE: Savegame slots validation against INI file // TODO.Translate - L"Internal error in reading %s slots from Savegame: Number of slots in Savegame (%d) differs from defined slots in ja2_options.ini settings (%d)", L"Mercenary (MAX_NUMBER_PLAYER_MERCS) / Vehicle (MAX_NUMBER_PLAYER_VEHICLES)", L"Enemy (MAX_NUMBER_ENEMIES_IN_TACTICAL)", L"Creature (MAX_NUMBER_CREATURES_IN_TACTICAL)",