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().
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?).
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?).