DesignatorDropdownGroupDef in 1.1?

Started by Napoleonite, March 02, 2020, 12:15:06 PM

Previous topic - Next topic

Napoleonite

<DesignatorDropdownGroupDef>
    <defName>SurveillanceCameras</defName>
</DesignatorDropdownGroupDef>

<!-- in my ThingDef -->
<designatorDropdown>SurveillanceCameras</designatorDropdown>
<uiIconPath>snip</uiIconPath>

Becomes:



In 1.1 the icons worked but in 1.1 they broke. I checked the autogenerated XML documentation but no example was given that is different from mine and this is also not mentioned in the 1.1 upgrade guide for modders. What should I do differently in 1.1?

Napoleonite

Apparently this is how 1.1 works now I guess. I'm not happy about it:



Even vanilla Rimworld has this now. They list the CostStuffCount instead of the buildings themselves. I didn't find this in the patch notes but I assume this is intended? It looks horrible imo and also prevents mods from sanely grouping similar buildings together into one button.
And when grouping buildings together that don't have a CostStuffCount it will apparently take an ingredient from the regular CostList (which seems to be random?)?

I don't understand why they did this?

LWM

Try specifying a "uiIcon" for your defs; does that icon show up in the designator dropdown?

Napoleonite

#3
That doesn't work either, to my surprise actually, this does nothing (but you can use this to override the button image yes but sadly not the dropdown images). The dropdown still shows an ingredient instead of the building.

Is this really not a Rimworld bug? It looks so stupid or is that just me?
Or is there another way we should group similar buildings since Royalty?

LWM

Oh, hmm.

And it behaved differently under 1.0?

Napoleonite

Yes, this was different in 1.0. This was an undocumented change (unless I missed it).
Like I said before, even for the vanilla carpets with only the core+DLC Rimworld mods this looks (in my opinion) stupid and I wonder if this is a bug. If this is not a bug, I still wonder how we fix this?

LWM

I think in vanilla 1.0, it simply didn't display ANYTHING, only the label.

You could change this (as a mod, say?) with a fairly easy Harmony patch, I think.  You would probably want to Transpile....no, wait you'd probably want to destructively prefix Designator_Dropdown's GetDesignatorCost(...) to only return a material if the def has a costStuffCount.  Otherwise, you'd return the item def iteslf.

Actually, I think I'll go ahead and add that to my MinorChanges mod, probably before the weekend ends.

Alternately (or at the same time), you might want to post in the Bugs group that GetDesignatorCost should behave as described above.  And cross your fingers.

Napoleonite

I don't want to use Harmony for tiny XML mods or patches. So much work and maintenance in the future and etc. etc. just for this... Yeah I'll probably post this in the bugs section because it looks like one.

LWM

Actually, there's nothing in Vanilla that uses drop-down designators for anything beyond cost except the colored lamps, so it's not super noticeable unless you're playing a modded game.

That said, it's still not perfect.  Here's my mod that fixes it: https://github.com/lilwhitemouse/RimWorld-LWM.MinorChanges/