Skip to content

Commit

Permalink
v3.7.2 fixes videos and adds tutorial button in settings
Browse files Browse the repository at this point in the history
  • Loading branch information
pardeike committed Aug 24, 2023
1 parent 54059ac commit dd14939
Show file tree
Hide file tree
Showing 23 changed files with 37 additions and 29 deletions.
Binary file modified 1.4/Assemblies/AchtungMod.dll
Binary file not shown.
Binary file modified 1.4/Assemblies/ModFeatures.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion About/About.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</li>
</modDependencies>
<packageId>brrainz.achtung</packageId>
<modVersion>3.7.1.0</modVersion>
<modVersion>3.7.2.0</modVersion>
<steamAppId>730936602</steamAppId>
<url>https://github.com/pardeike/Achtung2</url>
<description>Command your colonists like a boss!
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.1.0</version>
<version>3.7.2.0</version>
<targetVersions>
<li>1.0.0</li>
<li>1.1.0</li>
Expand Down
Binary file added Assemblies/ModFeatures.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<ModName>Achtung</ModName>
<ModFileName>Achtung</ModFileName>
<Repository>https://github.com/pardeike/Achtung2</Repository>
<ModVersion>3.7.1.0</ModVersion>
<ModVersion>3.7.2.0</ModVersion>
<ProjectGuid>{8BD5A28F-96C4-43B4-907F-600AA0162F84}</ProjectGuid>
</PropertyGroup>

Expand Down
Binary file modified Features/02_Forcing.mp4
Binary file not shown.
Binary file modified Features/04_Formations.mp4
Binary file not shown.
Binary file modified Features/05_Cooperation.mp4
Binary file not shown.
Binary file modified Features/06_ThreeModes.mp4
Binary file not shown.
Binary file modified Features/08_Draftstatus.mp4
Binary file not shown.
2 changes: 1 addition & 1 deletion Source/Achtung.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@

<ItemGroup>
<PackageReference Include="Brrainz.RimWorld.CrossPromotion" Version="1.1.1" />
<PackageReference Include="Brrainz.RimWorld.ModFeatures" Version="1.0.0" />
<PackageReference Include="Brrainz.RimWorld.ModFeatures" Version="1.2.0" />
<PackageReference Include="Krafs.Rimworld.Ref" Version="1.4.3704" GeneratePathProperty="true" />
<PackageReference Include="Lib.Harmony" Version="2.2.2" ExcludeAssets="runtime" />
<PackageReference Include="Microsoft.NETCore.Platforms" Version="7.0.4" />
Expand Down
2 changes: 1 addition & 1 deletion 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 Brrainz
namespace AchtungMod
{
public class DynamicWorkTypes
{
Expand Down
2 changes: 1 addition & 1 deletion Source/ExceptionAnalyser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ struct ModInfo
class ExceptionAnalyser
{
readonly Exception exception;
static readonly Dictionary<Assembly, ModMetaData> MetaDataCache = new Dictionary<Assembly, ModMetaData>();
static readonly Dictionary<Assembly, ModMetaData> MetaDataCache = new();
static readonly string RimworldAssemblyName = typeof(Pawn).Assembly.GetName().Name;

static readonly AccessTools.FieldRef<StackTrace, StackTrace[]> captured_traces_ref = AccessTools.FieldRefAccess<StackTrace, StackTrace[]>("captured_traces");
Expand Down
8 changes: 4 additions & 4 deletions Source/ForcedJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace AchtungMod
{
public class ForcedJobs : IExposable
{
public List<ForcedJob> jobs = new List<ForcedJob>();
public List<ForcedJob> jobs = new();
public int count; // optimization

public ForcedJobs()
Expand Down Expand Up @@ -40,12 +40,12 @@ public void ExposeData()

public class ForcedJob : IExposable
{
private HashSet<ForcedTarget> targets = new HashSet<ForcedTarget>();
private HashSet<ForcedTarget> targets = new();
const int ticksWaitPaused = 4;
const int ticksWaitRunning = 64;

public Pawn pawn = null;
public List<WorkGiverDef> workgiverDefs = new List<WorkGiverDef>();
public List<WorkGiverDef> workgiverDefs = new();
public bool isThingJob = false;
public bool reentranceFlag = false;
public XY lastLocation = XY.Invalid;
Expand All @@ -56,7 +56,7 @@ public class ForcedJob : IExposable
public bool started = false;
public bool cancelled = false;
public Coroutine expanderThing, expanderCell, contractor;
static readonly Dictionary<BuildableDef, int> TypeScores = new Dictionary<BuildableDef, int>
static readonly Dictionary<BuildableDef, int> TypeScores = new()
{
{ ThingDefOf.PowerConduit, 1000 },
{ ThingDefOf.Wall, 900 },
Expand Down
4 changes: 2 additions & 2 deletions Source/ForcedWork.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ namespace AchtungMod
{
public class ForcedWork : WorldComponent
{
Dictionary<Pawn, ForcedJobs> allForcedJobs = new Dictionary<Pawn, ForcedJobs>();
Dictionary<Pawn, ForcedJobs> allForcedJobs = new();
public bool hasForcedJobs = false; //optimization
private List<Pawn> forcedJobsKeysWorkingList;
private List<ForcedJobs> forcedJobsValuesWorkingList;
private int counter;

public readonly HashSet<Pawn> preparing = new HashSet<Pawn>();
public readonly HashSet<Pawn> preparing = new();
//readonly Dictionary<Pawn, HashSet<IntVec3>> forbiddenLocations = new Dictionary<Pawn, HashSet<IntVec3>>();

public ForcedWork(World world) : base(world) { }
Expand Down
4 changes: 2 additions & 2 deletions Source/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ public static bool Prefix(Pawn p, bool forced, ref bool __result)
static class Toil_AddEndCondition_Patch
{
public static readonly MethodInfo mIsForbidden = SymbolExtensions.GetMethodInfo(() => ForbidUtility.IsForbidden(null, (Pawn)null));
public static readonly Dictionary<MethodInfo, bool> hasForbiddenState = new Dictionary<MethodInfo, bool>();
public static readonly Dictionary<MethodInfo, bool> hasForbiddenState = new();

public static void Prefix(Toil __instance, ref Func<JobCondition> newEndCondition)
{
Expand Down Expand Up @@ -1071,7 +1071,7 @@ public static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstructio
[HarmonyPatch(nameof(Pawn.GetInspectString))]
static class Pawn_GetInspectString_Patch
{
static readonly Dictionary<Pawn, string> cache = new Dictionary<Pawn, string>();
static readonly Dictionary<Pawn, string> cache = new();

public static void Postfix(Pawn __instance, ref string __result)
{
Expand Down
4 changes: 2 additions & 2 deletions Source/MouseTracker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ enum DragState
public IntVec3 center;
public Vector2 start;
public int lastDelta = -1;
public Dictionary<Pawn, Action<int>> mouseMovedActions = new Dictionary<Pawn, Action<int>>();
public Dictionary<Pawn, Action> mouseUpActions = new Dictionary<Pawn, Action>();
public Dictionary<Pawn, Action<int>> mouseMovedActions = new();
public Dictionary<Pawn, Action> mouseUpActions = new();

public static MouseTracker GetInstance()
{
Expand Down
2 changes: 1 addition & 1 deletion Source/Pawn_AchtungThinker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace AchtungMod
//
public class Pawn_AchtungThinker : Pawn_Thinker
{
public ForcedJobs forcedJobs = new ForcedJobs();
public ForcedJobs forcedJobs = new();

public Pawn_AchtungThinker(Pawn pawn) : base(pawn) { }
}
Expand Down
8 changes: 4 additions & 4 deletions Source/Performance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ public static class Performance
static readonly bool enabled;
static readonly string logPath = Path.Combine(GenFilePaths.SaveDataFolderPath, "AchtungPerformance.txt");

static readonly Stopwatch w_EndCurrentJob = new Stopwatch();
static readonly Stopwatch w_ContinueJob = new Stopwatch();
static readonly Stopwatch w_GetNextJob = new Stopwatch();
static readonly Stopwatch w_EndCurrentJob = new();
static readonly Stopwatch w_ContinueJob = new();
static readonly Stopwatch w_GetNextJob = new();

static int w_GetNextJobCount = 0;
static int logNextTicks = 0;
Expand Down Expand Up @@ -119,7 +119,7 @@ public static void Report(ForcedJob forcedJob, Pawn pawn)
}
}

static readonly HashSet<string> knownExceptions = new HashSet<string>();
static readonly HashSet<string> knownExceptions = new();
public static void Log(Exception exception)
{
if (enabled == false)
Expand Down
8 changes: 8 additions & 0 deletions Source/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,14 @@ public override void ExposeData()

public static void DoWindowContents(Rect canvas)
{
var helpRect = canvas;
helpRect.height = Text.LineHeight + 2;
helpRect.x -= 17;
helpRect.y -= 33 + 4;
helpRect.xMin = helpRect.xMax - "Tutorial".Translate().GetWidthCached() - 42;
if (Widgets.ButtonText(helpRect, "Tutorial".Translate()))
ModFeatures.ShowAgain<Achtung>(true);

var columnWidth = (canvas.width - 30) / 2 - 2;
var list = new Listing_Standard { ColumnWidth = columnWidth };
list.Begin(canvas);
Expand Down
2 changes: 1 addition & 1 deletion Source/Tools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ static class Tools
public static string goHereLabel;
public static WorkTypeDef savedWorkTypeDef = null;

public static WorkTypeDef RescuingWorkTypeDef => new WorkTypeDef()
public static WorkTypeDef RescuingWorkTypeDef => new()
{
defName = "Rescuing",
labelShort = "WorkType_Rescue_Label".Translate(),
Expand Down
14 changes: 7 additions & 7 deletions Source/XY.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ namespace AchtungMod
public readonly short y;
public XY(int x, int y) { this.x = (short)x; this.y = (short)y; }
public XY(short x, short y) { this.x = x; this.y = y; }
public static XY Zero => new XY(0, 0);
public static XY Invalid => new XY(-500, -500);
public static XY Zero => new(0, 0);
public static XY Invalid => new(-500, -500);
public readonly bool IsValid => x != -500;
public readonly bool IsInvalid => x == -500;
public static XY[] Adjacent => new XY[8] {
Expand All @@ -22,13 +22,13 @@ namespace AchtungMod
};
public readonly int MagnitudeManhattan => x < 0 ? -x : x + (y < 0 ? -y : y);

public static implicit operator XY(IntVec3 v3) => new XY((short)v3.x, (short)v3.z);
public static implicit operator IntVec3(XY xy) => new IntVec3(xy.x, 0, xy.y);
public static implicit operator XY(IntVec3 v3) => new((short)v3.x, (short)v3.z);
public static implicit operator IntVec3(XY xy) => new(xy.x, 0, xy.y);
public static implicit operator XY(LocalTargetInfo info) { var cell = info.Cell; return new XY((short)cell.x, (short)cell.z); }
public static implicit operator LocalTargetInfo(XY xy) => new LocalTargetInfo() { thingInt = null, cellInt = xy };
public static implicit operator LocalTargetInfo(XY xy) => new() { thingInt = null, cellInt = xy };

public static XY operator +(XY a, XY b) => new XY((short)(a.x + b.x), (short)(a.y + b.y));
public static XY operator -(XY a, XY b) => new XY((short)(a.x - b.x), (short)(a.y - b.y));
public static XY operator +(XY a, XY b) => new((short)(a.x + b.x), (short)(a.y + b.y));
public static XY operator -(XY a, XY b) => new((short)(a.x - b.x), (short)(a.y - b.y));
public static bool operator ==(XY a, XY b) => a.x == b.x && a.y == b.y;
public static bool operator ==(IntVec3 v3, XY b) => v3.x == b.x && v3.z == b.y;
public static bool operator ==(XY a, IntVec3 v3) => a.x == v3.x && a.y == v3.z;
Expand Down

0 comments on commit dd14939

Please sign in to comment.