RimWorld

RimWorld

Pawn Badge Fan Fork
Macmillant 2 Jun, 2020 @ 9:01pm
Updating to 3 badges
I did try and have a look at it but I am lost honestly.

ITab_Pawn_Badge.cs

for (int i = 0; i < 3; i++) { DoBadgeDisplay(i, badgeRects, cb); } GUI.EndGroup();

CompBadge.cs

if (!isSave || this.badges[2] != "") { Scribe_Values.Look<string>(ref this.badges[2], "RRPawnBadge_Badge2", defaultValue: ""); } }

RimWorld_ColonistBarColonistDrawer_DrawColonist.cs

float iwidth_half = iwidth / 2.0f; float iwidth_third = iwidth / 3.0f; float ibottommargin = iwidth_half; ... if (cb.badges[1] != "") { Rect brect = new Rect(rect.xMax - iwidth_third, rect.y - iwidth_half, iwidth, iwidth); switch (Settings.badgePosition) { case Settings.BadgePosition.Bottom: brect.y += rect.height - ibottommargin; break; case Settings.BadgePosition.Left: brect.x -= rect.width; brect.y += rect.height - ibottommargin; break; case Settings.BadgePosition.Right: brect.y += rect.height - ibottommargin; break; } GUI.DrawTexture(brect, DefDatabase<BadgeDef>.GetNamed(cb.badges[1]).Symbol, ScaleMode.ScaleToFit); }

I assumed these were essentially the code changes needed to add a thid bage but no luck... didn't seem to change anything haha

Any help with this one if you have time?
< >
Showing 1-10 of 10 comments
Macmillant 2 Jun, 2020 @ 9:03pm 
Side note should change the code for the height of the tab scroll to be a lot smaller and get rid of the scroll all together if possible. It's more elegant that way.
Saucy_Pigeon  [developer] 3 Jun, 2020 @ 2:16am 
Are you using an IDE like Visual Studio to change the code? C# is a compiled language, so you need a compiler for your changes to take effect. Also, Visual Studio will show if you have errors in your code.

I agree with reducing the height of the scroll, ideally it would automatically adjust to how many badges you have. However, I don't think that removing it would be a good idea because in the original mod, once you have multiple badge mods, you are unable to select badges lower down in the list.
Macmillant 3 Jun, 2020 @ 3:01am 
Oh, perhaps that is the problem. It needs to be done via Visual Studio not just a text editor? I'm used to doing everything via notepad++
Macmillant 3 Jun, 2020 @ 4:26am 
Still at a loss. Tried setting up Visual studios. Not sure how to open existing mod structure and compile the code so the changes work. Wish I could just text edit the files it'd be so much easier.
Saucy_Pigeon  [developer] 3 Jun, 2020 @ 5:38am 
To edit the code, you need to open the solution file at (mod)/Source/RR_PawnBadge/RR_PawnBadge.sln. When you're done with editing the code, you then press F6 (or on the toolbar, press Build->Build Solution) and can test the code by running the game.
Macmillant 3 Jun, 2020 @ 7:27am 
Well, that seems to have done the trick! Now all I got to do is keep changing things till something sticks right haha :)
TheVillain 13 Jun, 2020 @ 7:51pm 
Anychance you could publish the work as a patch file? Or so on - I'd quite like to have 3 badges or more :D
I.R.R.I.S.H. 24 Jul, 2020 @ 8:39pm 
Were you successful at getting 3 badges on here? I'd love to have my colonists set up with military rank according to shooting skill, primary job, secondary job. Thanks!
NotTildaSwinton 3 Sep, 2020 @ 5:37am 
bump
Drayco84 9 Nov, 2021 @ 9:56am 
@Macmillant: Update, please?
< >
Showing 1-10 of 10 comments
Per page: 1530 50