Skip to content

Commit

Permalink
v2.7.5 has markers for anomaly entities
Browse files Browse the repository at this point in the history
  • Loading branch information
pardeike committed Apr 18, 2024
1 parent 0404c41 commit a1dbd65
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 7 deletions.
Binary file modified 1.5/Assemblies/CameraPlus.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 @@ -19,7 +19,7 @@
</li>
</modDependencies>
<packageId>brrainz.cameraplus</packageId>
<modVersion>2.7.2.0</modVersion>
<modVersion>2.7.5.0</modVersion>
<steamAppId>867467808</steamAppId>
<url>https://github.com/pardeike/CameraPlus</url>
<description>You want more zoom and different paning?
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.cameraplus</identifier>
<version>2.7.2.0</version>
<version>2.7.5.0</version>
<targetVersions>
<li>1.0.0</li>
<li>1.1.0</li>
Expand Down
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>Camera+</ModName>
<ModFileName>CameraPlus</ModFileName>
<Repository>https://github.com/pardeike/CameraPlus</Repository>
<ModVersion>2.7.2.0</ModVersion>
<ModVersion>2.7.5.0</ModVersion>
<ProjectGuid>{AC5EE7A1-16EA-498D-B21A-83ACF78F0E5A}</ProjectGuid>
</PropertyGroup>

Expand Down
12 changes: 8 additions & 4 deletions Source/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,14 @@ public static bool Prefix(Pawn ___pawn)

if (!___pawn.Spawned || ___pawn.Map.fogGrid.IsFogged(___pawn.Position))
return true;
if (___pawn.RaceProps.Humanlike)
return true;
if (___pawn.Name != null)
return true;

if (___pawn.IsEntity == false)
{
if (___pawn.RaceProps.Humanlike)
return true;
if (___pawn.Name != null)
return true;
}

var useMarkers = Tools.GetMarkerColors(___pawn, out var innerColor, out var outerColor);
if (useMarkers == false)
Expand Down
Binary file added Source/Originals/Marker.afphoto
Binary file not shown.
12 changes: 12 additions & 0 deletions Source/Tools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ class Tools : CameraPlusSettings
static readonly Texture2D outerColonistTexture = ContentFinder<Texture2D>.Get("OuterColonistMarker", true);
static readonly Texture2D innerAnimalTexture = ContentFinder<Texture2D>.Get("InnerAnimalMarker", true);
static readonly Texture2D outerAnimalTexture = ContentFinder<Texture2D>.Get("OuterAnimalMarker", true);
static readonly Texture2D innerEntityTexture = ContentFinder<Texture2D>.Get("InnerEntityMarker", true);
static readonly Texture2D outerEntityTexture = ContentFinder<Texture2D>.Get("OuterEntityMarker", true);

static readonly Texture2D downedTexture = ContentFinder<Texture2D>.Get("DownedMarker", true);
static readonly Texture2D draftedTexture = ContentFinder<Texture2D>.Get("DraftedMarker", true);
Expand Down Expand Up @@ -240,6 +242,9 @@ public static bool GetMarkerColors(Pawn pawn, out Color innerColor, out Color ou
var isDangerous = stateDef == MentalStateDefOf.ManhunterPermanent || stateDef == MentalStateDefOf.Manhunter;
innerColor = isDangerous ? dangerousAnimalColor : (GetMainColor(pawn) ?? innerColor);
}
else if (pawn.IsEntity)
innerColor = GetMainColor(pawn) ?? innerColor;

outerColor = Find.Selector.IsSelected(pawn) ? Color.black : Color.white;
return true;
}
Expand All @@ -261,6 +266,13 @@ public static bool GetMarkerTextures(Pawn pawn, out Texture2D innerTexture, out
return true;
}

if (pawn.IsEntity)
{
innerTexture = innerEntityTexture;
outerTexture = outerEntityTexture;
return true;
}

var isAnimal = pawn.RaceProps.Animal;
var customAnimalStyle = CameraPlusMain.Settings.customNameStyle == LabelStyle.AnimalsDifferent;
innerTexture = isAnimal && customAnimalStyle ? innerAnimalTexture : innerColonistTexture;
Expand Down
Binary file added Textures/InnerEntityMarker.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Textures/OuterEntityMarker.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a1dbd65

Please sign in to comment.