Ludeon Forums

RimWorld => Mods => Help => Topic started by: Napoleonite on March 02, 2020, 12:15:06 PM

Title: DesignatorDropdownGroupDef in 1.1?
Post by: Napoleonite on March 02, 2020, 12:15:06 PM
<DesignatorDropdownGroupDef>
    <defName>SurveillanceCameras</defName>
</DesignatorDropdownGroupDef>

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

Becomes:

(https://i.imgur.com/oi4w9pN.png)

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?
Title: Re: DesignatorDropdownGroupDef in 1.1?
Post by: Napoleonite on March 08, 2020, 07:12:36 PM
Apparently this is how 1.1 works now I guess. I'm not happy about it:

(https://i.imgur.com/QN7tgDR.png)

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?
Title: Re: DesignatorDropdownGroupDef in 1.1?
Post by: LWM on March 08, 2020, 10:16:50 PM
Try specifying a "uiIcon" for your defs; does that icon show up in the designator dropdown?
Title: Re: DesignatorDropdownGroupDef in 1.1?
Post by: Napoleonite on April 07, 2020, 01:05:25 PM
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?
Title: Re: DesignatorDropdownGroupDef in 1.1?
Post by: LWM on April 07, 2020, 10:17:41 PM
Oh, hmm.

And it behaved differently under 1.0?
Title: Re: DesignatorDropdownGroupDef in 1.1?
Post by: Napoleonite on April 08, 2020, 03:33:04 AM
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?
Title: Re: DesignatorDropdownGroupDef in 1.1?
Post by: LWM on April 08, 2020, 01:09:52 PM
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.
Title: Re: DesignatorDropdownGroupDef in 1.1?
Post by: Napoleonite on April 09, 2020, 05:42:49 AM
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.
Title: Re: DesignatorDropdownGroupDef in 1.1?
Post by: LWM on April 09, 2020, 03:11:33 PM
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/