Ludeon Forums

RimWorld => Mods => Help => Topic started by: svend on September 05, 2021, 09:34:10 PM

Title: How can I expand "Bio" menu after adding new skills?
Post by: svend on September 05, 2021, 09:34:10 PM
Hello :)

I've added a couple of new skills. That was fairly easy, and I've also managed to earn XP in them when I needed. However, the list of skills in the Bio/Character tab is now too short, and the last skill (Intelligence) is pushed off the bottom of the list. It seems to be that the size of the this list is decided by a combination of CharacterCardUtility.BasePawnCardSize, CharacterCardUtility.PawnCardSize and the call to CharacterCardUtility.DrawCharacterCard that passes in the size values from the former method...

Would the correct/only way to increase the size of the card be to set the CharacterCardUtility.BasePawnCardSize (public static) value in my code somewhere? As far as I can see it's not being set from anywhere in the core code?

Cheers,
   Svend
Title: Re: How can I expand "Bio" menu after adding new skills?
Post by: svend on September 05, 2021, 11:37:40 PM
I've tried adding this to my Controller's contructor:

CharacterCardUtility.BasePawnCardSize = new Vector2(480f, 500f);

But while this makes the card overall taller, it doesn't actually make the skills list any taller, so that must be defined somewhere else...
Title: Re: How can I expand "Bio" menu after adding new skills?
Post by: svend on September 05, 2021, 11:49:11 PM
Here (attached) is a snippet of what it looks like if I add 6 new skills, and increase the card height to 750. As you can see the skills after Animals aren't visible because the list isn't long enough...

It seems like the menu is drawn in SkillUI.DrawSkillsOf, but I really can't work out how the height of the list is controlled/calculated...
Title: Re: How can I expand "Bio" menu after adding new skills?
Post by: RawCode on September 06, 2021, 05:14:57 AM
you should read unity manual first

focus on
global::UnityEngine.GUI.BeginGroup(params);
and
global::UnityEngine.GUI.EndGroup(void);

hardcoded size for skills is 258f, 355f, you may need to read harmony transpiler manual also.
Title: Re: How can I expand "Bio" menu after adding new skills?
Post by: svend on September 06, 2021, 06:38:23 PM
Ah right, I see that now. Thanks for the pointer :)

I'm kind of surprised that this is a hardcoded value, considering how flexible the game generally is for modding, how easy it is to add a new skill and how simple it would have been to calculate the height based on the SkillHeight and the number of skills... maybe in a future Rimworld update :D

Anyway, for now I might just remove a couple of skills I don't need if I can get away with it :P ... I know that's not a solution for the mod if I want to share it, but it might work for development :D