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,3 +1,4 @@
using AIImages.Helpers;
using Verse;
namespace AIImages.Components
@@ -23,9 +24,35 @@ namespace AIImages.Components
public override void PostExposeData()
{
base.PostExposeData();
string portraitPath = PortraitPath;
bool isSaving = Scribe.mode == LoadSaveMode.Saving;
bool isLoading = Scribe.mode == LoadSaveMode.LoadingVars;
DebugLogger.Log(
$"[AI Images] PostExposeData for {parent?.LabelShort} - Mode: {Scribe.mode}, Current path: '{PortraitPath}'"
);
Scribe_Values.Look(ref portraitPath, "aiPortraitPath", null);
if (isSaving)
{
DebugLogger.Log(
$"[AI Images] Saving portrait path for {parent?.LabelShort}: '{portraitPath}'"
);
}
else if (isLoading)
{
DebugLogger.Log(
$"[AI Images] Loading portrait path for {parent?.LabelShort}: '{portraitPath}'"
);
}
PortraitPath = portraitPath;
DebugLogger.Log(
$"[AI Images] PostExposeData completed for {parent?.LabelShort} - Final path: '{PortraitPath}', HasPortrait: {HasPortrait}"
);
}
}
}