This commit is contained in:
2025-09-11 21:12:51 +08:00
parent f3d6c4e35e
commit 8cbd09e036
3 changed files with 26 additions and 21 deletions

View File

@@ -142,31 +142,14 @@ namespace ArachnaeSwarm
public override string GetInspectString()
{
List<string> inspectStrings = new List<string>();
string baseString = base.GetInspectString();
if (!baseString.NullOrEmpty())
{
inspectStrings.Add(baseString);
}
if (compMorphable?.StoredPawn != null)
{
Pawn pawn = compMorphable.StoredPawn;
SkillRecord intellectualSkill = pawn.skills?.GetSkill(SkillDefOf.Intellectual);
if (intellectualSkill != null)
{
inspectStrings.Add($"{SkillDefOf.Intellectual.LabelCap}: {intellectualSkill.Level} ({intellectualSkill.XpProgressPercent:P0})");
}
Need_Rest restNeed = pawn.needs?.rest;
if (restNeed != null)
{
inspectStrings.Add($"{restNeed.LabelCap}: {restNeed.CurLevelPercentage:P0}");
}
// 1. 活动状态 (置于首位)
TimeAssignmentDef assignment = pawn.timetable?.CurrentAssignment ?? TimeAssignmentDefOf.Anything;
bool isWorkingTime = !forceSleep && (assignment == TimeAssignmentDefOf.Work || assignment == TimeAssignmentDefOf.Anything);
string activity;
if (isWorkingTime)
{
@@ -185,6 +168,27 @@ namespace ArachnaeSwarm
activity = "Activity".Translate() + ": " + "Sleeping".Translate();
}
inspectStrings.Add(activity);
// 2. 智识技能
SkillRecord intellectualSkill = pawn.skills?.GetSkill(SkillDefOf.Intellectual);
if (intellectualSkill != null)
{
inspectStrings.Add($"{SkillDefOf.Intellectual.LabelCap}: {intellectualSkill.Level} ({intellectualSkill.XpProgressPercent:P0})");
}
// 3. 休息需求
Need_Rest restNeed = pawn.needs?.rest;
if (restNeed != null)
{
inspectStrings.Add($"{restNeed.LabelCap}: {virtualRest.ToStringPercent()}");
}
}
// 基础信息如HP最后添加
string baseString = base.GetInspectString();
if (!baseString.NullOrEmpty())
{
inspectStrings.Add(baseString);
}
return string.Join("\n", inspectStrings);