feat(xcui): advance core and editor validation flow

This commit is contained in:
2026-04-06 16:20:46 +08:00
parent 33bb84f650
commit 2d030a97da
128 changed files with 9961 additions and 773 deletions

View File

@@ -82,6 +82,17 @@ std::string FormatPoint(const UIPoint& point) {
return "(" + FormatFloat(point.x) + ", " + FormatFloat(point.y) + ")";
}
void AppendErrorMessage(std::string& target, const std::string& message) {
if (message.empty()) {
return;
}
if (!target.empty()) {
target += " | ";
}
target += message;
}
std::int32_t MapVirtualKeyToUIKeyCode(WPARAM wParam) {
switch (wParam) {
case 'A': return static_cast<std::int32_t>(KeyCode::A);
@@ -392,9 +403,19 @@ bool Application::LoadStructuredScreen(const char* triggerReason) {
m_screenAsset.themePath = m_shellAssetDefinition.themePath.string();
const bool loaded = m_screenPlayer.Load(m_screenAsset);
const EditorShellAssetValidationResult shellAssetValidation =
ValidateEditorShellAsset(m_shellAssetDefinition);
m_useStructuredScreen = loaded;
m_runtimeStatus = loaded ? "XCUI Editor Shell" : "Editor Shell | Load Error";
m_runtimeError = loaded ? std::string() : m_screenPlayer.GetLastError();
m_runtimeError.clear();
if (!loaded) {
AppendErrorMessage(m_runtimeError, m_screenPlayer.GetLastError());
}
if (!shellAssetValidation.IsValid()) {
AppendErrorMessage(
m_runtimeError,
"Editor shell asset invalid: " + shellAssetValidation.message);
}
RebuildTrackedFileStates();
return loaded;
}