Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -254,3 +254,4 @@ paket-files/
/.mailmap
/Source/StuffedFloors.sln
/Source/ModConfig.json
/Assemblies/arbiter_log.txt
Binary file modified Assemblies/WorkTab.dll
Binary file not shown.
6 changes: 5 additions & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

Provides a vastly more customizable work tab.

Multiplayer support added:
- Favourites are not working yet (more investigatinon needed in to architecture) (probably cause desync if a favourite is loaded)
- Everything else seems to be working, needs more testing
- Consider this "alpha"



Expand Down Expand Up @@ -103,4 +107,4 @@ Show your appreciation by buying me a coffee (or contribute towards a nice singl


![Version](https://banners.karel-kroeze.nl/title/Version.png)
This is version 3.20.302, for RimWorld 1.1.2652.
This is version 3.20.302, for RimWorld 1.1.2652.
3 changes: 0 additions & 3 deletions Source/Core/Controller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ public Controller( ModContentPack content ) : base( content )
#endif
var harmony = new Harmony( "fluffy.worktab" );
harmony.PatchAll( Assembly.GetExecutingAssembly() );

// if ( MP.enabled )
// MP.RegisterAll();
}

public override void DoSettingsWindowContents( Rect inRect )
Expand Down
21 changes: 21 additions & 0 deletions Source/Core/MPCompat.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using System;
using HarmonyLib;
using Multiplayer.API;
using Verse;

namespace WorkTab
{
[StaticConstructorOnStartup]
public static class WorkTabMPCompat
{

static WorkTabMPCompat()
{
if (!MP.enabled) return;

MP.RegisterAll();

Logger.Debug("MP WorkTab Enabled");
}
}
}
5 changes: 5 additions & 0 deletions Source/Extensions/Pawn_Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using System.Collections.Generic;
using RimWorld;
using Multiplayer.API;
using Verse;

namespace WorkTab
Expand Down Expand Up @@ -55,11 +56,13 @@ public static int GetPriority( this Pawn pawn, WorkGiverDef workgiver, int hour
return PriorityManager.Get[pawn].GetPriority( workgiver, hour );
}

[SyncMethod]
public static void SetPriority( this Pawn pawn, WorkTypeDef worktype, int priority, List<int> hours )
{
PriorityManager.Get[pawn].SetPriority( worktype, priority, hours );
}

[SyncMethod]
public static void SetPriority( Pawn pawn, WorkTypeDef worktype, int priority, int hour, bool recache = true )
{
if ( hour < 0 )
Expand All @@ -68,11 +71,13 @@ public static void SetPriority( Pawn pawn, WorkTypeDef worktype, int priority, i
PriorityManager.Get[pawn].SetPriority( worktype, priority, hour, recache );
}

[SyncMethod]
public static void SetPriority( this Pawn pawn, WorkGiverDef workgiver, int priority, List<int> hours )
{
PriorityManager.Get[pawn].SetPriority( workgiver, priority, hours );
}

[SyncMethod]
public static void SetPriority( this Pawn pawn, WorkGiverDef workgiver, int priority, int hour,
bool recache = true )
{
Expand Down
3 changes: 3 additions & 0 deletions Source/Extensions/WorkGiver_Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Linq;
using RimWorld;
using Verse;
using Multiplayer.API;
using Verse.Sound;

namespace WorkTab
Expand All @@ -29,6 +30,7 @@ public static void DecrementPriority( this WorkGiverDef workgiver, Pawn pawn, in
SoundDefOf.Tick_Low.PlayOneShotOnCamera();
}

[SyncMethod]
public static void DecrementPriority( this WorkGiverDef workgiver, List<Pawn> pawns, int hour,
List<int> hours, bool playSound = true )
{
Expand Down Expand Up @@ -67,6 +69,7 @@ public static void IncrementPriority( this WorkGiverDef workgiver, Pawn pawn, in
SoundDefOf.Tick_Low.PlayOneShotOnCamera();
}

[SyncMethod]
public static void IncrementPriority( this WorkGiverDef workgiver, List<Pawn> pawns, int hour,
List<int> hours, bool playSound = true )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using System.Collections.Generic;
using RimWorld;
using Multiplayer.API;
using Verse;

namespace WorkTab
Expand All @@ -12,6 +13,7 @@ public class PawnColumnWorker_CopyPasteDetailedWorkPriorities : PawnColumnWorker
private static Dictionary<WorkGiverDef, int[]> clipboard;
protected override bool AnythingInClipboard => clipboard != null;

[SyncMethod]
protected override void CopyFrom( Pawn pawn )
{
if ( clipboard == null )
Expand All @@ -21,6 +23,7 @@ protected override void CopyFrom( Pawn pawn )
clipboard[workgiver] = pawn.GetPriorities( workgiver );
}

[SyncMethod]
protected override void PasteTo( Pawn pawn )
{
foreach ( var worktype in DefDatabase<WorkTypeDef>.AllDefsListForReading )
Expand Down
3 changes: 3 additions & 0 deletions Source/PawnColumns/PawnColumnWorker_WorkTabLabel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using UnityEngine;
using Verse;
using Verse.Sound;
using Multiplayer.API;
using static WorkTab.InteractionUtilities;

namespace WorkTab
Expand All @@ -18,6 +19,7 @@ public override int Compare( Pawn a, Pawn b )
StringComparison.CurrentCultureIgnoreCase );
}

[SyncMethod]
public void Decrement( Pawn pawn )
{
var actionTaken = false;
Expand Down Expand Up @@ -90,6 +92,7 @@ public string GetTooltip( Pawn pawn )
return "WorkTab.LabelCellTip".Translate() + "\n\n" + pawn.GetTooltip().text;
}

[SyncMethod]
public void Increment( Pawn pawn )
{
var actionTaken = false;
Expand Down
5 changes: 5 additions & 0 deletions Source/Priorities/PriorityTracker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Collections.Generic;
using System.Linq;
using RimWorld;
using Multiplayer.API;
using Verse;

namespace WorkTab
Expand Down Expand Up @@ -170,6 +171,7 @@ public virtual void SetLoadId()
_loadId = PriorityManager.GetNextID();
}

[SyncMethod]
public void SetPriority( WorkGiverDef workgiver, int priority, int hour, bool recache = true )
{
if ( priority > Settings.maxPriority )
Expand All @@ -186,6 +188,7 @@ public void SetPriority( WorkGiverDef workgiver, int priority, int hour, bool re
}
}

[SyncMethod]
public void SetPriority( WorkGiverDef workgiver, int priority, List<int> hours )
{
if ( hours.NullOrEmpty() )
Expand All @@ -198,6 +201,7 @@ public void SetPriority( WorkGiverDef workgiver, int priority, List<int> hours )
OnChange();
}

[SyncMethod]
public void SetPriority( WorkTypeDef worktype, int priority, int hour, bool recache = true )
{
foreach ( var workgiver in worktype.WorkGivers() )
Expand All @@ -210,6 +214,7 @@ public void SetPriority( WorkTypeDef worktype, int priority, int hour, bool reca
}
}

[SyncMethod]
public void SetPriority( WorkTypeDef worktype, int priority, List<int> hours )
{
if ( hours.NullOrEmpty() )
Expand Down
36 changes: 22 additions & 14 deletions Source/WorkTab.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<DebugType>none</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\Assemblies\</OutputPath>
<DefineConstants>DEBUG</DefineConstants>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
Expand All @@ -38,39 +38,52 @@
<HintPath>packages\Lib.Harmony.2.0.0.6\lib\net472\0Harmony.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="0MultiplayerAPI">
<HintPath>H:\Games\RimWorld\Mods\Multiplayer\1.1\Assemblies\0MultiplayerAPI.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Assembly-CSharp">
<HintPath>C:\Program Files (x86)\Steam\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\Assembly-CSharp.dll</HintPath>
<HintPath>H:\Games\RimWorld\RimWorldWin64_Data\Managed\Assembly-CSharp.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="FluffyUI, Version=1.0.0.1226, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Assemblies\FluffyUI.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Runtime.InteropServices.RuntimeInformation" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="UnityEngine">
<HintPath>H:\Games\RimWorld\RimWorldWin64_Data\Managed\UnityEngine.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.CoreModule">
<HintPath>C:\Program Files (x86)\Steam\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
<HintPath>H:\Games\RimWorld\RimWorldWin64_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.IMGUIModule">
<HintPath>C:\Program Files (x86)\Steam\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\UnityEngine.IMGUIModule.dll</HintPath>
<HintPath>H:\Games\RimWorld\RimWorldWin64_Data\Managed\UnityEngine.IMGUIModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.InputLegacyModule">
<HintPath>C:\Program Files (x86)\Steam\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\UnityEngine.InputLegacyModule.dll</HintPath>
<HintPath>H:\Games\RimWorld\RimWorldWin64_Data\Managed\UnityEngine.InputLegacyModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.InputModule">
<HintPath>C:\Program Files (x86)\Steam\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\UnityEngine.InputModule.dll</HintPath>
<HintPath>H:\Games\RimWorld\RimWorldWin64_Data\Managed\UnityEngine.InputModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.TextRenderingModule">
<HintPath>C:\Program Files (x86)\Steam\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\UnityEngine.TextRenderingModule.dll</HintPath>
<HintPath>H:\Games\RimWorld\RimWorldWin64_Data\Managed\UnityEngine.TextRenderingModule.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Core\MPCompat.cs" />
<Compile Include="Core\Constants.cs" />
<Compile Include="Favourites\Dialog_CreateFavourite.cs" />
<Compile Include="Favourites\Dialog_EditFavourite.cs" />
Expand Down Expand Up @@ -120,17 +133,12 @@
<Compile Include="PawnTable\MainTabWindow_WorkTab.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\TOOLS\FluffyUI\FluffyUI\FluffyUI.csproj">
<Project>{3e905175-2540-4c06-b4c6-f955836c0451}</Project>
<Name>FluffyUI</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>mod update -x -n "Work Tab"</PostBuildEvent>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>
16 changes: 2 additions & 14 deletions Source/WorkTab.sln
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26430.6
# Visual Studio Version 16
VisualStudioVersion = 16.0.28803.352
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WorkTab", "WorkTab.csproj", "{5C909B0F-E82A-46B1-AE39-E56285B236A2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DynamicPawnTable", "..\..\..\TOOLS\DynamicPawnTable\DynamicPawnTable\DynamicPawnTable.csproj", "{E93B85A6-EEFF-4BDE-A6F4-CCE6D3487F9A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FluffyUI", "..\..\..\TOOLS\FluffyUI\FluffyUI\FluffyUI.csproj", "{3E905175-2540-4C06-B4C6-F955836C0451}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -19,14 +15,6 @@ Global
{5C909B0F-E82A-46B1-AE39-E56285B236A2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5C909B0F-E82A-46B1-AE39-E56285B236A2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5C909B0F-E82A-46B1-AE39-E56285B236A2}.Release|Any CPU.Build.0 = Release|Any CPU
{E93B85A6-EEFF-4BDE-A6F4-CCE6D3487F9A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E93B85A6-EEFF-4BDE-A6F4-CCE6D3487F9A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E93B85A6-EEFF-4BDE-A6F4-CCE6D3487F9A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E93B85A6-EEFF-4BDE-A6F4-CCE6D3487F9A}.Release|Any CPU.Build.0 = Release|Any CPU
{3E905175-2540-4C06-B4C6-F955836C0451}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3E905175-2540-4C06-B4C6-F955836C0451}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3E905175-2540-4C06-B4C6-F955836C0451}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3E905175-2540-4C06-B4C6-F955836C0451}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down