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:
@@ -0,0 +1,20 @@
|
||||
using KernelPanic.Data;
|
||||
|
||||
namespace KernelPanic.UI
|
||||
{
|
||||
/// <summary>
|
||||
/// Shared text formatting for distros, used by every screen that lists or details them.
|
||||
/// </summary>
|
||||
public static class DistroPresentation
|
||||
{
|
||||
public static string DisplayName(DistroDefinition unit)
|
||||
{
|
||||
return string.IsNullOrWhiteSpace(unit.DisplayName) ? unit.name : unit.DisplayName;
|
||||
}
|
||||
|
||||
public static string FormatLanguages(DistroDefinition unit)
|
||||
{
|
||||
return $"{unit.PrimaryLanguage} / {unit.SecondaryLanguage}";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user