Update resource selectors when their asset is renamed, fixed default world editor split sizes, disabled model editor save button outside of MP1
This commit is contained in:
parent
db277d7a15
commit
16e310fb2f
|
@ -7,7 +7,7 @@ CCamera::CCamera()
|
||||||
: mMode(eFreeCamera)
|
: mMode(eFreeCamera)
|
||||||
, mPosition(0)
|
, mPosition(0)
|
||||||
, mAspectRatio(1.7777777f)
|
, mAspectRatio(1.7777777f)
|
||||||
, mYaw(Math::skHalfPi)
|
, mYaw(-Math::skHalfPi)
|
||||||
, mPitch(0.f)
|
, mPitch(0.f)
|
||||||
, mMoveSpeed(1.f)
|
, mMoveSpeed(1.f)
|
||||||
, mLookSpeed(1.f)
|
, mLookSpeed(1.f)
|
||||||
|
@ -26,7 +26,7 @@ CCamera::CCamera(CVector3f Position, CVector3f /*Target*/)
|
||||||
, mMoveSpeed(1.f)
|
, mMoveSpeed(1.f)
|
||||||
, mLookSpeed(1.f)
|
, mLookSpeed(1.f)
|
||||||
, mPosition(Position)
|
, mPosition(Position)
|
||||||
, mYaw(Math::skHalfPi)
|
, mYaw(-Math::skHalfPi)
|
||||||
, mPitch(0.f)
|
, mPitch(0.f)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,7 @@ void CCamera::Zoom(float Amount)
|
||||||
void CCamera::Snap(CVector3f Position)
|
void CCamera::Snap(CVector3f Position)
|
||||||
{
|
{
|
||||||
mPosition = Position;
|
mPosition = Position;
|
||||||
mYaw = Math::skHalfPi;
|
mYaw = -Math::skHalfPi;
|
||||||
mPitch = 0.0f;
|
mPitch = 0.0f;
|
||||||
mTransformDirty = true;
|
mTransformDirty = true;
|
||||||
mViewDirty = true;
|
mViewDirty = true;
|
||||||
|
|
|
@ -34,6 +34,7 @@ CEditorApplication::~CEditorApplication()
|
||||||
|
|
||||||
void CEditorApplication::InitEditor()
|
void CEditorApplication::InitEditor()
|
||||||
{
|
{
|
||||||
|
mpResourceBrowser = new CResourceBrowser();
|
||||||
mpWorldEditor = new CWorldEditor();
|
mpWorldEditor = new CWorldEditor();
|
||||||
mpProjectDialog = new CProjectSettingsDialog(mpWorldEditor);
|
mpProjectDialog = new CProjectSettingsDialog(mpWorldEditor);
|
||||||
mpWorldEditor->showMaximized();
|
mpWorldEditor->showMaximized();
|
||||||
|
@ -292,8 +293,3 @@ void CEditorApplication::OnEditorClose()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CResourceBrowser* CEditorApplication::ResourceBrowser() const
|
|
||||||
{
|
|
||||||
return mpWorldEditor->ResourceBrowser();
|
|
||||||
}
|
|
||||||
|
|
|
@ -21,6 +21,7 @@ class CEditorApplication : public QApplication
|
||||||
|
|
||||||
CGameProject *mpActiveProject;
|
CGameProject *mpActiveProject;
|
||||||
CWorldEditor *mpWorldEditor;
|
CWorldEditor *mpWorldEditor;
|
||||||
|
CResourceBrowser *mpResourceBrowser;
|
||||||
CProjectSettingsDialog *mpProjectDialog;
|
CProjectSettingsDialog *mpProjectDialog;
|
||||||
QVector<IEditor*> mEditorWindows;
|
QVector<IEditor*> mEditorWindows;
|
||||||
QMap<CResourceEntry*,IEditor*> mEditingMap;
|
QMap<CResourceEntry*,IEditor*> mEditingMap;
|
||||||
|
@ -44,7 +45,7 @@ public:
|
||||||
|
|
||||||
bool RebuildResourceDatabase();
|
bool RebuildResourceDatabase();
|
||||||
|
|
||||||
CResourceBrowser* ResourceBrowser() const;
|
inline CResourceBrowser* ResourceBrowser() const { return mpResourceBrowser; }
|
||||||
|
|
||||||
// Accessors
|
// Accessors
|
||||||
inline CGameProject* ActiveProject() const { return mpActiveProject; }
|
inline CGameProject* ActiveProject() const { return mpActiveProject; }
|
||||||
|
|
|
@ -31,6 +31,7 @@ CModelEditorWindow::CModelEditorWindow(CModel *pModel, QWidget *pParent)
|
||||||
, mIgnoreSignals(false)
|
, mIgnoreSignals(false)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
ui->ActionSave->setEnabled( pModel->Game() == ePrime ); // we don't support saving games later than MP1
|
||||||
REPLACE_WINDOWTITLE_APPVARS;
|
REPLACE_WINDOWTITLE_APPVARS;
|
||||||
|
|
||||||
ui->Viewport->SetNode(mpCurrentModelNode);
|
ui->Viewport->SetNode(mpCurrentModelNode);
|
||||||
|
|
|
@ -129,6 +129,9 @@ CResourceBrowser::CResourceBrowser(QWidget *pParent)
|
||||||
pGroup->addAction(pEdStoreAction);
|
pGroup->addAction(pEdStoreAction);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Resize splitter
|
||||||
|
mpUI->splitter->setSizes( QList<int>() << width() * 0.4 << width() * 0.6 );
|
||||||
|
|
||||||
// Create context menu for the resource table
|
// Create context menu for the resource table
|
||||||
new CResourceTableContextMenu(this, mpUI->ResourceTableView, mpModel, mpProxyModel);
|
new CResourceTableContextMenu(this, mpUI->ResourceTableView, mpModel, mpProxyModel);
|
||||||
|
|
||||||
|
|
|
@ -66,6 +66,7 @@ CResourceSelector::CResourceSelector(QWidget *pParent /*= 0*/)
|
||||||
connect(mpResNameButton, SIGNAL(clicked()), this, SLOT(Find()));
|
connect(mpResNameButton, SIGNAL(clicked()), this, SLOT(Find()));
|
||||||
connect(mpSelectButton, SIGNAL(clicked()), this, SLOT(Select()));
|
connect(mpSelectButton, SIGNAL(clicked()), this, SLOT(Select()));
|
||||||
connect(mpClearButton, SIGNAL(clicked()), this, SLOT(Clear()));
|
connect(mpClearButton, SIGNAL(clicked()), this, SLOT(Clear()));
|
||||||
|
connect(gpEdApp->ResourceBrowser(), SIGNAL(ResourceMoved(CResourceEntry*,CVirtualDirectory*,TString)), this, SLOT(OnResourceMoved(CResourceEntry*)));
|
||||||
|
|
||||||
// Set up context menu
|
// Set up context menu
|
||||||
mpEditAssetAction = new QAction("Edit", this);
|
mpEditAssetAction = new QAction("Edit", this);
|
||||||
|
@ -292,3 +293,9 @@ void CResourceSelector::OnResourceChanged()
|
||||||
UpdateUI();
|
UpdateUI();
|
||||||
emit ResourceChanged(mpResEntry);
|
emit ResourceChanged(mpResEntry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CResourceSelector::OnResourceMoved(CResourceEntry *pEntry)
|
||||||
|
{
|
||||||
|
if (pEntry == mpResEntry)
|
||||||
|
UpdateUI();
|
||||||
|
}
|
||||||
|
|
|
@ -69,6 +69,7 @@ public slots:
|
||||||
void CopyName();
|
void CopyName();
|
||||||
void CopyPath();
|
void CopyPath();
|
||||||
void OnResourceChanged();
|
void OnResourceChanged();
|
||||||
|
void OnResourceMoved(CResourceEntry *pEntry);
|
||||||
void UpdateUI();
|
void UpdateUI();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
|
@ -46,9 +46,19 @@ CWorldEditor::CWorldEditor(QWidget *parent)
|
||||||
|
|
||||||
mpSelection->SetAllowedNodeTypes(eScriptNode | eLightNode);
|
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
|
// Initialize splitter
|
||||||
QList<int> SplitterSizes;
|
QList<int> SplitterSizes;
|
||||||
SplitterSizes << width() * 0.775 << width() * 0.225;
|
SplitterSizes << width() * 0.25 << width() * 0.53 << width() * 0.22;
|
||||||
ui->splitter->setSizes(SplitterSizes);
|
ui->splitter->setSizes(SplitterSizes);
|
||||||
|
|
||||||
// Initialize UI stuff
|
// Initialize UI stuff
|
||||||
|
@ -332,11 +342,6 @@ bool CWorldEditor::HasAnyScriptNodesSelected() const
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
CResourceBrowser* CWorldEditor::ResourceBrowser() const
|
|
||||||
{
|
|
||||||
return ui->ResourceBrowser;
|
|
||||||
}
|
|
||||||
|
|
||||||
CSceneViewport* CWorldEditor::Viewport() const
|
CSceneViewport* CWorldEditor::Viewport() const
|
||||||
{
|
{
|
||||||
return ui->MainViewport;
|
return ui->MainViewport;
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
<widget class="CResourceBrowser" name="ResourceBrowser" native="true"/>
|
<widget class="QWidget" name="ResourceBrowserContainer" native="true"/>
|
||||||
<widget class="QWidget" name="layoutWidget">
|
<widget class="QWidget" name="layoutWidget">
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||||
<item>
|
<item>
|
||||||
|
@ -786,12 +786,6 @@
|
||||||
<header>Editor/CSceneViewport.h</header>
|
<header>Editor/CSceneViewport.h</header>
|
||||||
<container>1</container>
|
<container>1</container>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
<customwidget>
|
|
||||||
<class>CResourceBrowser</class>
|
|
||||||
<extends>QWidget</extends>
|
|
||||||
<header>Editor/ResourceBrowser/CResourceBrowser.h</header>
|
|
||||||
<container>1</container>
|
|
||||||
</customwidget>
|
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../Icons.qrc"/>
|
<include location="../Icons.qrc"/>
|
||||||
|
|
Loading…
Reference in New Issue