Reordering Architect Icons (not category buttons)

Started by Whale Cancer, November 14, 2019, 08:43:37 PM

Previous topic - Next topic

Whale Cancer

Hello!

I have returned to RimWorld after a long break and am currently setting up a mod that patches some incompatabilities between mods I want to use and also brings some quality of life improvements. However, I have run into a problem.

I want to reorder the buttons within the various categories so they arranged in a non-chaotic fashion. AFAIK, the order of these icons is controlled by mod load order and the order their ThingDefs are found in Core or in any given mod. I want to rearrange these using patching somehow, but I have no idea what to do.

EDIT: I also seem to have the same problem with the order of bills/recipes



Any tutorials I can be pointed to or available help?

LWM

How good is your C#?

The Architect menu has a cached list of menu options. Each menu option has a list of "resolved designators," and THOSE are what you want to f*** with to make this happen.  They get filled automagically on startup from the resolveReferences bit, so it goes through all items, and everything that's supposed to be in Kitchen (or whatever) gets added to the appropriate menu option's list of reolvedDesignators.

So the easiest way to change the order is to change the mod loading order.

If you REALLY want to f*** with it, take a look at my Deep Storage mod's ModSettings.cs, and look for "Architect Menu"  You can see how I access the resolvedDesignators for a given category def, and then you can see how I rebuild the architect menu (clear that cached menu) in ClearCache (I think that's what it's called).  You could do something like that after all the defs are loaded.

It's not straightforward...okay it is fairly straightforward, but it involves black magic.  So it's doable.  Assuming you can figure out a way to decide how you want things ordered ;)

LWM