Skip to content

Commit

Permalink
Merge pull request #3378 from CombatExtended-Continued/GenericProjLab…
Browse files Browse the repository at this point in the history
…elOverride

generic projectile label override
  • Loading branch information
N7Huntsman authored Sep 8, 2024
2 parents e1e6043 + bd89e94 commit c7386a7
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions Defs/Ammo/Pistols/45ACP.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
<dropsCasings>true</dropsCasings>
<casingMoteDefname>Fleck_PistolAmmoCasings</casingMoteDefname>
<casingFilthDefname>Filth_PistolAmmoCasings</casingFilthDefname>
<genericLabelOverride>pistol</genericLabelOverride>
</projectile>
</ThingDef>

Expand Down
3 changes: 2 additions & 1 deletion Languages/English/Keyed/Keys.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,12 @@
<!-- Ranged Attack -->
<CE_OutOfBounds>Out of bounds</CE_OutOfBounds>
<CE_NoSelfTarget>Can't target self</CE_NoSelfTarget>
<CE_NoLoS>No line of sight</CE_NoLoS>
<CE_NoLoS>No line of sight</CE_NoLoS>
<CE_BlockedRoof>Blocked by roof</CE_BlockedRoof>
<CE_BlockedShield>Shooting disallowed by </CE_BlockedShield>
<CE_BlockedMaxRange>Outside of range</CE_BlockedMaxRange>
<CE_BlockedMinRange>Within minimum range</CE_BlockedMinRange>
<CE_GenericBullet>bullet</CE_GenericBullet>

<!-- Artillery -->
<CE_ArtilleryTarget_Distance>Distance: {0}/{1} Tiles</CE_ArtilleryTarget_Distance>
Expand Down
3 changes: 2 additions & 1 deletion Source/CombatExtended/CombatExtended/AmmoGeneralizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ static AmmoGeneralizer()
var sameClass = ammoSource.ammoTypes.Find(x => x.ammo.ammoClass == link.ammo.ammoClass);
if (sameClass != null)
{
link.projectile.label = ammoSource.label + " bullet " + "(" + link.ammo.ammoClass.labelShort + ")";
string labelNew = (link.projectile.projectile is ProjectilePropertiesCE projPropCE && projPropCE.genericLabelOverride != null) ? projPropCE.genericLabelOverride : ammoSource.label;
link.projectile.label = labelNew + " " + "CE_GenericBullet".Translate() + " (" + link.ammo.ammoClass.labelShort + ")";
newAmmos.Add(new AmmoLink { ammo = sameClass.ammo, projectile = link.projectile });
}

Expand Down
1 change: 1 addition & 0 deletions Source/CombatExtended/CombatExtended/Defs/AmmoDef.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ public List<AmmoSetDef> AmmoSetDefs
}
}

[NoTranslate]
private string oldDescription;
public void AddDescriptionParts()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ public class ProjectilePropertiesCE : ProjectileProperties
public ThingDef detonateMoteDef;
public FleckDef detonateFleckDef;
public float detonateEffectsScaleOverride = -1;
[MustTranslate]
public string genericLabelOverride = null;

#region Bunker Buster fields
/// <summary>
Expand Down

0 comments on commit c7386a7

Please sign in to comment.