New Feature: Added up to 15 game difficulty settings (by Jazz)

- Externalized the difficulty setings to "TableData\DifficultySettings.xml" file
- Some INI Settings (ja2_options.ini, CTHConstants.ini and Creature_Settings.ini) moved from INI file to this xml file
- see #define DIFFICULTY_SETTING

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7447 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2014-08-28 10:30:40 +00:00
parent 6b728e56ac
commit 344797f6af
47 changed files with 1976 additions and 49 deletions
+74 -10
View File
@@ -288,6 +288,11 @@
#define JA2SP_UB_RPC_TEX_AND_JOHN "RPC_TEX_AND_JOHN"
#define JA2SP_UB_RANDOM_MANUEL_TEXT "RANDOM_MANUEL_TEXT"
#ifdef DIFFICULTY_SETTING
//#define NUM_DIFF_SETTINGS 4
DIFFICULTY_SETTINGS_VALUES zDeffSetting[15];
UINT8 MaxDifficultySettingsValues;
#endif
//Difficulty settings
enum
@@ -296,8 +301,13 @@ enum
GIO_DIFF_MED,
GIO_DIFF_HARD,
GIO_DIFF_INSANE,
#ifdef DIFFICULTY_SETTING
GIO_DIFF_NEW = GIO_DIFF_INSANE + 245,
#else
NUM_DIFF_SETTINGS,
#endif
};
enum
@@ -1422,8 +1432,12 @@ void BtnGIODifficultySelectionRightCallback( GUI_BUTTON *btn,INT32 reason )
return;
if( reason & MSYS_CALLBACK_REASON_LBUTTON_REPEAT )
{
if ( iCurrentDifficulty < 2 )
{
#ifdef DIFFICULTY_SETTING
if ( iCurrentDifficulty < MaxDifficultySettingsValues /*NUM_DIFF_SETTINGS*/ - 2 ) //2
#else
if ( iCurrentDifficulty < MaxDifficultySettingsValues /*2*/ )
#endif
{
PlayButtonSound( giGIODifficultyButton[1], BUTTON_SOUND_CLICKED_ON );
@@ -1438,8 +1452,12 @@ void BtnGIODifficultySelectionRightCallback( GUI_BUTTON *btn,INT32 reason )
else if( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
{
btn->uiFlags|=(BUTTON_CLICKED_ON);
if ( iCurrentDifficulty < 2 )
#ifdef DIFFICULTY_SETTING
if ( iCurrentDifficulty < MaxDifficultySettingsValues /*NUM_DIFF_SETTINGS*/ - 2 ) //2
#else
if ( iCurrentDifficulty < MaxDifficultySettingsValues /*2*/ )
#endif
{
PlayButtonSound( giGIODifficultyButton[1], BUTTON_SOUND_CLICKED_ON );
@@ -2680,8 +2698,13 @@ BOOLEAN RenderGIOScreen()
//Display the Dif Settings Title Text
RenderGIOSmallSelectionFrame( (GIO_DIF_SETTING_X + 36), (GIO_DIF_SETTING_Y - 3) );
DisplayWrappedString( (UINT16)(GIO_DIF_SETTING_X+GIO_OFFSET_TO_TEXT + 1), (UINT16)(GIO_DIF_SETTING_Y-GIO_GAP_BN_SETTINGS + GIO_TITLE_DISTANCE - 12), GIO_DIF_SETTING_WIDTH, 2, GIO_TOGGLE_TEXT_FONT, GIO_TOGGLE_TEXT_COLOR, gzGIOScreenText[ GIO_DIF_LEVEL_TEXT ], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
#ifdef DIFFICULTY_SETTING
DisplayWrappedString( (UINT16)(GIO_DIF_SETTING_X+GIO_OFFSET_TO_TEXT + 1), (GIO_DIF_SETTING_Y+6), GIO_DIF_SETTING_WIDTH, 2, GIO_TOGGLE_TEXT_FONT, GIO_TOGGLE_TEXT_COLOR, zDeffSetting[ iCurrentDifficulty + 1].szDeffName, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
#else
DisplayWrappedString( (UINT16)(GIO_DIF_SETTING_X+GIO_OFFSET_TO_TEXT + 1), (GIO_DIF_SETTING_Y+6), GIO_DIF_SETTING_WIDTH, 2, GIO_TOGGLE_TEXT_FONT, GIO_TOGGLE_TEXT_COLOR, gzGIOScreenText[ iCurrentDifficulty + 9 ], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
#endif
//Display the IMP number Title Text
RenderGIOSmallSelectionFrame( (GIO_IMP_SETTING_X + 36), (GIO_IMP_SETTING_Y - 3) );
DisplayWrappedString( (UINT16)(GIO_IMP_SETTING_X+GIO_OFFSET_TO_TEXT + 1), (UINT16)(GIO_IMP_SETTING_Y-GIO_GAP_BN_SETTINGS + GIO_TITLE_DISTANCE - 12), GIO_DIF_SETTING_WIDTH, 2, GIO_TOGGLE_TEXT_FONT, GIO_TOGGLE_TEXT_COLOR, gzGIOScreenText[ GIO_IMP_NUMBER_TITLE_TEXT ], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
@@ -3050,8 +3073,12 @@ void DoneFadeOutForExitGameInitOptionScreen( void )
gGameOptions.ubGameStyle = FALSE;
gGameUBOptions.fRandomManuelText = GetCurrentTextStyleButtonSetting();
#ifdef DIFFICULTY_SETTING
gGameOptions.ubDifficultyLevel = min( MaxDifficultySettingsValues-1, ( max( 1, (iCurrentDifficulty + 1)) ));
#else
gGameOptions.ubDifficultyLevel = min( NUM_DIFF_SETTINGS-1, ( max( 1, (iCurrentDifficulty + 1)) ));
#endif
gGameOptions.fTurnTimeLimit = FALSE;
@@ -3161,6 +3188,9 @@ void DisplayMessageToUserAboutGameDifficulty()
{
UINT8 ubDiffLevel = iCurrentDifficulty;
#ifdef DIFFICULTY_SETTING
DoGioMessageBox( MSG_BOX_BASIC_STYLE, zDeffSetting[ubDiffLevel + 1].szConfirmText, GAME_INIT_OPTIONS_SCREEN, MSG_BOX_FLAG_YESNO, ConfirmGioDifSettingMessageBoxCallBack );
#else
switch( ubDiffLevel )
{
case 0:
@@ -3176,6 +3206,7 @@ void DisplayMessageToUserAboutGameDifficulty()
DoGioMessageBox( MSG_BOX_BASIC_STYLE, zGioDifConfirmText[GIO_CFS_INSANE], GAME_INIT_OPTIONS_SCREEN, MSG_BOX_FLAG_YESNO, ConfirmGioDifSettingMessageBoxCallBack );
break;
}
#endif
}
@@ -3415,6 +3446,12 @@ void RenderGIOSmallSelectionFrame(INT16 sX, INT16 sY)
#define JA2SP_FOODSYSTEM "FOOD_SYSTEM"
#ifdef DIFFICULTY_SETTING
//#define NUM_DIFF_SETTINGS 3
DIFFICULTY_SETTINGS_VALUES zDeffSetting[15];
UINT8 MaxDifficultySettingsValues;
#endif
//Difficulty settings
enum
{
@@ -3422,8 +3459,13 @@ enum
GIO_DIFF_MED,
GIO_DIFF_HARD,
GIO_DIFF_INSANE,
#ifdef DIFFICULTY_SETTING
GIO_DIFF_NEW = GIO_DIFF_INSANE + 245,
#else
NUM_DIFF_SETTINGS,
#endif
};
enum
@@ -4513,7 +4555,11 @@ void BtnGIODifficultySelectionRightCallback( GUI_BUTTON *btn,INT32 reason )
if( reason & MSYS_CALLBACK_REASON_LBUTTON_REPEAT )
{
#ifdef DIFFICULTY_SETTING
if ( iCurrentDifficulty < MaxDifficultySettingsValues /*NUM_DIFF_SETTINGS*/ - 1 ) //3
#else
if ( iCurrentDifficulty < 3 )
#endif
{
PlayButtonSound( giGIODifficultyButton[1], BUTTON_SOUND_CLICKED_ON );
@@ -4529,7 +4575,11 @@ void BtnGIODifficultySelectionRightCallback( GUI_BUTTON *btn,INT32 reason )
{
btn->uiFlags|=(BUTTON_CLICKED_ON);
#ifdef DIFFICULTY_SETTING
if ( iCurrentDifficulty < MaxDifficultySettingsValues /*NUM_DIFF_SETTINGS*/ - 1 ) //2
#else
if ( iCurrentDifficulty < 3 )
#endif
{
PlayButtonSound( giGIODifficultyButton[1], BUTTON_SOUND_CLICKED_ON );
@@ -5737,8 +5787,13 @@ BOOLEAN RenderGIOScreen()
//Display the Dif Settings Title Text
RenderGIOSmallSelectionFrame( (GIO_DIF_SETTING_X + 36), (GIO_DIF_SETTING_Y - 3) );
DisplayWrappedString( (UINT16)(GIO_DIF_SETTING_X+GIO_OFFSET_TO_TEXT + 1), (UINT16)(GIO_DIF_SETTING_Y-GIO_GAP_BN_SETTINGS + GIO_TITLE_DISTANCE - 12), GIO_DIF_SETTING_WIDTH, 2, GIO_TOGGLE_TEXT_FONT, GIO_TOGGLE_TEXT_COLOR, gzGIOScreenText[ GIO_DIF_LEVEL_TEXT ], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
#ifdef DIFFICULTY_SETTING
DisplayWrappedString( (UINT16)(GIO_DIF_SETTING_X+GIO_OFFSET_TO_TEXT + 1), (GIO_DIF_SETTING_Y+6), GIO_DIF_SETTING_WIDTH, 2, GIO_TOGGLE_TEXT_FONT, GIO_TOGGLE_TEXT_COLOR, zDeffSetting[ iCurrentDifficulty + 1].szDeffName, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
#else
DisplayWrappedString( (UINT16)(GIO_DIF_SETTING_X+GIO_OFFSET_TO_TEXT + 1), (GIO_DIF_SETTING_Y+6), GIO_DIF_SETTING_WIDTH, 2, GIO_TOGGLE_TEXT_FONT, GIO_TOGGLE_TEXT_COLOR, gzGIOScreenText[ iCurrentDifficulty + 9 ], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
#endif
//Display the IMP number Title Text
RenderGIOSmallSelectionFrame( (GIO_IMP_SETTING_X + 36), (GIO_IMP_SETTING_Y - 3) );
DisplayWrappedString( (UINT16)(GIO_IMP_SETTING_X+GIO_OFFSET_TO_TEXT + 1), (UINT16)(GIO_IMP_SETTING_Y-GIO_GAP_BN_SETTINGS + GIO_TITLE_DISTANCE - 12), GIO_DIF_SETTING_WIDTH, 2, GIO_TOGGLE_TEXT_FONT, GIO_TOGGLE_TEXT_COLOR, gzGIOScreenText[ GIO_IMP_NUMBER_TITLE_TEXT ], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
@@ -6092,8 +6147,13 @@ void DoneFadeOutForExitGameInitOptionScreen( void )
// loop through and get the status of all the buttons
gGameOptions.fGunNut = GetCurrentGunButtonSetting();
gGameOptions.ubGameStyle = GetCurrentGameStyleButtonSetting();
#ifdef DIFFICULTY_SETTING
gGameOptions.ubDifficultyLevel = min( MaxDifficultySettingsValues, ( max( 1, (iCurrentDifficulty + 1)) ));
#else
gGameOptions.ubDifficultyLevel = min( NUM_DIFF_SETTINGS, ( max( 1, (iCurrentDifficulty + 1)) ));
#endif
gGameOptions.fTurnTimeLimit = FALSE;
// iron man
@@ -6193,6 +6253,9 @@ void DisplayMessageToUserAboutGameDifficulty()
{
UINT8 ubDiffLevel = iCurrentDifficulty;
#ifdef DIFFICULTY_SETTING
DoGioMessageBox( MSG_BOX_BASIC_STYLE, zDeffSetting[ubDiffLevel + 1].szConfirmText, GAME_INIT_OPTIONS_SCREEN, MSG_BOX_FLAG_YESNO, ConfirmGioDifSettingMessageBoxCallBack );
#else
switch( ubDiffLevel )
{
case 0:
@@ -6208,6 +6271,7 @@ void DisplayMessageToUserAboutGameDifficulty()
DoGioMessageBox( MSG_BOX_BASIC_STYLE, zGioDifConfirmText[GIO_CFS_INSANE], GAME_INIT_OPTIONS_SCREEN, MSG_BOX_FLAG_YESNO, ConfirmGioDifSettingMessageBoxCallBack );
break;
}
#endif
}