Skip to content

Commit

Permalink
Updates to 1.0, proper multiversion support.
Browse files Browse the repository at this point in the history
  • Loading branch information
quicksilverfox committed Feb 20, 2020
1 parent b86fd7e commit 0ac59af
Show file tree
Hide file tree
Showing 231 changed files with 18,223 additions and 243 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file added AnimalsLogic/1.0/Assemblies/AnimalsLogic.dll
Binary file not shown.
26 changes: 26 additions & 0 deletions AnimalsLogic/1.0/Patches/patches.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8" ?>

<Patch>

<Operation Class="PatchOperationReplace">
<xpath>Defs/ThinkTreeDef[defName = "Animal"]/thinkRoot/subNodes/li[18]/subNodes/li[3]</xpath>
<value>
<li Class="AnimalsLogic.ThinkNode_ChancePerHour_AnimalsHaulConfig">
<subNodes>
<li Class="ThinkNode_ConditionalTrainableCompleted">
<trainable>Haul</trainable>
<subNodes>
<li Class="ThinkNode_Tagger">
<tagToGive>TrainedAnimalBehavior</tagToGive>
<subNodes>
<li Class="JobGiver_Haul" />
</subNodes>
</li>
</subNodes>
</li>
</subNodes>
</li>
</value>
</Operation>

</Patch>
Binary file added AnimalsLogic/1.1/Assemblies/0Harmony.dll
Binary file not shown.
2,434 changes: 2,434 additions & 0 deletions AnimalsLogic/1.1/Assemblies/0Harmony.xml

Large diffs are not rendered by default.

Binary file added AnimalsLogic/1.1/Assemblies/AnimalsLogic.dll
Binary file not shown.
26 changes: 26 additions & 0 deletions AnimalsLogic/1.1/Patches/patches.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8" ?>

<Patch>

<Operation Class="PatchOperationReplace">
<xpath>Defs/ThinkTreeDef[defName = "Animal"]/thinkRoot/subNodes/li[18]/subNodes/li[3]</xpath>
<value>
<li Class="AnimalsLogic.ThinkNode_ChancePerHour_AnimalsHaulConfig">
<subNodes>
<li Class="ThinkNode_ConditionalTrainableCompleted">
<trainable>Haul</trainable>
<subNodes>
<li Class="ThinkNode_Tagger">
<tagToGive>TrainedAnimalBehavior</tagToGive>
<subNodes>
<li Class="JobGiver_Haul" />
</subNodes>
</li>
</subNodes>
</li>
</subNodes>
</li>
</value>
</Operation>

</Patch>
2 changes: 2 additions & 0 deletions AnimalsLogic/About/About.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<ModMetaData>
<name>Animals Logic</name>
<packageId>Oblitus.AnimalsLogic</packageId>
<author>Oblitus</author>
<supportedVersions>
<li>0.19</li>
<li>1.0</li>
<li>1.1</li>
</supportedVersions>
<description>[*] Tags trained animals in caravan and trade interfaces.
[*] Egg-layers will try to find a bed (or any other type of animal sleeping spots) in their allowed area to lay an egg. Unforbids eggs laid outside the home area.
Expand Down
19 changes: 0 additions & 19 deletions AnimalsLogic/About/Manifest.xml

This file was deleted.

14 changes: 0 additions & 14 deletions AnimalsLogic/About/ModSync.xml

This file was deleted.

2 changes: 1 addition & 1 deletion AnimalsLogic/Source/AnimalsLogic/AnimalsAreDifferent.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Harmony;
using HarmonyLib;
using RimWorld;
using System;
using Verse;
Expand Down
4 changes: 2 additions & 2 deletions AnimalsLogic/Source/AnimalsLogic/AnimalsLogic.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Harmony;
using HarmonyLib;
using System.Reflection;
using Verse;
using UnityEngine;
Expand All @@ -14,7 +14,7 @@ class AnimalsLogic : Mod

public AnimalsLogic(ModContentPack content) : base(content)
{
var harmony = HarmonyInstance.Create("net.quicksilverfox.rimworld.mod.animalslogic");
var harmony = new Harmony("net.quicksilverfox.rimworld.mod.animalslogic");
harmony.PatchAll(Assembly.GetExecutingAssembly());
base.GetSettings<Settings>();
}
Expand Down
20 changes: 17 additions & 3 deletions AnimalsLogic/Source/AnimalsLogic/AnimalsLogic.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>AnimalsLogic</RootNamespace>
<AssemblyName>AnimalsLogic</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
Expand All @@ -31,8 +31,8 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="0Harmony">
<HintPath>..\..\..\0Harmony.dll</HintPath>
<Reference Include="0Harmony, Version=2.0.0.4, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Lib.Harmony.2.0.0.4\lib\net35\0Harmony.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp">
<HintPath>..\..\..\..\..\..\Games\SteamLibrary\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\Assembly-CSharp.dll</HintPath>
Expand All @@ -48,6 +48,14 @@
<HintPath>..\..\..\..\..\..\Games\SteamLibrary\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\UnityEngine.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.CoreModule">
<HintPath>..\..\..\..\..\..\Games\SteamLibrary\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>..\..\..\..\..\..\Games\SteamLibrary\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\UnityEngine.UI.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="AnimalsAreDifferent.cs" />
Expand All @@ -68,5 +76,11 @@
<Compile Include="TastesLikeChicken.cs" />
<Compile Include="YouSleepHere.cs" />
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Connected Services\" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
2 changes: 1 addition & 1 deletion AnimalsLogic/Source/AnimalsLogic/Come.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Harmony;
using HarmonyLib;
using RimWorld;
using Verse;
using System.Reflection;
Expand Down
2 changes: 1 addition & 1 deletion AnimalsLogic/Source/AnimalsLogic/DoNotEatRandomly.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Harmony;
using HarmonyLib;
using RimWorld;
using System;
using Verse;
Expand Down
2 changes: 1 addition & 1 deletion AnimalsLogic/Source/AnimalsLogic/ForgetMeNot.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Harmony;
using HarmonyLib;
using RimWorld;
using Verse;
using System.Reflection.Emit;
Expand Down
2 changes: 1 addition & 1 deletion AnimalsLogic/Source/AnimalsLogic/HostilePredators.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Harmony;
using HarmonyLib;
using RimWorld;
using System;
using Verse;
Expand Down
2 changes: 1 addition & 1 deletion AnimalsLogic/Source/AnimalsLogic/LayEggsInNests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Harmony;
using HarmonyLib;
using RimWorld;
using System;
using System.Collections.Generic;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace AnimalsLogic
public class Alert_AnimalNeedsRescuing : Alert_Critical
{

private IEnumerable<Pawn> AnimalsNeedingRescue
private IEnumerable<Thing> AnimalsNeedingRescue
{
get
{
Expand All @@ -28,19 +28,19 @@ public override string GetLabel()
return "AnimalsNeedRescue".Translate();
}

public override string GetExplanation()
public override TaggedString GetExplanation()
{
StringBuilder stringBuilder = new StringBuilder();
foreach (Pawn pawn in AnimalAlertsUtility.SortedAnimalList(AnimalsNeedingRescue))
foreach (Pawn pawn in AnimalAlertsUtility.SortedAnimalList(AnimalsNeedingRescue).Cast<Pawn>())
{
stringBuilder.AppendLine($" {pawn.LabelShort} {((pawn.Name != null && !pawn.Name.Numerical) ? "(" + pawn.KindLabel + ")" : "")} {(pawn.HasBondRelation() ? "BondBrackets".Translate() : "")}");
stringBuilder.AppendLine($" {pawn.LabelShort} {((pawn.Name != null && !pawn.Name.Numerical) ? "(" + pawn.KindLabel + ")" : "")} {(pawn.HasBondRelation() ? "BondBrackets".Translate().ToString() : "")}");
}
return string.Format("AnimalsNeedRescueDesc".Translate(), stringBuilder.ToString());
}

public override AlertReport GetReport()
{
return (Settings.medical_alerts) ? AlertReport.CulpritsAre(AnimalsNeedingRescue) : false;
return (Settings.medical_alerts) ? AlertReport.CulpritsAre(AnimalsNeedingRescue.ToList<Thing>()) : false;
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public Alert_AnimalNeedsTend()
defaultPriority = AlertPriority.High;
}

private IEnumerable<Pawn> NeedingAnimals
private IEnumerable<Thing> NeedingAnimals
{
get
{
Expand All @@ -39,19 +39,19 @@ public override string GetLabel()
return "AnimalsNeedTreatment".Translate();
}

public override string GetExplanation()
public override TaggedString GetExplanation()
{
StringBuilder stringBuilder = new StringBuilder();
foreach (Pawn pawn in AnimalAlertsUtility.SortedAnimalList(NeedingAnimals))
{
stringBuilder.AppendLine($" {pawn.LabelShort} {((pawn.Name != null && !pawn.Name.Numerical) ? "(" + pawn.KindLabel + ")" : "")} {(pawn.HasBondRelation() ? "BondBrackets".Translate() : "")}");
stringBuilder.AppendLine($" {pawn.LabelShort} {((pawn.Name != null && !pawn.Name.Numerical) ? "(" + pawn.KindLabel + ")" : "")} {(pawn.HasBondRelation() ? "BondBrackets".Translate().ToString() : "")}");
}
return string.Format("AnimalNeedsTreatmentDesc".Translate(), stringBuilder.ToString());
}

public override AlertReport GetReport()
{
return (Settings.medical_alerts) ? AlertReport.CulpritsAre(NeedingAnimals) : false;
return (Settings.medical_alerts) ? AlertReport.CulpritsAre(NeedingAnimals.ToList()) : false;
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace AnimalsLogic
public class Alert_LifeThreateningHediffAnimal : Alert_Critical
{

private IEnumerable<Pawn> SickAnimals
private IEnumerable<Thing> SickAnimals
{
get
{
Expand All @@ -33,13 +33,13 @@ public override string GetLabel()
return "AnimalsWithLifeThreateningDisease".Translate();
}

public override string GetExplanation()
public override TaggedString GetExplanation()
{
StringBuilder stringBuilder = new StringBuilder();
bool amputatable = false;
foreach (Pawn pawn in AnimalAlertsUtility.SortedAnimalList(SickAnimals))
{
stringBuilder.AppendLine($" {pawn.LabelShort} {((pawn.Name != null && !pawn.Name.Numerical) ? "(" + pawn.KindLabel + ")" : "")} {(pawn.HasBondRelation() ? "BondBrackets".Translate() : "")}");
stringBuilder.AppendLine($" {pawn.LabelShort} {((pawn.Name != null && !pawn.Name.Numerical) ? "(" + pawn.KindLabel + ")" : "")} {(pawn.HasBondRelation() ? "BondBrackets".Translate().ToString() : "")}");
foreach (Hediff hediff in pawn.health.hediffSet.hediffs)
{
if (hediff.CurStage != null && hediff.CurStage.lifeThreatening && hediff.Part != null && hediff.Part != pawn.RaceProps.body.corePart)
Expand All @@ -56,7 +56,7 @@ public override string GetExplanation()

public override AlertReport GetReport()
{
return (Settings.medical_alerts) ? AlertReport.CulpritsAre(SickAnimals) : false;
return (Settings.medical_alerts) ? AlertReport.CulpritsAre(SickAnimals.ToList<Thing>()) : false;
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ namespace AnimalsLogic
public static class AnimalAlertsUtility
{

public static List<Pawn> SortedAnimalList(IEnumerable<Pawn> pawnEnumerable)
public static List<Pawn> SortedAnimalList(IEnumerable<Thing> pawnEnumerable)
{
List<Pawn> pawnList = pawnEnumerable.ToList();
List<Pawn> pawnList = pawnEnumerable.Cast<Pawn>().ToList();
pawnList.SortBy(p => !p.HasBondRelation(), p => p.LabelShort);
return pawnList;
}
Expand Down
2 changes: 1 addition & 1 deletion AnimalsLogic/Source/AnimalsLogic/RuinedEggs.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System;
using Harmony;
using HarmonyLib;
using RimWorld;
using Verse;

Expand Down
2 changes: 1 addition & 1 deletion AnimalsLogic/Source/AnimalsLogic/TastesLikeChicken.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Harmony;
using HarmonyLib;
using RimWorld;
using Verse;

Expand Down
Loading

0 comments on commit 0ac59af

Please sign in to comment.