Checkpoint workspace changes

This commit is contained in:
2026-04-29 01:24:21 +08:00
parent 9b6adf1806
commit ef11651ec2
67 changed files with 3161 additions and 1904 deletions

View File

@@ -5,8 +5,6 @@
#include "Inspector/Components/InspectorComponentEditorRegistry.h"
#include "Scene/EditorSceneRuntime.h"
#include <XCEngine/Components/GameObject.h>
#include <algorithm>
#include <filesystem>
@@ -14,7 +12,6 @@ namespace XCEngine::UI::Editor::App {
namespace {
using ::XCEngine::Components::GameObject;
using Widgets::UIEditorPropertyGridField;
using Widgets::UIEditorPropertyGridFieldKind;
using Widgets::UIEditorPropertyGridSection;
@@ -26,9 +23,9 @@ std::string PathToUtf8String(const std::filesystem::path& path) {
std::string ResolveSceneObjectDisplayName(
const InspectorSceneObjectSubject& sceneObject) {
return sceneObject.displayName.empty()
return sceneObject.object.displayName.empty()
? std::string("GameObject")
: sceneObject.displayName;
: sceneObject.object.displayName;
}
std::string ResolveProjectSelectionTitle(
@@ -90,11 +87,11 @@ const EditorSceneComponentDescriptor* FindComponentDescriptor(
InspectorComponentEditorContext BuildComponentEditorContext(
const EditorSceneComponentDescriptor& descriptor,
const GameObject* gameObject,
const EditorSceneObjectSnapshot* gameObject,
const IInspectorComponentEditor* editor) {
InspectorComponentEditorContext context = {};
context.gameObject = gameObject;
context.component = descriptor.component;
context.component = descriptor.view.get();
context.componentId = descriptor.componentId;
context.typeName = descriptor.typeName;
context.displayName = editor != nullptr
@@ -146,7 +143,7 @@ void AppendFallbackComponentStructureSignature(
void AppendComponentStructureSignature(
const EditorSceneComponentDescriptor& descriptor,
const GameObject* gameObject,
const EditorSceneObjectSnapshot* gameObject,
const InspectorComponentEditorRegistry& componentEditorRegistry,
std::string& signature) {
const IInspectorComponentEditor* editor =
@@ -167,7 +164,7 @@ void AppendComponentStructureSignature(
void AppendComponentPresentation(
InspectorPresentationModel& model,
const EditorSceneComponentDescriptor& descriptor,
const GameObject* gameObject,
const EditorSceneObjectSnapshot* gameObject,
const InspectorComponentEditorRegistry& componentEditorRegistry,
std::string& structureSignature) {
InspectorPresentationComponentBinding binding = {};
@@ -219,10 +216,10 @@ std::string BuildSceneObjectStructureSignature(
std::string signature = {};
AppendInspectorStructureToken(signature, "scene");
for (const EditorSceneComponentDescriptor& descriptor :
sceneRuntime.GetSelectedComponents()) {
sceneRuntime.GetSelectedComponents()) {
AppendComponentStructureSignature(
descriptor,
sceneObject.gameObject,
&sceneObject.object,
componentEditorRegistry,
signature);
}
@@ -258,7 +255,7 @@ InspectorPresentationSyncResult SyncSceneObjectPresentationValues(
}
const InspectorComponentEditorContext context =
BuildComponentEditorContext(*descriptor, sceneObject.gameObject, editor);
BuildComponentEditorContext(*descriptor, &sceneObject.object, editor);
for (const std::string& fieldId : binding.fieldIds) {
const auto location =
Widgets::FindUIEditorPropertyGridFieldLocation(model.sections, fieldId);
@@ -332,7 +329,7 @@ InspectorPresentationModel BuildInspectorPresentationModel(
AppendComponentPresentation(
model,
descriptor,
sceneObject.gameObject,
&sceneObject.object,
componentEditorRegistry,
model.structureSignature);
}