mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-06-06 14:43:47 +00:00
Added functionality to change edit mode, made resource browser accessible from the world editor
This commit is contained in:
parent
ce0c544168
commit
4d87ef0312
@ -20,6 +20,12 @@ CResourceBrowser::CResourceBrowser(QWidget *pParent)
|
|||||||
mpUI->setupUi(this);
|
mpUI->setupUi(this);
|
||||||
setWindowFlags(windowFlags() | Qt::WindowMinimizeButtonHint);
|
setWindowFlags(windowFlags() | Qt::WindowMinimizeButtonHint);
|
||||||
|
|
||||||
|
#if PUBLIC_RELEASE
|
||||||
|
// Hide store select combo box in public release build; we don't want users to edit the editor store
|
||||||
|
mpUI->StoreLabel->setHidden(true);
|
||||||
|
mpUI->StoreComboBox->setHidden(true);
|
||||||
|
#endif
|
||||||
|
|
||||||
// Set up table models
|
// Set up table models
|
||||||
mpModel = new CResourceTableModel(this);
|
mpModel = new CResourceTableModel(this);
|
||||||
mpProxyModel = new CResourceProxyModel(this);
|
mpProxyModel = new CResourceProxyModel(this);
|
||||||
@ -137,37 +143,40 @@ void CResourceBrowser::CreateFilterCheckboxes()
|
|||||||
|
|
||||||
mTypeList.clear();
|
mTypeList.clear();
|
||||||
|
|
||||||
// No store - leave empty
|
if (mpStore)
|
||||||
if (!mpStore) return;
|
|
||||||
|
|
||||||
// Get new type list
|
|
||||||
std::list<CResTypeInfo*> TypeList;
|
|
||||||
CResTypeInfo::GetAllTypesInGame(mpStore->Game(), TypeList);
|
|
||||||
|
|
||||||
for (auto Iter = TypeList.begin(); Iter != TypeList.end(); Iter++)
|
|
||||||
{
|
{
|
||||||
CResTypeInfo *pType = *Iter;
|
// Get new type list
|
||||||
|
std::list<CResTypeInfo*> TypeList;
|
||||||
|
CResTypeInfo::GetAllTypesInGame(mpStore->Game(), TypeList);
|
||||||
|
|
||||||
if (pType->IsVisibleInBrowser())
|
for (auto Iter = TypeList.begin(); Iter != TypeList.end(); Iter++)
|
||||||
{
|
{
|
||||||
QCheckBox *pCheck = new QCheckBox(this);
|
CResTypeInfo *pType = *Iter;
|
||||||
pCheck->setFont(mFilterBoxFont);
|
|
||||||
pCheck->setText(TO_QSTRING(pType->TypeName()));
|
if (pType->IsVisibleInBrowser())
|
||||||
mTypeList << SResourceType { pType, pCheck };
|
{
|
||||||
|
QCheckBox *pCheck = new QCheckBox(this);
|
||||||
|
pCheck->setFont(mFilterBoxFont);
|
||||||
|
pCheck->setText(TO_QSTRING(pType->TypeName()));
|
||||||
|
mTypeList << SResourceType { pType, pCheck };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
qSort(mTypeList.begin(), mTypeList.end(), [](const SResourceType& rkLeft, const SResourceType& rkRight) -> bool {
|
||||||
|
return rkLeft.pTypeInfo->TypeName().ToUpper() < rkRight.pTypeInfo->TypeName().ToUpper();
|
||||||
|
});
|
||||||
|
|
||||||
|
// Add sorted checkboxes to the UI
|
||||||
|
foreach (const SResourceType& rkType, mTypeList)
|
||||||
|
{
|
||||||
|
QCheckBox *pCheck = rkType.pFilterCheckBox;
|
||||||
|
mpFilterBoxesLayout->addWidget(rkType.pFilterCheckBox);
|
||||||
|
connect(pCheck, SIGNAL(toggled(bool)), this, SLOT(OnFilterTypeBoxTicked(bool)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
qSort(mTypeList.begin(), mTypeList.end(), [](const SResourceType& rkLeft, const SResourceType& rkRight) -> bool {
|
QSpacerItem *pSpacer = new QSpacerItem(0, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
|
||||||
return rkLeft.pTypeInfo->TypeName().ToUpper() < rkRight.pTypeInfo->TypeName().ToUpper();
|
mpFilterBoxesLayout->addSpacerItem(pSpacer);
|
||||||
});
|
|
||||||
|
|
||||||
// Add sorted checkboxes to the UI
|
|
||||||
foreach (const SResourceType& rkType, mTypeList)
|
|
||||||
{
|
|
||||||
QCheckBox *pCheck = rkType.pFilterCheckBox;
|
|
||||||
mpFilterBoxesLayout->addWidget(rkType.pFilterCheckBox);
|
|
||||||
connect(pCheck, SIGNAL(toggled(bool)), this, SLOT(OnFilterTypeBoxTicked(bool)));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CResourceBrowser::RefreshResources()
|
void CResourceBrowser::RefreshResources()
|
||||||
|
@ -1,17 +1,29 @@
|
|||||||
#include "CScriptEditSidebar.h"
|
#include "CScriptEditSidebar.h"
|
||||||
|
#include "WEditorProperties.h"
|
||||||
#include "WCreateTab.h"
|
#include "WCreateTab.h"
|
||||||
#include "WModifyTab.h"
|
#include "WModifyTab.h"
|
||||||
#include "WInstancesTab.h"
|
#include "WInstancesTab.h"
|
||||||
#include "CWorldEditor.h"
|
#include "CWorldEditor.h"
|
||||||
|
|
||||||
CScriptEditSidebar::CScriptEditSidebar(CWorldEditor *pEditor)
|
CScriptEditSidebar::CScriptEditSidebar(CWorldEditor *pEditor)
|
||||||
: QTabWidget(pEditor)
|
: QWidget(pEditor)
|
||||||
{
|
{
|
||||||
|
QVBoxLayout *pLayout = new QVBoxLayout(this);
|
||||||
|
pLayout->setContentsMargins(1, 1, 1, 1);
|
||||||
|
pLayout->setSpacing(2);
|
||||||
|
|
||||||
|
mpEditorProperties = new WEditorProperties(this);
|
||||||
|
mpEditorProperties->SyncToEditor(pEditor);
|
||||||
|
pLayout->addWidget(mpEditorProperties);
|
||||||
|
|
||||||
|
mpTabWidget = new QTabWidget(this);
|
||||||
mpCreateTab = new WCreateTab(pEditor, this);
|
mpCreateTab = new WCreateTab(pEditor, this);
|
||||||
mpModifyTab = new WModifyTab(pEditor, this);
|
mpModifyTab = new WModifyTab(pEditor, this);
|
||||||
mpInstancesTab = new WInstancesTab(pEditor, this);
|
mpInstancesTab = new WInstancesTab(pEditor, this);
|
||||||
|
|
||||||
addTab(mpCreateTab, QIcon(":/icons/Create.png"), "Create");
|
mpTabWidget->setIconSize(QSize(24, 24));
|
||||||
addTab(mpModifyTab, QIcon(":/icons/Modify.png"), "Modify");
|
mpTabWidget->addTab(mpCreateTab, QIcon(":/icons/Create.png"), "");
|
||||||
addTab(mpInstancesTab, QIcon(":/icons/Instances.png"), "Instances");
|
mpTabWidget->addTab(mpModifyTab, QIcon(":/icons/Modify.png"), "");
|
||||||
|
mpTabWidget->addTab(mpInstancesTab, QIcon(":/icons/Instances.png"), "");
|
||||||
|
pLayout->addWidget(mpTabWidget);
|
||||||
}
|
}
|
||||||
|
@ -4,14 +4,17 @@
|
|||||||
#include <QTabWidget>
|
#include <QTabWidget>
|
||||||
|
|
||||||
class CWorldEditor;
|
class CWorldEditor;
|
||||||
|
class WEditorProperties;
|
||||||
class WCreateTab;
|
class WCreateTab;
|
||||||
class WModifyTab;
|
class WModifyTab;
|
||||||
class WInstancesTab;
|
class WInstancesTab;
|
||||||
|
|
||||||
class CScriptEditSidebar : public QTabWidget
|
class CScriptEditSidebar : public QWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
WEditorProperties *mpEditorProperties;
|
||||||
|
QTabWidget *mpTabWidget;
|
||||||
WCreateTab *mpCreateTab;
|
WCreateTab *mpCreateTab;
|
||||||
WModifyTab *mpModifyTab;
|
WModifyTab *mpModifyTab;
|
||||||
WInstancesTab *mpInstancesTab;
|
WInstancesTab *mpInstancesTab;
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
#include "Editor/CSelectionIterator.h"
|
#include "Editor/CSelectionIterator.h"
|
||||||
#include "Editor/UICommon.h"
|
#include "Editor/UICommon.h"
|
||||||
#include "Editor/PropertyEdit/CPropertyView.h"
|
#include "Editor/PropertyEdit/CPropertyView.h"
|
||||||
|
#include "Editor/ResourceBrowser/CResourceBrowser.h"
|
||||||
#include "Editor/Widgets/WDraggableSpinBox.h"
|
#include "Editor/Widgets/WDraggableSpinBox.h"
|
||||||
#include "Editor/Widgets/WVectorEditor.h"
|
#include "Editor/Widgets/WVectorEditor.h"
|
||||||
#include "Editor/Undo/UndoCommands.h"
|
#include "Editor/Undo/UndoCommands.h"
|
||||||
@ -52,6 +53,7 @@ CWorldEditor::CWorldEditor(QWidget *parent)
|
|||||||
ui->splitter->setSizes(SplitterSizes);
|
ui->splitter->setSizes(SplitterSizes);
|
||||||
|
|
||||||
// Initialize UI stuff
|
// Initialize UI stuff
|
||||||
|
ui->MainViewport->Camera().Snap(CVector3f(0.f, 5.f, 1.f));
|
||||||
ui->MainViewport->SetScene(this, &mScene);
|
ui->MainViewport->SetScene(this, &mScene);
|
||||||
ui->MainViewport->setAcceptDrops(true);
|
ui->MainViewport->setAcceptDrops(true);
|
||||||
ui->TransformSpinBox->SetOrientation(Qt::Horizontal);
|
ui->TransformSpinBox->SetOrientation(Qt::Horizontal);
|
||||||
@ -76,6 +78,11 @@ CWorldEditor::CWorldEditor(QWidget *parent)
|
|||||||
mpScriptSidebar->setHidden(true);
|
mpScriptSidebar->setHidden(true);
|
||||||
SetSidebarWidget(mpWorldInfoSidebar);
|
SetSidebarWidget(mpWorldInfoSidebar);
|
||||||
|
|
||||||
|
mpEditModeButtonGroup = new QButtonGroup(this);
|
||||||
|
mpEditModeButtonGroup->addButton( ui->EditWorldInfoButton, eWEM_WorldInfo );
|
||||||
|
mpEditModeButtonGroup->addButton( ui->EditScriptButton, eWEM_EditScript );
|
||||||
|
connect(mpEditModeButtonGroup, SIGNAL(buttonClicked(int)), this, SLOT(ChangeEditMode(int)));
|
||||||
|
|
||||||
// Initialize actions
|
// Initialize actions
|
||||||
addAction(ui->ActionIncrementGizmo);
|
addAction(ui->ActionIncrementGizmo);
|
||||||
addAction(ui->ActionDecrementGizmo);
|
addAction(ui->ActionDecrementGizmo);
|
||||||
@ -147,6 +154,10 @@ CWorldEditor::CWorldEditor(QWidget *parent)
|
|||||||
connect(ui->ActionLink, SIGNAL(toggled(bool)), this, SLOT(OnLinkButtonToggled(bool)));
|
connect(ui->ActionLink, SIGNAL(toggled(bool)), this, SLOT(OnLinkButtonToggled(bool)));
|
||||||
connect(ui->ActionUnlink, SIGNAL(triggered()), this, SLOT(OnUnlinkClicked()));
|
connect(ui->ActionUnlink, SIGNAL(triggered()), this, SLOT(OnUnlinkClicked()));
|
||||||
|
|
||||||
|
connect(ui->ActionResourceBrowser, SIGNAL(triggered()), this, SLOT(OpenResourceBrowser()));
|
||||||
|
connect(ui->ActionEditLayers, SIGNAL(triggered()), this, SLOT(EditLayers()));
|
||||||
|
connect(ui->ActionEditPoiToWorldMap, SIGNAL(triggered()), this, SLOT(EditPoiToWorldMap()));
|
||||||
|
|
||||||
connect(ui->ActionDrawWorld, SIGNAL(triggered()), this, SLOT(ToggleDrawWorld()));
|
connect(ui->ActionDrawWorld, SIGNAL(triggered()), this, SLOT(ToggleDrawWorld()));
|
||||||
connect(ui->ActionDrawObjects, SIGNAL(triggered()), this, SLOT(ToggleDrawObjects()));
|
connect(ui->ActionDrawObjects, SIGNAL(triggered()), this, SLOT(ToggleDrawObjects()));
|
||||||
connect(ui->ActionDrawCollision, SIGNAL(triggered()), this, SLOT(ToggleDrawCollision()));
|
connect(ui->ActionDrawCollision, SIGNAL(triggered()), this, SLOT(ToggleDrawCollision()));
|
||||||
@ -165,8 +176,6 @@ CWorldEditor::CWorldEditor(QWidget *parent)
|
|||||||
connect(ui->ActionIncrementGizmo, SIGNAL(triggered()), this, SLOT(IncrementGizmo()));
|
connect(ui->ActionIncrementGizmo, SIGNAL(triggered()), this, SLOT(IncrementGizmo()));
|
||||||
connect(ui->ActionDecrementGizmo, SIGNAL(triggered()), this, SLOT(DecrementGizmo()));
|
connect(ui->ActionDecrementGizmo, SIGNAL(triggered()), this, SLOT(DecrementGizmo()));
|
||||||
connect(ui->ActionCollisionRenderSettings, SIGNAL(triggered()), this, SLOT(EditCollisionRenderSettings()));
|
connect(ui->ActionCollisionRenderSettings, SIGNAL(triggered()), this, SLOT(EditCollisionRenderSettings()));
|
||||||
connect(ui->ActionEditLayers, SIGNAL(triggered()), this, SLOT(EditLayers()));
|
|
||||||
connect(ui->ActionEditPoiToWorldMap, SIGNAL(triggered()), this, SLOT(EditPoiToWorldMap()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CWorldEditor::~CWorldEditor()
|
CWorldEditor::~CWorldEditor()
|
||||||
@ -224,8 +233,11 @@ bool CWorldEditor::CloseWorld()
|
|||||||
else return false;
|
else return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CWorldEditor::SetArea(CWorld *pWorld, int AreaIndex)
|
bool CWorldEditor::SetArea(CWorld *pWorld, int AreaIndex)
|
||||||
{
|
{
|
||||||
|
if (!CloseWorld())
|
||||||
|
return false;
|
||||||
|
|
||||||
ExitPickMode();
|
ExitPickMode();
|
||||||
ui->MainViewport->ResetHover();
|
ui->MainViewport->ResetHover();
|
||||||
ClearSelection();
|
ClearSelection();
|
||||||
@ -311,6 +323,8 @@ void CWorldEditor::SetArea(CWorld *pWorld, int AreaIndex)
|
|||||||
|
|
||||||
// Make sure old area is destroyed
|
// Make sure old area is destroyed
|
||||||
gpResourceStore->DestroyUnreferencedResources();
|
gpResourceStore->DestroyUnreferencedResources();
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CWorldEditor::CheckUnsavedChanges()
|
bool CWorldEditor::CheckUnsavedChanges()
|
||||||
@ -462,6 +476,40 @@ bool CWorldEditor::SaveAndRepack()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CWorldEditor::ChangeEditMode(int Mode)
|
||||||
|
{
|
||||||
|
ChangeEditMode((EWorldEditorMode) Mode);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CWorldEditor::ChangeEditMode(EWorldEditorMode Mode)
|
||||||
|
{
|
||||||
|
mpEditModeButtonGroup->blockSignals(true);
|
||||||
|
mpEditModeButtonGroup->button(Mode)->setChecked(true);
|
||||||
|
mpEditModeButtonGroup->blockSignals(false);
|
||||||
|
|
||||||
|
switch (Mode)
|
||||||
|
{
|
||||||
|
case eWEM_WorldInfo:
|
||||||
|
SetSidebarWidget(mpWorldInfoSidebar);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case eWEM_EditScript:
|
||||||
|
SetSidebarWidget(mpScriptSidebar);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
ASSERT(false);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CWorldEditor::OpenResourceBrowser()
|
||||||
|
{
|
||||||
|
CResourceBrowser *pBrowser = gpEdApp->ResourceBrowser();
|
||||||
|
pBrowser->show();
|
||||||
|
pBrowser->raise();
|
||||||
|
}
|
||||||
|
|
||||||
void CWorldEditor::OnActiveProjectChanged(CGameProject *pProj)
|
void CWorldEditor::OnActiveProjectChanged(CGameProject *pProj)
|
||||||
{
|
{
|
||||||
ui->ActionCloseProject->setEnabled( pProj != nullptr );
|
ui->ActionCloseProject->setEnabled( pProj != nullptr );
|
||||||
@ -476,6 +524,8 @@ void CWorldEditor::OnActiveProjectChanged(CGameProject *pProj)
|
|||||||
RecentProjectsList.prepend(ProjPath);
|
RecentProjectsList.prepend(ProjPath);
|
||||||
Settings.setValue("WorldEditor/RecentProjectsList", RecentProjectsList);
|
Settings.setValue("WorldEditor/RecentProjectsList", RecentProjectsList);
|
||||||
UpdateOpenRecentActions();
|
UpdateOpenRecentActions();
|
||||||
|
|
||||||
|
ChangeEditMode(eWEM_WorldInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CWorldEditor::OnLinksModified(const QList<CScriptObject*>& rkInstances)
|
void CWorldEditor::OnLinksModified(const QList<CScriptObject*>& rkInstances)
|
||||||
|
@ -33,6 +33,12 @@ namespace Ui {
|
|||||||
class CWorldEditor;
|
class CWorldEditor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum EWorldEditorMode
|
||||||
|
{
|
||||||
|
eWEM_WorldInfo,
|
||||||
|
eWEM_EditScript
|
||||||
|
};
|
||||||
|
|
||||||
class CWorldEditor : public INodeEditor
|
class CWorldEditor : public INodeEditor
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@ -61,6 +67,7 @@ class CWorldEditor : public INodeEditor
|
|||||||
QVBoxLayout *mpRightSidebarLayout;
|
QVBoxLayout *mpRightSidebarLayout;
|
||||||
QWidget *mpCurSidebarWidget;
|
QWidget *mpCurSidebarWidget;
|
||||||
|
|
||||||
|
QButtonGroup *mpEditModeButtonGroup;
|
||||||
CWorldInfoSidebar *mpWorldInfoSidebar;
|
CWorldInfoSidebar *mpWorldInfoSidebar;
|
||||||
CScriptEditSidebar *mpScriptSidebar;
|
CScriptEditSidebar *mpScriptSidebar;
|
||||||
|
|
||||||
@ -69,7 +76,7 @@ public:
|
|||||||
~CWorldEditor();
|
~CWorldEditor();
|
||||||
void closeEvent(QCloseEvent *pEvent);
|
void closeEvent(QCloseEvent *pEvent);
|
||||||
bool CloseWorld();
|
bool CloseWorld();
|
||||||
void SetArea(CWorld *pWorld, int AreaIndex);
|
bool SetArea(CWorld *pWorld, int AreaIndex);
|
||||||
bool CheckUnsavedChanges();
|
bool CheckUnsavedChanges();
|
||||||
bool HasAnyScriptNodesSelected() const;
|
bool HasAnyScriptNodesSelected() const;
|
||||||
|
|
||||||
@ -98,6 +105,10 @@ public slots:
|
|||||||
bool Save();
|
bool Save();
|
||||||
bool SaveAndRepack();
|
bool SaveAndRepack();
|
||||||
|
|
||||||
|
void ChangeEditMode(int Mode);
|
||||||
|
void ChangeEditMode(EWorldEditorMode Mode);
|
||||||
|
void OpenResourceBrowser();
|
||||||
|
|
||||||
void OnActiveProjectChanged(CGameProject *pProj);
|
void OnActiveProjectChanged(CGameProject *pProj);
|
||||||
void OnLinksModified(const QList<CScriptObject*>& rkInstances);
|
void OnLinksModified(const QList<CScriptObject*>& rkInstances);
|
||||||
void OnPropertyModified(IProperty *pProp);
|
void OnPropertyModified(IProperty *pProp);
|
||||||
|
@ -30,140 +30,6 @@
|
|||||||
<property name="bottomMargin">
|
<property name="bottomMargin">
|
||||||
<number>3</number>
|
<number>3</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
|
||||||
<widget class="QFrame" name="LeftSidebarFrame">
|
|
||||||
<property name="frameShape">
|
|
||||||
<enum>QFrame::StyledPanel</enum>
|
|
||||||
</property>
|
|
||||||
<property name="frameShadow">
|
|
||||||
<enum>QFrame::Sunken</enum>
|
|
||||||
</property>
|
|
||||||
<property name="lineWidth">
|
|
||||||
<number>1</number>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
|
||||||
<property name="spacing">
|
|
||||||
<number>3</number>
|
|
||||||
</property>
|
|
||||||
<property name="leftMargin">
|
|
||||||
<number>2</number>
|
|
||||||
</property>
|
|
||||||
<property name="topMargin">
|
|
||||||
<number>2</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin">
|
|
||||||
<number>2</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin">
|
|
||||||
<number>2</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="EditWorldInfoButton">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>32</width>
|
|
||||||
<height>32</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>32</width>
|
|
||||||
<height>32</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>World Edit Mode</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="icon">
|
|
||||||
<iconset resource="../Icons.qrc">
|
|
||||||
<normaloff>:/icons/World.png</normaloff>:/icons/World.png</iconset>
|
|
||||||
</property>
|
|
||||||
<property name="iconSize">
|
|
||||||
<size>
|
|
||||||
<width>24</width>
|
|
||||||
<height>24</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="checkable">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="checked">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="flat">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="EditScriptButton">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>32</width>
|
|
||||||
<height>32</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>32</width>
|
|
||||||
<height>32</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Script Edit Mode</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="icon">
|
|
||||||
<iconset resource="../Icons.qrc">
|
|
||||||
<normaloff>:/icons/Modify.png</normaloff>:/icons/Modify.png</iconset>
|
|
||||||
</property>
|
|
||||||
<property name="iconSize">
|
|
||||||
<size>
|
|
||||||
<width>24</width>
|
|
||||||
<height>24</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="checkable">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="flat">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="verticalSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>546</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QSplitter" name="splitter">
|
<widget class="QSplitter" name="splitter">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
@ -368,6 +234,140 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QFrame" name="EditModeFrame">
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::NoFrame</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Sunken</enum>
|
||||||
|
</property>
|
||||||
|
<property name="lineWidth">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>3</number>
|
||||||
|
</property>
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="EditWorldInfoButton">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>32</width>
|
||||||
|
<height>32</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>32</width>
|
||||||
|
<height>32</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>World Edit Mode</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../Icons.qrc">
|
||||||
|
<normaloff>:/icons/World.png</normaloff>:/icons/World.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="iconSize">
|
||||||
|
<size>
|
||||||
|
<width>24</width>
|
||||||
|
<height>24</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="flat">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="EditScriptButton">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>32</width>
|
||||||
|
<height>32</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>32</width>
|
||||||
|
<height>32</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Script Edit Mode</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../Icons.qrc">
|
||||||
|
<normaloff>:/icons/Modify.png</normaloff>:/icons/Modify.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="iconSize">
|
||||||
|
<size>
|
||||||
|
<width>24</width>
|
||||||
|
<height>24</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="flat">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="verticalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>546</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QStatusBar" name="statusbar"/>
|
<widget class="QStatusBar" name="statusbar"/>
|
||||||
@ -473,6 +473,7 @@
|
|||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Tools</string>
|
<string>Tools</string>
|
||||||
</property>
|
</property>
|
||||||
|
<addaction name="ActionResourceBrowser"/>
|
||||||
<addaction name="ActionEditLayers"/>
|
<addaction name="ActionEditLayers"/>
|
||||||
<addaction name="ActionEditPoiToWorldMap"/>
|
<addaction name="ActionEditPoiToWorldMap"/>
|
||||||
</widget>
|
</widget>
|
||||||
@ -846,6 +847,11 @@
|
|||||||
<string>Close Project</string>
|
<string>Close Project</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="ActionResourceBrowser">
|
||||||
|
<property name="text">
|
||||||
|
<string>Resource Browser</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
<enum>QAbstractItemView::ScrollPerPixel</enum>
|
<enum>QAbstractItemView::ScrollPerPixel</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="indentation">
|
<property name="indentation">
|
||||||
<number>10</number>
|
<number>15</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="sortingEnabled">
|
<property name="sortingEnabled">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
|
@ -13,8 +13,8 @@ WCreateTab::WCreateTab(CWorldEditor *pEditor, QWidget *pParent /*= 0*/)
|
|||||||
|
|
||||||
mpEditor = pEditor;
|
mpEditor = pEditor;
|
||||||
mpEditor->Viewport()->installEventFilter(this);
|
mpEditor->Viewport()->installEventFilter(this);
|
||||||
connect(mpEditor, SIGNAL(LayersModified()), this, SLOT(OnLayersChanged()));
|
|
||||||
|
|
||||||
|
connect(mpEditor, SIGNAL(LayersModified()), this, SLOT(OnLayersChanged()));
|
||||||
connect(ui->SpawnLayerComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(OnSpawnLayerChanged(int)));
|
connect(ui->SpawnLayerComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(OnSpawnLayerChanged(int)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,70 +15,61 @@
|
|||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<property name="leftMargin">
|
<property name="leftMargin">
|
||||||
<number>9</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="topMargin">
|
<property name="topMargin">
|
||||||
<number>9</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="rightMargin">
|
<property name="rightMargin">
|
||||||
<number>9</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="bottomMargin">
|
<property name="bottomMargin">
|
||||||
<number>9</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="groupBox">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<property name="title">
|
<item>
|
||||||
<string>Create Instance</string>
|
<widget class="QLabel" name="SpawnLayerLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Spawn Layer:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QComboBox" name="SpawnLayerComboBox">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>1</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="CTemplateListView" name="TemplateView">
|
||||||
|
<property name="editTriggers">
|
||||||
|
<set>QAbstractItemView::NoEditTriggers</set>
|
||||||
|
</property>
|
||||||
|
<property name="dragEnabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="dragDropMode">
|
||||||
|
<enum>QAbstractItemView::InternalMove</enum>
|
||||||
|
</property>
|
||||||
|
<property name="defaultDropAction">
|
||||||
|
<enum>Qt::MoveAction</enum>
|
||||||
|
</property>
|
||||||
|
<property name="selectionBehavior">
|
||||||
|
<enum>QAbstractItemView::SelectItems</enum>
|
||||||
|
</property>
|
||||||
|
<property name="verticalScrollMode">
|
||||||
|
<enum>QAbstractItemView::ScrollPerPixel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="horizontalScrollMode">
|
||||||
|
<enum>QAbstractItemView::ScrollPerPixel</enum>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="SpawnLayerLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Spawn Layer:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QComboBox" name="SpawnLayerComboBox">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
|
||||||
<horstretch>1</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="CTemplateListView" name="TemplateView">
|
|
||||||
<property name="editTriggers">
|
|
||||||
<set>QAbstractItemView::NoEditTriggers</set>
|
|
||||||
</property>
|
|
||||||
<property name="dragEnabled">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="dragDropMode">
|
|
||||||
<enum>QAbstractItemView::InternalMove</enum>
|
|
||||||
</property>
|
|
||||||
<property name="defaultDropAction">
|
|
||||||
<enum>Qt::MoveAction</enum>
|
|
||||||
</property>
|
|
||||||
<property name="selectionBehavior">
|
|
||||||
<enum>QAbstractItemView::SelectItems</enum>
|
|
||||||
</property>
|
|
||||||
<property name="verticalScrollMode">
|
|
||||||
<enum>QAbstractItemView::ScrollPerPixel</enum>
|
|
||||||
</property>
|
|
||||||
<property name="horizontalScrollMode">
|
|
||||||
<enum>QAbstractItemView::ScrollPerPixel</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
@ -9,7 +9,7 @@ WEditorProperties::WEditorProperties(QWidget *pParent /*= 0*/)
|
|||||||
, mHasEditedName(false)
|
, mHasEditedName(false)
|
||||||
{
|
{
|
||||||
mpInstanceInfoLabel = new QLabel;
|
mpInstanceInfoLabel = new QLabel;
|
||||||
mpInstanceInfoLabel->setText("<i>No selection</i>");
|
mpInstanceInfoLabel->setText("<i>[No selection]</i>");
|
||||||
mpInstanceInfoLayout = new QHBoxLayout;
|
mpInstanceInfoLayout = new QHBoxLayout;
|
||||||
mpInstanceInfoLayout->addWidget(mpInstanceInfoLabel);
|
mpInstanceInfoLayout->addWidget(mpInstanceInfoLabel);
|
||||||
|
|
||||||
@ -34,7 +34,7 @@ WEditorProperties::WEditorProperties(QWidget *pParent /*= 0*/)
|
|||||||
mpMainLayout->addLayout(mpInstanceInfoLayout);
|
mpMainLayout->addLayout(mpInstanceInfoLayout);
|
||||||
mpMainLayout->addLayout(mpNameLayout);
|
mpMainLayout->addLayout(mpNameLayout);
|
||||||
mpMainLayout->addLayout(mpLayersLayout);
|
mpMainLayout->addLayout(mpLayersLayout);
|
||||||
mpMainLayout->setContentsMargins(6, 6, 6, 0);
|
mpMainLayout->setContentsMargins(3, 3, 3, 0);
|
||||||
mpMainLayout->setSpacing(3);
|
mpMainLayout->setSpacing(3);
|
||||||
setLayout(mpMainLayout);
|
setLayout(mpMainLayout);
|
||||||
setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
|
setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Form</string>
|
<string>Form</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||||
<property name="leftMargin">
|
<property name="leftMargin">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
@ -29,7 +29,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QTabWidget" name="TabWidget">
|
<widget class="QTabWidget" name="TabWidget">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>1</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="ShowLayersTab">
|
<widget class="QWidget" name="ShowLayersTab">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
|
@ -107,8 +107,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>276</width>
|
<width>278</width>
|
||||||
<height>460</height>
|
<height>442</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user