mirror of
https://github.com/jmarshall23/DoomRTX.git
synced 2026-08-19 20:19:50 +02:00
Added new editor layout similar to idTech 5.
Cleaned up the entity inspector. Fixed numerous radiant bugs.
This commit is contained in:
+115
-1
@@ -60,6 +60,111 @@ struct SKeyInfo
|
||||
};
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// CMainFrameLeftPaneWnd
|
||||
//
|
||||
// Left workspace stack:
|
||||
// [ Camera ]
|
||||
// [ splitter ]
|
||||
// [ Inspector]
|
||||
//
|
||||
// The first layout pass uses a percentage instead of loading child window
|
||||
// placement from radiant.ini / the registry. Dragging the splitter updates the
|
||||
// percentage so the split remains proportional when the frame is resized.
|
||||
//=============================================================================
|
||||
class CMainFrameLeftPaneWnd : public CWnd
|
||||
{
|
||||
DECLARE_DYNAMIC(CMainFrameLeftPaneWnd)
|
||||
public:
|
||||
CMainFrameLeftPaneWnd();
|
||||
virtual ~CMainFrameLeftPaneWnd();
|
||||
|
||||
BOOL Create(CWnd *pParent, UINT nID);
|
||||
void SetEmbeddedWindows(CWnd *pCameraWnd, CWnd *pInspectorWnd);
|
||||
void LayoutChildren();
|
||||
void RecalcLayout();
|
||||
|
||||
protected:
|
||||
CWnd *m_pCameraWnd;
|
||||
CWnd *m_pInspectorWnd;
|
||||
int m_nCameraPercent;
|
||||
int m_nCameraHeight;
|
||||
int m_nSplitterHeight;
|
||||
bool m_bInLayout;
|
||||
bool m_bTrackingSplitter;
|
||||
int m_nDragStartY;
|
||||
int m_nDragStartCameraHeight;
|
||||
CRect m_rcSplitter;
|
||||
|
||||
void AttachChild(CWnd *pWnd);
|
||||
bool IsWindowUsable(CWnd *pWnd) const;
|
||||
int ClampCameraHeight(int cameraHeight, const CRect &client) const;
|
||||
bool HitTestSplitter(const CPoint &point) const;
|
||||
void DrawSplitter(CDC *pDC);
|
||||
|
||||
afx_msg void OnSize(UINT nType, int cx, int cy);
|
||||
afx_msg void OnPaint();
|
||||
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
|
||||
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
|
||||
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
|
||||
afx_msg BOOL OnSetCursor(CWnd *pWnd, UINT nHitTest, UINT message);
|
||||
afx_msg BOOL OnEraseBkgnd(CDC *pDC);
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
// CMainFrameLayoutWnd
|
||||
//
|
||||
// Main workspace split:
|
||||
// [ Camera/Inspector stack ] [ splitter ] [ XYDock: menu, toolbar, Z | XY ]
|
||||
//
|
||||
// XYDock already owns the Z/XY splitter. This wrapper supplies the missing
|
||||
// MainFrm-level split and gives startup proportions like the reference image.
|
||||
//=============================================================================
|
||||
class CMainFrameLayoutWnd : public CWnd
|
||||
{
|
||||
DECLARE_DYNAMIC(CMainFrameLayoutWnd)
|
||||
public:
|
||||
CMainFrameLayoutWnd();
|
||||
virtual ~CMainFrameLayoutWnd();
|
||||
|
||||
BOOL Create(CWnd *pParent, UINT nID = AFX_IDW_PANE_FIRST);
|
||||
void SetEmbeddedWindows(CWnd *pCameraWnd, CWnd *pInspectorWnd, CWnd *pXYDockWnd);
|
||||
CWnd *GetLeftPaneWnd();
|
||||
void LayoutChildren();
|
||||
void RecalcLayout();
|
||||
|
||||
protected:
|
||||
CMainFrameLeftPaneWnd m_wndLeftPane;
|
||||
CWnd *m_pXYDockWnd;
|
||||
int m_nLeftPercent;
|
||||
int m_nLeftWidth;
|
||||
int m_nSplitterWidth;
|
||||
bool m_bInLayout;
|
||||
bool m_bTrackingSplitter;
|
||||
int m_nDragStartX;
|
||||
int m_nDragStartLeftWidth;
|
||||
CRect m_rcSplitter;
|
||||
|
||||
void AttachChild(CWnd *pWnd);
|
||||
bool IsWindowUsable(CWnd *pWnd) const;
|
||||
int ClampLeftWidth(int leftWidth, const CRect &client) const;
|
||||
bool HitTestSplitter(const CPoint &point) const;
|
||||
void DrawSplitter(CDC *pDC);
|
||||
|
||||
afx_msg void OnSize(UINT nType, int cx, int cy);
|
||||
afx_msg void OnPaint();
|
||||
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
|
||||
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
|
||||
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
|
||||
afx_msg BOOL OnSetCursor(CWnd *pWnd, UINT nHitTest, UINT message);
|
||||
afx_msg BOOL OnEraseBkgnd(CDC *pDC);
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
class CMainFrame : public CFrameWnd
|
||||
@@ -122,6 +227,10 @@ public:
|
||||
CXYWnd* GetYZWnd() {return m_pYZWnd;};
|
||||
CCamWnd* GetCamera() {return m_pCamWnd;};
|
||||
CZWnd* GetZWnd() {return m_pZWnd;};
|
||||
CXYDockWnd* GetXYDockWnd() { return m_pXYDockWnd; };
|
||||
CMenu* GetMenu() const;
|
||||
void RecalcMainLayout();
|
||||
void RecalcXYDockLayout();
|
||||
|
||||
void SetActiveXY(CXYWnd* p)
|
||||
{
|
||||
@@ -142,7 +251,8 @@ public:
|
||||
protected: // control bar embedded members
|
||||
CStatusBar m_wndStatusBar;
|
||||
CToolBar m_wndToolBar;
|
||||
CTextureBar m_wndTextureBar;
|
||||
//CTextureBar m_wndTextureBar;
|
||||
CMainFrameLayoutWnd m_wndMainLayout;
|
||||
CSplitterWnd m_wndSplit;
|
||||
CSplitterWnd m_wndSplit2;
|
||||
CSplitterWnd m_wndSplit3;
|
||||
@@ -151,6 +261,8 @@ protected: // control bar embedded members
|
||||
CXYWnd* m_pXZWnd;
|
||||
CCamWnd* m_pCamWnd;
|
||||
CZWnd* m_pZWnd;
|
||||
CXYDockWnd* m_pXYDockWnd;
|
||||
HMENU m_hMovedMenu;
|
||||
CString m_strStatus[15];
|
||||
CXYWnd* m_pActiveXY;
|
||||
bool m_bCamPreview;
|
||||
@@ -161,6 +273,8 @@ protected: // control bar embedded members
|
||||
protected:
|
||||
bool m_bDoLoop;
|
||||
void CreateQEChildren();
|
||||
BOOL CreateEmbeddedMainToolBar(UINT nID);
|
||||
void MoveFrameMenuIntoXYWnd();
|
||||
void LoadCommandMap();
|
||||
void SaveCommandMap();
|
||||
void ShowMenuItemKeyBindings(CMenu *pMenu);
|
||||
|
||||
Reference in New Issue
Block a user