KerbalEngineer icon indicating copy to clipboard operation
KerbalEngineer copied to clipboard

Using name and not displayname

Open Gameslinx opened this issue 5 years ago • 6 comments

Hey.

Kerbal Engineer's biome readout is reporting the "name" of the biome and not the "displayname", which means any biomes that have names "Biome1, Biome2, Biome3 etc" shows up on KER, whereas it should be using the displayname.

This help for localisation in mods, specifically planet mods. Without using displayName, localisation of biome names is impossible. Would it be possible to update KER to use biome displayNames?

Cheers.

Gameslinx avatar Mar 18 '19 21:03 Gameslinx

I'll have to do some testing. The biome readout uses an odd API call ScienceUtil.GetExperiemntBiome. I seem to recall changing that at one point to something more straightforward and it not working correctly for some mod-added biomes. I will look into it and thanks for bringing it to my attention.

jrbudda avatar Mar 19 '19 00:03 jrbudda

What mod specifically are you getting Biome1, etc, on so I can test it?

jrbudda avatar Mar 20 '19 23:03 jrbudda

Beyond Home, on the planet Kohm. I use displayName for the actual names and name for the internal names (usually A, B, C, D and so on), but this could be applied for localisation too. Thanks for looking into it!

Gameslinx avatar Mar 21 '19 00:03 Gameslinx

It may just be a case of substituting in:

ScienceUtil.GetBiomedisplayName instead of the current ScienceUtil.GetExperimentBiome

Where:

public static string GetBiomedisplayName(CelestialBody body, string biome)
	{
		return ScienceUtil.GetBiomedisplayName(body, biome, true);
	}

The final bool is true if the Localization string is returned from a #LOC tag. Quite a few of the more in-depth planet packs/mods utlize the localization entries for the displaying of these biome names but some of the smaller or older mods do not.

https://kerbalspaceprogram.com/api/class_science_util.html#a00a7763f63572b590f4164bb8782d4d6

Poodmund avatar Apr 08 '19 22:04 Poodmund

I will test that for the 1.7 update.

jrbudda avatar Apr 09 '19 00:04 jrbudda

Planets also could use the same treatment, right now some planet packs use "displayName" to rename Kerbin to other names (eg: Nodens) so the name "Kerbin" shows up in the editor window rather than the correct name

Sigma88 avatar Jan 28 '20 10:01 Sigma88