diff --git a/.gitignore b/.gitignore index e3bbdca..940794e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,16 +1,288 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files *.suo -*.cache -*/Thumbs.db -/Source/.vs/* -/Source/CombatExtended/bin/* -/Source/CombatExtended/obj/* -/Source/CombatExtended/CombatExtended.csproj.user - +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ +**/Properties/launchSettings.json + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + # ReSharper is a .NET coding add-in _ReSharper*/ *.[Rr]e[Ss]harper *.DotSettings.user - -# Ignore RimWorld assemblies -Assembly-CSharp.dll -UnityEngine.dll + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Typescript v1 declaration files +typings/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml + +# CodeRush +.cr/ + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs diff --git a/About/About.xml b/About/About.xml index a2be961..68501a1 100644 --- a/About/About.xml +++ b/About/About.xml @@ -2,6 +2,6 @@ Mass Graves NoImageAvailable - 0.18.1722 - v0.18.1.0\n\nAdds mass graves to allow easier disposing of raider corpses. + 0.19.2009 + [B19]\n\nAdds mass graves to allow easier disposing of raider corpses. diff --git a/Assemblies/0Harmony.dll b/Assemblies/0Harmony.dll index a95b6df..6c0dd94 100644 Binary files a/Assemblies/0Harmony.dll and b/Assemblies/0Harmony.dll differ diff --git a/Assemblies/MassGraves.dll b/Assemblies/MassGraves.dll index ae0a5a6..3175b69 100644 Binary files a/Assemblies/MassGraves.dll and b/Assemblies/MassGraves.dll differ diff --git a/Defs/Buildings_MassGrave.xml b/Defs/Buildings_MassGrave.xml index aeeb3f7..9eabece 100644 --- a/Defs/Buildings_MassGrave.xml +++ b/Defs/Buildings_MassGrave.xml @@ -1,18 +1,5 @@  - - - Building - Building - BulletImpactMetal - true - MapMeshAndRealTime - Light - Repair - true - BuildingRubble - - MassGraves.Building_MassGrave @@ -21,14 +8,18 @@ false A large hole for dumping bodies. It's not pretty but sometimes you have to make do. Rare + false 1300 - PassThroughOnly + Standable + South false + false true true + 500 @@ -87,11 +78,5 @@ (6,3) - -
  • ITab_Storage
  • -
    - Diggable - Misc
    - -
    \ No newline at end of file + diff --git a/Source/MassGraves/Building_MassGrave.cs b/Source/MassGraves/Building_MassGrave.cs index d23112d..6a458f5 100644 --- a/Source/MassGraves/Building_MassGrave.cs +++ b/Source/MassGraves/Building_MassGrave.cs @@ -1,22 +1,39 @@ using System; using System.Collections.Generic; -using System.Linq; using System.Text; using RimWorld; using Verse; -using UnityEngine; namespace MassGraves { public class Building_MassGrave : Building_Grave { - private int CorpseCount => innerContainer.Count; + public int CorpseCount => innerContainer.Count; - private bool CanAcceptCorpses => CorpseCount < Controller.settings.CorpseCapacity; + public bool CanAcceptCorpses => CorpseCount < Controller.settings.CorpseCapacity; + + // Overwrite this so we can have multiple pawns putting corpses in graves + public new int MaxAssignedPawnsCount + { + get + { + return Math.Max(1, Controller.settings.CorpseCapacity - CorpseCount); + } + } + + // Need to overwrite this to allow for changing settings after placing the first corpse + public new bool StorageTabVisible + { + get + { + return this.CanAcceptCorpses; + } + } public override bool Accepts(Thing thing) { - return innerContainer.CanAcceptAnyOf(thing) && CanAcceptCorpses && GetStoreSettings().AllowedToAccept(thing); + // CanAcceptAnyOf is from Building_Casket.cs which is too far up the inheritance tree to call directly + return this.innerContainer.CanAcceptAnyOf(thing, true) && this.GetStoreSettings().AllowedToAccept(thing) && CanAcceptCorpses; } public override string GetInspectString() @@ -27,15 +44,25 @@ public override string GetInspectString() return stringBuilder.ToString(); } - /* Kind of a hack, because we don't want the assign owner gizmo that simply using base.GetGizmos() would give us. Instead iterate through all the gizmos - * produced by base classes of Building_Grave and only return them if they're not labeled 'Assign colonist'. - */ public override IEnumerable GetGizmos() { var gizmos = base.GetGizmos(); - foreach(Gizmo giz in gizmos) + // StorageTabVisible is not virtual, so check if we need to still apply it + if (!base.StorageTabVisible && this.StorageTabVisible) + { + foreach (Gizmo g2 in StorageSettingsClipboard.CopyPasteGizmosFor(this.GetStoreSettings())) + { + yield return g2; + } + } + + /* + * Kind of a hack, because we don't want the assign owner gizmo that simply using base.GetGizmos() would give us. Instead iterate through all the gizmos + * produced by base classes of Building_Grave and only return them if they're not labeled 'Assign colonist'. + */ + foreach (Gizmo giz in gizmos) { - if((giz as Command_Action)?.defaultLabel!= "CommandGraveAssignColonistLabel".Translate()) + if ((giz as Command_Action)?.defaultLabel != "CommandGraveAssignColonistLabel".Translate()) { yield return giz; } diff --git a/Source/MassGraves/Controller.cs b/Source/MassGraves/Controller.cs index d870479..ebd2c60 100644 --- a/Source/MassGraves/Controller.cs +++ b/Source/MassGraves/Controller.cs @@ -1,12 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Reflection; -using RimWorld; +using RimWorld; using Verse; using UnityEngine; -using Harmony; namespace MassGraves { @@ -17,7 +11,6 @@ public class Controller : Mod public Controller(ModContentPack content) : base(content) { settings = GetSettings(); - HarmonyInstance.Create("MassGraves.Harmony").PatchAll(Assembly.GetExecutingAssembly()); } public override string SettingsCategory() diff --git a/Source/MassGraves/GraveDefOf.cs b/Source/MassGraves/GraveDefOf.cs index 7c22d0a..7d2c267 100644 --- a/Source/MassGraves/GraveDefOf.cs +++ b/Source/MassGraves/GraveDefOf.cs @@ -1,10 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using RimWorld; +using RimWorld; using Verse; -using UnityEngine; namespace MassGraves { diff --git a/Source/MassGraves/Harmony-Designator_Build.cs b/Source/MassGraves/Harmony-Designator_Build.cs index ca79887..f7661c9 100644 --- a/Source/MassGraves/Harmony-Designator_Build.cs +++ b/Source/MassGraves/Harmony-Designator_Build.cs @@ -1,16 +1,19 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using RimWorld; +using RimWorld; using Verse; -using UnityEngine; using Harmony; +using System.Reflection; namespace MassGraves { - [HarmonyPatch(typeof(Designator_Build))] - [HarmonyPatch("Visible", PropertyMethod.Getter)] + [StaticConstructorOnStartup] + public static class HarmonyLoader { + static HarmonyLoader() + { + HarmonyInstance.Create("MassGraves.Harmony").PatchAll(Assembly.GetExecutingAssembly()); + } + } + + [HarmonyPatch(typeof(Designator_Build), "Visible", MethodType.Getter)] public static class Harmony_Designator_Build { public static bool Prefix(Designator_Build __instance, ref bool __result) @@ -24,4 +27,18 @@ public static bool Prefix(Designator_Build __instance, ref bool __result) return true; } } + + [HarmonyPatch(typeof(Building_Grave), "StorageTabVisible", MethodType.Getter)] + public static class Harmony_Storage_Tab_Visible { + public static bool Prefix(Building_Grave __instance, ref bool __result) + { + if (__instance is Building_MassGrave massGrave) + { + // This method is not virtual so we have to replace the root definition :( + __result = massGrave.StorageTabVisible; + return false; + } + return true; + } + } } diff --git a/Source/MassGraves/MassGraves.csproj b/Source/MassGraves/MassGraves.csproj index 579de95..c052930 100644 --- a/Source/MassGraves/MassGraves.csproj +++ b/Source/MassGraves/MassGraves.csproj @@ -24,33 +24,31 @@ 4 - pdbonly true - bin\Release\ - TRACE + ..\..\Assemblies\ + + prompt 4 - + False ..\..\Assemblies\0Harmony.dll False - ..\..\..\..\RimWorld1722Win_Data\Managed\Assembly-CSharp.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\Assembly-CSharp.dll False - - - ..\..\..\..\RimWorld1722Win_Data\Managed\UnityEngine.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\UnityEngine.dll False diff --git a/Source/MassGraves/Settings.cs b/Source/MassGraves/Settings.cs index e58438e..294ee5b 100644 --- a/Source/MassGraves/Settings.cs +++ b/Source/MassGraves/Settings.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using RimWorld; -using Verse; +using Verse; using UnityEngine; namespace MassGraves diff --git a/Source/MassGraves/obj/Debug/MassGraves.csproj.CopyComplete b/Source/MassGraves/obj/Debug/MassGraves.csproj.CopyComplete deleted file mode 100644 index e69de29..0000000 diff --git a/Source/MassGraves/obj/Debug/MassGraves.csproj.FileListAbsolute.txt b/Source/MassGraves/obj/Debug/MassGraves.csproj.FileListAbsolute.txt deleted file mode 100644 index 86ca8d5..0000000 --- a/Source/MassGraves/obj/Debug/MassGraves.csproj.FileListAbsolute.txt +++ /dev/null @@ -1,4 +0,0 @@ -D:\Games\RimWorld1722Win\Mods\MassGraves\Assemblies\MassGraves.dll -D:\Games\RimWorld1722Win\Mods\MassGraves\Source\MassGraves\obj\Debug\MassGraves.csprojResolveAssemblyReference.cache -D:\Games\RimWorld1722Win\Mods\MassGraves\Source\MassGraves\obj\Debug\MassGraves.csproj.CoreCompileInputs.cache -D:\Games\RimWorld1722Win\Mods\MassGraves\Source\MassGraves\obj\Debug\MassGraves.dll diff --git a/Source/MassGraves/obj/Debug/MassGraves.dll b/Source/MassGraves/obj/Debug/MassGraves.dll deleted file mode 100644 index ae0a5a6..0000000 Binary files a/Source/MassGraves/obj/Debug/MassGraves.dll and /dev/null differ diff --git a/Textures/Things/MassGraveAlt/GraveEmpty_side.png b/Textures/Things/MassGraveAlt/GraveEmpty_east.png similarity index 100% rename from Textures/Things/MassGraveAlt/GraveEmpty_side.png rename to Textures/Things/MassGraveAlt/GraveEmpty_east.png diff --git a/Textures/Things/MassGraveAlt/GraveEmpty_back.png b/Textures/Things/MassGraveAlt/GraveEmpty_north.png similarity index 100% rename from Textures/Things/MassGraveAlt/GraveEmpty_back.png rename to Textures/Things/MassGraveAlt/GraveEmpty_north.png diff --git a/Textures/Things/MassGraveAlt/GraveEmpty_front.png b/Textures/Things/MassGraveAlt/GraveEmpty_south.png similarity index 100% rename from Textures/Things/MassGraveAlt/GraveEmpty_front.png rename to Textures/Things/MassGraveAlt/GraveEmpty_south.png diff --git a/Textures/Things/MassGraveAlt/GraveFull_side.png b/Textures/Things/MassGraveAlt/GraveFull_east.png similarity index 100% rename from Textures/Things/MassGraveAlt/GraveFull_side.png rename to Textures/Things/MassGraveAlt/GraveFull_east.png diff --git a/Textures/Things/MassGraveAlt/GraveFull_back.png b/Textures/Things/MassGraveAlt/GraveFull_north.png similarity index 100% rename from Textures/Things/MassGraveAlt/GraveFull_back.png rename to Textures/Things/MassGraveAlt/GraveFull_north.png diff --git a/Textures/Things/MassGraveAlt/GraveFull_front.png b/Textures/Things/MassGraveAlt/GraveFull_south.png similarity index 100% rename from Textures/Things/MassGraveAlt/GraveFull_front.png rename to Textures/Things/MassGraveAlt/GraveFull_south.png diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..600b19c --- /dev/null +++ b/install.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +TARGET_DIR="/mnt/c/Program Files (x86)/Steam/steamapps/common/RimWorld/Mods/Mass Graves" +rm -rf "${TARGET_DIR}" +mkdir "${TARGET_DIR}" +cp -r About "${TARGET_DIR}" +cp -r Assemblies "${TARGET_DIR}" +cp -r Defs "${TARGET_DIR}" +cp -r Languages "${TARGET_DIR}" +cp -r Patches "${TARGET_DIR}" +cp -r Textures "${TARGET_DIR}"