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:
Binary file not shown.
@@ -18,6 +18,8 @@
|
||||
<AIImages.Info.HairColor>Hair Color</AIImages.Info.HairColor>
|
||||
<AIImages.Info.Traits>Traits</AIImages.Info.Traits>
|
||||
<AIImages.Info.Apparel>Apparel</AIImages.Info.Apparel>
|
||||
<AIImages.Info.Genes>Genes</AIImages.Info.Genes>
|
||||
<AIImages.Info.Hediffs>Hediffs</AIImages.Info.Hediffs>
|
||||
<!-- Appearance -->
|
||||
<AIImages.Appearance.SectionTitle>Appearance</AIImages.Appearance.SectionTitle>
|
||||
<AIImages.Appearance.NoInfo>Appearance information unavailable</AIImages.Appearance.NoInfo>
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
<AIImages.Info.HairColor>Цвет волос</AIImages.Info.HairColor>
|
||||
<AIImages.Info.Traits>Черты характера</AIImages.Info.Traits>
|
||||
<AIImages.Info.Apparel>Одежда</AIImages.Info.Apparel>
|
||||
<AIImages.Info.Genes>Гены</AIImages.Info.Genes>
|
||||
<AIImages.Info.Hediffs>Состояния</AIImages.Info.Hediffs>
|
||||
<!-- Appearance -->
|
||||
<AIImages.Appearance.SectionTitle>Внешность</AIImages.Appearance.SectionTitle>
|
||||
<AIImages.Appearance.NoInfo>Информация о внешности недоступна</AIImages.Appearance.NoInfo>
|
||||
|
||||
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user