diff --git a/1.5/Assemblies/CameraPlus.dll b/1.5/Assemblies/CameraPlus.dll
index fce5d0a..9c4fbd3 100644
Binary files a/1.5/Assemblies/CameraPlus.dll and b/1.5/Assemblies/CameraPlus.dll differ
diff --git a/About/About.xml b/About/About.xml
index 846e72a..e644326 100755
--- a/About/About.xml
+++ b/About/About.xml
@@ -19,7 +19,7 @@
brrainz.cameraplus
- 2.7.1.0
+ 2.7.2.0
867467808
https://github.com/pardeike/CameraPlus
You want more zoom and different paning?
diff --git a/About/Manifest.xml b/About/Manifest.xml
index cfefdfc..c8ff2d6 100644
--- a/About/Manifest.xml
+++ b/About/Manifest.xml
@@ -1,7 +1,7 @@
net.pardeike.rimworld.mod.cameraplus
- 2.7.1.0
+ 2.7.2.0
1.0.0
1.1.0
diff --git a/Directory.Build.props b/Directory.Build.props
index d4a8ccf..df0a8fc 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -4,7 +4,7 @@
Camera+
CameraPlus
https://github.com/pardeike/CameraPlus
- 2.7.1.0
+ 2.7.2.0
{AC5EE7A1-16EA-498D-B21A-83ACF78F0E5A}
diff --git a/Source/Tools.cs b/Source/Tools.cs
index 911f345..1fc5fff 100644
--- a/Source/Tools.cs
+++ b/Source/Tools.cs
@@ -46,24 +46,19 @@ class Tools : CameraPlusSettings
return isSmall && (CameraPlusMain.Settings.includeNotTamedAnimals || pawn.RaceProps.Animal == false || tamedAnimal);
});
- static readonly QuotaCache shouldShowLabelCache = new(60, thing => thing.thingIDNumber, thing =>
+ static readonly QuotaCache shouldShowLabelCache = new(60, pawn => pawn.thingIDNumber, pawn =>
{
var len = FastUI.CurUICellSize;
- var isPawn = thing is Pawn;
-
- var lower = isPawn ? CameraPlusMain.Settings.hidePawnLabelBelow : CameraPlusMain.Settings.hideThingLabelBelow;
- if (len <= lower)
+ if (len <= CameraPlusMain.Settings.hidePawnLabelBelow)
return false;
- var pawn = thing as Pawn;
-
if (InvisibilityUtility.IsHiddenFromPlayer(pawn))
return false;
if (pawn != null && CameraPlusMain.Settings.customNameStyle == LabelStyle.HideAnimals && pawn.RaceProps.Animal)
return true;
- if (isPawn && len <= CameraPlusMain.Settings.dotSize)
+ if (pawn != null && len <= CameraPlusMain.Settings.dotSize)
return false;
return true;
@@ -71,21 +66,24 @@ class Tools : CameraPlusSettings
public static bool ShouldShowDot(Pawn pawn)
{
- if (CameraPlusMain.Settings.hideNamesWhenZoomedOut == false)
+ if (pawn == null || CameraPlusMain.Settings.hideNamesWhenZoomedOut == false)
return false;
return shouldShowDotCache.Get(pawn);
}
- public static bool ShouldShowLabel(Thing thing, Vector2 screenPos = default)
+ public static bool ShouldShowLabel(Pawn pawn, Vector2 screenPos = default)
{
if (CameraPlusMain.Settings.hideNamesWhenZoomedOut == false)
return true;
- if (CameraPlusMain.Settings.mouseOverShowsLabels && MouseDistanceSquared(thing?.DrawPos ?? screenPos, thing is Pawn) <= 2.25f)
+ if (CameraPlusMain.Settings.mouseOverShowsLabels && MouseDistanceSquared(pawn?.DrawPos ?? screenPos, pawn != null) <= 2.25f)
return true;
- return shouldShowLabelCache.Get(thing);
+ if (pawn == null)
+ return FastUI.CurUICellSize > CameraPlusMain.Settings.hideThingLabelBelow;
+
+ return shouldShowLabelCache.Get(pawn);
}
public static void DrawDot(Pawn pawn, Color innerColor, Color outerColor)