Stop colonists from using chairs that don't belong to them!
Mod Content
This mini-mod adds a toggle on all "sittable" furniture that allows you to specify them as Public, Colonist, Slave, Private, Guest, or Disallowed. This includes all vanilla chairs as well as modded chairs, sofas, thrones, and even toilets!
[list]
[*] When set to Colonist, only player-controlled colonists and slaves can use the chair.
[*] When set to Slave, only player-controlled slaves can use the chair.
[*] When set to Private, colonists will only use the specified chair if their assigned bed is in the same room as the chair. This works for both couples and barracks.
[*] Additional, when set to Private, you can assign a specific colonist or slave to the chair. No one else will be allowed to use it.
[*] When set to Guest, then anyone that is not a player-controlled colonist or slave can use the chair.
[*] When set to Disallowed, no one can use this chair.
[/list]
For convenience, there is also a toggle on tables to set the use permissions of all chairs adjacent to it.
Technical Details
Get Out Of My Chair! uses a single postfix on ReservationUtility.CanReserve() to disallow pawns that do not meet its use permissions from reserving it for jobs.
Get Out Of My Chair! also uses three postfixes on CompGatherSpot.CompGetGizmosExtra(), Building.GetGizmos(), and Building.ExposeData() to display the dining policy toggle and save and load chair settings.
Get Out Of My Chair! has one final postfix on MemoryUtility.ClearAllMapsAndWorld() to clear its cached data when loading a new game or returning to the main menu.
This mod operates on chairs instead of tables because many jobs such as eating actually search for unreserved chairs first before validating that they are in fact adjacent to a table surface. Policy data is kept in a Dictionary<int, enum> that uses the chair's thingIDNumber as the key for its use mode and a second Dictionary<int, int> for specific owners in Private use mode.
Compatibility
Get Out Of My Chair! is potentially incompatible with [url=https://steamcommunity.com/sharedfiles/filedetails/?id=1430086135]Table Diner[/url], which appears to use a destructive prefix on the vanilla chair-finding code.
Get Out Of My Chair! mostly works with [url=https://steamcommunity.com/sharedfiles/filedetails/?id=2606448745]Multiplayer[/url] [b]except[/b] for assigning specific colonists to chairs. Doing so will cause a desync when a colonist attempts to use the chair.
Known Issues
[list]
[*] When a chair is designated to be Deconstructed, Uninstalled, Painted, or Paint Removed, then permissions are disabled. This is done because otherwise no one but the permitted users would be able to perform these jobs, and specifically limiting the permissions check to specific jobs would both be a more invasive patch and not be able to catch modded jobs.
[/list]
Links
Furniture in the preview image is from [url=https://steamcommunity.com/sharedfiles/filedetails/?id=3118185542]Eccentric Tech - Spacer Furniture[/url]. Please check out the entire [url=https://steamcommunity.com/workshop/filedetails/?id=2592094724]Eccentric Tech collection[/url]!