diff --git a/About/About.xml b/About/About.xml
index ab50123..56f186e 100644
--- a/About/About.xml
+++ b/About/About.xml
@@ -4,6 +4,6 @@
Pawn RulesJaxe0.19.0
- Pawn 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.
+ Mod Version: 1.0.9\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.https://ludeon.com/forums/index.php?topic=43086.0
diff --git a/About/ModSync.xml b/About/ModSync.xml
index f4c3afa..9c1d833 100644
--- a/About/ModSync.xml
+++ b/About/ModSync.xml
@@ -3,7 +3,7 @@
59f538ed-f86d-4506-a4a5-7e9faaa37508Pawn Rules
- v1.0.8
+ v1.0.9FalseJaxe-Dev
diff --git a/Assemblies/PawnRules.xml b/Assemblies/PawnRules.xml
index 01aa16e..42e118d 100644
--- a/Assemblies/PawnRules.xml
+++ b/Assemblies/PawnRules.xml
@@ -4,49 +4,49 @@
PawnRules
-
+
The base class of a rules option handle.
-
+
Called when the button for this option is clicked. Setting the value must be handled by the delegate. Unused if this option does not implement a button widget.
The pawn being displayed when the button was clicked.
Currently unused but as practice return true if the value was changed.
-
+
Called when the button for this option is clicked in the default rules dialog. Setting the value must be handled by the delegate. Unused if this option does not implement a button widget.
The target of the default rule.
Currently unused but as practice return true if the value was changed.
-
+
Called when the button for this option is clicked. Unused if this option does not implement a button widget.
-
+
Called when the button for this option is clicked in the default rules dialog. Unused if this option does not implement a button widget.
-
+
Used to see if a given pawn has this option.
The pawn to query.
-
+
- Provides a handle for a rules option. This class may not be instantiated manually, create a to add one.
+ Provides a handle for a rules option. This class may not be instantiated manually, create a to add one.
The value type.
-
+
This is called when the value of the option is changing for a pawn. Unused if the option implements a button.
@@ -55,7 +55,7 @@
The new value of the option entered in the rules dialog.
The return value will be the value set for the option.
-
+
This is called when the value of the option is changing for a preset. Unused if the option implements a button.
@@ -64,27 +64,27 @@
The new value of the option entered in the rules dialog.
The return value will be the value set for the option.
-
+
This is called when the value of the option is changing for a pawn. Unused if option option implements a button.
-
+
This is called when the value of the option is changing for a preset type. Unused if the option implements a button.
-
+
Gets or sets the displayed label of this option.
-
+
Gets or sets the tooltip of this option.
-
+
Gets the value of this option for the given pawn.
@@ -92,7 +92,7 @@
The value returned if unable to retrieve the option.
Returns the value if the option is found or if not.
-
+
Gets the default value of this option for the given target.
@@ -100,7 +100,7 @@
The value returned if unable to retrieve the option.
Returns the value if the option is found or if not.
-
+
Sets the value of this option for the given pawn.
@@ -108,42 +108,42 @@
The new value for the option.
Returns true if the option was successfully set.
-
+
Used to set the target type of the pawn that a rule will be applied to. Multiple flags may be set.
-
+
For all colonists part of the player's faction.
-
+
For all animals part of the player's faction.
-
+
For all guests that are currently staying with the player's faction.
-
+
For all prisoners that are being held by the player's faction.
-
+
Provides a link to Pawn Rules and is used to add options to the rules dialog.
-
+
Initializes a link to Pawn Rules. Only one plugin per mod is allowed.
-
+
Adds a new Toggle to the Rules dialog that sets a .
@@ -155,7 +155,7 @@
If set to false it cannot be used in a preset.
Returns a handle for this option.
-
+
Adds a new Entry to the Rules dialog that sets a value.
@@ -167,7 +167,7 @@
If set to false it cannot be used in a preset.
Returns a handle for this option.
-
+
Adds a new Entry to the Rules dialog that sets an value.
@@ -179,7 +179,7 @@
If set to false it cannot be used in a preset.
Returns a handle for this option.
-
+
Adds a new Entry to the Rules dialog that sets a value.
@@ -191,9 +191,9 @@
If set to false it cannot be used in a preset.
Returns a handle for this option.
-
+
- Adds a new Button to the Rules dialog that sets a value. Buttons require to be used to set the value.
+ Adds a new Button to the Rules dialog that sets a value. Buttons require to be used to set the value.
The key used in the save file. Will be automatically prefixed with your Mod Identifier.
The type(s) of pawns this option will apply to.
@@ -203,9 +203,9 @@
If set to false it cannot be used in a preset.
Returns a handle for this option.
-
+
- Adds a new Button to the Rules dialog that sets a value. Buttons require to be used to set the value.
+ Adds a new Button to the Rules dialog that sets a value. Buttons require to be used to set the value.
The key used in the save file. Will be automatically prefixed with your Mod Identifier.
The type(s) of pawns this option will apply to.
@@ -215,9 +215,9 @@
If set to false it cannot be used in a preset.
Returns a handle for this option.
-
+
- Adds a new Button to the Rules dialog that sets an value. Buttons require to be used to set the value.
+ Adds a new Button to the Rules dialog that sets an value. Buttons require to be used to set the value.
The key used in the save file. Will be automatically prefixed with your Mod Identifier.
The type(s) of pawns this option will apply to.
@@ -227,9 +227,9 @@
If set to false it cannot be used in a preset.
Returns a handle for this option.
-
+
- Adds a new Button to the Rules dialog that sets a value. Buttons to be used to set the value.
+ Adds a new Button to the Rules dialog that sets a value. Buttons to be used to set the value.
The key used in the save file. Will be automatically prefixed with your Mod Identifier.
The type(s) of pawns this option will apply to.
diff --git a/README.md b/README.md
index 49f4bd3..9b4cde0 100644
--- a/README.md
+++ b/README.md
@@ -1,12 +1,12 @@
# Pawn Rules
-![](https://img.shields.io/badge/Version-1.0.8-brightgreen.svg)
+![](https://img.shields.io/badge/Version-1.0.9-brightgreen.svg)
Built for **RimWorld B19**\
Powered by **Harmony**\
Supports **ModSync RW**
-[Link to Ludeon Forum thread](https://ludeon.com/forums/index.php?topic=43086.0)\
-[Link to Steam Workshop page](https://steamcommunity.com/sharedfiles/filedetails/?id=1499843448)
+[Link to Steam Workshop page](https://steamcommunity.com/sharedfiles/filedetails/?id=1499843448)\
+[Link to Ludeon Forum thread](https://ludeon.com/forums/index.php?topic=43086.0)
------------
@@ -52,6 +52,7 @@ RimWorld.InteractionWorker_RomanceAttempt.RandomSelectionWeight : Prefix
RimWorld.InteractionWorker_RomanceAttempt.SuccessChance : Prefix
RimWorld.JobGiver_PackFood.IsGoodPackableFoodFor : Postfix
RimWorld.JoyGiver_Ingest.CanIngestForJoy : Prefix
+RimWorld.Pawn_GuestTracker.SetGuestStatus : Prefix
RimWorld.PawnUtility.TrySpawnHatchedOrBornPawn : Postfix
RimWorld.RelationsUtility.TryDevelopBondRelation : Prefix
Verse.Game.FinalizeInit : Postfix
@@ -59,5 +60,4 @@ Verse.Pawn.GetGizmos : Postfix
Verse.Pawn.Kill : Postfix
Verse.Pawn.SetFaction : Prefix
Verse.PawnGenerator.GeneratePawn : Postfix
-Verse.Pawn_GuestTracker.SetGuestStatus : Prefix
```
diff --git a/Source/SDK/OptionHandle.cs b/Source/API/OptionHandle.cs
similarity index 99%
rename from Source/SDK/OptionHandle.cs
rename to Source/API/OptionHandle.cs
index c80ded5..7b7945a 100644
--- a/Source/SDK/OptionHandle.cs
+++ b/Source/API/OptionHandle.cs
@@ -1,7 +1,7 @@
using PawnRules.Data;
using Verse;
-namespace PawnRules.SDK
+namespace PawnRules.API
{
///
/// The base class of a rules option handle.
diff --git a/Source/SDK/OptionTarget.cs b/Source/API/OptionTarget.cs
similarity index 96%
rename from Source/SDK/OptionTarget.cs
rename to Source/API/OptionTarget.cs
index 57d15c1..b49c4f1 100644
--- a/Source/SDK/OptionTarget.cs
+++ b/Source/API/OptionTarget.cs
@@ -1,6 +1,6 @@
using System;
-namespace PawnRules.SDK
+namespace PawnRules.API
{
///
/// Used to set the target type of the pawn that a rule will be applied to. Multiple flags may be set.
diff --git a/Source/SDK/PawnRulesLink.cs b/Source/API/PawnRulesLink.cs
similarity index 99%
rename from Source/SDK/PawnRulesLink.cs
rename to Source/API/PawnRulesLink.cs
index 142383f..7d6a8dc 100644
--- a/Source/SDK/PawnRulesLink.cs
+++ b/Source/API/PawnRulesLink.cs
@@ -4,7 +4,7 @@
using PawnRules.Interface;
using Verse;
-namespace PawnRules.SDK
+namespace PawnRules.API
{
///
/// Provides a link to Pawn Rules and is used to add options to the rules dialog.
diff --git a/Source/Data/AddonOption.cs b/Source/Data/AddonOption.cs
index 90eb55d..f71d08a 100644
--- a/Source/Data/AddonOption.cs
+++ b/Source/Data/AddonOption.cs
@@ -1,6 +1,6 @@
using System;
+using PawnRules.API;
using PawnRules.Interface;
-using PawnRules.SDK;
using Verse;
namespace PawnRules.Data
diff --git a/Source/Data/PawnType.cs b/Source/Data/PawnType.cs
index b5629e5..19d3a5a 100644
--- a/Source/Data/PawnType.cs
+++ b/Source/Data/PawnType.cs
@@ -1,5 +1,5 @@
using System.Linq;
-using PawnRules.SDK;
+using PawnRules.API;
namespace PawnRules.Data
{
diff --git a/Source/Data/Registry.cs b/Source/Data/Registry.cs
index 8257ff0..1de4bb4 100644
--- a/Source/Data/Registry.cs
+++ b/Source/Data/Registry.cs
@@ -2,9 +2,9 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
+using PawnRules.API;
using PawnRules.Interface;
using PawnRules.Patch;
-using PawnRules.SDK;
using RimWorld;
using RimWorld.Planet;
using Verse;
@@ -165,11 +165,7 @@ public static Rules GetOrDefaultRules(Pawn pawn)
public static void ReplaceRules(Pawn pawn, Rules rules) => Instance._rules[pawn] = rules;
public static void ReplaceDefaultRules(PawnType type, Rules rules) => Instance._defaults[type] = rules;
- private static Rules ChangeTypeOrCreateRules(Pawn pawn, PawnType type)
- {
- Instance._rules[pawn] = new Rules(pawn, type ?? pawn.GetTargetType());
- return Instance._rules[pawn];
- }
+ private static void ChangeTypeOrCreateRules(Pawn pawn, PawnType type) => Instance._rules[pawn] = GetDefaultRules(type);
public static Rules CloneRules(Pawn original, Pawn cloner)
{
@@ -191,7 +187,7 @@ public static void DeleteRules(Pawn pawn)
public static void FactionUpdate(Thing thing, Faction newFaction, bool? guest = null)
{
- if (!(thing is Pawn pawn) || !pawn.Spawned || !pawn.Dead) { return; }
+ if (!(thing is Pawn pawn) || !pawn.Spawned || pawn.Dead) { return; }
PawnType type;
@@ -207,8 +203,6 @@ public static void FactionUpdate(Thing thing, Faction newFaction, bool? guest =
}
else { return; }
- if (GetDefaultRules(type).IsVoid) { return; }
-
ChangeTypeOrCreateRules(pawn, type);
}
diff --git a/Source/Interface/Dialog_Alert.cs b/Source/Interface/Dialog_Alert.cs
index 2206ce5..b8ca6be 100644
--- a/Source/Interface/Dialog_Alert.cs
+++ b/Source/Interface/Dialog_Alert.cs
@@ -36,13 +36,13 @@ public Dialog_Alert(string message, Buttons buttons = Buttons.Ok, Action onAccep
public override void DoWindowContents(Rect rect)
{
var listing = new Listing_Standard();
- var vGrid = rect.GetVGrid(4f, 0f, 30f);
+ var vGrid = rect.GetVGrid(4f, -1f, 30f);
listing.Begin(vGrid[0]);
listing.Label(_message);
listing.End();
- var hGrid = vGrid[1].GetHGrid(4f, 100f, 0f);
+ var hGrid = vGrid[1].GetHGrid(4f, 100f, -1f);
listing.Begin(_buttons == Buttons.Ok ? vGrid[1] : hGrid[0]);
diff --git a/Source/Interface/Dialog_PresetName.cs b/Source/Interface/Dialog_PresetName.cs
index 3be4f43..45c5a17 100644
--- a/Source/Interface/Dialog_PresetName.cs
+++ b/Source/Interface/Dialog_PresetName.cs
@@ -73,7 +73,7 @@ public override void DoContent(Rect rect)
listing.Gap();
listing.End();
- var grid = rect.AdjustedBy(0f, listing.CurHeight, 0f, -listing.CurHeight).GetHGrid(4f, 0f, 0f);
+ var grid = rect.AdjustedBy(0f, listing.CurHeight, 0f, -listing.CurHeight).GetHGrid(4f, -1f, -1f);
listing.Begin(grid[0]);
if (listing.ButtonText(Lang.Get("Button.OK"), null, valid))
diff --git a/Source/Interface/Dialog_Restrictions.cs b/Source/Interface/Dialog_Restrictions.cs
index 20936d6..3e46468 100644
--- a/Source/Interface/Dialog_Restrictions.cs
+++ b/Source/Interface/Dialog_Restrictions.cs
@@ -75,8 +75,8 @@ public override void DoContent(Rect rect)
_color = GUI.color;
- var vGrid = rect.GetVGrid(4f, 42f, 0f);
- var hGrid = vGrid[1].GetHGrid(8f, 200f, 0f, 0f);
+ var vGrid = rect.GetVGrid(4f, 42f, -1f);
+ var hGrid = vGrid[1].GetHGrid(8f, 200f, -1f, -1f);
DoHeader(vGrid[0]);
_presetList.DoContent(hGrid[0]);
@@ -86,7 +86,7 @@ public override void DoContent(Rect rect)
private void DoHeader(Rect rect)
{
- var grid = rect.GetHGrid(8f, 200f, 0f, 0f);
+ var grid = rect.GetHGrid(8f, 200f, -1f, -1f);
_headerList.Begin(grid[0]);
_headerList.Label(Lang.Get("Preset.Header").Italic().Bold());
_headerList.GapLine();
@@ -105,7 +105,7 @@ private void DoHeader(Rect rect)
private void DoCategories(Rect rect)
{
- var vGrid = rect.GetVGrid(4f, 0f, 30f);
+ var vGrid = rect.GetVGrid(4f, -1f, 30f);
_categoryList.Begin(vGrid[0]);
foreach (var category in _template.Categories)
@@ -129,7 +129,7 @@ private void DoCategories(Rect rect)
if (!_presetList.EditMode) { return; }
- var hGrid = vGrid[1].GetHGrid(4f, 0f, 0f);
+ var hGrid = vGrid[1].GetHGrid(4f, -1f, -1f);
_categoryList.Begin(hGrid[0]);
if (_categoryList.ButtonText(Lang.Get("Button.RestrictionsAllowOn"))) { _template.ToggleAll(true); }
_categoryList.End();
diff --git a/Source/Interface/Dialog_Rules.cs b/Source/Interface/Dialog_Rules.cs
index f613597..f602fc9 100644
--- a/Source/Interface/Dialog_Rules.cs
+++ b/Source/Interface/Dialog_Rules.cs
@@ -201,8 +201,8 @@ public override void DoContent(Rect rect)
Title = _type == null ? Lang.Get("Dialog_Rules.Title", _pawn.Name.ToStringFull.Bold(), _preset.Type.Label) : Lang.Get("Dialog_Rules.TitleDefault", _type.LabelPlural.Bold());
var listing = new Listing_StandardPlus();
- var hGrid = rect.GetHGrid(8f, 200f, 0f);
- var lGrid = hGrid[0].GetVGrid(4f, 42f, 0f);
+ var hGrid = rect.GetHGrid(8f, 200f, -1f);
+ var lGrid = hGrid[0].GetVGrid(4f, 42f, -1f);
listing.Begin(lGrid[0]);
listing.Label(Lang.Get("Preset.Header").Italic().Bold());
@@ -210,7 +210,7 @@ public override void DoContent(Rect rect)
listing.End();
_preset.DoContent(lGrid[1]);
- var vGrid = hGrid[1].GetVGrid(4f, 42f, 0f, 62f);
+ var vGrid = hGrid[1].GetVGrid(4f, 42f, -1f, 62f);
listing.Begin(vGrid[0]);
listing.Label(Lang.Get("Dialog_Rules.Configuration").Italic().Bold());
listing.GapLine();
@@ -238,7 +238,7 @@ public override void DoContent(Rect rect)
if (_template.HasAddons)
{
- var addonsRect = vGrid[1].GetVGrid(4f, listing.CurHeight, 0f)[1];
+ var addonsRect = vGrid[1].GetVGrid(4f, listing.CurHeight, -1f)[1];
_addons.Begin(addonsRect, addonsRect.height <= _template.AddonsRectHeight);
GuiPlus.DoAddonsListing(_addons, _template, editMode);
_addons.End();
@@ -246,7 +246,7 @@ public override void DoContent(Rect rect)
GUI.color = color;
- var optionGrid = vGrid[2].GetVGrid(2f, 0f, 0f);
+ var optionGrid = vGrid[2].GetVGrid(2f, -1f, -1f);
listing.Begin(optionGrid[0]);
if (listing.ButtonText(Lang.Get("Button.AssignTo"), Lang.Get("Button.AssignToDesc"), (_floatMenuAssign.Count > 0) && (!editMode || (_template == _personalized)))) { Find.WindowStack.Add(new FloatMenu(_floatMenuAssign)); }
listing.End();
diff --git a/Source/Interface/GuiPlus.cs b/Source/Interface/GuiPlus.cs
index c6cee19..cc29367 100644
--- a/Source/Interface/GuiPlus.cs
+++ b/Source/Interface/GuiPlus.cs
@@ -18,7 +18,7 @@ internal static class GuiPlus
private static readonly Color InactiveColor = new Color(0.37f, 0.37f, 0.37f, 0.8f);
public static readonly Color ReadOnlyColor = new Color(0.75f, 0.75f, 0.75f, 0.75f);
- private static readonly Texture2D EditRulesTexture = ContentFinder.Get("UI/EditRules");
+ private static readonly Texture2D EditRulesTexture = ContentFinder.Get("PawnRules/EditRules");
public static Command_Action EditRulesCommand(Pawn pawn) => new Command_Action
{
diff --git a/Source/Interface/Listing_Preset.cs b/Source/Interface/Listing_Preset.cs
index 2d34c06..051f7b4 100644
--- a/Source/Interface/Listing_Preset.cs
+++ b/Source/Interface/Listing_Preset.cs
@@ -58,7 +58,7 @@ public void DoContent(Rect rect)
if (presets.Any()) { _listing.GapLine(); }
_listing.End();
- var presetGrid = rect.GetVGrid(4f, _listing.CurHeight, 0f, 62f);
+ var presetGrid = rect.GetVGrid(4f, _listing.CurHeight, -1f, 62f);
_presetListing.Begin(presetGrid[1], true);
foreach (var preset in presets)
@@ -68,7 +68,7 @@ public void DoContent(Rect rect)
}
_presetListing.End();
- var buttonGrid = presetGrid[2].GetHGrid(4f, 0f, 0f);
+ var buttonGrid = presetGrid[2].GetHGrid(4f, -1f, -1f);
_listing.Begin(buttonGrid[0]);
if (_listing.ButtonText(Lang.Get("Button.PresetNew"), Lang.Get("Button.PresetNewDesc"), !EditMode))
diff --git a/Source/Mod.cs b/Source/Mod.cs
index 77fd13e..4b622a3 100644
--- a/Source/Mod.cs
+++ b/Source/Mod.cs
@@ -7,7 +7,7 @@ internal class Mod : Verse.Mod
public const string Id = "PawnRules";
public const string Name = "Pawn Rules";
public const string Author = "Jaxe";
- public const string Version = "1.0.8";
+ public const string Version = "1.0.9";
public static ModContentPack ContentPack { get; private set; }
diff --git a/Source/Patch/Extensions.cs b/Source/Patch/Extensions.cs
index 0037ee1..aa740df 100644
--- a/Source/Patch/Extensions.cs
+++ b/Source/Patch/Extensions.cs
@@ -40,19 +40,19 @@ public static Rect[] GetHGrid(this Rect self, float spacing, params float[] widt
for (var index = 0; index < widths.Length; index++)
{
var width = widths[index];
- if (width > 0) { fixedWidths += width; }
+ if (width >= 0f) { fixedWidths += width; }
else { unfixedCount++; }
if (index != widths.LastIndex()) { fixedWidths += spacing; }
}
- var unfixedWidth = unfixedCount > 0 ? (self.width - fixedWidths) / unfixedCount : 0;
+ var unfixedWidth = unfixedCount > 0 ? (self.width - fixedWidths) / unfixedCount : 0f;
for (var index = 0; index < widths.Length; index++)
{
var width = widths[index];
float newWidth;
- if (width > 0)
+ if (width >= 0f)
{
newWidth = width;
rects[index] = new Rect(currentX, self.y, newWidth, self.height);
@@ -78,19 +78,19 @@ public static Rect[] GetVGrid(this Rect self, float spacing, params float[] heig
for (var index = 0; index < heights.Length; index++)
{
var height = heights[index];
- if (height > 0) { fixedHeights += height; }
+ if (height >= 0f) { fixedHeights += height; }
else { unfixedCount++; }
if (index != heights.LastIndex()) { fixedHeights += spacing; }
}
- var unfixedWidth = unfixedCount > 0 ? (self.height - fixedHeights) / unfixedCount : 0;
+ var unfixedWidth = unfixedCount > 0 ? (self.height - fixedHeights) / unfixedCount : 0f;
for (var index = 0; index < heights.Length; index++)
{
var height = heights[index];
float newHeight;
- if (height > 0)
+ if (height >= 0f)
{
newHeight = height;
rects[index] = new Rect(self.x, currentY, self.width, newHeight);
diff --git a/Source/Patch/RimWorld_FoodUtility_BestFoodInInventory.cs b/Source/Patch/RimWorld_FoodUtility_BestFoodInInventory.cs
index 4d798ac..cf94ae2 100644
--- a/Source/Patch/RimWorld_FoodUtility_BestFoodInInventory.cs
+++ b/Source/Patch/RimWorld_FoodUtility_BestFoodInInventory.cs
@@ -5,7 +5,7 @@
namespace PawnRules.Patch
{
- [HarmonyPatch(typeof(FoodUtility), nameof(FoodUtility.BestFoodInInventory))]
+ [HarmonyPatch(typeof(FoodUtility), "BestFoodInInventory")]
internal static class RimWorld_FoodUtility_BestFoodInInventory
{
private static bool Prefix(ref Thing __result, Pawn holder, Pawn eater = null, FoodPreferability minFoodPref = FoodPreferability.NeverForNutrition, FoodPreferability maxFoodPref = FoodPreferability.MealLavish, float minStackNutrition = 0.0f, bool allowDrug = false)
diff --git a/Source/Patch/RimWorld_FoodUtility_BestFoodSourceOnMap.cs b/Source/Patch/RimWorld_FoodUtility_BestFoodSourceOnMap.cs
index 9081dad..ba3cd21 100644
--- a/Source/Patch/RimWorld_FoodUtility_BestFoodSourceOnMap.cs
+++ b/Source/Patch/RimWorld_FoodUtility_BestFoodSourceOnMap.cs
@@ -8,7 +8,7 @@
namespace PawnRules.Patch
{
- [HarmonyPatch(typeof(FoodUtility), nameof(FoodUtility.BestFoodSourceOnMap))]
+ [HarmonyPatch(typeof(FoodUtility), "BestFoodSourceOnMap")]
internal static class RimWorld_FoodUtility_BestFoodSourceOnMap
{
private static bool Prefix(ref Thing __result, Pawn getter, Pawn eater, bool desperate, out ThingDef foodDef, FoodPreferability maxPref = FoodPreferability.MealLavish, bool allowPlant = true, bool allowDrug = true, bool allowCorpse = true, bool allowDispenserFull = true, bool allowDispenserEmpty = true, bool allowForbidden = false, bool allowSociallyImproper = false, bool allowHarvest = false, bool forceScanWholeMap = false)
diff --git a/Source/Patch/RimWorld_FoodUtility_TryFindBestFoodSourceFor.cs b/Source/Patch/RimWorld_FoodUtility_TryFindBestFoodSourceFor.cs
index 0ec8262..271fa6c 100644
--- a/Source/Patch/RimWorld_FoodUtility_TryFindBestFoodSourceFor.cs
+++ b/Source/Patch/RimWorld_FoodUtility_TryFindBestFoodSourceFor.cs
@@ -4,7 +4,7 @@
namespace PawnRules.Patch
{
- [HarmonyPatch(typeof(FoodUtility), nameof(FoodUtility.TryFindBestFoodSourceFor))]
+ [HarmonyPatch(typeof(FoodUtility), "TryFindBestFoodSourceFor")]
internal static class RimWorld_FoodUtility_TryFindBestFoodSourceFor
{
private static bool Prefix(ref bool __result, Pawn getter, Pawn eater, bool desperate, out Thing foodSource, out ThingDef foodDef, bool canRefillDispenser = true, bool canUseInventory = true, bool allowForbidden = false, bool allowCorpse = true, bool allowSociallyImproper = false, bool allowHarvest = false, bool forceScanWholeMap = false)
diff --git a/Source/Patch/RimWorld_GenConstruct_CanConstruct.cs b/Source/Patch/RimWorld_GenConstruct_CanConstruct.cs
index f29b19e..95d585f 100644
--- a/Source/Patch/RimWorld_GenConstruct_CanConstruct.cs
+++ b/Source/Patch/RimWorld_GenConstruct_CanConstruct.cs
@@ -6,7 +6,7 @@
namespace PawnRules.Patch
{
- [HarmonyPatch(typeof(GenConstruct), nameof(GenConstruct.CanConstruct))]
+ [HarmonyPatch(typeof(GenConstruct), "CanConstruct")]
internal static class RimWorld_GenConstruct_CanConstruct
{
private static void Postfix(ref bool __result, Thing t, Pawn p, bool checkConstructionSkill = true, bool forced = false)
diff --git a/Source/Patch/RimWorld_InteractionWorker_RomanceAttempt_RandomSelectionWeight.cs b/Source/Patch/RimWorld_InteractionWorker_RomanceAttempt_RandomSelectionWeight.cs
index 129f569..6d964c7 100644
--- a/Source/Patch/RimWorld_InteractionWorker_RomanceAttempt_RandomSelectionWeight.cs
+++ b/Source/Patch/RimWorld_InteractionWorker_RomanceAttempt_RandomSelectionWeight.cs
@@ -5,7 +5,7 @@
namespace PawnRules.Patch
{
- [HarmonyPatch(typeof(InteractionWorker_RomanceAttempt), nameof(InteractionWorker_RomanceAttempt.RandomSelectionWeight))]
+ [HarmonyPatch(typeof(InteractionWorker_RomanceAttempt), "RandomSelectionWeight")]
internal static class RimWorld_InteractionWorker_RomanceAttempt_RandomSelectionWeight
{
private static bool Prefix(ref float __result, Pawn initiator, Pawn recipient)
diff --git a/Source/Patch/RimWorld_InteractionWorker_RomanceAttempt_SuccessChance.cs b/Source/Patch/RimWorld_InteractionWorker_RomanceAttempt_SuccessChance.cs
index 27f2552..d7c9b39 100644
--- a/Source/Patch/RimWorld_InteractionWorker_RomanceAttempt_SuccessChance.cs
+++ b/Source/Patch/RimWorld_InteractionWorker_RomanceAttempt_SuccessChance.cs
@@ -5,7 +5,7 @@
namespace PawnRules.Patch
{
- [HarmonyPatch(typeof(InteractionWorker_RomanceAttempt), nameof(InteractionWorker_RomanceAttempt.SuccessChance))]
+ [HarmonyPatch(typeof(InteractionWorker_RomanceAttempt), "SuccessChance")]
internal static class RimWorld_InteractionWorker_RomanceAttempt_SuccessChance
{
private static bool Prefix(ref float __result, Pawn initiator, Pawn recipient)
diff --git a/Source/Patch/RimWorld_JobGiver_PackFood.cs b/Source/Patch/RimWorld_JobGiver_PackFood_IsGoodPackableFoodFor.cs
similarity index 88%
rename from Source/Patch/RimWorld_JobGiver_PackFood.cs
rename to Source/Patch/RimWorld_JobGiver_PackFood_IsGoodPackableFoodFor.cs
index 495aaaf..2a7d51c 100644
--- a/Source/Patch/RimWorld_JobGiver_PackFood.cs
+++ b/Source/Patch/RimWorld_JobGiver_PackFood_IsGoodPackableFoodFor.cs
@@ -6,7 +6,7 @@
namespace PawnRules.Patch
{
[HarmonyPatch(typeof(JobGiver_PackFood), "IsGoodPackableFoodFor")]
- internal static class RimWorld_JobGiver_PackFood
+ internal static class RimWorld_JobGiver_PackFood_IsGoodPackableFoodFor
{
private static void Postfix(ref bool __result, Thing food, Pawn forPawn)
{
diff --git a/Source/Patch/RimWorld_JoyGiver_Ingest.cs b/Source/Patch/RimWorld_JoyGiver_Ingest_CanIngestForJoy.cs
similarity index 89%
rename from Source/Patch/RimWorld_JoyGiver_Ingest.cs
rename to Source/Patch/RimWorld_JoyGiver_Ingest_CanIngestForJoy.cs
index fbd156a..940fff1 100644
--- a/Source/Patch/RimWorld_JoyGiver_Ingest.cs
+++ b/Source/Patch/RimWorld_JoyGiver_Ingest_CanIngestForJoy.cs
@@ -6,7 +6,7 @@
namespace PawnRules.Patch
{
[HarmonyPatch(typeof(JoyGiver_Ingest), "CanIngestForJoy")]
- internal static class RimWorld_JoyGiver_Ingest
+ internal static class RimWorld_JoyGiver_Ingest_CanIngestForJoy
{
private static bool Prefix(ref bool __result, Pawn pawn, Thing t)
{
diff --git a/Source/Patch/RimWorld_PawnUtility_TrySpawnHatchedOrBornPawn.cs b/Source/Patch/RimWorld_PawnUtility_TrySpawnHatchedOrBornPawn.cs
index 4b017e0..57fa569 100644
--- a/Source/Patch/RimWorld_PawnUtility_TrySpawnHatchedOrBornPawn.cs
+++ b/Source/Patch/RimWorld_PawnUtility_TrySpawnHatchedOrBornPawn.cs
@@ -5,7 +5,7 @@
namespace PawnRules.Patch
{
- [HarmonyPatch(typeof(PawnUtility), nameof(PawnUtility.TrySpawnHatchedOrBornPawn))]
+ [HarmonyPatch(typeof(PawnUtility), "TrySpawnHatchedOrBornPawn")]
internal static class RimWorld_PawnUtility_TrySpawnHatchedOrBornPawn
{
private static void Postfix(bool __result, Pawn pawn, Thing motherOrEgg)
diff --git a/Source/Patch/Verse_Pawn_GuestTracker_SetGuestStatus.cs b/Source/Patch/RimWorld_Pawn_GuestTracker_SetGuestStatus.cs
similarity index 72%
rename from Source/Patch/Verse_Pawn_GuestTracker_SetGuestStatus.cs
rename to Source/Patch/RimWorld_Pawn_GuestTracker_SetGuestStatus.cs
index 6ab6a8b..5b43f22 100644
--- a/Source/Patch/Verse_Pawn_GuestTracker_SetGuestStatus.cs
+++ b/Source/Patch/RimWorld_Pawn_GuestTracker_SetGuestStatus.cs
@@ -5,8 +5,8 @@
namespace PawnRules.Patch
{
- [HarmonyPatch(typeof(Pawn_GuestTracker), nameof(Pawn_GuestTracker.SetGuestStatus))]
- internal static class Verse_Pawn_GuestTracker_SetGuestStatus
+ [HarmonyPatch(typeof(Pawn_GuestTracker), "SetGuestStatus")]
+ internal static class RimWorld_Pawn_GuestTracker_SetGuestStatus
{
private static void Prefix(Pawn_GuestTracker __instance, Faction newHost, bool prisoner = false)
{
diff --git a/Source/Patch/RimWorld_RelationsUtility_TryDevelopBondRelation.cs b/Source/Patch/RimWorld_RelationsUtility_TryDevelopBondRelation.cs
index 62bdc05..18e6279 100644
--- a/Source/Patch/RimWorld_RelationsUtility_TryDevelopBondRelation.cs
+++ b/Source/Patch/RimWorld_RelationsUtility_TryDevelopBondRelation.cs
@@ -5,7 +5,7 @@
namespace PawnRules.Patch
{
- [HarmonyPatch(typeof(RelationsUtility), nameof(RelationsUtility.TryDevelopBondRelation))]
+ [HarmonyPatch(typeof(RelationsUtility), "TryDevelopBondRelation")]
internal static class RimWorld_RelationsUtility_TryDevelopBondRelation
{
private static bool Prefix(ref bool __result, Pawn humanlike, Pawn animal)
diff --git a/Source/Patch/Verse_Game_FinalizeInit.cs b/Source/Patch/Verse_Game_FinalizeInit.cs
index b992d5c..f118aee 100644
--- a/Source/Patch/Verse_Game_FinalizeInit.cs
+++ b/Source/Patch/Verse_Game_FinalizeInit.cs
@@ -3,7 +3,7 @@
namespace PawnRules.Patch
{
- [HarmonyPatch(typeof(Game), nameof(Game.FinalizeInit))]
+ [HarmonyPatch(typeof(Game), "FinalizeInit")]
internal static class Verse_Game_FinalizeInit
{
private static void Postfix() => Controller.LoadWorld();
diff --git a/Source/Patch/Verse_PawnGenerator_GeneratePawn.cs b/Source/Patch/Verse_PawnGenerator_GeneratePawn.cs
index 7ff4783..8633021 100644
--- a/Source/Patch/Verse_PawnGenerator_GeneratePawn.cs
+++ b/Source/Patch/Verse_PawnGenerator_GeneratePawn.cs
@@ -5,7 +5,7 @@
namespace PawnRules.Patch
{
- [HarmonyPatch(typeof(PawnGenerator), nameof(PawnGenerator.GeneratePawn), typeof(PawnGenerationRequest))]
+ [HarmonyPatch(typeof(PawnGenerator), "GeneratePawn", typeof(PawnKindDef), typeof(Faction))]
internal static class Verse_PawnGenerator_GeneratePawn
{
private static void Postfix(ref Pawn __result)
diff --git a/Source/Patch/Verse_Pawn_GetGizmos.cs b/Source/Patch/Verse_Pawn_GetGizmos.cs
index 048e580..d076a5f 100644
--- a/Source/Patch/Verse_Pawn_GetGizmos.cs
+++ b/Source/Patch/Verse_Pawn_GetGizmos.cs
@@ -6,7 +6,7 @@
namespace PawnRules.Patch
{
- [HarmonyPatch(typeof(Pawn), nameof(Pawn.GetGizmos))]
+ [HarmonyPatch(typeof(Pawn), "GetGizmos")]
internal static class Verse_Pawn_GetGizmos
{
private static void Postfix(Pawn __instance, ref IEnumerable __result)
diff --git a/Source/Patch/Verse_Pawn_Kill.cs b/Source/Patch/Verse_Pawn_Kill.cs
index 6edb494..509de49 100644
--- a/Source/Patch/Verse_Pawn_Kill.cs
+++ b/Source/Patch/Verse_Pawn_Kill.cs
@@ -4,7 +4,7 @@
namespace PawnRules.Patch
{
- [HarmonyPatch(typeof(Pawn), nameof(Pawn.Kill))]
+ [HarmonyPatch(typeof(Pawn), "Kill")]
internal static class Verse_Pawn_Kill
{
private static void Postfix(Pawn __instance)
diff --git a/Source/Patch/Verse_Pawn_SetFaction.cs b/Source/Patch/Verse_Pawn_SetFaction.cs
index 52a84b3..20617d3 100644
--- a/Source/Patch/Verse_Pawn_SetFaction.cs
+++ b/Source/Patch/Verse_Pawn_SetFaction.cs
@@ -5,7 +5,7 @@
namespace PawnRules.Patch
{
- [HarmonyPatch(typeof(Pawn), nameof(Pawn.SetFaction))]
+ [HarmonyPatch(typeof(Pawn), "SetFaction")]
internal static class Verse_Pawn_SetFaction
{
private static void Prefix(Pawn __instance, Faction newFaction)
diff --git a/Source/PawnRules.csproj b/Source/PawnRules.csproj
index 4ad5a96..4d085ee 100644
--- a/Source/PawnRules.csproj
+++ b/Source/PawnRules.csproj
@@ -88,8 +88,9 @@
-
-
+
+
+
@@ -97,10 +98,9 @@
-
-
-
-
+
+
+
@@ -124,8 +124,8 @@
-\Languages\English\Keyed\PawnRules.xml
Designer
-
- -\Textures\UI\EditRules.png
+
+ -\Textures\PawnRules\EditRules.png
diff --git a/Textures/UI/EditRules.png b/Textures/PawnRules/EditRules.png
similarity index 100%
rename from Textures/UI/EditRules.png
rename to Textures/PawnRules/EditRules.png