1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-30 08:57:00 +02:00

Merge pull request #4775 from dydzio0614/map-editor-event-day-fix

Count days from 1 instead of 0 in map editor timed event UI
This commit is contained in:
Ivan Savenko 2024-10-15 18:00:23 +03:00 committed by GitHub
commit 60fe8a05b9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 3 deletions

View File

@ -28,7 +28,7 @@ TimedEvent::TimedEvent(QListWidgetItem * t, QWidget *parent) :
ui->eventMessageText->setPlainText(params.value("message").toString());
ui->eventAffectsCpu->setChecked(params.value("computerAffected").toBool());
ui->eventAffectsHuman->setChecked(params.value("humanAffected").toBool());
ui->eventFirstOccurrence->setValue(params.value("firstOccurrence").toInt());
ui->eventFirstOccurrence->setValue(params.value("firstOccurrence").toInt() + 1);
ui->eventRepeatAfter->setValue(params.value("nextOccurrence").toInt());
auto playerList = params.value("players").toList();
@ -68,7 +68,7 @@ void TimedEvent::on_TimedEvent_finished(int result)
descriptor["message"] = ui->eventMessageText->toPlainText();
descriptor["humanAffected"] = QVariant::fromValue(ui->eventAffectsHuman->isChecked());
descriptor["computerAffected"] = QVariant::fromValue(ui->eventAffectsCpu->isChecked());
descriptor["firstOccurrence"] = QVariant::fromValue(ui->eventFirstOccurrence->value());
descriptor["firstOccurrence"] = QVariant::fromValue(ui->eventFirstOccurrence->value() - 1);
descriptor["nextOccurrence"] = QVariant::fromValue(ui->eventRepeatAfter->value());
QVariantList players;

View File

@ -72,7 +72,11 @@
</widget>
</item>
<item>
<widget class="QSpinBox" name="eventFirstOccurrence"/>
<widget class="QSpinBox" name="eventFirstOccurrence">
<property name="minimum">
<number>1</number>
</property>
</widget>
</item>
</layout>
</item>