Validate DistroDatabase and split MainMenuController's starter/collection logic out

- DistroDatabase.TryValidate() catches empty slots, blank ids, and
  duplicate ids at edit time (OnValidate) and runtime, instead of only
  surfacing as a runtime count check.
- StarterSelectionController centralizes the "do we have a usable
  starter set" check (previously re-derived in five places) and shows a
  dismissible in-UI error when the database is misconfigured, rather
  than silently leaving the modal hidden with just a console warning.
- Boot-intro's bootIntroPlayed flag now resets via
  RuntimeInitializeOnLoadMethod so it stays session-scoped even when
  the Editor's Reload Domain setting is off.
- Extracted StarterSelectionController and CollectionScreenController
  out of MainMenuController (885 -> ~490 lines), following the same
  plain-class-plus-Bind() pattern already used by FeaturedUnitPanel.
  Shared DisplayName/FormatLanguages formatting and digit-key mapping
  moved into DistroPresentation/CommandKeyBindings to remove the
  duplication that split would otherwise have introduced.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01364Mm9NsPooiSfDHKr4FAx
This commit is contained in:
Claude
2026-07-06 09:42:27 +00:00
parent 00e990ac18
commit f5ed13b98d
9 changed files with 578 additions and 365 deletions
+2 -3
View File
@@ -100,11 +100,10 @@ namespace KernelPanic.UI
populatedState.RemoveFromClassList("hidden");
emptyState.AddToClassList("hidden");
string displayName = string.IsNullOrWhiteSpace(unit.DisplayName) ? unit.name : unit.DisplayName;
titleLabel.text = "[ neofetch ]";
asciiFitter.SetArt(DistroArtPresenter.Render(asciiLabel, asciiPlaceholder, unit));
unitNameLabel.text = displayName;
languagesLabel.text = $"{unit.PrimaryLanguage} / {unit.SecondaryLanguage}";
unitNameLabel.text = DistroPresentation.DisplayName(unit);
languagesLabel.text = DistroPresentation.FormatLanguages(unit);
passiveLabel.text = string.IsNullOrWhiteSpace(unit.PassiveName) ? "--" : unit.PassiveName;
bestWaveLabel.text = "--"; // TODO: Bind best-wave stats from SaveService when stats exist.
SetAccent(ColorUtility.ToHtmlStringRGB(unit.AccentColor));