RimWorld
Pawn Badge Fan Fork
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?
< >
Εμφάνιση 1-10 από 10 σχόλια
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  [δημιουργός] 3 Ιουν 2020, 2:16 
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.
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++
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  [δημιουργός] 3 Ιουν 2020, 5:38 
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.
Well, that seems to have done the trick! Now all I got to do is keep changing things till something sticks right haha :)
Anychance you could publish the work as a patch file? Or so on - I'd quite like to have 3 badges or more :D
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!
@Macmillant: Update, please?
< >
Εμφάνιση 1-10 από 10 σχόλια
Ανά σελίδα: 1530 50