Jump to content

WorldTrait icon is unused, possible modding issues


Aki Art
  • Branch: Live Branch Version: Windows Pending

WorldTrait has an icon property, but it is unused, and modded world traits have difficulties providing the proper icons.

Instead the game uses WorldTrait.filePath.Substring(cachedWorldTrait.filePath.LastIndexOf("/") + 1) in it's UI-s to over and over calculate an expected icon name. This happens in AsteroidDescriptorPanel.cs, ColonyDestinationAsteroidBeltData.cs and SimpleInfoScreen.cs.
This means mods efforts to namespace their own added traits are discarded, leading to potentially colliding icon names.

It was also very confusing why my configured icon kept showing up as an empty rectangle, since the expectation was that the icon field sets the icon.

Here for example, the trait "traits/Beached/CrystalGeodes" expects a "CrystalGeodes" icon. If another mod, or in a future update Klei decided to add a "CrystalGeodes" trait, it would clash.

image.png.63e9e5b5281d1328488f37f53485d195.png

Expected behavior:

name: Beached.STRINGS.WORLD_TRAITS.CRYSTAL_GEODES.NAME
description: Beached.STRINGS.WORLD_TRAITS.CRYSTAL_GEODES.DESCRIPTION
colorHex: ffb3ec
icon: Beached_WorldTrait_CrystalGeodes

traitTags:
  - LargeWorld
  
additionalWorldTemplateRules:
  - ...

"Beached_WorldTrait_CrystalGeodes" icon should be used as the icon, not "CrystalGeodes". The working screenshot above uses the problematic "CrystalGeodes".

The file path should only be a fallback, not the default.


Steps to Reproduce

- Add a trait

- Define an "icon" YAML property

- The icon will not be used, instead the yamls original filename is the expected sprite asset.




User Feedback


There are no comments to display.



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
  • Create New...