Merged from revision: 7359

Fixes (by Buggler)
- new error message when launching game in fullscreen beyond desktop resolution
- fixed cycling previous item hotkey in cheat mode
- refactored main menu button and hotkey code

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7360 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2014-07-22 16:40:02 +00:00
parent 9f5aa4c227
commit a79be62f21
13 changed files with 129 additions and 102 deletions
+74 -85
View File
@@ -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()
}
+5 -5
View File
@@ -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)
+18 -4
View File
@@ -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");
+18
View File
@@ -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':
+6
View File
@@ -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[];
+1 -1
View File
@@ -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)",
+1 -1
View File
@@ -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)",
+1 -1
View File
@@ -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)",
+1 -1
View File
@@ -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)",
+1 -1
View File
@@ -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)",
+1 -1
View File
@@ -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)",
+1 -1
View File
@@ -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)",
+1 -1
View File
@@ -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)",