Falconne / ImprovedWorkbenches

Rimworld mod to add many QoL improvements to the workbench UI.
http://steamcommunity.com/sharedfiles/filedetails/?id=935982361
GNU General Public License v3.0
22 stars 26 forks source link

Bills tab only opens every other time bench is selected #72

Open lilwhitemouse opened 5 years ago

lilwhitemouse commented 5 years ago

I think this is a vanilla ImprovedWorkbenches issue:

Load a game, select a workbench: the bills ITab opens. Click on the floor (unselecting the workbench). Click on the same workbench: the bills ITab does NOT open.

If it is, as I suspect, the logic of the _lastSelectedThingId, then you might consider an alternate mechanism for opening the ITab: harmony patch on Selector's Select().

See as an example: https://github.com/lilwhitemouse/RimWorld-LWM.DeepStorage/blob/7032d81cb36922d69616f0205917d85899ba4a55/DeepStorage/Deep_Storage_ITab.cs#L256

Imitation is the sincerest form of flattery ;) I just went about it a different way. I think my code should be robust if multiple people are using it at the same time for the same building; whoever is loaded first should win (by opening an ITab and then everyone later sees an open ITab that can open for this window, so all good?).

Falconne commented 5 years ago

Thanks for the note. I'll look into it the next time I get a chance to do some bug fixes.