jrossignol / Strategia

MIT License
8 stars 16 forks source link

Allow portraits to be replaced by static images #89

Closed jrossignol closed 3 years ago

jrossignol commented 3 years ago

Here's what I had in the CH-4 discord:

So the kerbals (called "instructors" in the code) are a GameObject that has their own little scene and would be a huge PITA to do a replacement. There's a headImage in the config, but it never gets used. But it does look like there's a hacky way. Normally it'll grab a camera from the instructor object and dump it to a render texture, but you should just be able to swap in a regular texture So you'd need to find the KerbalListItem (it's deep, the Strategy screen UI is a big mess) and put it in KerbalListItem.kerbalImage.texture. I think that should work, but I've never played with the RawImage in Unity (it may be easier to replace that entirely instead of the texture within).

Need to do further investigation - ideal solution would allow them just to specify their image as the headImage.