-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from Aviuz/2.7.5
2.7.5
- Loading branch information
Showing
14 changed files
with
171 additions
and
8 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using HarmonyLib; | ||
using Locks.Options; | ||
using RimWorld; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Locks.HarmonyPatches | ||
{ | ||
[HarmonyPatch(typeof(LordJob_PrisonBreak), "CanOpenAnyDoor")] | ||
public class PrisonerEscapePatch | ||
{ | ||
static bool Postfix(bool __result) | ||
{ | ||
return !LocksSettings.prisonerBreakRespectsLock; | ||
} | ||
} | ||
|
||
[HarmonyPatch(typeof(LordJob_SlaveRebellion), "CanOpenAnyDoor")] | ||
public class SlaveRebelionPatch | ||
{ | ||
static bool Postfix(bool __result) | ||
{ | ||
return !LocksSettings.revoltRespectsLocks; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using UnityEngine; | ||
using Verse; | ||
|
||
namespace Locks.Options | ||
{ | ||
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"; | ||
|
||
public LocksMod(ModContentPack content) : base(content) | ||
{ | ||
this.GetSettings<LocksSettings>(); | ||
} | ||
|
||
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.End(); | ||
} | ||
|
||
public override string SettingsCategory() | ||
{ | ||
return MOD_NAME.Translate(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Verse; | ||
|
||
namespace Locks.Options | ||
{ | ||
public class LocksSettings : ModSettings | ||
{ | ||
public static int childLockAge = 6; | ||
public static bool prisonerBreakRespectsLock = true; | ||
public static bool revoltRespectsLocks = true; | ||
|
||
public override void ExposeData() | ||
{ | ||
Scribe_Values.Look<int>(ref childLockAge, "Locks_childLockAge", 6, true); | ||
|
||
Scribe_Values.Look<bool>(ref prisonerBreakRespectsLock, "Locks_BreakRespectsLocks", true, true); | ||
Scribe_Values.Look<bool>(ref revoltRespectsLocks, "Locks_RevoltRespectLocks", true, true); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters