Fix some fucking bugs (FSFB)

This commit is contained in:
2026-07-06 15:46:53 +02:00
parent 68dc13c60d
commit a794d5692f
8 changed files with 519 additions and 35 deletions
+6 -35
View File
@@ -737,46 +737,17 @@ namespace KernelPanic.UI
stats.AddToClassList("collection-detail-muted");
copy.Add(stats);
AddDistroTeachingDetails(copy, unit);
if (unit.Passive != null)
{
Label passive = new($"{unit.Passive.Name}: {unit.Passive.RulesText}");
passive.AddToClassList("run-passive-summary");
copy.Add(passive);
}
readout.Add(copy);
return readout;
}
private static void AddDistroTeachingDetails(VisualElement target, DistroDefinition unit)
{
if (unit.Passive != null)
{
Label passiveTitle = new(unit.Passive.Name);
passiveTitle.AddToClassList("detail-section-title");
target.Add(passiveTitle);
Label passiveRules = new(unit.Passive.RulesText);
passiveRules.AddToClassList("collection-detail-description");
target.Add(passiveRules);
if (!string.IsNullOrWhiteSpace(unit.Passive.FlavorText))
{
Label passiveFlavor = new(unit.Passive.FlavorText);
passiveFlavor.AddToClassList("flavor-text");
target.Add(passiveFlavor);
}
}
if (!string.IsNullOrWhiteSpace(unit.PlaystyleSummary))
{
Label playstyle = new(unit.PlaystyleSummary);
playstyle.AddToClassList("collection-detail-description");
target.Add(playstyle);
}
for (int i = 0; i < unit.LanguageBlurbs.Count; i++)
{
DistroDefinition.LanguageBlurb blurb = unit.LanguageBlurbs[i];
target.Add(BuildDetailLine(blurb.Lang.ToString(), blurb.Blurb));
}
}
private static VisualElement BuildDetailLine(string key, string value)
{
VisualElement row = new();