diff --git a/mapeditor/inspector/armywidget.cpp b/mapeditor/inspector/armywidget.cpp index 3878fea73..0cfd68d9a 100644 --- a/mapeditor/inspector/armywidget.cpp +++ b/mapeditor/inspector/armywidget.cpp @@ -31,7 +31,6 @@ ArmyWidget::ArmyWidget(CArmedInstance & a, QWidget *parent) : for(int i = 0; i < TOTAL_SLOTS; ++i) { - uiCounts[i]->setText("1"); uiSlots[i]->addItem(""); uiSlots[i]->setItemData(0, -1); @@ -64,7 +63,7 @@ void ArmyWidget::obtainData() { auto * creature = army.getCreature(SlotID(i)); uiSlots[i]->setCurrentIndex(searchItemIndex(i, creature->getId())); - uiCounts[i]->setText(QString::number(army.getStackCount(SlotID(i)))); + uiCounts[i]->setValue(army.getStackCount(SlotID(i))); } } @@ -88,7 +87,7 @@ bool ArmyWidget::commitChanges() else { isArmed = true; - int amount = uiCounts[i]->text().toInt(); + int amount = uiCounts[i]->value(); if(amount) { army.setCreature(SlotID(i), creId, amount); diff --git a/mapeditor/inspector/armywidget.h b/mapeditor/inspector/armywidget.h index e26953057..c4eaabe32 100644 --- a/mapeditor/inspector/armywidget.h +++ b/mapeditor/inspector/armywidget.h @@ -35,7 +35,7 @@ private: Ui::ArmyWidget *ui; CArmedInstance & army; - std::array uiCounts; + std::array uiCounts; std::array uiSlots; }; diff --git a/mapeditor/inspector/armywidget.ui b/mapeditor/inspector/armywidget.ui index a808f0c3a..a6f141752 100644 --- a/mapeditor/inspector/armywidget.ui +++ b/mapeditor/inspector/armywidget.ui @@ -20,8 +20,8 @@ Army settings - - + + 0 @@ -40,6 +40,16 @@ + + + + + 0 + 0 + + + + @@ -50,164 +60,6 @@ - - - - - 0 - 0 - - - - - 30 - 0 - - - - - 50 - 16777215 - - - - Qt::ImhDigitsOnly - - - - - - - - 0 - 0 - - - - - 30 - 0 - - - - - 50 - 16777215 - - - - Qt::ImhDigitsOnly - - - - - - - - 0 - 0 - - - - - 30 - 0 - - - - - 50 - 16777215 - - - - Qt::ImhDigitsOnly - - - - - - - - 0 - 0 - - - - - 30 - 0 - - - - - 50 - 16777215 - - - - Qt::ImhDigitsOnly - - - - - - - - 0 - 0 - - - - Wide formation - - - - - - - - 0 - 0 - - - - - 30 - 0 - - - - - 50 - 16777215 - - - - Qt::ImhDigitsOnly - - - - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - @@ -218,33 +70,8 @@ - - - - - 0 - 0 - - - - - 30 - 0 - - - - - 50 - 16777215 - - - - Qt::ImhDigitsOnly - - - - - + + 0 @@ -253,29 +80,14 @@ - - + + - + 0 0 - - - 30 - 0 - - - - - 50 - 16777215 - - - - Qt::ImhDigitsOnly - @@ -291,6 +103,131 @@ + + + + + 0 + 0 + + + + Wide formation + + + + + + + false + + + QAbstractSpinBox::PlusMinus + + + true + + + 9999 + + + + + + + false + + + QAbstractSpinBox::PlusMinus + + + true + + + 9999 + + + + + + + false + + + QAbstractSpinBox::PlusMinus + + + true + + + 9999 + + + + + + + false + + + QAbstractSpinBox::PlusMinus + + + true + + + 9999 + + + + + + + false + + + QAbstractSpinBox::PlusMinus + + + true + + + 9999 + + + + + + + false + + + QAbstractSpinBox::PlusMinus + + + true + + + 9999 + + + + + + + false + + + QAbstractSpinBox::PlusMinus + + + true + + + 9999 + + +