diff --git a/Ja2/Init.cpp b/Ja2/Init.cpp index 1d803358..bf74dbf3 100644 --- a/Ja2/Init.cpp +++ b/Ja2/Init.cpp @@ -228,7 +228,7 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer) strcat(fileName, AMMOFILENAME); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); -#ifndef ENGLISH +if( g_lang != i18n::Lang::en ) { AddLanguagePrefix(fileName); if ( FileExists(fileName) ) @@ -242,9 +242,9 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer) strcat(fileName, AMMOFILENAME); SGP_THROW_IFFALSE(ReadInAmmoStats(fileName),AMMOFILENAME); } -#else +} else { SGP_THROW_IFFALSE(ReadInAmmoStats(fileName),AMMOFILENAME); -#endif +} // Lesh: added this, begin strcpy(fileName, directoryName); @@ -268,14 +268,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer) // the uiIndex (for reference), szItemName, szLongItemName, szItemDesc, szBRName, and szBRDesc tags -#ifndef ENGLISH +if( g_lang != i18n::Lang::en ) { AddLanguagePrefix(fileName); if ( FileExists(fileName) ) { DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); SGP_THROW_IFFALSE(ReadInItemStats(fileName,TRUE), fileName); } -#endif +} //if(!WriteItemStats()) // return FALSE; @@ -340,14 +340,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer) strcat( fileName, DISEASEFILENAME ); SGP_THROW_IFFALSE( ReadInDiseaseStats( fileName,FALSE ), DISEASEFILENAME ); -#ifndef ENGLISH +if( g_lang != i18n::Lang::en ) { AddLanguagePrefix(fileName); if ( FileExists(fileName) ) { DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); SGP_THROW_IFFALSE(ReadInDiseaseStats(fileName,TRUE), DISEASEFILENAME); } -#endif +} strcpy(fileName, directoryName); strcat(fileName, STRUCTUREDECONSTRUCTFILENAME); @@ -385,14 +385,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer) strcat(fileName, LOADSCREENHINTSFILENAME); SGP_THROW_IFFALSE(ReadInLoadScreenHints(fileName, FALSE),LOADSCREENHINTSFILENAME); - #ifndef ENGLISH + if( g_lang != i18n::Lang::en ) { AddLanguagePrefix(fileName); if ( FileExists(fileName) ) { DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); SGP_THROW_IFFALSE(ReadInLoadScreenHints(fileName,TRUE), fileName); } - #endif + } strcpy(fileName, directoryName); strcat(fileName, ARMOURSFILENAME); @@ -422,14 +422,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer) } } -#ifndef ENGLISH +if( g_lang != i18n::Lang::en ) { AddLanguagePrefix(fileName); if ( FileExists(fileName) ) { DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); SGP_THROW_IFFALSE(ReadInLBEPocketStats(fileName,TRUE), fileName); } -#endif +} // THE_BOB : added for pocket popup definitions LBEPocketPopup.clear(); @@ -437,7 +437,7 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer) strcat(fileName, LBEPOCKETPOPUPFILENAME); SGP_THROW_IFFALSE(ReadInLBEPocketPopups(fileName),LBEPOCKETPOPUPFILENAME); -#ifndef ENGLISH +if( g_lang != i18n::Lang::en ) { AddLanguagePrefix(fileName); if (FileExists(fileName)) @@ -452,10 +452,10 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer) strcat(fileName, LBEPOCKETPOPUPFILENAME); SGP_THROW_IFFALSE(ReadInLBEPocketPopups(fileName),LBEPOCKETPOPUPFILENAME); } -#else +} else { // WANNE: Load english file SGP_THROW_IFFALSE(ReadInLBEPocketPopups(fileName),LBEPOCKETPOPUPFILENAME); -#endif +} #ifdef JA2UB @@ -471,14 +471,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer) strcat(fileName, MERCSTARTINGGEARFILENAME); SGP_THROW_IFFALSE(ReadInMercStartingGearStats(fileName, FALSE), MERCSTARTINGGEARFILENAME); - #ifndef ENGLISH + if( g_lang != i18n::Lang::en ) { AddLanguagePrefix(fileName); if ( FileExists(fileName) ) { DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); SGP_THROW_IFFALSE(ReadInMercStartingGearStats(fileName,TRUE), fileName); } - #endif + } #endif @@ -495,14 +495,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer) strcat(fileName, ATTACHMENTSLOTSFILENAME); SGP_THROW_IFFALSE(ReadInAttachmentSlotsStats(fileName, FALSE),ATTACHMENTSLOTSFILENAME); - #ifndef ENGLISH + if( g_lang != i18n::Lang::en ) { AddLanguagePrefix(fileName); if ( FileExists(fileName) ) { DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); SGP_THROW_IFFALSE(ReadInAttachmentSlotsStats(fileName,TRUE), fileName); } - #endif + } // Flugente: created separate gun and item choices for different soldier classes - read in different xmls strcpy(fileName, directoryName); @@ -676,14 +676,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer) strcat(fileName, CITYTABLEFILENAME); SGP_THROW_IFFALSE(ReadInMapStructure(fileName, FALSE),CITYTABLEFILENAME); -#ifndef ENGLISH +if( g_lang != i18n::Lang::en ) { AddLanguagePrefix(fileName); if ( FileExists(fileName) ) { DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); SGP_THROW_IFFALSE(ReadInStrategicMapSectorTownNames(fileName,TRUE), fileName); } -#endif +} // Lesh: Strategic movement costs will be read in Strategic\Strategic Movement Costs.cpp, // function BOOLEAN InitStrategicMovementCosts(); @@ -734,14 +734,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer) DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); SGP_THROW_IFFALSE(ReadInShippingDestinations(fileName, FALSE),SHIPPINGDESTINATIONSFILENAME); -#ifndef ENGLISH +if( g_lang != i18n::Lang::en ) { AddLanguagePrefix(fileName); if ( FileExists(fileName) ) { DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); SGP_THROW_IFFALSE(ReadInShippingDestinations(fileName, TRUE),fileName); } -#endif +} strcpy(fileName, directoryName); strcat(fileName, DELIVERYMETHODSFILENAME); @@ -754,14 +754,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer) DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); SGP_THROW_IFFALSE(ReadInFacilityTypes(fileName,FALSE), FACILITYTYPESFILENAME); -#ifndef ENGLISH +if( g_lang != i18n::Lang::en ) { AddLanguagePrefix(fileName); if ( FileExists(fileName) ) { DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); SGP_THROW_IFFALSE(ReadInFacilityTypes(fileName,TRUE), fileName); } -#endif +} // HEADROCK HAM 3.4: Read in facility locations strcpy(fileName, directoryName); @@ -775,14 +775,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer) DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); SGP_THROW_IFFALSE(ReadInSectorNames(fileName,FALSE,0), SECTORNAMESFILENAME); -#ifndef ENGLISH +if( g_lang != i18n::Lang::en ) { AddLanguagePrefix(fileName); if ( FileExists(fileName) ) { DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); SGP_THROW_IFFALSE(ReadInSectorNames(fileName,TRUE, 0), fileName); } -#endif +} // HEADROCK HAM 5: Read in Coolness by Sector strcpy(fileName, directoryName); @@ -804,7 +804,7 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer) DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); SGP_THROW_IFFALSE(ReadInMercProfiles(fileName, FALSE), MERCPROFILESFILENAME25); - #ifndef ENGLISH + if( g_lang != i18n::Lang::en ) { AddLanguagePrefix(fileName); if ( FileExists(fileName) ) { @@ -812,7 +812,7 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer) if(!ReadInMercProfiles(fileName,TRUE)) return FALSE; } - #endif + } } strcpy(fileName, directoryName); @@ -830,14 +830,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer) DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); SGP_THROW_IFFALSE(ReadInMercProfiles(fileName, FALSE), MERCPROFILESFILENAME); - #ifndef ENGLISH + if( g_lang != i18n::Lang::en ) { AddLanguagePrefix(fileName); if ( FileExists(fileName) ) { DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); SGP_THROW_IFFALSE(ReadInMercProfiles(fileName,TRUE), fileName); } - #endif + } // HEADROCK PROFEX: Read in Merc Opinion data to replace PROF.DAT data strcpy(fileName, directoryName); @@ -900,14 +900,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer) DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); SGP_THROW_IFFALSE(ReadInEnemyNames(fileName,FALSE), ENEMYNAMESFILENAME); -#ifndef ENGLISH +if( g_lang != i18n::Lang::en ) { AddLanguagePrefix(fileName); if ( FileExists(fileName) ) { DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); SGP_THROW_IFFALSE(ReadInEnemyNames(fileName,TRUE), fileName); } -#endif +} } @@ -919,14 +919,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer) DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); SGP_THROW_IFFALSE(ReadInCivGroupNamesStats(fileName,FALSE), CIVGROUPNAMESFILENAME); -#ifndef ENGLISH +if( g_lang != i18n::Lang::en ) { AddLanguagePrefix(fileName); if ( FileExists(fileName) ) { DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); SGP_THROW_IFFALSE(ReadInCivGroupNamesStats(fileName,TRUE), fileName); } -#endif +} } @@ -936,14 +936,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer) DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); SGP_THROW_IFFALSE(ReadInSenderNameList(fileName,FALSE), EMAILSENDERNAMELIST); -#ifndef ENGLISH +if( g_lang != i18n::Lang::en ) { AddLanguagePrefix(fileName); if ( FileExists(fileName) ) { DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); SGP_THROW_IFFALSE(ReadInSenderNameList(fileName,TRUE), fileName); } -#endif +} if (gGameExternalOptions.fEnemyRank == TRUE) { @@ -953,14 +953,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer) DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); SGP_THROW_IFFALSE(ReadInEnemyRank(fileName,FALSE), ENEMYRANKFILENAME); -#ifndef ENGLISH +if( g_lang != i18n::Lang::en ) { AddLanguagePrefix(fileName); if ( FileExists(fileName) ) { DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); SGP_THROW_IFFALSE(ReadInEnemyRank(fileName,TRUE), fileName); } -#endif +} } // Flugente: backgrounds @@ -969,14 +969,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer) DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); SGP_THROW_IFFALSE(ReadInBackgrounds(fileName,FALSE), BACKGROUNDSFILENAME); -#ifndef ENGLISH +if( g_lang != i18n::Lang::en ) { AddLanguagePrefix(fileName); if ( FileExists(fileName) ) { DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); SGP_THROW_IFFALSE(ReadInBackgrounds(fileName,TRUE), BACKGROUNDSFILENAME); } -#endif +} // Flugente: individual militia strcpy( fileName, directoryName ); @@ -990,14 +990,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer) DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); SGP_THROW_IFFALSE(ReadInCampaignStatsEvents(fileName,FALSE), CAMPAIGNSTATSEVENTSFILENAME); -#ifndef ENGLISH +if( g_lang != i18n::Lang::en ) { AddLanguagePrefix(fileName); if ( FileExists(fileName) ) { DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); SGP_THROW_IFFALSE(ReadInCampaignStatsEvents(fileName,TRUE), CAMPAIGNSTATSEVENTSFILENAME); } -#endif +} // WANNE: Only in a singleplayer game... // Externalised taunts @@ -1018,14 +1018,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer) strcat(fileName, FileInfo.zFileName); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); SGP_THROW_IFFALSE(ReadInTaunts(fileName,FALSE), fileName); - #ifndef ENGLISH + if( g_lang != i18n::Lang::en ) { AddLanguagePrefix(fileName); if ( FileExists(fileName) ) { DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); SGP_THROW_IFFALSE(ReadInTaunts(fileName,TRUE), fileName); } - #endif + } while( GetFileNext(&FileInfo) ) { strcpy(fileName, directoryName); @@ -1033,14 +1033,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer) strcat(fileName, FileInfo.zFileName); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); SGP_THROW_IFFALSE(ReadInTaunts(fileName,FALSE), fileName); - #ifndef ENGLISH + if( g_lang != i18n::Lang::en ) { AddLanguagePrefix(fileName); if ( FileExists(fileName) ) { DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); SGP_THROW_IFFALSE(ReadInTaunts(fileName,TRUE), fileName); } - #endif + } } GetFileClose(&FileInfo); } @@ -1052,14 +1052,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer) DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); SGP_THROW_IFFALSE(ReadInHistorys(fileName,FALSE), HISTORYNAMEFILENAME); -#ifndef ENGLISH +if( g_lang != i18n::Lang::en ) { AddLanguagePrefix(fileName); if ( FileExists(fileName) ) { DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); SGP_THROW_IFFALSE(ReadInHistorys(fileName,TRUE), fileName); } -#endif +} // IMP Portraits List by Jazz strcpy(fileName, directoryName); @@ -1067,14 +1067,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer) DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); SGP_THROW_IFFALSE(ReadInIMPPortraits(fileName,FALSE), IMPPORTRAITS); -#ifndef ENGLISH +if( g_lang != i18n::Lang::en ) { AddLanguagePrefix(fileName); if ( FileExists(fileName) ) { DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); SGP_THROW_IFFALSE(ReadInIMPPortraits(fileName,TRUE), fileName); } -#endif +} LoadIMPPortraitsTEMP( ); @@ -1159,14 +1159,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer) SGP_THROW_IFFALSE(ReadInFaceGear(zNewFaceGear, fileName), FACEGEARFILENAME); //WriteFaceGear(); -#ifndef ENGLISH +if( g_lang != i18n::Lang::en ) { AddLanguagePrefix(fileName); if ( FileExists(fileName) ) { DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); SGP_THROW_IFFALSE(ReadInMercAvailability(fileName,TRUE), fileName); } -#endif +} UINT32 i; for(i=0; i BOOLEAN Style_JA = TRUE; extern INT8 Test = 0; @@ -726,11 +727,11 @@ void DisplaySirtechSplashScreen() * (2006-10-10, Sergeant_Kolja) */ #ifdef _DEBUG - # if defined(ENGLISH) + if( g_lang == i18n::Lang::en ) { AssertMsg( 0, String( "Wheter English nor German works. May be You built English - but have only German or other foreign Disk?" ) ); - # elif defined(GERMAN) + } else if( g_lang == i18n::Lang::de ) { AssertMsg( 0, String( "Weder Englisch noch Deutsch geht. Deutsche Version kompiliert und mit englischer CDs gestartet? Das geht nicht!" ) ); - # endif + } #endif AssertMsg( 0, String( "Failed to load %s", VObjectDesc.ImageFile ) ); return; diff --git a/Ja2/JA2 Splash.cpp b/Ja2/JA2 Splash.cpp index 4ef6714a..c7d9634d 100644 --- a/Ja2/JA2 Splash.cpp +++ b/Ja2/JA2 Splash.cpp @@ -5,6 +5,7 @@ #include "Timer Control.h" #include "Multi Language Graphic Utils.h" #include +#include UINT32 guiSplashFrameFade = 10; UINT32 guiSplashStartTime = 0; @@ -13,10 +14,10 @@ extern HVSURFACE ghFrameBuffer; //Simply create videosurface, load image, and draw it to the screen. void InitJA2SplashScreen() { -#ifdef ENGLISH +if( g_lang == i18n::Lang::en ) { ClearMainMenu(); -#else +} else { UINT32 uiLogoID = 0; HVSURFACE hVSurface; // unused jonathanl // lalien reenabled for international versions VSURFACE_DESC VSurfaceDesc; //unused jonathanl // lalien reenabled for international versions @@ -69,7 +70,7 @@ void InitJA2SplashScreen() GetVideoSurface( &hVSurface, uiLogoID ); BltVideoSurfaceToVideoSurface( ghFrameBuffer, hVSurface, 0, iScreenWidthOffset, iScreenHeightOffset, 0, NULL ); DeleteVideoSurfaceFromIndex( uiLogoID ); -#endif // ENGLISH +} // ENGLISH InvalidateScreen(); RefreshScreen( NULL ); diff --git a/Ja2/SaveLoadGame.cpp b/Ja2/SaveLoadGame.cpp index dc30a1e7..a0dd2cb5 100644 --- a/Ja2/SaveLoadGame.cpp +++ b/Ja2/SaveLoadGame.cpp @@ -152,6 +152,7 @@ #endif #include "LuaInitNPCs.h" +#include #ifdef JA2UB @@ -7205,7 +7206,7 @@ BOOLEAN LoadSoldierStructure( HWFILE hFile ) } } -#ifdef GERMAN +if( g_lang == i18n::Lang::de ) { // Fix neutral flags if ( guiCurrentSaveGameVersion < 94 ) { @@ -7215,7 +7216,7 @@ BOOLEAN LoadSoldierStructure( HWFILE hFile ) Menptr[ cnt].aiData.bNeutral = FALSE; } } -#endif +} //#ifdef JA2UB //if the soldier has the NON weapon version of the merc knofe or merc umbrella //ConvertWeapons( &Menptr[ cnt ] ); @@ -9896,9 +9897,9 @@ UINT32 CalcJA2EncryptionSet( SAVED_GAME_HEADER * pSaveGameHeader ) } } - #ifdef GERMAN + if( g_lang == i18n::Lang::de ) { uiEncryptionSet *= 11; - #endif + } uiEncryptionSet = uiEncryptionSet % 10; diff --git a/Ja2/jascreens.cpp b/Ja2/jascreens.cpp index 4e1d8897..87d04505 100644 --- a/Ja2/jascreens.cpp +++ b/Ja2/jascreens.cpp @@ -48,6 +48,7 @@ #include "IniReader.h" #include "sgp_logger.h" +#include #define _UNICODE // Networking Stuff @@ -331,7 +332,7 @@ UINT32 InitScreenHandle(void) if ( ubCurrentScreen == 255 ) { - #ifdef ENGLISH + if( g_lang == i18n::Lang::en ) { if( gfDoneWithSplashScreen ) { ubCurrentScreen = 0; @@ -341,9 +342,9 @@ UINT32 InitScreenHandle(void) SetCurrentCursorFromDatabase( VIDEO_NO_CURSOR ); return( INTRO_SCREEN ); } - #else + } else { ubCurrentScreen = 0; - #endif + } } if ( ubCurrentScreen == 0 ) diff --git a/Laptop/AimMembers.cpp b/Laptop/AimMembers.cpp index 05d63151..0c1e2f37 100644 --- a/Laptop/AimMembers.cpp +++ b/Laptop/AimMembers.cpp @@ -49,6 +49,7 @@ #include "Encrypted File.h" #include "InterfaceItemImages.h" #include +#include // //****** Defines ****** @@ -5461,20 +5462,20 @@ void DisplayPopUpBoxExplainingMercArrivalLocationAndTime( ) //create the string to display to the user, looks like.... // L"%s should arrive at the designated drop-off point ( sector %d:%d %s ) on day %d, at approximately %s.", //first %s is mercs name, next is the sector location and name where they will be arriving in, lastely is the day an the time of arrival -#ifdef GERMAN +if( g_lang == i18n::Lang::de ) { //Germans version has a different argument order swprintf( szLocAndTime, pMessageStrings[ MSG_JUST_HIRED_MERC_ARRIVAL_LOCATION_POPUP ], gMercProfiles[ pSoldier->ubProfile ].zNickname, LaptopSaveInfo.sLastHiredMerc.uiArrivalTime / 1440, zTimeString, zSectorIDString ); -#else +} else { swprintf( szLocAndTime, pMessageStrings[ MSG_JUST_HIRED_MERC_ARRIVAL_LOCATION_POPUP ], gMercProfiles[ pSoldier->ubProfile ].zNickname, zSectorIDString, LaptopSaveInfo.sLastHiredMerc.uiArrivalTime / 1440, zTimeString ); -#endif +} diff --git a/Laptop/BobbyRGuns.cpp b/Laptop/BobbyRGuns.cpp index d336e436..ac9855fc 100644 --- a/Laptop/BobbyRGuns.cpp +++ b/Laptop/BobbyRGuns.cpp @@ -20,6 +20,7 @@ // HEADROCK HAM 4 #include "input.h" #include "Encyclopedia_new.h" //update encyclopedia item visibility when viewing that item + #include #define BOBBYR_DEFAULT_MENU_COLOR 255 @@ -2516,11 +2517,11 @@ void DisplayItemNameAndInfo(UINT16 usPosY, UINT16 usIndex, UINT16 usBobbyIndex, //if it's a used item, display how damaged the item is if( fUsed ) { - #ifdef CHINESE + if ( g_lang == i18n::Lang::zh ) { swprintf( sTemp, ChineseSpecString2, LaptopSaveInfo.BobbyRayUsedInventory[ usBobbyIndex ].ubItemQuality );//zww - #else + } else { swprintf( sTemp, L"*%3d%%%%", LaptopSaveInfo.BobbyRayUsedInventory[ usBobbyIndex ].ubItemQuality ); - #endif + } DrawTextToScreen(sTemp, (UINT16)(BOBBYR_ITEM_NAME_X-2), (UINT16)(usPosY - BOBBYR_ORDER_NUM_Y_OFFSET), BOBBYR_ORDER_NUM_WIDTH, BOBBYR_ITEM_NAME_TEXT_FONT, BOBBYR_ITEM_NAME_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED); } diff --git a/Laptop/BobbyRMailOrder.cpp b/Laptop/BobbyRMailOrder.cpp index a7610e23..a145c7a7 100644 --- a/Laptop/BobbyRMailOrder.cpp +++ b/Laptop/BobbyRMailOrder.cpp @@ -30,6 +30,7 @@ #include "GameSettings.h" #include #include +#include /* typedef struct @@ -488,11 +489,11 @@ BOOLEAN EnterBobbyRMailOrder() SetButtonCursor(guiBobbyRClearOrder, CURSOR_LAPTOP_SCREEN); SpecifyDisabledButtonStyle( guiBobbyRClearOrder, DISABLED_STYLE_NONE ); //inshy: fix position of text for buttons -#ifdef FRENCH +if(g_lang == i18n::Lang::fr) { SpecifyButtonTextOffsets( guiBobbyRClearOrder, 13, 10, TRUE ); -#else +} else { SpecifyButtonTextOffsets( guiBobbyRClearOrder, 39, 10, TRUE ); -#endif +} // Accept Order button guiBobbyRAcceptOrderImage = LoadButtonImage("LAPTOP\\AcceptOrderButton.sti", 2,0,-1,1,-1 ); @@ -504,11 +505,11 @@ BOOLEAN EnterBobbyRMailOrder() DEFAULT_MOVE_CALLBACK, BtnBobbyRAcceptOrderCallback); SetButtonCursor( guiBobbyRAcceptOrder, CURSOR_LAPTOP_SCREEN); //inshy: fix position of text for buttons -#ifdef FRENCH +if(g_lang == i18n::Lang::fr) { SpecifyButtonTextOffsets( guiBobbyRAcceptOrder, 15, 24, TRUE ); -#else +} else { SpecifyButtonTextOffsets( guiBobbyRAcceptOrder, 43, 24, TRUE ); -#endif +} SpecifyDisabledButtonStyle( guiBobbyRAcceptOrder, DISABLED_STYLE_SHADED ); if( gbSelectedCity == -1 ) diff --git a/Laptop/IMP Text System.cpp b/Laptop/IMP Text System.cpp index 4fd013b8..9555ef80 100644 --- a/Laptop/IMP Text System.cpp +++ b/Laptop/IMP Text System.cpp @@ -38,6 +38,7 @@ #include "GameSettings.h" #endif +#include #define IMP_SEEK_AMOUNT 5 * 80 * 2 @@ -204,18 +205,18 @@ void PrintImpText( void ) LoadAndDisplayIMPText( LAPTOP_SCREEN_UL_X + 81, LAPTOP_SCREEN_WEB_UL_Y + 259, ( 640 ), IMP_BEGIN_6, FONT14ARIAL, FONT_BLACK, FALSE, 0); //inshy (18.01.2009): fix position for russian text - #ifdef RUSSIAN + if( g_lang == i18n::Lang::ru ) { // male LoadAndDisplayIMPText( LAPTOP_SCREEN_UL_X + 225, LAPTOP_SCREEN_WEB_UL_Y + 259, ( 640 ), IMP_BEGIN_10, FONT14ARIAL, FONT_BLACK, FALSE, 0); // female LoadAndDisplayIMPText( LAPTOP_SCREEN_UL_X + 335, LAPTOP_SCREEN_WEB_UL_Y + 259, ( 640 ), IMP_BEGIN_11, FONT14ARIAL, FONT_BLACK, FALSE, 0); - #else + } else { // male LoadAndDisplayIMPText( LAPTOP_SCREEN_UL_X + 240, LAPTOP_SCREEN_WEB_UL_Y + 259, ( 640 ), IMP_BEGIN_10, FONT14ARIAL, FONT_BLACK, FALSE, 0); // female LoadAndDisplayIMPText( LAPTOP_SCREEN_UL_X + 360, LAPTOP_SCREEN_WEB_UL_Y + 259, ( 640 ), IMP_BEGIN_11, FONT14ARIAL, FONT_BLACK, FALSE, 0); - #endif + } break; case ( IMP_PERSONALITY ): diff --git a/Strategic/Map Screen Interface Map.cpp b/Strategic/Map Screen Interface Map.cpp index 0ec76fd7..73af166a 100644 --- a/Strategic/Map Screen Interface Map.cpp +++ b/Strategic/Map Screen Interface Map.cpp @@ -56,6 +56,7 @@ #include "MilitiaSquads.h" #include "LaptopSave.h" +#include // added by Flugente extern CHAR16 gzSectorNames[256][4][MAX_SECTOR_NAME_LENGTH]; @@ -1199,11 +1200,11 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Map Screen1"); // don't show loyalty string until loyalty tracking for that town has been started if( gTownLoyalty[ bTown ].fStarted && gfTownUsesLoyalty[ bTown ]) { - #ifdef CHINESE + if ( g_lang == i18n::Lang::zh ) { swprintf( sStringA, L"%d%£¥%% %s", gTownLoyalty[ bTown ].ubRating, gsLoyalString[ 0 ]); - #else + } else { swprintf( sStringA, L"%d%%%% %s", gTownLoyalty[ bTown ].ubRating, gsLoyalString[ 0 ]); - #endif + } // if loyalty is too low to train militia, and militia training is allowed here if ( ( gTownLoyalty[ bTown ].ubRating < iMinLoyaltyToTrain ) && MilitiaTrainingAllowedInTown( bTown ) ) @@ -4873,11 +4874,11 @@ void BlitMineText( INT16 sMapX, INT16 sMapY ) // if potential is not nil, show percentage of the two if (GetMaxPeriodicRemovalFromMine(ubMineIndex) > 0) { - #ifdef CHINESE + if ( g_lang == i18n::Lang::zh ) { swprintf( wSubString, L" (%d%£¥%%)", (PredictDailyIncomeFromAMine(ubMineIndex, TRUE) * 100 ) / GetMaxDailyRemovalFromMine(ubMineIndex) ); - #else + } else { swprintf( wSubString, L" (%d%%%%)", (PredictDailyIncomeFromAMine(ubMineIndex, TRUE) * 100 ) / GetMaxDailyRemovalFromMine(ubMineIndex) ); - #endif + } wcscat( wString, wSubString ); } diff --git a/Strategic/Strategic Town Loyalty.cpp b/Strategic/Strategic Town Loyalty.cpp index d4542de0..9de36dc0 100644 --- a/Strategic/Strategic Town Loyalty.cpp +++ b/Strategic/Strategic Town Loyalty.cpp @@ -40,6 +40,7 @@ #include "Luaglobal.h" #include "LuaInitNPCs.h" #include "Interface.h" +#include #include "GameInitOptionsScreen.h" extern WorldItems gAllWorldItems; @@ -1631,12 +1632,12 @@ void AdjustLoyaltyForCivsEatenByMonsters( INT16 sSectorX, INT16 sSectorY, UINT8 swprintf( str, gpStrategicString[STR_PB_BANDIT_KILLCIVS_IN_SECTOR], ubHowMany, pSectorString ); else { -#ifdef CHINESE +if( g_lang == i18n::Lang::zh ) { //diffrent order of words in Chinese swprintf( str, gpStrategicString[STR_DIALOG_CREATURES_KILL_CIVILIANS], pSectorString, ubHowMany ); -#else +} else { swprintf( str, gpStrategicString[STR_DIALOG_CREATURES_KILL_CIVILIANS], ubHowMany, pSectorString ); -#endif +} } DoScreenIndependantMessageBox( str, MSG_BOX_FLAG_OK, MapScreenDefaultOkBoxCallback ); diff --git a/Strategic/mapscreen.cpp b/Strategic/mapscreen.cpp index 9e180ddd..bdd2a631 100644 --- a/Strategic/mapscreen.cpp +++ b/Strategic/mapscreen.cpp @@ -9665,27 +9665,27 @@ void BltCharInvPanel() // print armor/weight/camo labels mprintf(UI_CHARINV.Text.ArmorLabel.iX, UI_CHARINV.Text.ArmorLabel.iY, pInvPanelTitleStrings[ 0 ] ); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { mprintf(UI_CHARINV.Text.ArmorPercent.iX, UI_CHARINV.Text.ArmorPercent.iY, ChineseSpecString1 ); - #else + } else { mprintf(UI_CHARINV.Text.ArmorPercent.iX, UI_CHARINV.Text.ArmorPercent.iY, L"%%" ); - #endif + } mprintf(UI_CHARINV.Text.WeightLabel.iX, UI_CHARINV.Text.WeightLabel.iY, pInvPanelTitleStrings[ 1 ] ); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { mprintf(UI_CHARINV.Text.WeightPercent.iX, UI_CHARINV.Text.WeightPercent.iY, ChineseSpecString1 ); - #else + } else { mprintf(UI_CHARINV.Text.WeightPercent.iX, UI_CHARINV.Text.WeightPercent.iY, L"%%" ); - #endif + } mprintf(UI_CHARINV.Text.CamoLabel.iX, UI_CHARINV.Text.CamoLabel.iY, pInvPanelTitleStrings[ 2 ] ); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { mprintf(UI_CHARINV.Text.CamoPercent.iX, UI_CHARINV.Text.CamoPercent.iY, ChineseSpecString1 ); - #else + } else { mprintf(UI_CHARINV.Text.CamoPercent.iX, UI_CHARINV.Text.CamoPercent.iY, L"%%" ); - #endif + } const auto width = UI_CHARINV.Text.PercentWidth; const auto height = UI_CHARINV.Text.PercentHeight; diff --git a/Tactical/Handle Doors.cpp b/Tactical/Handle Doors.cpp index 4d63103b..ba62ff48 100644 --- a/Tactical/Handle Doors.cpp +++ b/Tactical/Handle Doors.cpp @@ -33,6 +33,7 @@ #include "GameSettings.h" #include "fresh_header.h" #include "connect.h" +#include #ifdef JA2UB #include "Explosion Control.h" @@ -1492,7 +1493,7 @@ void SetDoorString( INT32 sGridNo ) // ATE: If here, we try to say, opened or closed... if ( gfUIIntTileLocation2 == FALSE ) { -#ifdef GERMAN +if( g_lang == i18n::Lang::de ) { wcscpy( gzIntTileLocation2, TacticalStr[ DOOR_DOOR_MOUSE_DESCRIPTION ] ); gfUIIntTileLocation2 = TRUE; @@ -1535,7 +1536,7 @@ void SetDoorString( INT32 sGridNo ) gfUIIntTileLocation = TRUE; } } -#else +} else { // Try to get doors status here... pDoorStatus = GetDoorStatus( sGridNo ); @@ -1576,7 +1577,7 @@ void SetDoorString( INT32 sGridNo ) } } -#endif +} } } diff --git a/Tactical/Interface Enhanced.cpp b/Tactical/Interface Enhanced.cpp index f992338c..37fc0757 100644 --- a/Tactical/Interface Enhanced.cpp +++ b/Tactical/Interface Enhanced.cpp @@ -54,6 +54,7 @@ #include "Food.h" // added by Flugente #include "Multi Language Graphic Utils.h" +#include //forward declarations of common classes to eliminate includes class OBJECTTYPE; @@ -6586,11 +6587,11 @@ void DrawPropertyValueInColour( INT16 iValue, UINT8 ubNumLine, UINT8 ubNumRegion if( fPercentSign && wcscmp( pStr, L"--" ) != 0 && wcscmp( pStr, L"=" ) != 0 ) { - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } mprintf( usX, usY, pStr ); @@ -6681,11 +6682,11 @@ void DrawPropertyValueInColour_X( INT16 iValue, UINT8 numBullets, UINT8 ubNumLin if ( fPercentSign && wcscmp( pStr, L"--" ) != 0 && wcscmp( pStr, L"=" ) != 0 ) { -#ifdef CHINESE +if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); -#else +} else { wcscat( pStr, L"%" ); -#endif +} } mprintf( usX, usY, pStr ); @@ -10356,11 +10357,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"+%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if (iModifier[cnt2] < 0) { @@ -10368,11 +10369,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if( fComparisonMode ) { @@ -10484,11 +10485,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"+%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if (iModifier[cnt2] < 0) { @@ -10496,11 +10497,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if( fComparisonMode ) { @@ -10612,11 +10613,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"+%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if (iModifier[cnt2] < 0) { @@ -10624,11 +10625,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if( fComparisonMode ) { @@ -10745,11 +10746,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"+%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if (iModifier[cnt2] < 0) { @@ -10757,11 +10758,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if( fComparisonMode ) { @@ -10816,11 +10817,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"+%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if (iModifier[cnt2] < 0) { @@ -10828,11 +10829,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if( fComparisonMode && cnt2 != 1 ) { @@ -10888,11 +10889,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"+%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if (iModifier[cnt2] < 0) { @@ -10900,11 +10901,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if( fComparisonMode ) { @@ -10958,11 +10959,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"+%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if (iModifier[cnt2] < 0) { @@ -10970,11 +10971,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if( fComparisonMode ) { @@ -11027,11 +11028,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"+%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if (iModifier[cnt2] < 0) { @@ -11039,11 +11040,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if( fComparisonMode ) { @@ -11096,11 +11097,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"+%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if (iModifier[cnt2] < 0) { @@ -11108,11 +11109,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if( fComparisonMode ) { @@ -11520,11 +11521,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"+%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if (iModifier[cnt2] < 0) { @@ -11532,11 +11533,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if( fComparisonMode ) { @@ -11764,11 +11765,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"+%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if (iModifier[cnt2] < 0) { @@ -11776,11 +11777,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if( fComparisonMode ) { @@ -11833,11 +11834,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"+%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if (iModifier[cnt2] < 0) { @@ -11845,11 +11846,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if( fComparisonMode ) { @@ -11961,11 +11962,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"-%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if (iModifier[cnt2] < 0) { @@ -11973,11 +11974,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"+%d", abs(iModifier[cnt2]) ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if( fComparisonMode ) { @@ -12031,11 +12032,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"-%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if (iModifier[cnt2] < 0) { @@ -12043,11 +12044,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"+%d", abs(iModifier[cnt2]) ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if( fComparisonMode ) { @@ -12101,11 +12102,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"-%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if (iModifier[cnt2] < 0) { @@ -12113,11 +12114,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"+%d", abs(iModifier[cnt2]) ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if( fComparisonMode ) { @@ -12171,11 +12172,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"-%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if (iModifier[cnt2] < 0) { @@ -12183,11 +12184,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"+%d", abs(iModifier[cnt2]) ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if( fComparisonMode ) { @@ -12241,11 +12242,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"-%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if (iModifier[cnt2] < 0) { @@ -12253,11 +12254,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"+%d", abs(iModifier[cnt2]) ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if( fComparisonMode ) { @@ -12490,11 +12491,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if (iModifier[cnt2] > 0) { @@ -12502,11 +12503,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"+%d", abs(iModifier[cnt2]) ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if( fComparisonMode ) { @@ -12679,11 +12680,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"+%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if (iModifier[cnt2] < 0) { @@ -12691,11 +12692,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if( fComparisonMode ) { @@ -12749,11 +12750,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"+%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if (iModifier[cnt2] < 0) { @@ -12761,11 +12762,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if( fComparisonMode ) { @@ -12819,11 +12820,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"+%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if (iModifier[cnt2] < 0) { @@ -12831,11 +12832,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if( fComparisonMode ) { @@ -12889,11 +12890,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"+%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if (iModifier[cnt2] < 0) { @@ -12901,11 +12902,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if( fComparisonMode ) { @@ -12959,11 +12960,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"+%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if (iModifier[cnt2] < 0) { @@ -12971,11 +12972,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if( fComparisonMode ) { @@ -13029,11 +13030,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"+%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if (iModifier[cnt2] < 0) { @@ -13041,11 +13042,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if( fComparisonMode ) { @@ -13099,11 +13100,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"+%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if (iModifier[cnt2] < 0) { @@ -13111,11 +13112,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if( fComparisonMode ) { @@ -13169,11 +13170,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"+%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if (iModifier[cnt2] < 0) { @@ -13181,11 +13182,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if( fComparisonMode ) { @@ -13239,11 +13240,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"+%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if (iModifier[cnt2] < 0) { @@ -13251,11 +13252,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if( fComparisonMode ) { @@ -13309,11 +13310,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"+%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if (iModifier[cnt2] < 0) { @@ -13321,11 +13322,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if( fComparisonMode ) { @@ -13379,11 +13380,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"+%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if (iModifier[cnt2] < 0) { @@ -13391,11 +13392,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if( fComparisonMode ) { @@ -13449,11 +13450,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"+%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if (iModifier[cnt2] < 0) { @@ -13461,11 +13462,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%d", iModifier[cnt2] ); wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if( fComparisonMode ) { @@ -13538,11 +13539,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%4.2f", iFloatModifier[cnt2] ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if (iFloatModifier[cnt2] < 0) { @@ -13551,11 +13552,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%4.2f", iFloatModifier[cnt2] ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if( fComparisonMode ) { @@ -13615,11 +13616,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%4.2f", iFloatModifier[cnt2] ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if (iFloatModifier[cnt2] < 0) { @@ -13628,11 +13629,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%4.2f", iFloatModifier[cnt2] ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if( fComparisonMode ) { @@ -13692,11 +13693,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%4.0f", iFloatModifier[cnt2] ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if (iFloatModifier[cnt2] < 0) { @@ -13705,11 +13706,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%4.0f", iFloatModifier[cnt2] ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if( fComparisonMode ) { @@ -13769,11 +13770,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%4.0f", iFloatModifier[cnt2] ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if (iFloatModifier[cnt2] < 0) { @@ -13782,11 +13783,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%4.0f", iFloatModifier[cnt2] ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if( fComparisonMode ) { @@ -13843,11 +13844,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%4.2f", iFloatModifier[cnt2] ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if (iFloatModifier[cnt2] < 0) { @@ -13856,11 +13857,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%4.2f", iFloatModifier[cnt2] ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if( fComparisonMode ) { @@ -13917,11 +13918,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%4.2f", iFloatModifier[cnt2] ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if (iFloatModifier[cnt2] < 0) { @@ -13930,11 +13931,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%4.2f", iFloatModifier[cnt2] ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if( fComparisonMode ) { @@ -13988,11 +13989,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%4.2f", iFloatModifier[cnt2] ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if (iFloatModifier[cnt2] < 0) { @@ -14001,11 +14002,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%4.2f", iFloatModifier[cnt2] ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if( fComparisonMode ) { @@ -14059,11 +14060,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%4.2f", iFloatModifier[cnt2] ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if (iFloatModifier[cnt2] < 0) { @@ -14072,11 +14073,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%4.2f", iFloatModifier[cnt2] ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if( fComparisonMode ) { @@ -14130,11 +14131,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%4.2f", iFloatModifier[cnt2] ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if (iFloatModifier[cnt2] < 0) { @@ -14143,11 +14144,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%4.2f", iFloatModifier[cnt2] ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if( fComparisonMode ) { @@ -14211,11 +14212,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"+%4.2f", iFloatModifier[cnt2] ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if (iFloatModifier[cnt2] < 0) { @@ -14224,11 +14225,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%4.2f", iFloatModifier[cnt2] ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%" ); - #endif + } } else if( fComparisonMode ) { @@ -14594,11 +14595,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) if( !( fComparisonMode && iModifier[0] == 0 ) ) { wcscat( pStr, L"%" ); -#ifdef CHINESE +if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); -#else +} else { wcscat( pStr, L"%" ); -#endif +} } mprintf( usX, usY, pStr ); } diff --git a/Tactical/Interface Items.cpp b/Tactical/Interface Items.cpp index 78f7933d..87cc1279 100644 --- a/Tactical/Interface Items.cpp +++ b/Tactical/Interface Items.cpp @@ -82,6 +82,7 @@ #include "Sound Control.h" #include "Multi Language Graphic Utils.h" +#include #ifdef JA2UB #include "Ja25_Tactical.h" @@ -7409,11 +7410,11 @@ void RenderItemDescriptionBox( ) FindFontRightCoordinates( gODBItemDescRegions[0][0].sLeft, gODBItemDescRegions[0][0].sTop, gODBItemDescRegions[0][0].sRight - gODBItemDescRegions[0][0].sLeft, gODBItemDescRegions[0][0].sBottom - gODBItemDescRegions[0][0].sTop ,pStr, BLOCKFONT2, &usX, &usY); } - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { wcscat( pStr, ChineseSpecString1 ); - #else + } else { wcscat( pStr, L"%%" ); - #endif + } mprintf( usX, usY, pStr ); } @@ -11178,11 +11179,11 @@ void SetupPickupPage( INT8 bPage ) } else { - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { swprintf( pStr, ChineseSpecString3, sValue ); - #else + } else { swprintf( pStr, L"%d%%", sValue ); - #endif + } } SetRegionFastHelpText( &(gItemPickupMenu.Regions[ cnt - iStart ]), pStr ); diff --git a/Tactical/Interface Panels.cpp b/Tactical/Interface Panels.cpp index 13d9d2cb..5eb07868 100644 --- a/Tactical/Interface Panels.cpp +++ b/Tactical/Interface Panels.cpp @@ -73,6 +73,8 @@ //legion by Jazz #include "Interface Utils.h" +#include + //forward declarations of common classes to eliminate includes class OBJECTTYPE; class SOLDIERTYPE; @@ -2747,27 +2749,27 @@ void RenderSMPanel( BOOLEAN *pfDirty ) mprintf( SM_ARMOR_LABEL_X - StringPixLength( pInvPanelTitleStrings[0], BLOCKFONT2 ) / 2, SM_ARMOR_LABEL_Y, pInvPanelTitleStrings[ 0 ] ); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { mprintf( SM_ARMOR_PERCENT_X, SM_ARMOR_PERCENT_Y, ChineseSpecString1 ); - #else + } else { mprintf( SM_ARMOR_PERCENT_X, SM_ARMOR_PERCENT_Y, L"%%" ); - #endif + } mprintf( SM_WEIGHT_LABEL_X - StringPixLength( pInvPanelTitleStrings[1], BLOCKFONT2 ), SM_WEIGHT_LABEL_Y, pInvPanelTitleStrings[ 1 ] ); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { mprintf( SM_WEIGHT_PERCENT_X, SM_WEIGHT_PERCENT_Y, ChineseSpecString1 ); - #else + } else { mprintf( SM_WEIGHT_PERCENT_X, SM_WEIGHT_PERCENT_Y, L"%%" ); - #endif + } mprintf( SM_CAMMO_LABEL_X - StringPixLength( pInvPanelTitleStrings[2], BLOCKFONT2 ), SM_CAMMO_LABEL_Y, pInvPanelTitleStrings[ 2 ] ); - #ifdef CHINESE + if( g_lang == i18n::Lang::zh ) { mprintf( SM_CAMMO_PERCENT_X, SM_CAMMO_PERCENT_Y, ChineseSpecString1 ); - #else + } else { mprintf( SM_CAMMO_PERCENT_X, SM_CAMMO_PERCENT_Y, L"%%" ); - #endif + } UpdateStatColor( gpSMCurrentMerc->timeChanges.uiChangeAgilityTime, (BOOLEAN)(gpSMCurrentMerc->usValueGoneUp & AGIL_INCREASE ? TRUE : FALSE), (BOOLEAN)((gGameOptions.fNewTraitSystem && (gpSMCurrentMerc->ubCriticalStatDamage[DAMAGED_STAT_AGILITY] > 0)) ? TRUE : FALSE), gpSMCurrentMerc->bExtraAgility != 0 ); // SANDRO diff --git a/sgp/WinFont.cpp b/sgp/WinFont.cpp index 574235cf..0760c928 100644 --- a/sgp/WinFont.cpp +++ b/sgp/WinFont.cpp @@ -22,6 +22,7 @@ #include "font.h" #include "Font Control.h" #include "GameSettings.h" +#include #include @@ -353,7 +354,7 @@ INT32 CreateWinFont( LOGFONT &logfont ) HDC hdc = GetDC(NULL); SelectObject(hdc, hFont); -#ifdef CHINESE +if(g_lang == i18n::Lang::zh) { SIZE RectSize; wchar_t str[2]=L"\1"; for (int i = 1; i<0x80; i++) @@ -365,7 +366,7 @@ INT32 CreateWinFont( LOGFONT &logfont ) str[0] = L'啊'; GetTextExtentPoint32W( hdc, str, 1, &RectSize ); WinFonts[iFont].Width[0] = (UINT8)RectSize.cx; -#endif +} TEXTMETRIC tm; GetTextMetrics(hdc, &tm); @@ -467,7 +468,7 @@ INT16 WinFontStringPixLength( STR16 string2, INT32 iFont ) if (pWinFont == NULL) return(0); -#ifdef CHINESE +if(g_lang == i18n::Lang::zh) { wchar_t *p=string2; UINT32 size = 0; while (*p!=0) @@ -482,7 +483,7 @@ INT16 WinFontStringPixLength( STR16 string2, INT32 iFont ) p++; } return size; -#else +} else { SIZE RectSize; HDC hdc = GetDC(NULL); @@ -491,7 +492,7 @@ INT16 WinFontStringPixLength( STR16 string2, INT32 iFont ) ReleaseDC(NULL, hdc); return( (INT16)RectSize.cx ); -#endif +} } @@ -502,11 +503,11 @@ INT16 GetWinFontHeight(INT32 iFont) pWinFont = GetWinFont(iFont); if (pWinFont == NULL) return(0); -#ifdef CHINESE //zwwooooo: Correct tactical interface font height to fixed Chinese characters smearing bug +if(g_lang == i18n::Lang::zh) { //zwwooooo: Correct tactical interface font height to fixed Chinese characters smearing bug if (iFont == WinFontMap[TINYFONT1] || iFont == WinFontMap[SMALLFONT1] || iFont == WinFontMap[FONT14ARIAL]) { return pWinFont->Height + 2; } -#endif +} return pWinFont->Height; } diff --git a/sgp/sgp.cpp b/sgp/sgp.cpp index de26331d..be1fcf5a 100644 --- a/sgp/sgp.cpp +++ b/sgp/sgp.cpp @@ -58,6 +58,7 @@ #endif #include +#include static void MAGIC(std::string const& aarrrrgggh = "") {} @@ -858,13 +859,13 @@ int PASCAL HandledWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR pC } #endif -# ifdef ENGLISH + if( g_lang == i18n::Lang::en ) { try { SetIntroType( INTRO_SPLASH ); } HANDLE_FATAL_ERROR; -# endif + } gfApplicationActive = TRUE; gfProgramIsRunning = TRUE;