29 lines
946 B
C++
29 lines
946 B
C++
|
|
#include "Workspace/UIEditorWorkspaceModelInternal.h"
|
||
|
|
|
||
|
|
namespace XCEngine::UI::Editor {
|
||
|
|
|
||
|
|
UIEditorWorkspaceValidationResult ValidateUIEditorWorkspace(
|
||
|
|
const UIEditorWorkspaceModel& workspace) {
|
||
|
|
std::unordered_set<std::string> panelIds = {};
|
||
|
|
UIEditorWorkspaceValidationResult result =
|
||
|
|
Detail::ValidateNodeRecursive(workspace.root, panelIds);
|
||
|
|
if (!result.IsValid()) {
|
||
|
|
return result;
|
||
|
|
}
|
||
|
|
|
||
|
|
if (!workspace.activePanelId.empty()) {
|
||
|
|
const UIEditorWorkspacePanelState* activePanel =
|
||
|
|
FindUIEditorWorkspaceActivePanel(workspace);
|
||
|
|
if (activePanel == nullptr) {
|
||
|
|
return Detail::MakeValidationError(
|
||
|
|
UIEditorWorkspaceValidationCode::InvalidActivePanelId,
|
||
|
|
"Active panel id '" + workspace.activePanelId +
|
||
|
|
"' is missing or hidden by the current tab selection.");
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
return {};
|
||
|
|
}
|
||
|
|
|
||
|
|
} // namespace XCEngine::UI::Editor
|