Advance editor runtime and scripting integration

This commit is contained in:
2026-04-29 16:55:44 +08:00
parent 631bf32db2
commit 2e50c90167
60 changed files with 4071 additions and 228 deletions

View File

@@ -19,6 +19,7 @@
#include "D3D12EditorWindowRenderRuntime.h"
#include "EnvironmentFlags.h"
#include <XCEditor/Shell/UIEditorShellAsset.h>
#include <XCEditor/Foundation/UIEditorRuntimeTrace.h>
#include <XCEngine/Debug/Logger.h>
#include <XCEditor/Windowing/System/EditorWindowSystem.h>
@@ -223,7 +224,6 @@ bool Application::Initialize(HINSTANCE hInstance, int nCmdShow) {
return App::CreateEditorWorkspaceShellRuntime(
App::CreateEditorWorkspacePanelRuntimeSet(
m_editorContext->GetSession(),
m_editorContext->GetCommandFocusService(),
m_editorContext->GetProjectRuntime(),
m_editorContext->GetSceneRuntime(),
m_editorContext->GetColorPickerToolState(),
@@ -235,7 +235,17 @@ bool Application::Initialize(HINSTANCE hInstance, int nCmdShow) {
return m_editorContext->RequestOpenSceneAsset(scenePath);
}),
App::CreateEditorIconService(),
App::CreateEditorViewportRuntimeServices());
App::CreateEditorViewportRuntimeServices(),
::XCEngine::UI::Editor::BuildEditorShellShortcutManager(
m_editorContext->GetShellAsset()),
m_editorContext->GetRuntimeCoordinator(),
[this]() {
if (m_windowManager == nullptr) {
return;
}
m_windowManager->RequestPrimaryWindowClose();
});
};
m_windowManager = std::make_unique<App::EditorWindowManager>(
*m_editorContext,
@@ -254,13 +264,6 @@ bool Application::Initialize(HINSTANCE hInstance, int nCmdShow) {
m_editorContext->GetSceneRuntime());
});
m_editorContext->SetExitRequestHandler([this]() {
if (m_windowManager == nullptr) {
return;
}
m_windowManager->RequestPrimaryWindowClose();
});
m_editorContext->SetReadyStatus();
App::EditorWindowCreateParams createParams = {};
@@ -422,6 +425,9 @@ int Application::Run(HINSTANCE hInstance, int nCmdShow) {
break;
}
if (m_editorContext != nullptr) {
m_editorContext->TickEditorRuntime();
}
m_windowManager->RenderAllWindows();
if (m_smokeTestEnabled && !m_smokeTestCloseRequested) {
++m_smokeTestRenderedFrameCount;