Add Genes and Hediffs information display in AIImages mod. Update English and Russian localization files to include new labels. Modify Window_AIImage.cs to render gene and hediff details in the character information display. Update AIImages.dll to reflect these changes.

This commit is contained in:
Leonid Pershin
2025-10-28 19:53:04 +03:00
parent 5f8f29a7dc
commit 51c3ea4bc1
4 changed files with 72 additions and 0 deletions

View File

@@ -641,6 +641,56 @@ namespace AIImages
}
}
// Гены
if (pawn.genes?.GenesListForReading != null && pawn.genes.GenesListForReading.Any())
{
contentY += 15f;
Text.Font = GameFont.Small;
Widgets.Label(
new Rect(parentRect.x + 5f, contentY, parentRect.width - 10f, lineHeight),
"AIImages.Info.Genes".Translate() + ":"
);
contentY += lineHeight + 2f;
Text.Font = GameFont.Tiny;
var geneLabels = pawn
.genes.GenesListForReading.Where(gene => gene.Active)
.Select(gene => gene.def.LabelCap);
foreach (var geneLabel in geneLabels)
{
Widgets.Label(
new Rect(parentRect.x + 15f, contentY, parentRect.width - 20f, lineHeight),
"• " + geneLabel
);
contentY += lineHeight;
}
}
// Хедифы (состояния)
if (pawn.health?.hediffSet?.hediffs != null && pawn.health.hediffSet.hediffs.Any())
{
contentY += 15f;
Text.Font = GameFont.Small;
Widgets.Label(
new Rect(parentRect.x + 5f, contentY, parentRect.width - 10f, lineHeight),
"AIImages.Info.Hediffs".Translate() + ":"
);
contentY += lineHeight + 2f;
Text.Font = GameFont.Tiny;
var hediffLabels = pawn
.health.hediffSet.hediffs.Where(hediff => hediff.Visible)
.Select(hediff => hediff.LabelCap);
foreach (var hediffLabel in hediffLabels)
{
Widgets.Label(
new Rect(parentRect.x + 15f, contentY, parentRect.width - 20f, lineHeight),
"• " + hediffLabel
);
contentY += lineHeight;
}
}
// Одежда
var apparel = pawn.apparel?.WornApparel;
if (apparel != null && apparel.Any())
@@ -767,6 +817,24 @@ namespace AIImages
height += pawn.story.traits.allTraits.Count * 22f; // Каждая черта
}
// Гены (если есть)
if (pawn.genes?.GenesListForReading != null && pawn.genes.GenesListForReading.Any())
{
height += 15f; // Отступ
height += 22f; // Заголовок "Гены"
height += 2f; // Отступ
height += pawn.genes.GenesListForReading.Count(gene => gene.Active) * 22f; // Каждый активный ген
}
// Хедифы (если есть)
if (pawn.health?.hediffSet?.hediffs != null && pawn.health.hediffSet.hediffs.Any())
{
height += 15f; // Отступ
height += 22f; // Заголовок "Хедифы"
height += 2f; // Отступ
height += pawn.health.hediffSet.hediffs.Count(hediff => hediff.Visible) * 22f; // Каждый видимый хедиф
}
// Одежда (если есть)
var apparel = pawn.apparel?.WornApparel;
if (apparel != null && apparel.Any())