Refine editor shell asset contract

This commit is contained in:
2026-04-07 13:01:48 +08:00
parent e7669dc8c3
commit 6bf61ad8e2
4 changed files with 130 additions and 54 deletions

View File

@@ -199,6 +199,9 @@ int Application::Run(HINSTANCE hInstance, int nCmdShow) {
bool Application::Initialize(HINSTANCE hInstance, int nCmdShow) {
m_hInstance = hInstance;
m_shellAssetDefinition = BuildDefaultEditorShellAsset(ResolveRepoRootPath());
m_structuredShell = BuildStructuredEditorShellBinding(m_shellAssetDefinition);
m_shellServices = BuildStructuredEditorShellServices(m_structuredShell);
m_screenAsset = m_structuredShell.screenAsset;
WNDCLASSEXW windowClass = {};
windowClass.cbSize = sizeof(windowClass);
@@ -397,14 +400,11 @@ void Application::QueueWindowFocusEvent(UIInputEventType type) {
bool Application::LoadStructuredScreen(const char* triggerReason) {
(void)triggerReason;
m_screenAsset = {};
m_screenAsset.screenId = m_shellAssetDefinition.screenId;
m_screenAsset.documentPath = m_shellAssetDefinition.documentPath.string();
m_screenAsset.themePath = m_shellAssetDefinition.themePath.string();
m_screenAsset = m_structuredShell.screenAsset;
const bool loaded = m_screenPlayer.Load(m_screenAsset);
const EditorShellAssetValidationResult shellAssetValidation =
ValidateEditorShellAsset(m_shellAssetDefinition);
const EditorShellAssetValidationResult& shellAssetValidation =
m_structuredShell.assetValidation;
const auto shortcutValidation = m_structuredShell.shortcutManager.ValidateConfiguration();
m_useStructuredScreen = loaded;
m_runtimeStatus = loaded ? "XCUI Editor Shell" : "Editor Shell | Load Error";
m_runtimeError.clear();
@@ -416,6 +416,11 @@ bool Application::LoadStructuredScreen(const char* triggerReason) {
m_runtimeError,
"Editor shell asset invalid: " + shellAssetValidation.message);
}
if (!shortcutValidation.IsValid()) {
AppendErrorMessage(
m_runtimeError,
"Structured shell shortcut manager invalid: " + shortcutValidation.message);
}
RebuildTrackedFileStates();
return loaded;
}