Update PawnGizmoPatch to add a gizmo button to all spawned pawns instead of just colonists. Modify Window_AIImage to handle selection of any spawned pawn, enhancing functionality and usability across the AIImages mod.
All checks were successful
SonarQube Analysis / Build and analyze (push) Successful in 1m38s

This commit is contained in:
Leonid Pershin
2025-11-01 09:27:32 +03:00
parent a9dd7910a0
commit 5c9887c669
3 changed files with 5 additions and 11 deletions

View File

@@ -10,7 +10,7 @@ using Verse;
namespace AIImages
{
/// <summary>
/// Harmony patch to add a gizmo (button) to all colonist pawns
/// Harmony patch to add a gizmo (button) to all pawns
/// </summary>
[HarmonyPatch(typeof(Pawn), "GetGizmos")]
[System.Diagnostics.CodeAnalysis.SuppressMessage(
@@ -34,12 +34,8 @@ namespace AIImages
yield return gizmo;
}
// Only add button to colonist pawns that are spawned
if (
__instance.IsColonist
&& __instance.Spawned
&& __instance.Faction == Faction.OfPlayer
)
// Add button to all spawned pawns (not just colonists)
if (__instance.Spawned)
{
yield return new Command_Action
{