diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2008-05-26 07:08:59 +0000 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2008-05-26 07:08:59 +0000 |
| commit | 9200ed0568719fc3ffbf9c1f2fd07a667097b875 (patch) | |
| tree | 0a7df5baf46c1b5f51ec0215f68ecd91cfa49863 /pokemodr/MoveUI.cpp | |
| parent | 2be7d8f347d2f1e21832b29063609adc82d7bbfa (diff) | |
[FIX] Recent files now works
[FIX] Various UI fixes
[FIX] Scripts are now escaped correctly in the XML
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@176 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemodr/MoveUI.cpp')
| -rw-r--r-- | pokemodr/MoveUI.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/pokemodr/MoveUI.cpp b/pokemodr/MoveUI.cpp index effe2770..e306cfbe 100644 --- a/pokemodr/MoveUI.cpp +++ b/pokemodr/MoveUI.cpp @@ -44,22 +44,24 @@ void MoveUI::initGui() void MoveUI::refreshGui() { varType->clear(); - for (int i = 0; i < static_cast<const Pokemod*>(original()->pokemod())->typeCount(); ++i) + for (int i = 0; i < pokemod()->typeCount(); ++i) { - const Type* type = static_cast<const Pokemod*>(original()->pokemod())->type(i); + const Type* type = pokemod()->type(i); varType->addItem(type->name(), type->id()); } - varNumTargets->setMaximum(static_cast<const Pokemod*>(original()->pokemod())->rules()->maxFight()); + varNumTargets->setMaximum(pokemod()->rules()->maxFight() * pokemod()->rules()->maxPlayers()); } void MoveUI::setGui() { varName->setText(static_cast<Move*>(modified())->name()); varAccuracy->setValue(static_cast<Move*>(modified())->accuracy()); + varPower->setValue(static_cast<Move*>(modified())->power()); varType->setCurrentIndex(varType->findData(static_cast<Move*>(modified())->type())); varTarget->setCurrentIndex(static_cast<Move*>(modified())->target()); - varNumTargets->setValue(static_cast<Move*>(modified())->numTargets()); varTargetChoice->setCurrentIndex(static_cast<Move*>(modified())->targetChoice()); + varPowerPoints->setValue(static_cast<Move*>(modified())->powerPoints()); + varNumTargets->setValue(static_cast<Move*>(modified())->numTargets()); varSpecial->setChecked(static_cast<Move*>(modified())->special() ? Qt::Checked : Qt::Unchecked); varOverworld->setChecked(static_cast<Move*>(modified())->overworld() ? Qt::Checked : Qt::Unchecked); varDescription->setPlainText(static_cast<Move*>(modified())->description()); @@ -80,7 +82,9 @@ void MoveUI::discard() void MoveUI::on_varName_textChanged(const QString& name) { + const int cursor = varName->cursorPosition(); static_cast<Move*>(modified())->setName(name); + varName->setCursorPosition(cursor); } void MoveUI::on_varAccuracy_valueChanged(const Fraction& accuracy) @@ -88,6 +92,11 @@ void MoveUI::on_varAccuracy_valueChanged(const Fraction& accuracy) static_cast<Move*>(modified())->setAccuracy(accuracy); } +void MoveUI::on_varPower_valueChanged(const int power) +{ + static_cast<Move*>(modified())->setPower(power); +} + void MoveUI::on_varType_activated(const int type) { static_cast<Move*>(modified())->setType(varType->itemData(type).toInt()); |
