aboutsummaryrefslogtreecommitdiff
path: root/Source/MapEditor/mainwindow.cpp
diff options
context:
space:
mode:
authorXaviDCR92 <xavi.dcr@gmail.com>2017-12-29 23:19:43 +0100
committerXaviDCR92 <xavi.dcr@gmail.com>2017-12-29 23:19:43 +0100
commit67cfc8b2c23177f036eda97f3423d062ba0c3e90 (patch)
tree736dd4c76c30bf0f74ef4bf73f1218219ab26dc0 /Source/MapEditor/mainwindow.cpp
parent0d1df70f2d1a08fdb6389391ee59afc5fbc6277a (diff)
downloadairport-67cfc8b2c23177f036eda97f3423d062ba0c3e90.tar.gz
* RWY_DIR and AIRCRAFT_DIRECTION have been joint into a single enum.
* Game.c: new prototypes GameGetParkingDirection() and GameGetRunwayDirection(). * Slight optimizations into GameRenderLevel(). * Added some comment headers into Gfx.c.
Diffstat (limited to 'Source/MapEditor/mainwindow.cpp')
-rw-r--r--Source/MapEditor/mainwindow.cpp30
1 files changed, 24 insertions, 6 deletions
diff --git a/Source/MapEditor/mainwindow.cpp b/Source/MapEditor/mainwindow.cpp
index 89687eb..ed0bdc9 100644
--- a/Source/MapEditor/mainwindow.cpp
+++ b/Source/MapEditor/mainwindow.cpp
@@ -12,12 +12,16 @@ MainWindow::MainWindow(QWidget *parent) :
{
ui->setupUi(this);
- connect(ui->LoadMap_Btn, SIGNAL(released()), this, SLOT(onLoadMap()));
- connect(ui->CreateMap_Btn, SIGNAL(released()), this, SLOT(onCreateMap()));
- connect(ui->saveMap_Btn, SIGNAL(released()), this, SLOT(onSaveMap(void)));
- connect(gscene, SIGNAL(positionClicked(QPointF)), this, SLOT(onMapItemClicked(QPointF)));
- connect(gscene, SIGNAL(noItemSelected(void)), this, SLOT(onNoItemSelected(void)));
- connect(gscene, SIGNAL(updateSelectedItem(void)), this, SLOT(onListItemSelected(void)));
+ ui->centralWidget->setWindowTitle("Airport Map Editor");
+
+ connect(ui->LoadMap_Btn, SIGNAL(released()), this, SLOT(onLoadMap()));
+ connect(ui->CreateMap_Btn, SIGNAL(released()), this, SLOT(onCreateMap()));
+ connect(ui->saveMap_Btn, SIGNAL(released()), this, SLOT(onSaveMap(void)));
+ connect(ui->showNumbers_Checkbox, SIGNAL(stateChanged(int)), this, SLOT(onShowNumbers(int)));
+
+ connect(gscene, SIGNAL(positionClicked(QPointF)), this, SLOT(onMapItemClicked(QPointF)));
+ connect(gscene, SIGNAL(noItemSelected(void)), this, SLOT(onNoItemSelected(void)));
+ connect(gscene, SIGNAL(updateSelectedItem(void)), this, SLOT(onListItemSelected(void)));
appSettings();
loadTilesetData();
@@ -29,6 +33,11 @@ MainWindow::~MainWindow()
delete gscene;
}
+void MainWindow::onShowNumbers(int)
+{
+ onProcessMapFile(map_buffer);
+}
+
void MainWindow::onMapItemClicked(QPointF pos)
{
QPoint realPos;
@@ -314,6 +323,15 @@ void MainWindow::onProcessMapFile(QByteArray data)
it->setX(x);
it->setY(y);
+
+ if (ui->showNumbers_Checkbox->isChecked() == true)
+ {
+ QGraphicsTextItem* io = new QGraphicsTextItem();
+ io->setPos(x + (TILE_SIZE / 4), y);
+ io->setPlainText(QString::number(i + (j * level_size)));
+
+ gscene->addItem(io);
+ }
}
}