Skip to content

Commit

Permalink
v1.1
Browse files Browse the repository at this point in the history
- Updated for 1.0
  • Loading branch information
Jaxe-Dev committed Oct 17, 2018
1 parent e170ca2 commit f4aae3c
Show file tree
Hide file tree
Showing 12 changed files with 60 additions and 49 deletions.
5 changes: 2 additions & 3 deletions About/About.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<ModMetaData>
<name>Toggle Harvest</name>
<author>Jaxe</author>
<targetVersion>0.19.0</targetVersion>
<description>Adds an &lt;i&gt;Allow Harvest&lt;/i&gt; toggle to Growing Zones alongside the already existing &lt;i&gt;Allow Sowing&lt;/i&gt; button.</description>
<url>https://ludeon.com/forums/index.php?topic=43552.0</url>
<targetVersion>1.0.0</targetVersion>
<description>Mod Version: 1.1\n\n\nAdds an &lt;i&gt;Allow Harvest&lt;/i&gt; toggle to Growing Zones alongside the already existing &lt;i&gt;Allow Sowing&lt;/i&gt; button.</description>
</ModMetaData>
8 changes: 8 additions & 0 deletions About/Manifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<Manifest>
<identifier>ToggleHarvest</identifier>
<version>1.1</version>
<manifestUri>https://github.com/Jaxe-Dev/ToggleHarvest/master/About/Manifest.xml</manifestUri>
<downloadUri>https://github.com/Jaxe-Dev/ToggleHarvest/releases/latest</downloadUri>
</Manifest>
2 changes: 1 addition & 1 deletion About/ModSync.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<ModSyncNinjaData>
<ID>59f538ed-f86d-4506-a4a5-7e9faaa3750a</ID>
<ModName>ToggleHarvest</ModName>
<Version>v1.0</Version>
<Version>v1.1</Version>
<SaveBreaking>False</SaveBreaking>
<Host name="Github">
<Owner>Jaxe-Dev</Owner>
Expand Down
24 changes: 15 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
# Toggle Harvest
![](https://img.shields.io/badge/Version-1.0-brightgreen.svg)

Built for **RimWorld 1.0.x / 0.19.x**\
Powered by **Harmony**\
Supports **ModSync RW**
![Mod Version](https://img.shields.io/badge/Mod_Version-1.1-blue.svg)
![RimWorld Version](https://img.shields.io/badge/Built_for_RimWorld-1.0-blue.svg)
![Harmony Version](https://img.shields.io/badge/Powered_by_Harmony-1.2.0.1-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=1499848654&suffix=+total)
![GitHub Downloads](https://img.shields.io/github/downloads/Jaxe-Dev/ToggleHarvest/total.svg?colorB=blue&label=GitHub+Downloads)

[Link to Steam Workshop page](https://steamcommunity.com/sharedfiles/filedetails/?id=1499848654)\
[Link to Ludeon Forum Post](https://ludeon.com/forums/index.php?topic=43552.0)

------------
---

Adds an *Allow Harvest* button to Growing Zones alongside the already existing *Allow Sowing* button.

---

Adds an *Allow Harvesting* button to Growing Zones alongside the already existing *Allow Sowing* button.
##### STEAM INSTALLATION
- **[Go to the Steam Workshop page](https://steamcommunity.com/sharedfiles/filedetails/?id=1499848654) and subscribe to the mod.**

------------
---

##### INSTALLATION
##### NON-STEAM INSTALLATION
- **[Download the latest release](https://github.com/Jaxe-Dev/ToggleHarvest/releases/latest) and unzip it into your *RimWorld/Mods* folder.**
6 changes: 5 additions & 1 deletion Source/Mod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@ namespace ToggleHarvest
[StaticConstructorOnStartup]
internal static class Mod
{
public const string Id = "ToggleHarvest";
public const string Name = "Toggle Harvest";
public const string Version = "1.1";

private static readonly HashSet<Zone_Growing> DisallowedZones = new HashSet<Zone_Growing>();

static Mod() => HarmonyInstance.Create("ToggleHarvest").PatchAll();
static Mod() => HarmonyInstance.Create(Id).PatchAll();

public static void Reset() => DisallowedZones.Clear();
public static bool IsAllowed(Zone_Growing zone) => !DisallowedZones.Contains(zone);
Expand Down
14 changes: 7 additions & 7 deletions Source/Patch/RimWorld_Zone_Growing_GetGizmos.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ internal static class RimWorld_Zone_Growing_GetGizmos
private static void Postfix(Zone_Growing __instance, ref IEnumerable<Gizmo> __result)
{
var allowHarvestCommand = new Command_Toggle
{
defaultLabel = "ToggleHarvest.CommandAllowHarvest".Translate(),
defaultDesc = "ToggleHarvest.CommandAllowHarvestDesc".Translate(),
icon = TexCommand.Forbidden,
isActive = () => Mod.IsAllowed(__instance),
toggleAction = () => Mod.SetAllowed(__instance, !Mod.IsAllowed(__instance))
};
{
defaultLabel = "ToggleHarvest.CommandAllowHarvest".Translate(),
defaultDesc = "ToggleHarvest.CommandAllowHarvestDesc".Translate(),
icon = TexCommand.ForbidOff,
isActive = () => Mod.IsAllowed(__instance),
toggleAction = () => Mod.SetAllowed(__instance, !Mod.IsAllowed(__instance))
};

__result = new List<Gizmo>(__result) { allowHarvestCommand };
}
Expand Down
11 changes: 0 additions & 11 deletions Source/Patch/Verse_Game_InitNewGame.cs

This file was deleted.

11 changes: 0 additions & 11 deletions Source/Patch/Verse_Game_LoadGame.cs

This file was deleted.

11 changes: 11 additions & 0 deletions Source/Patch/Verse_Profile_MemoryUtility_ClearAllMapsAndWorld.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using Harmony;
using Verse.Profile;

namespace ToggleHarvest.Patch
{
[HarmonyPatch(typeof(MemoryUtility), "ClearAllMapsAndWorld")]
internal static class Verse_Profile_MemoryUtility_ClearAllMapsAndWorld
{
private static void Prefix() => Mod.Reset();
}
}
8 changes: 4 additions & 4 deletions Source/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Reflection;
using ToggleHarvest;

[assembly: AssemblyTitle("ToggleHarvest")]
[assembly: AssemblyProduct("ToggleHarvest")]
[assembly: AssemblyTitle(Mod.Name)]
[assembly: AssemblyProduct("RimWorld Mods by Jaxe")]
[assembly: AssemblyCopyright("© Jaxe")]
[assembly: AssemblyVersion("1.0")]
[assembly: AssemblyFileVersion("1.0")]
[assembly: AssemblyVersion(Mod.Version)]
6 changes: 4 additions & 2 deletions Source/ToggleHarvest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,15 @@
<Compile Include="Patch\RimWorld_WorkGiver_GrowerHarvest_HasJobOnCell.cs" />
<Compile Include="Patch\RimWorld_Zone_Growing_ExposeData.cs" />
<Compile Include="Patch\RimWorld_Zone_Growing_GetGizmos.cs" />
<Compile Include="Patch\Verse_Game_InitNewGame.cs" />
<Compile Include="Patch\Verse_Game_LoadGame.cs" />
<Compile Include="Patch\Verse_Profile_MemoryUtility_ClearAllMapsAndWorld.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="..\About\About.xml">
<Link>-\About\About.xml</Link>
</Content>
<Content Include="..\About\Manifest.xml">
<Link>-\About\Manifest.xml</Link>
</Content>
<Content Include="..\About\ModSync.xml">
<Link>-\About\ModSync.xml</Link>
</Content>
Expand Down
3 changes: 3 additions & 0 deletions Source/ToggleHarvest.sln
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,7 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {ADA5545C-FB42-43B1-8E2A-DBB63E43BBDE}
EndGlobalSection
EndGlobal

0 comments on commit f4aae3c

Please sign in to comment.