Skip to content

Commit

Permalink
v1.5.0
Browse files Browse the repository at this point in the history
- Added 1.3 support
  • Loading branch information
Jaxe-Dev committed Jul 27, 2021
1 parent 5de5ba6 commit 86e5cf3
Show file tree
Hide file tree
Showing 9 changed files with 269 additions and 13 deletions.
3 changes: 2 additions & 1 deletion About/About.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
<packageId>Jaxe.PawnRules</packageId>
<name>Pawn Rules</name>
<author>Jaxe</author>
<description>Mod Version: 1.4.4\n\n\nPawn Rules is a mod that allows custom rules to be assigned individually to your colonists, animals, guests and prisoners.\n\nCurrently the following rules can be applied:\n\n- Disallow certain foods\n- Disallow bonding with certain animals\n- Disallow new romances\n- Disallow constructing items that have a quality level\n\nAny of these rules can be disabled and hidden from the rules window. Rules presets and defaults can be imported and exported between games.</description>
<description>Mod Version: 1.5.0\n\n\nPawn Rules is a mod that allows custom rules to be assigned individually to your colonists, animals, guests and prisoners.\n\nCurrently the following rules can be applied:\n\n- Disallow certain foods\n- Disallow bonding with certain animals\n- Disallow new romances\n- Disallow constructing items that have a quality level\n\nAny of these rules can be disabled and hidden from the rules window. Rules presets and defaults can be imported and exported between games.</description>
<supportedVersions>
<li>1.1</li>
<li>1.2</li>
<li>1.3</li>
</supportedVersions>
<modDependencies>
<li>
Expand Down
243 changes: 243 additions & 0 deletions Legacy/1.1-1.2/Assemblies/PawnRules.xml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Pawn Rules
![Mod Version](https://img.shields.io/badge/Mod_Version-1.4.4-blue.svg)
![RimWorld Version](https://img.shields.io/badge/Built_for_RimWorld-1.2-blue.svg)
![Mod Version](https://img.shields.io/badge/Mod_Version-1.5.0-blue.svg)
![RimWorld Version](https://img.shields.io/badge/Built_for_RimWorld-1.3-blue.svg)
![Harmony Version](https://img.shields.io/badge/Powered_by_Harmony-2.x-blue.svg)\
![Steam Subscribers](https://img.shields.io/badge/dynamic/xml.svg?label=Steam+Subscribers&query=//table/tr[2]/td[1]&colorB=blue&url=https://steamcommunity.com/sharedfiles/filedetails/%3Fid=1499843448&suffix=+total)
![GitHub Downloads](https://img.shields.io/github/downloads/Jaxe-Dev/PawnRules/total.svg?colorB=blue&label=GitHub+Downloads)
Expand Down
2 changes: 1 addition & 1 deletion Source/Interface/Dialog_Plans.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ protected override void DoContent(Rect rect)
_listing.Begin(vGrid[1], true);
foreach (var plan in _plans)
{
if (_listing.RadioButton_NewTemp(plan, _selected == plan)) { _selected = plan; }
if (_listing.RadioButton(plan, _selected == plan)) { _selected = plan; }
}
}
else
Expand Down
2 changes: 1 addition & 1 deletion Source/Mod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ internal class Mod : Verse.Mod
{
public const string Id = "PawnRules";
public const string Name = "Pawn Rules";
public const string Version = "1.4.4";
public const string Version = "1.5.0";

public static readonly DirectoryInfo ConfigDirectory = new DirectoryInfo(Path.Combine(GenFilePaths.ConfigFolderPath, Id));

Expand Down
4 changes: 2 additions & 2 deletions Source/Patch/RimWorld_GenConstruct_CanConstruct.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace PawnRules.Patch
{
[HarmonyPatch(typeof(GenConstruct), "CanConstruct")]
[HarmonyPatch(typeof(GenConstruct), "CanConstruct", typeof(Thing), typeof(Pawn), typeof(bool), typeof(bool))]
internal static class RimWorld_GenConstruct_CanConstruct
{
private static void Postfix(ref bool __result, Thing t, Pawn p, bool checkSkills = true, bool forced = false)
Expand All @@ -15,7 +15,7 @@ private static void Postfix(ref bool __result, Thing t, Pawn p, bool checkSkills

var rules = p.GetRules();
if ((rules == null) || rules.AllowArtisan || !checkSkills) { return; }

if (!(t.def.entityDefToBuild is ThingDef thingDef) || !thingDef.HasComp(typeof(CompQuality))) { return; }

if (forced && !JobFailReason.HaveReason && !rules.AllowArtisan) { JobFailReason.Is(Lang.Get("Rules.NotArtisanReason"), Lang.Get("Rules.NotArtisanJob", t.LabelCap)); }
Expand Down
5 changes: 2 additions & 3 deletions Source/Patch/RimWorld_Pawn_GuestTracker_SetGuestStatus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ namespace PawnRules.Patch
[HarmonyPatch(typeof(Pawn_GuestTracker), "SetGuestStatus")]
internal static class RimWorld_Pawn_GuestTracker_SetGuestStatus
{
private static void Prefix(Pawn_GuestTracker __instance, Faction newHost, bool prisoner = false)
private static void Prefix(Pawn_GuestTracker __instance, Faction newHost, GuestStatus guestStatus = GuestStatus.Guest)
{
if (!Registry.IsActive) { return; }

Registry.FactionUpdate(Traverse.Create(__instance).Field<Pawn>("pawn").Value, newHost, !prisoner);
Registry.FactionUpdate(Traverse.Create(__instance).Field<Pawn>("pawn").Value, newHost, guestStatus == GuestStatus.Guest);
}
}
}
6 changes: 3 additions & 3 deletions Source/PawnRules.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,6 @@
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Content Include="..\.gitignore">
<Link>-\.gitignore</Link>
</Content>
<Content Include="..\About\About.xml">
<Link>-\About\About.xml</Link>
</Content>
Expand All @@ -128,6 +125,9 @@
<Content Include="..\Languages\English\Keyed\Keys.xml">
<Link>-\Languages\English\Keyed\Keys.xml</Link>
</Content>
<Content Include="..\loadFolders.xml">
<Link>-\loadFolders.xml</Link>
</Content>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
13 changes: 13 additions & 0 deletions loadFolders.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<loadFolders>
<v1.1>
<li>/</li>
<li>Legacy/1.1-1.2</li>
</v1.1>
<v1.2>
<li>/</li>
<li>Legacy/1.1-1.2</li>
</v1.2>
<v1.3>
<li>/</li>
</v1.3>
</loadFolders>

0 comments on commit 86e5cf3

Please sign in to comment.