2022-09-04 02:12:33 +02:00
|
|
|
#include "mapsettings.h"
|
|
|
|
#include "ui_mapsettings.h"
|
2022-09-04 18:16:36 +02:00
|
|
|
#include "mainwindow.h"
|
2022-09-04 02:12:33 +02:00
|
|
|
|
2022-09-04 18:16:36 +02:00
|
|
|
MapSettings::MapSettings(MainWindow *parent) :
|
|
|
|
QDialog(static_cast<QWidget*>(parent)),
|
|
|
|
ui(new Ui::MapSettings),
|
|
|
|
main(parent)
|
2022-09-04 02:12:33 +02:00
|
|
|
{
|
|
|
|
ui->setupUi(this);
|
2022-09-04 18:16:36 +02:00
|
|
|
|
|
|
|
assert(main);
|
|
|
|
assert(main->getMap());
|
|
|
|
|
|
|
|
ui->mapNameEdit->setText(QString::fromStdString(main->getMap()->name));
|
|
|
|
ui->mapDescriptionEdit->setPlainText(QString::fromStdString(main->getMap()->description));
|
|
|
|
|
|
|
|
show();
|
|
|
|
|
|
|
|
//ui8 difficulty;
|
|
|
|
//ui8 levelLimit;
|
|
|
|
|
|
|
|
//std::string victoryMessage;
|
|
|
|
//std::string defeatMessage;
|
|
|
|
//ui16 victoryIconIndex;
|
|
|
|
//ui16 defeatIconIndex;
|
|
|
|
|
|
|
|
//std::vector<PlayerInfo> players; /// The default size of the vector is PlayerColor::PLAYER_LIMIT.
|
2022-09-04 02:12:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
MapSettings::~MapSettings()
|
|
|
|
{
|
|
|
|
delete ui;
|
|
|
|
}
|
2022-09-04 18:16:36 +02:00
|
|
|
|
|
|
|
void MapSettings::on_pushButton_clicked()
|
|
|
|
{
|
|
|
|
main->getMap()->name = ui->mapNameEdit->text().toStdString();
|
|
|
|
main->getMap()->description = ui->mapDescriptionEdit->toPlainText().toStdString();
|
|
|
|
close();
|
|
|
|
}
|