jrbudda / KerbalEngineer

Kerbal Engineer v1.0 (current in-development build).
241 stars 30 forks source link

Using name and not displayname #37

Open Gameslinx opened 5 years ago

Gameslinx commented 5 years ago

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.

jrbudda commented 5 years ago

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 commented 5 years ago

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

Gameslinx commented 5 years ago

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!

Poodmund commented 5 years ago

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

jrbudda commented 5 years ago

I will test that for the 1.7 update.

Sigma88 commented 4 years ago

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