Skip to content

Commit

Permalink
Merge pull request #58 from Sigma88/displayName
Browse files Browse the repository at this point in the history
use displayname rather than name
  • Loading branch information
jrbudda authored Jul 1, 2020
2 parents e73888e + d8b6eda commit d62e753
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions KerbalEngineer/CelestialBodies.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ static CelestialBodies()
try
{
SystemBody = new BodyInfo(PSystemManager.Instance.localBodies.Find(b => b.referenceBody == null || b.referenceBody == b));
String homeCBName = Planetarium.fetch.Home.bodyName;
String homeCBName = Planetarium.fetch.Home.bodyDisplayName.LocalizeRemoveGender();
if (!SetSelectedBody(homeCBName))
{
SelectedBody = SystemBody;
Expand Down Expand Up @@ -104,7 +104,7 @@ public BodyInfo(CelestialBody body, BodyInfo parent = null)
{
// Set the body information.
CelestialBody = body;
Name = body.bodyName;
Name = body.bodyDisplayName.LocalizeRemoveGender();
Gravity = 9.81 * body.GeeASL;
Parent = parent;

Expand Down
2 changes: 1 addition & 1 deletion KerbalEngineer/Flight/Readouts/Body/BodyName.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public override void Draw(Unity.Flight.ISectionModule section) {
if (FlightGlobals.ActiveVessel.mainBody == null)
DrawLine("N/A", section.IsHud);
else
DrawLine(FlightGlobals.ActiveVessel.mainBody.bodyName, section.IsHud);
DrawLine(FlightGlobals.ActiveVessel.mainBody.bodyDisplayName.LocalizeRemoveGender(), section.IsHud);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -534,9 +534,9 @@ public static string nameForTargetable(ITargetable tgt) {
mo = ((global::Vessel)tgt).mapObject;

if (mo == null || mo.Discoverable == null)
return Localizer.Format("<<1>>", tgt.GetDisplayName());
return Localizer.Format("<<1>>", tgt.GetDisplayName().LocalizeRemoveGender());
else
return Localizer.Format("<<1>>", mo.GetDisplayName());
return Localizer.Format("<<1>>", mo.GetDisplayName().LocalizeRemoveGender());
}

private double CalcInterceptAngle(Orbit targetOrbit, Orbit originOrbit) {
Expand Down
16 changes: 8 additions & 8 deletions KerbalEngineer/Flight/Readouts/Rendezvous/TargetSelector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,12 @@ private int DrawMoons() {
continue;
}

if (this.searchQuery.Length > 0 && !body.bodyName.ToLower().Contains(this.searchQuery)) {
if (this.searchQuery.Length > 0 && !body.bodyDisplayName.LocalizeRemoveGender().ToLower().Contains(this.searchQuery)) {
continue;
}

count++;
if (GUILayout.Button(body.bodyName, this.ButtonStyle, GUILayout.Width(this.ContentWidth))) {
if (GUILayout.Button(body.bodyDisplayName.LocalizeRemoveGender(), this.ButtonStyle, GUILayout.Width(this.ContentWidth))) {
this.SetTargetAs(body);
}
}
Expand All @@ -136,12 +136,12 @@ private int DrawPlanets() {
continue;
}

if (this.searchQuery.Length > 0 && !body.bodyName.ToLower().Contains(this.searchQuery)) {
if (this.searchQuery.Length > 0 && !body.bodyDisplayName.LocalizeRemoveGender().ToLower().Contains(this.searchQuery)) {
continue;
}

count++;
if (GUILayout.Button(body.GetName(), this.ButtonStyle, GUILayout.Width(this.ContentWidth))) {
if (GUILayout.Button(body.GetDisplayName().LocalizeRemoveGender(), this.ButtonStyle, GUILayout.Width(this.ContentWidth))) {
this.SetTargetAs(body);
}
}
Expand Down Expand Up @@ -268,14 +268,14 @@ private void DrawTarget(Unity.Flight.ISectionModule section) {

if (RendezvousProcessor.sourceDisplay != null) {
if (RendezvousProcessor.landedSamePlanet || RendezvousProcessor.overrideANDN)
this.DrawLine("Ref Orbit", "Landed on " + RendezvousProcessor.activeVessel.GetOrbit().referenceBody.GetName(), section.IsHud);
this.DrawLine("Ref Orbit", "Landed on " + RendezvousProcessor.activeVessel.GetOrbit().referenceBody.GetDisplayName().LocalizeRemoveGender(), section.IsHud);
else
this.DrawLine("Ref Orbit", RendezvousProcessor.sourceDisplay, section.IsHud);
}

if (RendezvousProcessor.targetDisplay != null) {
if (RendezvousProcessor.landedSamePlanet || RendezvousProcessor.overrideANDNRev)
this.DrawLine("Target Orbit", "Landed on " + target.GetOrbit().referenceBody.GetName(), section.IsHud);
this.DrawLine("Target Orbit", "Landed on " + target.GetOrbit().referenceBody.GetDisplayName().LocalizeRemoveGender(), section.IsHud);
else
this.DrawLine("Target Orbit", RendezvousProcessor.targetDisplay, section.IsHud);
}
Expand Down Expand Up @@ -394,12 +394,12 @@ private int DrawVessels() {
if (this.searchQuery.Length == 0) {
count++;

if (GUILayout.Button(vessel.GetName(), this.ButtonStyle, GUILayout.Width(this.ContentWidth))) {
if (GUILayout.Button(vessel.GetDisplayName().LocalizeRemoveGender(), this.ButtonStyle, GUILayout.Width(this.ContentWidth))) {
this.SetTargetAs(vessel);
}
} else if (vessel.vesselName.ToLower().Contains(this.searchQuery)) {
count++;
if (GUILayout.Button(vessel.GetName(), this.ButtonStyle, GUILayout.Width(this.ContentWidth))) {
if (GUILayout.Button(vessel.GetDisplayName().LocalizeRemoveGender(), this.ButtonStyle, GUILayout.Width(this.ContentWidth))) {
this.SetTargetAs(vessel);
}
}
Expand Down
2 changes: 1 addition & 1 deletion KerbalEngineer/Flight/Readouts/Surface/Situation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ private static string GetBiome()

private static string GetBodyPlural()
{
return FlightGlobals.currentMainBody.bodyName.EndsWith("s") ? FlightGlobals.currentMainBody.bodyName + "\'" : FlightGlobals.currentMainBody.bodyName + "\'s";
return FlightGlobals.currentMainBody.bodyDisplayName.LocalizeRemoveGender().EndsWith("s") ? FlightGlobals.currentMainBody.bodyDisplayName.LocalizeRemoveGender() + "\'" : FlightGlobals.currentMainBody.bodyDisplayName.LocalizeRemoveGender() + "\'s";
}

#endregion
Expand Down

0 comments on commit d62e753

Please sign in to comment.