RimWorld
Pawn Badge Fan Fork
Macmillant 2020년 6월 2일 오후 9시 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?
< >
전체 댓글 10개 중 1~10개 표시 중
Macmillant 2020년 6월 2일 오후 9시 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  [개발자] 2020년 6월 3일 오전 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 2020년 6월 3일 오전 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 2020년 6월 3일 오전 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  [개발자] 2020년 6월 3일 오전 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 2020년 6월 3일 오전 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 2020년 6월 13일 오후 7시 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. 2020년 7월 24일 오후 8시 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 2020년 9월 3일 오전 5시 37분 
bump
Drayco84 2021년 11월 9일 오전 9시 56분 
@Macmillant: Update, please?
< >
전체 댓글 10개 중 1~10개 표시 중
페이지당 표시 개수: 1530 50