Skip to content

Commit

Permalink
Small tweaks and cleaning before release
Browse files Browse the repository at this point in the history
  • Loading branch information
Byte-Nova committed Oct 6, 2024
1 parent 6896812 commit da23df9
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 9 deletions.
17 changes: 9 additions & 8 deletions Source/Client/Managers/RimworldManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -228,18 +228,19 @@ public static Pawn[] GetAllSettlementPawns(Faction faction, bool includeAnimals)

public static Pawn[] GetPawnsFromMap(Map map, Faction faction, bool includeAnimals)
{
if (includeAnimals) return map.mapPawns.AllPawns.Where(fetch => fetch.Faction == faction).ToArray();
else return map.mapPawns.AllPawns.Where(fetch => fetch.Faction == faction && !DeepScribeHelper.CheckIfThingIsAnimal(fetch)).ToArray();
if (map == null || map.mapPawns == null) return new Pawn[0];
else
{
if (includeAnimals) return map.mapPawns.AllPawns.Where(fetch => fetch.Faction == faction).ToArray();
else return map.mapPawns.AllPawns.Where(fetch => fetch.Faction == faction && !DeepScribeHelper.CheckIfThingIsAnimal(fetch)).ToArray();
}
}

public static bool CheckIfMapHasPlayerPawns(Map map)
{
if (map == null) return false;
else
{
if (map.mapPawns.AllPawns.FirstOrDefault(fetch => fetch.Faction == Faction.OfPlayer) != null) return true;
else return false;
}
if (map == null || map.mapPawns == null) return false;
else if (map.mapPawns.AllPawns.FirstOrDefault(fetch => fetch.Faction == Faction.OfPlayer) != null) return true;
else return false;
}
}
}
17 changes: 17 additions & 0 deletions Source/Client/Patches/Pages/MainMenuPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,23 @@ namespace GameClient
{
public class MainMenuPatches
{
[HarmonyPatch(typeof(VersionControl), nameof(VersionControl.DrawInfoInCorner))]
private static class VersionControl_DrawInfoInCorner_Patch
{
private static void Postfix()
{
string toDisplay = $"RimWorld Together v{CommonValues.executableVersion}";
Vector2 size = Text.CalcSize(toDisplay);
Rect rect = new Rect(10f, 73f, size.x, size.y);

Text.Font = GameFont.Small;

GUI.color = Color.white.ToTransparent(0.5f);
Widgets.Label(rect, toDisplay);
GUI.color = Color.white;
}
}

[HarmonyPatch(typeof(MainMenuDrawer), "DoMainMenuControls")]
public static class PatchButton
{
Expand Down
2 changes: 1 addition & 1 deletion Source/Shared/Misc/CommonValues.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ namespace Shared
{
public static class CommonValues
{
public readonly static string executableVersion = "dev";
public readonly static string executableVersion = "24.10.6.1";

public readonly static string clientAssemblyName = "GameClient";

Expand Down

0 comments on commit da23df9

Please sign in to comment.