fix encounter field slot change config limits

- add min and max value limits *before* setting value
This commit is contained in:
garak 2019-09-21 12:36:56 -04:00
parent 029c4fddfc
commit 303cf37b48

View file

@ -338,9 +338,9 @@ void Editor::configureEncounterJSON() {
QLabel *indexLabel = new QLabel(QString("Index: %1").arg(QString::number(index)));
QSpinBox *chanceSpinner = new QSpinBox;
int chance = currentField.second.at(index);
chanceSpinner->setValue(chance);
chanceSpinner->setMinimum(0);
chanceSpinner->setMaximum(9999);
chanceSpinner->setValue(chance);
connect(chanceSpinner, QOverload<int>::of(&QSpinBox::valueChanged), [&chanceSpinner, &updateTotal, &currentField](int) {
updateTotal(currentField);
});