Hospitality
Hospitality copied to clipboard
Hospitality: Hook into default bed policy gizmo
What problem does your suggestion solve As of 1.3, there's a new unified gizmo on beds for setting usage policies (dropdown for colonists/prisoner/slaves). At the moment, there's an additional gizmo for Hospitality.
Describe the solution you propose Rather than add a new gizmo here: https://github.com/OrionFive/Hospitality/blob/debfc8532f2e3cbb8d034048c1cd1e9ea2dd37dc/Source/Source/Patches/Building_Bed_Patch.cs#L39-L61 Consider hooking onto the existing gizmo, similar to how the Ideology DLC does already.
Describe alternatives you've considered Replacing the base gizmo with a new one - this may cause issues with other mods/DLCs that hook into the existing gizmo.
I don't think the problem is grave enough to warrant spending time on this over other features. Can you explain why this is important to you?
It likely isn't, except that it's a tad confusing for new users.
That being said, it doesn't seem like it'd be super hard to implement - I'm trying to figure out how the base gizmo works, and if it's feasible to add to that menu (rather than make our own). The first step to a PR, though, is opening an issue. 😄
Notes from #mod-development:
- The base gizmo for bed ownership policies uses a custom command,
Command_SetBedOwnerType
. - Said command builds the list of owner types (and list objects) in-line, rather than calling a different method that we can hook on to - a transpiler patch would be necessary.
- The delegates within said list items would also need to be patched - in the event we're coming out of a guest bed, we need to call the swap method within those delegates. This likely can be handled with a single wrapper method.
- Because guest beds aren't tracked as a member of the BedOwnerTypes enum (as it predates those), we may hit issues if there's ever an expectation that list items are solely members of that enum.
This sounds like it'd be a tad complex, but I'd be willing to take a crack at it. The examples for transpiler patching that I got seem pretty relevant.
Well, if you figure it out, I'm not standing in the way of merging your code. I won't spend any time on it myself, though, as I'm fine with players realizing guest beds are more than just a different setting on normal beds.