diff --git a/src/Core/Render/CCamera.cpp b/src/Core/Render/CCamera.cpp index 1b1c047e..c1ecb4f1 100644 --- a/src/Core/Render/CCamera.cpp +++ b/src/Core/Render/CCamera.cpp @@ -7,7 +7,7 @@ CCamera::CCamera() : mMode(eFreeCamera) , mPosition(0) , mAspectRatio(1.7777777f) - , mYaw(Math::skHalfPi) + , mYaw(-Math::skHalfPi) , mPitch(0.f) , mMoveSpeed(1.f) , mLookSpeed(1.f) @@ -26,7 +26,7 @@ CCamera::CCamera(CVector3f Position, CVector3f /*Target*/) , mMoveSpeed(1.f) , mLookSpeed(1.f) , mPosition(Position) - , mYaw(Math::skHalfPi) + , mYaw(-Math::skHalfPi) , mPitch(0.f) { } @@ -75,7 +75,7 @@ void CCamera::Zoom(float Amount) void CCamera::Snap(CVector3f Position) { mPosition = Position; - mYaw = Math::skHalfPi; + mYaw = -Math::skHalfPi; mPitch = 0.0f; mTransformDirty = true; mViewDirty = true; diff --git a/src/Editor/CEditorApplication.cpp b/src/Editor/CEditorApplication.cpp index 64ed0c69..4bfc70fc 100644 --- a/src/Editor/CEditorApplication.cpp +++ b/src/Editor/CEditorApplication.cpp @@ -34,6 +34,7 @@ CEditorApplication::~CEditorApplication() void CEditorApplication::InitEditor() { + mpResourceBrowser = new CResourceBrowser(); mpWorldEditor = new CWorldEditor(); mpProjectDialog = new CProjectSettingsDialog(mpWorldEditor); mpWorldEditor->showMaximized(); @@ -292,8 +293,3 @@ void CEditorApplication::OnEditorClose() } } } - -CResourceBrowser* CEditorApplication::ResourceBrowser() const -{ - return mpWorldEditor->ResourceBrowser(); -} diff --git a/src/Editor/CEditorApplication.h b/src/Editor/CEditorApplication.h index ed25d493..f1645cfc 100644 --- a/src/Editor/CEditorApplication.h +++ b/src/Editor/CEditorApplication.h @@ -21,6 +21,7 @@ class CEditorApplication : public QApplication CGameProject *mpActiveProject; CWorldEditor *mpWorldEditor; + CResourceBrowser *mpResourceBrowser; CProjectSettingsDialog *mpProjectDialog; QVector mEditorWindows; QMap mEditingMap; @@ -44,7 +45,7 @@ public: bool RebuildResourceDatabase(); - CResourceBrowser* ResourceBrowser() const; + inline CResourceBrowser* ResourceBrowser() const { return mpResourceBrowser; } // Accessors inline CGameProject* ActiveProject() const { return mpActiveProject; } diff --git a/src/Editor/ModelEditor/CModelEditorWindow.cpp b/src/Editor/ModelEditor/CModelEditorWindow.cpp index 55592334..bd7d03a7 100644 --- a/src/Editor/ModelEditor/CModelEditorWindow.cpp +++ b/src/Editor/ModelEditor/CModelEditorWindow.cpp @@ -31,6 +31,7 @@ CModelEditorWindow::CModelEditorWindow(CModel *pModel, QWidget *pParent) , mIgnoreSignals(false) { ui->setupUi(this); + ui->ActionSave->setEnabled( pModel->Game() == ePrime ); // we don't support saving games later than MP1 REPLACE_WINDOWTITLE_APPVARS; ui->Viewport->SetNode(mpCurrentModelNode); diff --git a/src/Editor/ResourceBrowser/CResourceBrowser.cpp b/src/Editor/ResourceBrowser/CResourceBrowser.cpp index bc4418da..f43329b2 100644 --- a/src/Editor/ResourceBrowser/CResourceBrowser.cpp +++ b/src/Editor/ResourceBrowser/CResourceBrowser.cpp @@ -129,6 +129,9 @@ CResourceBrowser::CResourceBrowser(QWidget *pParent) pGroup->addAction(pEdStoreAction); #endif + // Resize splitter + mpUI->splitter->setSizes( QList() << width() * 0.4 << width() * 0.6 ); + // Create context menu for the resource table new CResourceTableContextMenu(this, mpUI->ResourceTableView, mpModel, mpProxyModel); diff --git a/src/Editor/Widgets/CResourceSelector.cpp b/src/Editor/Widgets/CResourceSelector.cpp index 5e5d0dd7..9b00e4ad 100644 --- a/src/Editor/Widgets/CResourceSelector.cpp +++ b/src/Editor/Widgets/CResourceSelector.cpp @@ -66,6 +66,7 @@ CResourceSelector::CResourceSelector(QWidget *pParent /*= 0*/) connect(mpResNameButton, SIGNAL(clicked()), this, SLOT(Find())); connect(mpSelectButton, SIGNAL(clicked()), this, SLOT(Select())); connect(mpClearButton, SIGNAL(clicked()), this, SLOT(Clear())); + connect(gpEdApp->ResourceBrowser(), SIGNAL(ResourceMoved(CResourceEntry*,CVirtualDirectory*,TString)), this, SLOT(OnResourceMoved(CResourceEntry*))); // Set up context menu mpEditAssetAction = new QAction("Edit", this); @@ -292,3 +293,9 @@ void CResourceSelector::OnResourceChanged() UpdateUI(); emit ResourceChanged(mpResEntry); } + +void CResourceSelector::OnResourceMoved(CResourceEntry *pEntry) +{ + if (pEntry == mpResEntry) + UpdateUI(); +} diff --git a/src/Editor/Widgets/CResourceSelector.h b/src/Editor/Widgets/CResourceSelector.h index 7228b148..a1214171 100644 --- a/src/Editor/Widgets/CResourceSelector.h +++ b/src/Editor/Widgets/CResourceSelector.h @@ -69,6 +69,7 @@ public slots: void CopyName(); void CopyPath(); void OnResourceChanged(); + void OnResourceMoved(CResourceEntry *pEntry); void UpdateUI(); signals: diff --git a/src/Editor/WorldEditor/CWorldEditor.cpp b/src/Editor/WorldEditor/CWorldEditor.cpp index 6ee2afff..f3139197 100644 --- a/src/Editor/WorldEditor/CWorldEditor.cpp +++ b/src/Editor/WorldEditor/CWorldEditor.cpp @@ -46,9 +46,19 @@ CWorldEditor::CWorldEditor(QWidget *parent) mpSelection->SetAllowedNodeTypes(eScriptNode | eLightNode); + // Add resource browser to the layout + QVBoxLayout *pLayout = new QVBoxLayout(); + pLayout->setContentsMargins(0,0,0,0); + + CResourceBrowser *pResourceBrowser = gpEdApp->ResourceBrowser(); + //pResourceBrowser->setParent(this); + pLayout->addWidget( pResourceBrowser ); + + ui->ResourceBrowserContainer->setLayout(pLayout); + // Initialize splitter QList SplitterSizes; - SplitterSizes << width() * 0.775 << width() * 0.225; + SplitterSizes << width() * 0.25 << width() * 0.53 << width() * 0.22; ui->splitter->setSizes(SplitterSizes); // Initialize UI stuff @@ -332,11 +342,6 @@ bool CWorldEditor::HasAnyScriptNodesSelected() const return false; } -CResourceBrowser* CWorldEditor::ResourceBrowser() const -{ - return ui->ResourceBrowser; -} - CSceneViewport* CWorldEditor::Viewport() const { return ui->MainViewport; diff --git a/src/Editor/WorldEditor/CWorldEditor.ui b/src/Editor/WorldEditor/CWorldEditor.ui index 307df539..2bf747e4 100644 --- a/src/Editor/WorldEditor/CWorldEditor.ui +++ b/src/Editor/WorldEditor/CWorldEditor.ui @@ -32,7 +32,7 @@ Qt::Horizontal - + @@ -786,12 +786,6 @@
Editor/CSceneViewport.h
1 - - CResourceBrowser - QWidget -
Editor/ResourceBrowser/CResourceBrowser.h
- 1 -