Enhance AIImages mod by adding debug logging functionality to various components, improving troubleshooting capabilities. Introduce a new setting to enable or disable debug logs in the UI, with localized strings in English and Russian. Update StableDiffusionNet.Core dependency to version 1.1.5. Update AIImages.dll to reflect these changes.

This commit is contained in:
Leonid Pershin
2025-10-28 19:01:38 +03:00
parent 0bdcd3036a
commit beb1e2b2fc
14 changed files with 385 additions and 52 deletions

View File

@@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.Reflection;
using AIImages.Components;
using AIImages.Helpers;
using HarmonyLib;
using Verse;
@@ -24,6 +25,8 @@ namespace AIImages.Patches
&& pawn.GetComp<PawnPortraitComp>() == null
)
{
DebugLogger.Log($"[AI Images] Adding portrait component to {pawn.Name}");
// Создаем компонент
var comp = new PawnPortraitComp { parent = pawn };
@@ -35,6 +38,26 @@ namespace AIImages.Patches
if (compsList != null)
{
compsList.Add(comp);
DebugLogger.Log(
$"[AI Images] Successfully added portrait component to {pawn.Name}"
);
}
else
{
DebugLogger.Error($"[AI Images] Failed to get comps list for {pawn.Name}");
}
}
else if (__instance is Pawn pawn2)
{
if (pawn2.RaceProps?.Humanlike != true)
{
DebugLogger.Log($"[AI Images] Skipping non-humanlike pawn: {pawn2.Name}");
}
else if (pawn2.GetComp<PawnPortraitComp>() != null)
{
DebugLogger.Log(
$"[AI Images] Portrait component already exists for {pawn2.Name}"
);
}
}
}