Add new Zone wizard

This commit is contained in:
2018-01-29 23:56:36 -06:00
parent eebce9924d
commit 68bb2729d7
15 changed files with 85 additions and 60 deletions
@@ -17,8 +17,6 @@ namespace world {
using namespace studio;
const QString NewWorldWizard::FIELD_WORLD_PATH = "World.WorldPath";
const QString NewWorldWizard::FIELD_WIDTH = "World.Width";
const QString NewWorldWizard::FIELD_HEIGHT = "World.Height";
NewWorldWizard::NewWorldWizard(const Context *ctx) {
addLineEdit(tr("&Name:"), FIELD_WORLD_PATH, "", [this, ctx](QString worldName) {
@@ -31,28 +29,6 @@ NewWorldWizard::NewWorldWizard(const Context *ctx) {
}
}
);
addLineEdit(tr("&Width:"), FIELD_WIDTH, "", [this, ctx](QString widthStr) {
bool ok = false;
widthStr.toInt(&ok);
if (ok) {
return 0;
} else {
this->showValidationError(tr("Invalid width: \"%1\"").arg(widthStr));
return 1;
}
}
);
addLineEdit(tr("&Height:"), FIELD_HEIGHT, "", [this, ctx](QString widthStr) {
bool ok = false;
widthStr.toInt(&ok);
if (ok) {
return 0;
} else {
this->showValidationError(tr("Invalid height: \"%1\"").arg(widthStr));
return 1;
}
}
);
}
}