diff --git a/1.4/Assemblies/0MultiplayerAPI.dll b/1.4/Assemblies/0MultiplayerAPI.dll index 38b8a0e..9648606 100644 Binary files a/1.4/Assemblies/0MultiplayerAPI.dll and b/1.4/Assemblies/0MultiplayerAPI.dll differ diff --git a/1.4/Assemblies/Locks.dll b/1.4/Assemblies/Locks.dll index 865d995..61705aa 100644 Binary files a/1.4/Assemblies/Locks.dll and b/1.4/Assemblies/Locks.dll differ diff --git a/About/About.xml b/About/About.xml index ae05969..f667850 100644 --- a/About/About.xml +++ b/About/About.xml @@ -1,29 +1,30 @@ - Locks - Avius, Hazzer - -
  • 1.0
  • -
  • 1.1
  • -
  • 1.2
  • -
  • 1.3
  • -
  • 1.4
  • -
    - avius.locks - -
  • brrainz.harmony
  • -
  • haplo.miscellaneous.robots
  • -
  • kentington.saveourship2
  • -
  • linkolas.linkabledoors
  • -
  • jecrell.doorsexpanded
  • -
    - -
  • - brrainz.harmony - Harmony - steam://url/CommunityFilePage/2009463077 - https://github.com/pardeike/HarmonyRimWorld/releases/latest -
  • -
    - Version 2.8.3\nThis addon adds Lock command on every door.\n - Left-click to lock toggle.\n - Right click for more options\n - Alternatively you can use "Lock" inspector tab\n\nNote: Door lock must be flicked by colonist. + Locks + Avius, Hazzer + +
  • 1.0
  • +
  • 1.1
  • +
  • 1.2
  • +
  • 1.3
  • +
  • 1.4
  • +
  • 1.5
  • +
    + avius.locks + +
  • brrainz.harmony
  • +
  • haplo.miscellaneous.robots
  • +
  • kentington.saveourship2
  • +
  • linkolas.linkabledoors
  • +
  • jecrell.doorsexpanded
  • +
    + +
  • + brrainz.harmony + Harmony + steam://url/CommunityFilePage/2009463077 + https://github.com/pardeike/HarmonyRimWorld/releases/latest +
  • +
    + Version 2.9.0\nThis addon adds Lock command on every door.\n - Left-click to lock toggle.\n - Right click for more options\n - Alternatively you can use "Lock" inspector tab\n\nNote: Door lock must be flicked by colonist.
    diff --git a/Languages/English/Keyed/Keys.xml b/Languages/English/Keyed/Keys.xml index 1aac52d..165237c 100644 --- a/Languages/English/Keyed/Keys.xml +++ b/Languages/English/Keyed/Keys.xml @@ -1,59 +1,61 @@ - Locks - Child lock minimal age: {0} - Minimal age needed for humanlike pawn to open doors - Always pens door - When enabled every door will has "pens door" option turn on after construction. - - Lock - When unlocked all pawn will be allowed to use this door.\n[Right click for more options] - - Escaping prisoners respecting locks - Rebeling slaves respecting locks - - Door - locked - unlocked - changing... - - Locked - When unlocked door settings do not apply, therefore all humanoids capable of opening doors can pass. - Visitors allowed - When disabled, allies and traders will not be allowed to pass through this door. This setting do not apply when owners are set. - Pet door - When enabled small animals, like dogs can pass through door. This setting is not required for doors without owners. - Pens door - When enabled, pens animals can't pass through the door. Some doors may not block animals (e.g. Animal Flap). Check "roamerCanOpen" in defs. - Slaves allowed - When disabled slaves are not allowed to pass through this door. This setting do not apply when owners are set. - Animals allowed - When disabled all animals will not be allowed to pass through this door. This setting is checked after pens and pet door settings. - Children lock - When enabled only humanlike pawn over age (check options) are allowed to pass through this door. Works only on pawn from that same faction as door. - - - Owners - Change lock in order to apply settings! - - Lock - Unlock - Allow visitors to use - Forbid visitors from using - Add pet door - Remove pet door - Set as pens door - Remove pens door - Set owners - Clear owners - - Lock does not belong to {0} - - Locks can't be changed - Some locks can't be changed, because owners of those locks do not perform flick jobs:\n\n{0} - Some locks can't be changed, because owners of those locks do not perform flick jobs. - - Cancel - Copy - Paste + Locks + Child lock minimal age: {0} + Minimal age needed for humanlike pawn to open doors + Always pens door + When enabled every door will has "pens door" option turn on after construction. + Anomalies ignore locks + When disables anomalies will respects door locks settings. + + Lock + When unlocked all pawn will be allowed to use this door.\n[Right click for more options] + + Escaping prisoners respecting locks + Rebeling slaves respecting locks + + Door + locked + unlocked + changing... + + Locked + When unlocked door settings do not apply, therefore all humanoids capable of opening doors can pass. + Visitors allowed + When disabled, allies and traders will not be allowed to pass through this door. This setting do not apply when owners are set. + Pet door + When enabled small animals, like dogs can pass through door. This setting is not required for doors without owners. + Pens door + When enabled, pens animals can't pass through the door. Some doors may not block animals (e.g. Animal Flap). Check "roamerCanOpen" in defs. + Slaves allowed + When disabled slaves are not allowed to pass through this door. This setting do not apply when owners are set. + Animals allowed + When disabled all animals will not be allowed to pass through this door. This setting is checked after pens and pet door settings. + Children lock + When enabled only humanlike pawn over age (check options) are allowed to pass through this door. Works only on pawn from that same faction as door. + + + Owners + Change lock in order to apply settings! + + Lock + Unlock + Allow visitors to use + Forbid visitors from using + Add pet door + Remove pet door + Set as pens door + Remove pens door + Set owners + Clear owners + + Lock does not belong to {0} + + Locks can't be changed + Some locks can't be changed, because owners of those locks do not perform flick jobs:\n\n{0} + Some locks can't be changed, because owners of those locks do not perform flick jobs. + + Cancel + Copy + Paste \ No newline at end of file diff --git a/LoadFolders.xml b/LoadFolders.xml index b78569b..1083f40 100644 --- a/LoadFolders.xml +++ b/LoadFolders.xml @@ -19,4 +19,8 @@
  • /
  • 1.4
  • + +
  • /
  • +
  • 1.4
  • +
    \ No newline at end of file diff --git a/README.md b/README.md index 0b3310f..9d28272 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@

    - v2.8.3 + v2.9.0

    diff --git a/Source/HarmonyPatches/RespectLockPatches.cs b/Source/HarmonyPatches/RespectLockPatches.cs index 9d65bb9..1c4ebbd 100644 --- a/Source/HarmonyPatches/RespectLockPatches.cs +++ b/Source/HarmonyPatches/RespectLockPatches.cs @@ -26,4 +26,13 @@ static bool Postfix(bool __result) return !LocksSettings.revoltRespectsLocks; } } + + [HarmonyPatch(typeof(LordJob_TradeWithColony), "CanOpenAnyDoor")] + public class AnimalCaravanaRespectPatch + { + static bool Postfix(bool __result) + { + return false; + } + } } diff --git a/Source/LockUtility.cs b/Source/LockUtility.cs index 42d91bc..d9d334c 100644 --- a/Source/LockUtility.cs +++ b/Source/LockUtility.cs @@ -53,9 +53,14 @@ public static bool PawnCanOpen(ThingWithComps door, Pawn p) bool canOpenAnyDoor = lord != null && lord.LordJob != null && lord.LordJob.CanOpenAnyDoor(p); bool noFaction = door.Faction == null; bool specialGuest = p.guest != null && p.guest.Released; - if (canOpenAnyDoor || noFaction || specialGuest) + if (canOpenAnyDoor || specialGuest) return true; + if (noFaction) + { + return p.RaceProps.canOpenFactionlessDoors; + } + LockState respectedState; if (!p.IsPrisoner && !door.Faction.HostileTo(p.Faction) && !p.InMentalState) respectedState = GetData(door).WantedState; @@ -70,7 +75,7 @@ public static bool PawnCanOpen(ThingWithComps door, Pawn p) if (respectedState.pensDoor && p.RaceProps.FenceBlocked && !door.def.building.roamerCanOpen && (!p.roping.IsRopedByPawn || !PawnCanOpen(door, p.roping.RopedByPawn))) { - return false; + return p.RaceProps.intelligence == Intelligence.Animal && p.GetLord()?.LordJob is LordJob_TradeWithColony; } if (respectedState.mode == LockMode.Allies && WildManUtility.WildManShouldReachOutsideNow(p)) { @@ -118,6 +123,17 @@ public static bool PawnCanOpen(ThingWithComps door, Pawn p) { return true; } + if (ModsConfig.AnomalyActive && LocksSettings.anomaliesIgnoreLocks) + { + if (p.kindDef == PawnKindDefOf.Revenant) + { + return true; + } + if (p.IsMutant && p.mutant.Def.canOpenAnyDoor) + { + return true; + } + } return false; } diff --git a/Source/Locks.csproj b/Source/Locks.csproj index efbc9ea..9c7f5e4 100644 --- a/Source/Locks.csproj +++ b/Source/Locks.csproj @@ -35,13 +35,12 @@ false - - packages\Lib.Harmony.2.0.0.8\lib\net472\0Harmony.dll + + packages\Lib.Harmony.2.3.3\lib\net472\0Harmony.dll False - - packages\RimWorld.MultiplayerAPI.0.3.0\lib\net472\0MultiplayerAPI.dll - True + + packages\RimWorld.MultiplayerAPI.0.5.0\lib\net472\0MultiplayerAPI.dll ..\..\..\Gry\Steam\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\Assembly-CSharp.dll @@ -95,46 +94,46 @@ - + Defs\Designations.xml - + Defs\JobDefs.xml - + Defs\WorkGivers.xml - + Patches\AddCompLock.xml - + Patches\AddCompLockArchitectExpandedFences.xml - + Patches\AddCompLockDoorsExpanded.xml - + Patches\AddCompLockLinkableDoors.xml - + Patches\AddCompLockSoS2.xml - + Patches\AddInspectTab.xml - + Patches\AddInspectTabLockArchitectExpandedFences.xml - + Patches\AddInspectTabLockDoorsExpanded.xml - + Patches\AddInspectTabLockLinkableDoors.xml - + Patches\AddInspectTabLts.xml - + Patches\AddInspectTabSoS2.xml diff --git a/Source/Options/LocksMod.cs b/Source/Options/LocksMod.cs index 2246eb6..8d309f1 100644 --- a/Source/Options/LocksMod.cs +++ b/Source/Options/LocksMod.cs @@ -8,47 +8,55 @@ namespace Locks.Options { - class LocksMod : Mod + class LocksMod : Mod + { + private const string MOD_NAME = "Locks_ModName"; + private const string CHILD_LOCK = "Locks_ChildrenLock"; + private const string CHILD_LOCK_DESC = "Lock_ChildrenLock_Description"; + private const string PRISON_BREAK = "Locks_PrisonBreak"; + private const string SLAVE_REBELION = "Locks_SlaveRebel"; + private const string ALWAYS_PENS_DOOR = "Locks_AlwaysPensDoor"; + private const string ALWAYS_PENS_DOOR_DESC = "Locks_AlwaysPensDoor_Description"; + private const string ANOMALIES_IGNORE_LOCKS = "Locks_AnomaliesIgnoreLocks"; + private const string ANOMALIES_IGNORE_LOCKS_DESC = "Locks_AnomaliesIgnoreLocks_Description"; + + public LocksMod(ModContentPack content) : base(content) { - private const string MOD_NAME = "Locks_ModName"; - private const string CHILD_LOCK = "Locks_ChildrenLock"; - private const string CHILD_LOCK_DESC = "Lock_ChildrenLock_Description"; - private const string PRISON_BREAK= "Locks_PrisonBreak"; - private const string SLAVE_REBELION ="Locks_SlaveRebel"; - private const string ALWAYS_PENS_DOOR = "Locks_AlwaysPensDoor"; - private const string ALWAYS_PENS_DOOR_DESC = "Locks_AlwaysPensDoor_Description"; - - public LocksMod(ModContentPack content) : base(content) - { - this.GetSettings(); - } - - public override void DoSettingsWindowContents(Rect inRect) - { - Listing_Standard listingStandard = new Listing_Standard(); - - listingStandard.Begin(inRect); - listingStandard.Gap(12f); - - listingStandard.Label(CHILD_LOCK.Translate(LocksSettings.childLockAge), tooltip: CHILD_LOCK_DESC.Translate()); - LocksSettings.childLockAge = (int)listingStandard.Slider(LocksSettings.childLockAge, 0, 18); - listingStandard.Gap(12f); - - listingStandard.CheckboxLabeled(PRISON_BREAK.Translate(), ref LocksSettings.prisonerBreakRespectsLock); - listingStandard.Gap(12f); - - listingStandard.CheckboxLabeled(SLAVE_REBELION.Translate(), ref LocksSettings.revoltRespectsLocks); - listingStandard.Gap(12f); - - listingStandard.CheckboxLabeled(ALWAYS_PENS_DOOR.Translate(), ref LocksSettings.alwaysPensDoor, ALWAYS_PENS_DOOR_DESC.Translate()); - listingStandard.Gap(12f); - - listingStandard.End(); - } - - public override string SettingsCategory() - { - return MOD_NAME.Translate(); - } + this.GetSettings(); } + + public override void DoSettingsWindowContents(Rect inRect) + { + Listing_Standard listingStandard = new Listing_Standard(); + + listingStandard.Begin(inRect); + listingStandard.Gap(12f); + + listingStandard.Label(CHILD_LOCK.Translate(LocksSettings.childLockAge), tooltip: CHILD_LOCK_DESC.Translate()); + LocksSettings.childLockAge = (int)listingStandard.Slider(LocksSettings.childLockAge, 0, 18); + listingStandard.Gap(12f); + + listingStandard.CheckboxLabeled(PRISON_BREAK.Translate(), ref LocksSettings.prisonerBreakRespectsLock); + listingStandard.Gap(12f); + + listingStandard.CheckboxLabeled(SLAVE_REBELION.Translate(), ref LocksSettings.revoltRespectsLocks); + listingStandard.Gap(12f); + + listingStandard.CheckboxLabeled(ALWAYS_PENS_DOOR.Translate(), ref LocksSettings.alwaysPensDoor, ALWAYS_PENS_DOOR_DESC.Translate()); + listingStandard.Gap(12f); + + if (ModsConfig.AnomalyActive) + { + listingStandard.CheckboxLabeled(ANOMALIES_IGNORE_LOCKS.Translate(), ref LocksSettings.anomaliesIgnoreLocks, ANOMALIES_IGNORE_LOCKS_DESC.Translate()); + listingStandard.Gap(12f); + } + + listingStandard.End(); + } + + public override string SettingsCategory() + { + return MOD_NAME.Translate(); + } + } } diff --git a/Source/Options/LocksSettings.cs b/Source/Options/LocksSettings.cs index f48a348..dff57f7 100644 --- a/Source/Options/LocksSettings.cs +++ b/Source/Options/LocksSettings.cs @@ -7,21 +7,23 @@ namespace Locks.Options { - public class LocksSettings : ModSettings - { - public static int childLockAge = 6; - public static bool prisonerBreakRespectsLock = true; - public static bool revoltRespectsLocks = true; - public static bool alwaysPensDoor = false; + public class LocksSettings : ModSettings + { + public static int childLockAge = 6; + public static bool prisonerBreakRespectsLock = true; + public static bool revoltRespectsLocks = true; + public static bool alwaysPensDoor = false; + public static bool anomaliesIgnoreLocks = true; - public override void ExposeData() - { - Scribe_Values.Look(ref childLockAge, "Locks_childLockAge", 6, true); + public override void ExposeData() + { + Scribe_Values.Look(ref childLockAge, "Locks_childLockAge", 6, true); - Scribe_Values.Look(ref prisonerBreakRespectsLock, "Locks_BreakRespectsLocks", true, true); - Scribe_Values.Look(ref revoltRespectsLocks, "Locks_RevoltRespectLocks", true, true); + Scribe_Values.Look(ref prisonerBreakRespectsLock, "Locks_BreakRespectsLocks", true, true); + Scribe_Values.Look(ref revoltRespectsLocks, "Locks_RevoltRespectLocks", true, true); - Scribe_Values.Look(ref alwaysPensDoor, "Locks_AlwaysPensDoor", false, true); - } + Scribe_Values.Look(ref alwaysPensDoor, "Locks_AlwaysPensDoor", false, true); + Scribe_Values.Look(ref alwaysPensDoor, "Locks_AnomaliesIgnoreLocks", true, true); } + } } diff --git a/Source/Properties/AssemblyInfo.cs b/Source/Properties/AssemblyInfo.cs index e501b98..3b766be 100644 --- a/Source/Properties/AssemblyInfo.cs +++ b/Source/Properties/AssemblyInfo.cs @@ -10,7 +10,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Avius' mods")] [assembly: AssemblyProduct("Locks")] -[assembly: AssemblyCopyright("Copyright © 2017")] +[assembly: AssemblyCopyright("Copyright © 2017-2024")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.8.*")] -[assembly: AssemblyFileVersion("2.8.2")] +[assembly: AssemblyVersion("2.9.*")] +[assembly: AssemblyFileVersion("2.9.0")] diff --git a/Source/packages.config b/Source/packages.config index ee34f33..a40d0a1 100644 --- a/Source/packages.config +++ b/Source/packages.config @@ -1,6 +1,6 @@  - + - + \ No newline at end of file diff --git a/changelog.txt b/changelog.txt index 1a54f7c..d62120a 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,8 @@ Changelog: +2.9.0 +- Update to Rimworld 1.5 +- Trader animals should respect locks +- Option for anomalies to respect locks (DLC required) 2.8.3 - Fix for null element in door owners. 2.8.2