Editing "ITab_Pawn_Character" interface

Started by CrazyMalk, November 04, 2017, 06:24:59 PM

Previous topic - Next topic

CrazyMalk

Hello, I'm trying to edit the interface from the pawn's Character tab and add a Scroll Bar into it, to make you able to see new skills added by mods. I thought about using a scrollbar from another mod like EDB Prepare Carefully, or even from vanilla RimWorld... But i can't even find, with IlSpy, the interface itself to edit. Can someone with more experience (that I, for sure, don't have) show me the path to find the skills interface in Character Tab and Character Creation, if possible?

Varisha

I just began modding and added a scrollview to a certain interface.

Widgets.BeginScrollView(mainRect, ref this.scrollPosition, viewRect, true);
// .. magic ..
Widgets.EndScrollView();


But this added a entire new scroll section including new content. I am not sure about extending existing content and wrap it in a scroll view additionally. If you need more input, paste a screen so I can see what you are talking about :)
With IlSpy you are able to "analyze" the use of Widgets.BeginScrollView or other methods. So you can navigate to caller methods.

CrazyMalk



When adding a new skill, as you can note, it does not fit in the ui, and gets cut at the bottom. I would like to edit that interface and add a scrollbar there, so that you could scroll down and see the new skills, but i can't find the interface itself.

Varisha

I am not sure what you are looking for if you say "I can't find the interface". The thread topic is already the correct class and looking at this class you can find that:

protected override void FillTab() {
Rect rect = new Rect(17f, 17f, CharacterCardUtility.PawnCardSize.x, CharacterCardUtility.PawnCardSize.y);
CharacterCardUtility.DrawCharacterCard(rect, this.PawnToShowInfoAbout);
}


going further you will find this:
RimWorld.SkillUI#public static void DrawSkillsOf(Pawn p, Vector2 offset, SkillUI.SkillDrawMode mode)

CrazyMalk

I think this is what i need... Now i only need to figure how to stick a scrollbar in there with my poor C# coding skills ._.