1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00
vcmi/mapeditor/mapsettings.cpp
2022-09-05 04:19:21 +04:00

42 lines
986 B
C++

#include "mapsettings.h"
#include "ui_mapsettings.h"
#include "mainwindow.h"
MapSettings::MapSettings(MapController & ctrl, QWidget *parent) :
QDialog(parent),
ui(new Ui::MapSettings),
controller(ctrl)
{
ui->setupUi(this);
assert(controller.map());
ui->mapNameEdit->setText(QString::fromStdString(controller.map()->name));
ui->mapDescriptionEdit->setPlainText(QString::fromStdString(controller.map()->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.
}
MapSettings::~MapSettings()
{
delete ui;
}
void MapSettings::on_pushButton_clicked()
{
controller.map()->name = ui->mapNameEdit->text().toStdString();
controller.map()->description = ui->mapDescriptionEdit->toPlainText().toStdString();
controller.commitChangeWithoutRedraw();
close();
}