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

PRF Mod Conflict?: Plasma Drill Cannot Re-order Bills #104

Open BardezAnAvatar opened 1 year ago

BardezAnAvatar commented 1 year ago

Describe the bug

The Plasma Drill from Project RimFactory Revived cannot re-order any of its bills when installed along side Better Workbench Management mod. When a bill is selected ON ONLY THIS STATION, it instead re-orders... colonists instead.

To Reproduce Reproducibility: ? Steps to reproduce the behavior:

  1. Install Better Workbench Management mod + Project RimFactory Revived
  2. Place a Plasma Drill
  3. Add several bills to the Plasma Drill
  4. Try to drag the bills to re-order
  5. Notice that colonists are moved instead. May have to drag the cursor to the bottom of the screen.
    • Note: The colonist being moved represents the index of the bill being dragged. i.e.: first bill will drag first colonist; second bill will drag second colonist; etc.

Expected behavior Bills should be movable

Actual Behavior Bills will not be reorderable. Instead, the bill selection appears to redirect to colonists. See screenshots that show cursor over bills, but have floating colonist pawns dragged instead.

Screenshots screenshot10 screenshot11 screenshot9

Rimworld (please complete the following information):

Modlist (please complete the following information):

Additional context Other workbenches and machines within PRF work properly (such as assemblers); I want to say, anecdotally, that I used to see an index out of bounds of array error message when dragging bills on this station but I am not able to reproduce that error reporting behavior at this time.

Link to bug report over at PRF repo

Sn1p3rr3c0n commented 1 year ago

Hi Rimfactory Maintainer here I see that you have a patch for ProjectRimFactory.SAL3.UI.ITab_SAL3Bills https://github.com/Falconne/ImprovedWorkbenches/blob/9c3e0dda1a897f500c0712e75527aca1c2b67e35/src/ImprovedWorkbenches/Main.cs#L91

there is a additional ITab specifically for the Plasma Drill called ProjectRimFactory.AutoMachineTool.ITab_Bills2 The issue likely is that there is no patch for that one.

I think i will recheck if that additional ITab is necessary or not and update you here.

Sn1p3rr3c0n commented 1 year ago

I was able to remove the additional ITab in https://github.com/zymex22/Project-RimFactory-Revived/commit/ccda0c5c93f59970eecc49a8a05ecf715763688f This change did not break any of the existing compatibility, however the Plasma Drill ProjectRimFactory.AutoMachineTool.Building_Miner is still not supported by your Patch.

this might be the case as you appear to check for the Building type https://github.com/Falconne/ImprovedWorkbenches/blob/9c3e0dda1a897f500c0712e75527aca1c2b67e35/src/ImprovedWorkbenches/Main.cs#L96-L97 With the mentioned Change I have introduced the IBillTab Interface. maybe you can used that instead or otherwise update the patch.

BardezAnAvatar commented 1 year ago

I have submitted a PR for this issue.

Root cause: From what I can tell, it was getting into a code path if it was a PRF building and then subsequent PRF exception cases were not being checked, causing half-functional code patches. The existing captured re-order collection was invalid and the code to look for a collection to re-order just reverts to the colonist bar?

BardezAnAvatar commented 1 year ago

@Sn1p3rr3c0n: The patch I have looks rather lazy, checking multiple types. You mention IBillTab and that looks like it would be a better candidate once your PR is completed and the mod gets published. In the interim: is there a better base type that we could use that encompasses all PRF buildings that have bill tabs, but not any buildings lacking one?