Setup failsafe to block NIV Mode if "Data" is specified as the CUSTOM_DATA_LOCATION.

Setup language specific files to be optional.
Setup code to accept all language specific files for items.xml, pockets.xml and ammostrings.xml.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@1953 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
ChrisL
2008-03-31 19:02:34 +00:00
parent a7e6b96bbe
commit fbf63c8af0
11 changed files with 180 additions and 17 deletions
+23 -1
View File
@@ -72,6 +72,28 @@ bool UsingNewInventorySystem()
return (gGameOptions.ubInventorySystem == INVENTORY_NEW);
}
std::string StringToLower(std::string strToConvert)
{//change each element of the string to lower case
for(unsigned int i=0;i<strToConvert.length();i++)
{
strToConvert[i] = tolower(strToConvert[i]);
}
return strToConvert;//return the converted string
}
BOOLEAN IsNIVModeValid(bool checkRes)
{
if(iResolution == 0 && checkRes == true)
return( FALSE );
if(gCustomDataCat.GetRootDir() == "")
return( FALSE );
char customDataPath[MAX_PATH];
GetPrivateProfileString( "Ja2 Settings","CUSTOM_DATA_LOCATION", "", customDataPath, MAX_PATH, "..\\Ja2.ini" );
if(StringToLower((std::string)customDataPath) == "data")
return( FALSE );
return( TRUE );
}
BOOLEAN LoadGameSettings()
{
HWFILE hFile;
@@ -300,7 +322,7 @@ void InitGameOptions()
gGameOptions.ubGameStyle = STYLE_SCIFI;
gGameOptions.ubDifficultyLevel = DIF_LEVEL_MEDIUM;
//CHRISL: override default inventory mode when in low res
if(iResolution == 0 || gCustomDataCat.GetRootDir() == "")
if(IsNIVModeValid() == FALSE)
gGameOptions.ubInventorySystem = INVENTORY_OLD;
else
gGameOptions.ubInventorySystem = INVENTORY_NEW;