mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Slightly less straightforward CHINESE conversion in Interface Items.cpp
A bit clunkier, had to repeat function calls because of how preprocessor tricks don't map 1:1 with actual C++.
This commit is contained in:
+174
-52
@@ -12281,12 +12281,28 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
|
||||
|
||||
if ( gGameExternalOptions.fAdvRepairSystem && sThreshold < 100 )
|
||||
{
|
||||
#ifdef CHINESE
|
||||
if( g_lang == i18n::Lang::zh ) {
|
||||
swprintf( pStr, ChineseSpecString11,
|
||||
#else
|
||||
ItemNames[ usItem ],
|
||||
AmmoCaliber[ Weapon[ usItem ].ubCalibre ],
|
||||
sValue,
|
||||
sThreshold,
|
||||
gWeaponStatsDesc[ 9 ], //Accuracy String
|
||||
accuracy,
|
||||
gWeaponStatsDesc[ 11 ], //Damage String
|
||||
GetDamage(pObject),
|
||||
gWeaponStatsDesc[ 10 ], //Range String
|
||||
gGameSettings.fOptions[ TOPTION_SHOW_WEAPON_RANGE_IN_TILES ] ? GunRange( pObject, NULL )/10 : GunRange( pObject, NULL ), // SANDRO - added argument //Modified Range
|
||||
gGameSettings.fOptions[ TOPTION_SHOW_WEAPON_RANGE_IN_TILES ] ? GetModifiedGunRange(usItem)/10 : GetModifiedGunRange(usItem), //Gun Range
|
||||
gWeaponStatsDesc[ 6 ], //AP String
|
||||
(Weapon[ usItem ].ubReadyTime * (100 - GetPercentReadyTimeAPReduction( pObject )) / 100), // Ready AP's
|
||||
apStr, //AP's
|
||||
gWeaponStatsDesc[ 12 ], //Weight String
|
||||
fWeight, //Weight
|
||||
GetWeightUnitString() //Weight units
|
||||
);
|
||||
} else {
|
||||
swprintf( pStr, L"%s (%s) [%d%%(%d%%)]\n%s %d\n%s %d\n%s %d (%d)\n%s (%d) %s\n%s %1.1f %s",
|
||||
#endif
|
||||
|
||||
ItemNames[ usItem ],
|
||||
AmmoCaliber[ Weapon[ usItem ].ubCalibre ],
|
||||
sValue,
|
||||
@@ -12305,16 +12321,12 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
|
||||
fWeight, //Weight
|
||||
GetWeightUnitString() //Weight units
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef CHINESE
|
||||
if( g_lang == i18n::Lang::zh ) {
|
||||
swprintf( pStr, ChineseSpecString4,
|
||||
#else
|
||||
swprintf( pStr, L"%s (%s) [%d%%]\n%s %d\n%s %d\n%s %d (%d)\n%s (%d) %s\n%s %1.1f %s",
|
||||
#endif
|
||||
|
||||
|
||||
ItemNames[ usItem ],
|
||||
AmmoCaliber[ Weapon[ usItem ].ubCalibre ],
|
||||
sValue,
|
||||
@@ -12332,6 +12344,28 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
|
||||
fWeight, //Weight
|
||||
GetWeightUnitString() //Weight units
|
||||
);
|
||||
} else {
|
||||
|
||||
swprintf( pStr, L"%s (%s) [%d%%]\n%s %d\n%s %d\n%s %d (%d)\n%s (%d) %s\n%s %1.1f %s",
|
||||
ItemNames[ usItem ],
|
||||
AmmoCaliber[ Weapon[ usItem ].ubCalibre ],
|
||||
sValue,
|
||||
gWeaponStatsDesc[ 9 ], //Accuracy String
|
||||
accuracy,
|
||||
gWeaponStatsDesc[ 11 ], //Damage String
|
||||
GetDamage(pObject),
|
||||
gWeaponStatsDesc[ 10 ], //Range String
|
||||
gGameSettings.fOptions[ TOPTION_SHOW_WEAPON_RANGE_IN_TILES ] ? GunRange( pObject, NULL )/10 : GunRange( pObject, NULL ), // SANDRO - added argument //Modified Range
|
||||
gGameSettings.fOptions[ TOPTION_SHOW_WEAPON_RANGE_IN_TILES ] ? GetModifiedGunRange(usItem)/10 : GetModifiedGunRange(usItem), //Gun Range
|
||||
gWeaponStatsDesc[ 6 ], //AP String
|
||||
(Weapon[ usItem ].ubReadyTime * (100 - GetPercentReadyTimeAPReduction( pObject )) / 100), // Ready AP's
|
||||
apStr, //AP's
|
||||
gWeaponStatsDesc[ 12 ], //Weight String
|
||||
fWeight, //Weight
|
||||
GetWeightUnitString() //Weight units
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -12380,12 +12414,8 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
|
||||
|
||||
if ( gGameExternalOptions.fAdvRepairSystem && sThreshold < 100 )
|
||||
{
|
||||
#ifdef CHINESE
|
||||
if( g_lang == i18n::Lang::zh ) {
|
||||
swprintf( pStr, L"%s [%d%£¥(%d%£¥)]\n%s %d\n%s %d\n%s %d (%d)\n%s (%d) %s\n%s %1.1f %s",
|
||||
#else
|
||||
swprintf( pStr, L"%s [%d%%(%d%%)]\n%s %d\n%s %d\n%s %d (%d)\n%s (%d) %s\n%s %1.1f %s",
|
||||
#endif
|
||||
|
||||
ItemNames[ usItem ],
|
||||
sValue,
|
||||
sThreshold,
|
||||
@@ -12403,15 +12433,31 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
|
||||
fWeight, //Weight
|
||||
GetWeightUnitString() //Weight units
|
||||
);
|
||||
} else {
|
||||
swprintf( pStr, L"%s [%d%%(%d%%)]\n%s %d\n%s %d\n%s %d (%d)\n%s (%d) %s\n%s %1.1f %s",
|
||||
ItemNames[ usItem ],
|
||||
sValue,
|
||||
sThreshold,
|
||||
gWeaponStatsDesc[ 9 ], //Accuracy String
|
||||
accuracy,
|
||||
gWeaponStatsDesc[ 11 ], //Damage String
|
||||
GetDamage(pObject),
|
||||
gWeaponStatsDesc[ 10 ], //Range String
|
||||
gGameSettings.fOptions[ TOPTION_SHOW_WEAPON_RANGE_IN_TILES ] ? GunRange( pObject, NULL )/10 : GunRange( pObject, NULL ), // SANDRO - added argument //Modified Range
|
||||
gGameSettings.fOptions[ TOPTION_SHOW_WEAPON_RANGE_IN_TILES ] ? GetModifiedGunRange(usItem)/10 : GetModifiedGunRange(usItem), //Gun Range
|
||||
gWeaponStatsDesc[ 6 ], //AP String
|
||||
(Weapon[ usItem ].ubReadyTime * (100 - GetPercentReadyTimeAPReduction( pObject )) / 100), // Ready AP's
|
||||
apStr, //AP's
|
||||
gWeaponStatsDesc[ 12 ], //Weight String
|
||||
fWeight, //Weight
|
||||
GetWeightUnitString() //Weight units
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef CHINESE
|
||||
if( g_lang == i18n::Lang::zh ) {
|
||||
swprintf( pStr, L"%s [%d%£¥]\n%s %d\n%s %d\n%s %d (%d)\n%s (%d) %s\n%s %1.1f %s",
|
||||
#else
|
||||
swprintf( pStr, L"%s [%d%%]\n%s %d\n%s %d\n%s %d (%d)\n%s (%d) %s\n%s %1.1f %s",
|
||||
#endif
|
||||
|
||||
ItemNames[ usItem ],
|
||||
sValue,
|
||||
gWeaponStatsDesc[ 9 ], //Accuracy String
|
||||
@@ -12428,6 +12474,25 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
|
||||
fWeight, //Weight
|
||||
GetWeightUnitString() //Weight units
|
||||
);
|
||||
} else {
|
||||
swprintf( pStr, L"%s [%d%%]\n%s %d\n%s %d\n%s %d (%d)\n%s (%d) %s\n%s %1.1f %s",
|
||||
ItemNames[ usItem ],
|
||||
sValue,
|
||||
gWeaponStatsDesc[ 9 ], //Accuracy String
|
||||
accuracy,
|
||||
gWeaponStatsDesc[ 11 ], //Damage String
|
||||
GetDamage(pObject),
|
||||
gWeaponStatsDesc[ 10 ], //Range String
|
||||
gGameSettings.fOptions[ TOPTION_SHOW_WEAPON_RANGE_IN_TILES ] ? GunRange( pObject, NULL )/10 : GunRange( pObject, NULL ), // SANDRO - added argument //Modified Range
|
||||
gGameSettings.fOptions[ TOPTION_SHOW_WEAPON_RANGE_IN_TILES ] ? GetModifiedGunRange(usItem)/10 : GetModifiedGunRange(usItem), //Gun Range
|
||||
gWeaponStatsDesc[ 6 ], //AP String
|
||||
(Weapon[ usItem ].ubReadyTime * (100 - GetPercentReadyTimeAPReduction( pObject )) / 100), // Ready AP's
|
||||
apStr, //AP's
|
||||
gWeaponStatsDesc[ 12 ], //Weight String
|
||||
fWeight, //Weight
|
||||
GetWeightUnitString() //Weight units
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -12438,13 +12503,9 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
|
||||
{
|
||||
if ( gGameExternalOptions.fAdvRepairSystem && sThreshold < 100 )
|
||||
{
|
||||
#ifdef CHINESE
|
||||
if( g_lang == i18n::Lang::zh ) {
|
||||
swprintf( pStr, ChineseSpecString9,
|
||||
#else
|
||||
swprintf( pStr, L"%s [%d%%(%d%%)]\n%s %d\n%s %d\n%s %1.1f %s",
|
||||
#endif
|
||||
|
||||
ItemNames[ usItem ],
|
||||
ItemNames[ usItem ],
|
||||
sValue,
|
||||
sThreshold,
|
||||
gWeaponStatsDesc[ 11 ], //Damage String
|
||||
@@ -12455,16 +12516,26 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
|
||||
fWeight, //Weight
|
||||
GetWeightUnitString() //Weight units
|
||||
);
|
||||
} else {
|
||||
swprintf( pStr, L"%s [%d%%(%d%%)]\n%s %d\n%s %d\n%s %1.1f %s",
|
||||
ItemNames[ usItem ],
|
||||
sValue,
|
||||
sThreshold,
|
||||
gWeaponStatsDesc[ 11 ], //Damage String
|
||||
GetDamage(pObject), //Melee damage
|
||||
gWeaponStatsDesc[ 6 ], //AP String
|
||||
BaseAPsToShootOrStab( APBPConstants[DEFAULT_APS], APBPConstants[DEFAULT_AIMSKILL], pObject, pSoldier ), //AP's
|
||||
gWeaponStatsDesc[ 12 ], //Weight String
|
||||
fWeight, //Weight
|
||||
GetWeightUnitString() //Weight units
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef CHINESE
|
||||
if( g_lang == i18n::Lang::zh ) {
|
||||
swprintf( pStr, ChineseSpecString5,
|
||||
#else
|
||||
swprintf( pStr, L"%s [%d%%]\n%s %d\n%s %d\n%s %1.1f %s",
|
||||
#endif
|
||||
|
||||
ItemNames[ usItem ],
|
||||
ItemNames[ usItem ],
|
||||
sValue,
|
||||
gWeaponStatsDesc[ 11 ], //Damage String
|
||||
GetDamage(pObject), //Melee damage
|
||||
@@ -12474,6 +12545,19 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
|
||||
fWeight, //Weight
|
||||
GetWeightUnitString() //Weight units
|
||||
);
|
||||
} else {
|
||||
swprintf( pStr, L"%s [%d%%]\n%s %d\n%s %d\n%s %1.1f %s",
|
||||
ItemNames[ usItem ],
|
||||
sValue,
|
||||
gWeaponStatsDesc[ 11 ], //Damage String
|
||||
GetDamage(pObject), //Melee damage
|
||||
gWeaponStatsDesc[ 6 ], //AP String
|
||||
BaseAPsToShootOrStab( APBPConstants[DEFAULT_APS], APBPConstants[DEFAULT_AIMSKILL], pObject, pSoldier ), //AP's
|
||||
gWeaponStatsDesc[ 12 ], //Weight String
|
||||
fWeight, //Weight
|
||||
GetWeightUnitString() //Weight units
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -12513,13 +12597,9 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
|
||||
UINT16 explDamage = (UINT16) GetModifiedExplosiveDamage( Explosive[Item[ usItem ].ubClassIndex].ubDamage, 0 );
|
||||
UINT16 explStunDamage = (UINT16) GetModifiedExplosiveDamage( Explosive[Item[ usItem ].ubClassIndex].ubStunDamage, 1 );
|
||||
|
||||
#ifdef CHINESE
|
||||
if( g_lang == i18n::Lang::zh ) {
|
||||
swprintf( pStr, ChineseSpecString5,
|
||||
#else
|
||||
swprintf( pStr, L"%s [%d%%]\n%s %d\n%s %d\n%s %1.1f %s",
|
||||
#endif
|
||||
|
||||
ItemNames[ usItem ],
|
||||
ItemNames[ usItem ],
|
||||
sValue,
|
||||
gWeaponStatsDesc[ 11 ], //Damage String
|
||||
explDamage,
|
||||
@@ -12529,6 +12609,19 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
|
||||
fWeight, //Weight
|
||||
GetWeightUnitString() //Weight units
|
||||
);
|
||||
} else {
|
||||
swprintf( pStr, L"%s [%d%%]\n%s %d\n%s %d\n%s %1.1f %s",
|
||||
ItemNames[ usItem ],
|
||||
sValue,
|
||||
gWeaponStatsDesc[ 11 ], //Damage String
|
||||
explDamage,
|
||||
gWeaponStatsDesc[ 13 ], //Stun Damage String
|
||||
explStunDamage, //Stun Damage
|
||||
gWeaponStatsDesc[ 12 ], //Weight String
|
||||
fWeight, //Weight
|
||||
GetWeightUnitString() //Weight units
|
||||
);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -12558,12 +12651,8 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
|
||||
|
||||
if ( gGameExternalOptions.fAdvRepairSystem && sThreshold < 100 )
|
||||
{
|
||||
#ifdef CHINESE
|
||||
if( g_lang == i18n::Lang::zh ) {
|
||||
swprintf( pStr, ChineseSpecString10,
|
||||
#else
|
||||
swprintf( pStr, L"%s [%d%%(%d%%)]\n%s %d%% (%d/%d)\n%s %d%%\n%s %1.1f %s",
|
||||
#endif
|
||||
|
||||
ItemNames[ usItem ], //Item long name
|
||||
sValue, //Item condition
|
||||
sThreshold, //repair threshold
|
||||
@@ -12577,15 +12666,27 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
|
||||
fWeight, //Weight
|
||||
GetWeightUnitString() //Weight units
|
||||
);
|
||||
} else {
|
||||
swprintf( pStr, L"%s [%d%%(%d%%)]\n%s %d%% (%d/%d)\n%s %d%%\n%s %1.1f %s",
|
||||
ItemNames[ usItem ], //Item long name
|
||||
sValue, //Item condition
|
||||
sThreshold, //repair threshold
|
||||
pInvPanelTitleStrings[ 4 ], //Protection string
|
||||
iProtection, //Protection rating in % based on best armor
|
||||
Armour[ Item[ usItem ].ubClassIndex ].ubProtection * sValue / 100,
|
||||
Armour[ Item[ usItem ].ubClassIndex ].ubProtection, //Protection (raw data)
|
||||
pInvPanelTitleStrings[ 3 ], //Camo string
|
||||
GetCamoBonus(pObject)+GetUrbanCamoBonus(pObject)+GetDesertCamoBonus(pObject)+GetSnowCamoBonus(pObject), //Camo bonus
|
||||
gWeaponStatsDesc[ 12 ], //Weight string
|
||||
fWeight, //Weight
|
||||
GetWeightUnitString() //Weight units
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef CHINESE
|
||||
if( g_lang == i18n::Lang::zh ) {
|
||||
swprintf( pStr, ChineseSpecString6,
|
||||
#else
|
||||
swprintf( pStr, L"%s [%d%%]\n%s %d%% (%d/%d)\n%s %d%%\n%s %1.1f %s",
|
||||
#endif
|
||||
|
||||
ItemNames[ usItem ], //Item long name
|
||||
sValue, //Item condition
|
||||
pInvPanelTitleStrings[ 4 ], //Protection string
|
||||
@@ -12598,6 +12699,21 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
|
||||
fWeight, //Weight
|
||||
GetWeightUnitString() //Weight units
|
||||
);
|
||||
} else {
|
||||
swprintf( pStr, L"%s [%d%%]\n%s %d%% (%d/%d)\n%s %d%%\n%s %1.1f %s",
|
||||
ItemNames[ usItem ], //Item long name
|
||||
sValue, //Item condition
|
||||
pInvPanelTitleStrings[ 4 ], //Protection string
|
||||
iProtection, //Protection rating in % based on best armor
|
||||
Armour[ Item[ usItem ].ubClassIndex ].ubProtection * sValue / 100,
|
||||
Armour[ Item[ usItem ].ubClassIndex ].ubProtection, //Protection (raw data)
|
||||
pInvPanelTitleStrings[ 3 ], //Camo string
|
||||
GetCamoBonus(pObject)+GetUrbanCamoBonus(pObject)+GetDesertCamoBonus(pObject)+GetSnowCamoBonus(pObject), //Camo bonus
|
||||
gWeaponStatsDesc[ 12 ], //Weight string
|
||||
fWeight, //Weight
|
||||
GetWeightUnitString() //Weight units
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -12610,17 +12726,23 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
|
||||
default:
|
||||
{
|
||||
// The final, and typical case, is that of an item with a percent status
|
||||
#ifdef CHINESE
|
||||
if( g_lang == i18n::Lang::zh ) {
|
||||
swprintf( pStr, ChineseSpecString7,
|
||||
#else
|
||||
swprintf( pStr, L"%s [%d%%]\n%s %1.1f %s",
|
||||
#endif
|
||||
ItemNames[ usItem ], //Item long name
|
||||
sValue, //Item condition
|
||||
gWeaponStatsDesc[ 12 ], //Weight String
|
||||
fWeight, //Weight
|
||||
GetWeightUnitString() //Weight units
|
||||
);
|
||||
} else {
|
||||
swprintf( pStr, L"%s [%d%%]\n%s %1.1f %s",
|
||||
ItemNames[ usItem ], //Item long name
|
||||
sValue, //Item condition
|
||||
gWeaponStatsDesc[ 12 ], //Weight String
|
||||
fWeight, //Weight
|
||||
GetWeightUnitString() //Weight units
|
||||
);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user