This commit is contained in:
2026-05-14 13:30:06 +08:00
parent 974946cee4
commit e43171521d
91 changed files with 10485 additions and 3254 deletions
+50 -3
View File
@@ -24,6 +24,7 @@ class QMenu;
class QFrame;
class QIcon;
class QPushButton;
class QListWidget;
class QSlider;
class QStackedWidget;
class QToolButton;
@@ -32,12 +33,14 @@ class QTreeWidgetItem;
class QWidget;
class EditorCanvas;
class TimelineWidget;
class TimelineEditorModel;
namespace gui {
class BackgroundPropertySection;
class BlackholePropertySection;
class EntityPropertySection;
class ToolPropertySection;
class CameraPropertySection;
class HotspotPropertySection;
class EntityIntroPopup;
class ResourceLibraryDock;
}
@@ -81,15 +84,18 @@ private:
void computeDepthAsync();
// UI 状态分三种:
// - Welcome:未打开项目。只显示欢迎页,其它 dock 一律隐藏,视图开关禁用。
// - Editor:已打开项目。显示编辑页,按默认规则显示 dock,同时允许用户通过“视图”菜单控制
// - EntityEditor:静态实体编辑(activeAnimationId=none,不显示摄像机)
// - AnimationEditor:动画编辑(真实动画方案,可编辑摄像机/时间轴)。
// - HotspotEditor:展示热点布点(要求:项目已打开且背景不为空)。
// - Preview:预览展示。用于全流程完成后的展示(要求:项目已打开且背景不为空)。
enum class UiMode { Welcome, Editor, Preview };
enum class UiMode { Welcome, EntityEditor, AnimationEditor, HotspotEditor, Preview };
void createMenus(); // 菜单和工具栏
void createFileMenu(); // 文件菜单
void createEditMenu(); // 编辑菜单
void createHelpMenu(); // 帮助菜单
void createViewMenu(); // 视图菜单
void createAnimationMenu();
void createWindowMenu(); // 窗口菜单(资源库等)
void createProjectTreeDock();
void createTimelineDock();
@@ -109,6 +115,8 @@ private:
void showPreviewPage();
void refreshWelcomeRecentList();
void openProjectFromPath(const QString& dir);
/// 打开/新建工程后:模态「加载中」直至首张背景可显示(无背景则立即继续)
void presentWorkspaceEditorWithBlockingInitialLoad();
void refreshPreviewPage();
void refreshEditorPage();
void applyTimelineFromProject();
@@ -116,6 +124,20 @@ private:
void refreshDopeSheet();
void setPreviewRequested(bool preview);
void syncPreviewPlaybackBar();
void stopEditorPlayback();
void stopPreviewPlayback();
void togglePreviewPlayback();
void startPreviewPlayback();
QString effectivePreviewAnimationId() const;
void refreshPreviewSchemeCombo();
void onPreviewSchemeComboChanged(int idx);
void switchPreviewSchemeAdjacent(int delta);
void requestPreviewSchemeSwitchTo(const QString& id, bool warmupDialog);
void updatePreviewEdgeArrowsHover(const QPointF& posInCanvasHost);
QVector<QString> previewAnimationSchemeIdsNonNone() const;
void syncHotspotEnterPreviewCombo();
void syncEditorRailForMode();
QStackedWidget* m_centerStack = nullptr;
QWidget* m_pageWelcome = nullptr;
@@ -132,6 +154,7 @@ private:
gui::EntityPropertySection* m_entityPropertySection = nullptr;
gui::ToolPropertySection* m_toolPropertySection = nullptr;
gui::CameraPropertySection* m_cameraPropertySection = nullptr;
gui::HotspotPropertySection* m_hotspotPropertySection = nullptr;
QToolButton* m_btnCreateEntity = nullptr;
ToolOptionPopup* m_createEntityPopup = nullptr;
QToolButton* m_btnToggleDepthOverlay = nullptr;
@@ -139,6 +162,8 @@ private:
EditorCanvas* m_editorCanvas = nullptr;
QTreeWidget* m_projectTree = nullptr;
QStackedWidget* m_rightTopDockStack = nullptr;
QListWidget* m_hotspotAnimationList = nullptr;
QDockWidget* m_dockProjectTree = nullptr;
QDockWidget* m_dockProperties = nullptr;
QDockWidget* m_dockTimeline = nullptr;
@@ -155,6 +180,7 @@ private:
QAction* m_actionToggleResourceLibrary = nullptr;
QAction* m_actionEnterPreview = nullptr;
QAction* m_actionBackToEditor = nullptr;
QAction* m_actionAnimationSettings = nullptr;
QAction* m_actionCanvasWorldAxes = nullptr;
QAction* m_actionCanvasAxisValues = nullptr;
QAction* m_actionCanvasGrid = nullptr;
@@ -192,6 +218,8 @@ private:
void refreshPropertyPanel();
void refreshEntityPropertyPanelFast();
void syncProjectTreeFromCanvasSelection();
/// 右侧项目树+属性列最小宽度:随当前属性页与树内容 minimumSizeHint 抬高,窄于内容时不再缩小。
void updateRightDockColumnMinimumWidthFromContent();
bool m_timelineScrubbing = false;
bool m_entityDragging = false;
@@ -200,7 +228,24 @@ private:
int m_currentFrame = 0;
bool m_playing = false;
QTimer* m_playTimer = nullptr;
QString m_previewAnimationId;
bool m_animationRequested = false;
bool m_hotspotRequested = false;
QString m_selectedHotspotId;
QToolButton* m_railBtnMove = nullptr;
QToolButton* m_railBtnZoom = nullptr;
QToolButton* m_railBtnFit = nullptr;
QToolButton* m_btnRailAddHotspot = nullptr;
QToolButton* m_btnRailMoveHotspot = nullptr;
QToolButton* m_btnHotspotEnterPreview = nullptr;
QToolButton* m_previewBackToCanvasBtn = nullptr;
int m_previewFrame = 0;
bool m_previewPlaying = false;
QTimer* m_previewPlayTimer = nullptr;
TimelineWidget* m_timeline = nullptr;
TimelineEditorModel* m_timelineModel = nullptr;
QToolButton* m_btnPlay = nullptr;
QComboBox* m_schemeSelector = nullptr;
// 时间轴区间选择(用于逐帧贴图动画)
@@ -214,7 +259,9 @@ private:
gui::EntityIntroPopup* m_entityIntroPopup = nullptr;
QFrame* m_previewPlaybackBar = nullptr;
QToolButton* m_previewBtnPlay = nullptr;
QToolButton* m_previewBtnPause = nullptr;
QComboBox* m_previewSchemeCombo = nullptr;
QToolButton* m_previewArrowLeft = nullptr;
QToolButton* m_previewArrowRight = nullptr;
gui::ResourceLibraryDock* m_resourceLibraryDockWidget = nullptr;
core::library::ResourceLibraryProvider* m_resourceLibraryProvider = nullptr;