Added new WIP UI to the world editor for loading worlds/areas

This commit is contained in:
Aruki
2017-02-12 00:34:04 -07:00
parent 9928a599be
commit ce0c544168
22 changed files with 871 additions and 289 deletions

View File

@@ -4,13 +4,17 @@
#include "CWorldEditor.h"
#include "Editor/Undo/UndoCommands.h"
WCreateTab::WCreateTab(QWidget *parent)
: QWidget(parent)
WCreateTab::WCreateTab(CWorldEditor *pEditor, QWidget *pParent /*= 0*/)
: QWidget(pParent)
, ui(new Ui::WCreateTab)
, mpSpawnLayer(nullptr)
{
ui->setupUi(this);
mpEditor = pEditor;
mpEditor->Viewport()->installEventFilter(this);
connect(mpEditor, SIGNAL(LayersModified()), this, SLOT(OnLayersChanged()));
connect(ui->SpawnLayerComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(OnSpawnLayerChanged(int)));
}
@@ -52,19 +56,14 @@ bool WCreateTab::eventFilter(QObject *pObj, QEvent *pEvent)
return false;
}
void WCreateTab::SetEditor(CWorldEditor *pEditor)
{
mpEditor = pEditor;
pEditor->Viewport()->installEventFilter(this);
connect(mpEditor, SIGNAL(LayersModified()), this, SLOT(OnLayersChanged()));
}
void WCreateTab::SetMaster(CMasterTemplate *pMaster)
// ************ PUBLIC SLOTS ************
void WCreateTab::OnMapChanged()
{
EGame Game = mpEditor->CurrentGame();
CMasterTemplate *pMaster = CMasterTemplate::MasterForGame(Game);
ui->TemplateView->SetMaster(pMaster);
}
// ************ PUBLIC SLOTS ************
void WCreateTab::OnLayersChanged()
{
CGameArea *pArea = mpEditor->ActiveArea();