From 9200ed0568719fc3ffbf9c1f2fd07a667097b875 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Mon, 26 May 2008 07:08:59 +0000 Subject: [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 --- pokemodr/MoveUI.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'pokemodr/MoveUI.cpp') 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(original()->pokemod())->typeCount(); ++i) + for (int i = 0; i < pokemod()->typeCount(); ++i) { - const Type* type = static_cast(original()->pokemod())->type(i); + const Type* type = pokemod()->type(i); varType->addItem(type->name(), type->id()); } - varNumTargets->setMaximum(static_cast(original()->pokemod())->rules()->maxFight()); + varNumTargets->setMaximum(pokemod()->rules()->maxFight() * pokemod()->rules()->maxPlayers()); } void MoveUI::setGui() { varName->setText(static_cast(modified())->name()); varAccuracy->setValue(static_cast(modified())->accuracy()); + varPower->setValue(static_cast(modified())->power()); varType->setCurrentIndex(varType->findData(static_cast(modified())->type())); varTarget->setCurrentIndex(static_cast(modified())->target()); - varNumTargets->setValue(static_cast(modified())->numTargets()); varTargetChoice->setCurrentIndex(static_cast(modified())->targetChoice()); + varPowerPoints->setValue(static_cast(modified())->powerPoints()); + varNumTargets->setValue(static_cast(modified())->numTargets()); varSpecial->setChecked(static_cast(modified())->special() ? Qt::Checked : Qt::Unchecked); varOverworld->setChecked(static_cast(modified())->overworld() ? Qt::Checked : Qt::Unchecked); varDescription->setPlainText(static_cast(modified())->description()); @@ -80,7 +82,9 @@ void MoveUI::discard() void MoveUI::on_varName_textChanged(const QString& name) { + const int cursor = varName->cursorPosition(); static_cast(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(modified())->setAccuracy(accuracy); } +void MoveUI::on_varPower_valueChanged(const int power) +{ + static_cast(modified())->setPower(power); +} + void MoveUI::on_varType_activated(const int type) { static_cast(modified())->setType(varType->itemData(type).toInt()); -- cgit