Skip to content

Commit

Permalink
v3.7.1 fixes a bug in rescue work type toggling
Browse files Browse the repository at this point in the history
  • Loading branch information
pardeike committed Aug 24, 2023
1 parent 856fa29 commit 54059ac
Show file tree
Hide file tree
Showing 9 changed files with 100 additions and 67 deletions.
Binary file modified 1.4/Assemblies/AchtungMod.dll
Binary file not shown.
45 changes: 23 additions & 22 deletions About/About.xml
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<ModMetaData>
<name>Achtung!</name>
<author>Andreas Pardeike</author>
<supportedVersions>
<li>1.0</li>
<li>1.1</li>
<li>1.2</li>
<li>1.3</li>
<li>1.4</li>
</supportedVersions>
<modDependencies>
<li>
<packageId>brrainz.harmony</packageId>
<displayName>Harmony</displayName>
<steamWorkshopUrl>steam://url/CommunityFilePage/2009463077</steamWorkshopUrl>
<downloadUrl>https://github.com/pardeike/HarmonyRimWorld/releases/latest</downloadUrl>
</li>
</modDependencies>
<packageId>brrainz.achtung</packageId>
<steamAppId>730936602</steamAppId>
<url>https://github.com/pardeike/Achtung2</url>
<description>Command your colonists like a boss!
<name>Achtung!</name>
<author>Andreas Pardeike</author>
<supportedVersions>
<li>1.0</li>
<li>1.1</li>
<li>1.2</li>
<li>1.3</li>
<li>1.4</li>
</supportedVersions>
<modDependencies>
<li>
<packageId>brrainz.harmony</packageId>
<displayName>Harmony</displayName>
<steamWorkshopUrl>steam://url/CommunityFilePage/2009463077</steamWorkshopUrl>
<downloadUrl>https://github.com/pardeike/HarmonyRimWorld/releases/latest</downloadUrl>
</li>
</modDependencies>
<packageId>brrainz.achtung</packageId>
<modVersion>3.7.1.0</modVersion>
<steamAppId>730936602</steamAppId>
<url>https://github.com/pardeike/Achtung2</url>
<description>Command your colonists like a boss!

The Achtung! mod enhances how you control RimWorld. You will get more control on how to position your colonists and how they take job orders.

Expand Down
2 changes: 1 addition & 1 deletion About/Manifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Manifest>
<identifier>net.pardeike.rimworld.mod.achtung</identifier>
<version>3.7.0.0</version>
<version>3.7.1.0</version>
<targetVersions>
<li>1.0.0</li>
<li>1.1.0</li>
Expand Down
11 changes: 11 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<Project>

<PropertyGroup>
<ModName>Achtung</ModName>
<ModFileName>Achtung</ModFileName>
<Repository>https://github.com/pardeike/Achtung2</Repository>
<ModVersion>3.7.1.0</ModVersion>
<ProjectGuid>{8BD5A28F-96C4-43B4-907F-600AA0162F84}</ProjectGuid>
</PropertyGroup>

</Project>
88 changes: 56 additions & 32 deletions Source/Achtung.csproj
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<ProjectGuid>{8BD5A28F-96C4-43B4-907F-600AA0162F84}</ProjectGuid>
<RootNamespace>AchtungMod</RootNamespace>
<AssemblyName>AchtungMod</AssemblyName>
<TargetFramework>net472</TargetFramework>
<LangVersion>8.0</LangVersion>
<LangVersion>latest</LangVersion>
<PlatformTarget>x64</PlatformTarget>
<OutputPath>..\1.4\Assemblies\</OutputPath>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<Version>3.7.0.0</Version>
<Version>$(ModVersion)</Version>
<AssemblyVersion>$(ModVersion)</AssemblyVersion>
<FileVersion>$(ModVersion)</FileVersion>
<PackageVersion>$(ModVersion)</PackageVersion>
<InformationalVersion>$(ModVersion)</InformationalVersion>
<Company>Brrainz</Company>
<Authors>Andreas Pardeike</Authors>
<Copyright>© July, 2016</Copyright>
<Configurations>Release;Debug</Configurations>
<PackageProjectUrl>$(Repository)</PackageProjectUrl>
<RepositoryUrl>$(Repository)</RepositoryUrl>
<Product>$(ModName)</Product>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
Expand All @@ -31,6 +38,9 @@
</PropertyGroup>

<ItemGroup>
<Content Include="..\Directory.Build.props">
<Link>%(Filename)%(Extension)</Link>
</Content>
<Content Include="..\Languages\**\*.xml">
<Link>Languages\%(RecursiveDir)%(FileName)%(Extension)</Link>
</Content>
Expand Down Expand Up @@ -88,33 +98,47 @@
</ItemGroup>
</Target>

<PropertyGroup>
<!--<PostBuildEvent>
mkdir -p /Users/ap/Library/Application\ Support/Steam/steamapps/common/RimWorld/RimWorldMac.app/Mods/Achtung
pushd ../..
cp -rf 1.1 1.2 1.3 1.4 About Assemblies Features Languages Patches Resources Textures LoadFolders.xml /Users/ap/Library/Application\ Support/Steam/steamapps/common/RimWorld/RimWorldMac.app/Mods/Achtung/
popd
pushd /Users/ap/Library/Application\ Support/Steam/steamapps/common/RimWorld/RimWorldMac.app/Mods
rm -f Achtung.zip
zip -q -r -0 Achtung.zip Achtung
popd
</PostBuildEvent>-->
<PostBuildEvent>
echo Postprocessing
where ModBuilder 2&gt; nul | find /i "ModBuilder.exe"
if not errorlevel 1 (
ModBuilder AssemblyVersion -file "$(MSBuildProjectDirectory)\$(OutputPath)$(AssemblyName).dll" -save "$(MSBuildProjectName)-version"
ModBuilder XMLPut -file "$(SolutionDir)About\Manifest.xml" -xpath /Manifest/version -value "{{$(MSBuildProjectName)-version}}"
)
if defined INSTALL_MOD (
"%INSTALL_MOD%" "$(Configuration)" "$(SolutionDir)" "$(MSBuildProjectName)" "1.1 1.2 1.3 1.4 About Assemblies Features Languages Patches Resources Textures" "LoadFolders.xml"
)
</PostBuildEvent>
<Company>Brrainz</Company>
<Authors>Andreas Pardeike</Authors>
<Description>Command your colonists like a boss!</Description>
<PackageProjectUrl>https://github.com/pardeike/Achtung2</PackageProjectUrl>
<RepositoryUrl>https://github.com/pardeike/Achtung2</RepositoryUrl>
</PropertyGroup>
<Target Name="PostBuildAction" AfterTargets="Build">
<XmlPoke XmlInputPath="$(MSBuildProjectDirectory)\..\About\About.xml" Query="//ModMetaData/modVersion" Value="$(ModVersion)" />
<XmlPoke XmlInputPath="$(MSBuildProjectDirectory)\..\About\Manifest.xml" Query="//Manifest/version" Value="$(ModVersion)" />
</Target>

<Target Name="CopyToRimworld" AfterTargets="PostBuildAction" Condition="'$(RIMWORLD_MOD_DIR)' != ''">
<RemoveDir Directories="$(RIMWORLD_MOD_DIR)\$(ModFileName)" />
<ItemGroup>
<Copy_11 Include="..\1.1\**" />
<Copy_12 Include="..\1.2\**" />
<Copy_13 Include="..\1.3\**" />
<Copy_14 Include="..\1.4\**" />
<CopyAbout Include="..\About\**" />
<CopyAssemblies Include="..\Assemblies\**" />
<CopyFeatures Include="..\Features\**" />
<CopyLanguages Include="..\Languages\**" />
<CopyPatches Include="..\Patches\**" />
<CopyResources Include="..\Resources\**" />
<CopyTextures Include="..\Textures\**" />
<CopyLicense Include="..\LICENSE" />
<CopyLoadFolders Include="..\LoadFolders.xml" />
<CopyReadme Include="..\Readme.md" />
</ItemGroup>
<Copy SourceFiles="@(Copy_11)" DestinationFolder="$(RIMWORLD_MOD_DIR)\$(ModFileName)\1.1\%(RecursiveDir)" />
<Copy SourceFiles="@(Copy_12)" DestinationFolder="$(RIMWORLD_MOD_DIR)\$(ModFileName)\1.2\%(RecursiveDir)" />
<Copy SourceFiles="@(Copy_13)" DestinationFolder="$(RIMWORLD_MOD_DIR)\$(ModFileName)\1.3\%(RecursiveDir)" />
<Copy SourceFiles="@(Copy_14)" DestinationFolder="$(RIMWORLD_MOD_DIR)\$(ModFileName)\1.4\%(RecursiveDir)" />
<Copy SourceFiles="@(CopyAbout)" DestinationFolder="$(RIMWORLD_MOD_DIR)\$(ModFileName)\About\%(RecursiveDir)" />
<Copy SourceFiles="@(CopyAssemblies)" DestinationFolder="$(RIMWORLD_MOD_DIR)\$(ModFileName)\Assemblies\%(RecursiveDir)" />
<Copy SourceFiles="@(CopyFeatures)" DestinationFolder="$(RIMWORLD_MOD_DIR)\$(ModFileName)\Features\%(RecursiveDir)" />
<Copy SourceFiles="@(CopyLanguages)" DestinationFolder="$(RIMWORLD_MOD_DIR)\$(ModFileName)\Languages\%(RecursiveDir)" />
<Copy SourceFiles="@(CopyPatches)" DestinationFolder="$(RIMWORLD_MOD_DIR)\$(ModFileName)\Patches\%(RecursiveDir)" />
<Copy SourceFiles="@(CopyResources)" DestinationFolder="$(RIMWORLD_MOD_DIR)\$(ModFileName)\Resources\%(RecursiveDir)" />
<Copy SourceFiles="@(CopyTextures)" DestinationFolder="$(RIMWORLD_MOD_DIR)\$(ModFileName)\Textures\%(RecursiveDir)" />
<Copy SourceFiles="@(CopyLicense)" DestinationFolder="$(RIMWORLD_MOD_DIR)\$(ModFileName)" />
<Copy SourceFiles="@(CopyLoadFolders)" DestinationFolder="$(RIMWORLD_MOD_DIR)\$(ModFileName)" />
<Copy SourceFiles="@(CopyReadme)" DestinationFolder="$(RIMWORLD_MOD_DIR)\$(ModFileName)" />
</Target>

<Target Name="ZipMod" AfterTargets="CopyToRimworld" Condition="'$(RIMWORLD_MOD_DIR)' != ''">
<ZipDirectory SourceDirectory="$(RIMWORLD_MOD_DIR)\$(ModFileName)" DestinationFile="$(RIMWORLD_MOD_DIR)\$(ModFileName).zip" Overwrite="true" />
</Target>

</Project>
11 changes: 7 additions & 4 deletions Source/DynamicWorkTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Linq;
using Verse;

namespace AchtungMod
namespace Brrainz
{
public class DynamicWorkTypes
{
Expand Down Expand Up @@ -83,13 +83,16 @@ public static WorkTypeDef AddWorkTypeDef(WorkTypeDef def, WorkGiverDef workgiver

public static void RemoveWorkTypeDef(WorkTypeDef def, WorkTypeDef savedDef, WorkGiverDef workGiver)
{
var oldWorkGiver = workGiver.workType;
workGiver.workType = savedDef;
DefDatabase<WorkTypeDef>.Remove(def);
var columnDef = DefDatabase<PawnColumnDef>.AllDefsListForReading.First(d => d.workType == def);
DefDatabase<PawnColumnDef>.Remove(columnDef);

var columnDef = DefDatabase<PawnColumnDef>.AllDefsListForReading.FirstOrDefault(d => d.workType == oldWorkGiver);
if (columnDef != null)
DefDatabase<PawnColumnDef>.Remove(columnDef);

PawnTableDef workTable = PawnTableDefOf.Work;
workTable.columns.RemoveAll(col => col.workType == def);
workTable.columns.RemoveAll(col => col.workType == oldWorkGiver);
Update(workTable);

Reload<WorkTypeDef>();
Expand Down
8 changes: 2 additions & 6 deletions Source/Settings.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using RimWorld;
using Brrainz;
using RimWorld;
using UnityEngine;
using Verse;

Expand Down Expand Up @@ -112,11 +113,6 @@ public static void DoWindowContents(Rect canvas)
else if (rescuing != null && Achtung.Settings.rescueEnabled == false)
DynamicWorkTypes.RemoveWorkTypeDef(Tools.RescuingWorkTypeDef, Tools.savedWorkTypeDef, doctorRescueWorkGiver);

// var r = list.GetRect(Tools.menuExampleTexture.height);
// r.width = r.height * Tools.menuExampleTexture.width / Tools.menuExampleTexture.height;
// GUI.color = Color.white;
// GenUI.DrawTextureWithMaterial(r, Tools.menuExampleTexture, null, new Rect(0f, 0f, 1f, 1f));

list.NewColumn();
list.curX += 30 - Listing.ColumnSpacing;

Expand Down
2 changes: 0 additions & 2 deletions Source/Tools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ namespace AchtungMod
[StaticConstructorOnStartup]
static class Tools
{
public static Texture2D menuExampleTexture;
public static Material forceIconMaterial;
public static Material markerMaterial;
public static Material lineMaterial;
Expand Down Expand Up @@ -56,7 +55,6 @@ public static string Version

static Tools()
{
menuExampleTexture = ContentFinder<Texture2D>.Get("MenuExample", true);
forceIconMaterial = MaterialPool.MatFrom("ForceIcon", ShaderDatabase.Cutout);
markerMaterial = MaterialPool.MatFrom("AchtungMarker", ShaderDatabase.Transparent);
lineMaterial = MaterialPool.MatFrom(GenDraw.LineTexPath, ShaderDatabase.Transparent, new Color(1f, 0.5f, 0.5f));
Expand Down
Binary file removed Textures/MenuExample.png
Binary file not shown.

0 comments on commit 54059ac

Please sign in to comment.