RimWorld

RimWorld

Pawn Badge Fan Fork
Macmillant 2. juni 2020 kl. 21:01
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?
< >
Viser 1-10 af 10 kommentarer
Macmillant 2. juni 2020 kl. 21:03 
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  [udvikler] 3. juni 2020 kl. 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.
Macmillant 3. juni 2020 kl. 3:01 
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. juni 2020 kl. 4:26 
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  [udvikler] 3. juni 2020 kl. 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.
Macmillant 3. juni 2020 kl. 7:27 
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. juni 2020 kl. 19:51 
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. juli 2020 kl. 20:39 
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 kl. 5:37 
bump
Drayco84 9. nov. 2021 kl. 9:56 
@Macmillant: Update, please?
< >
Viser 1-10 af 10 kommentarer
Per side: 1530 50