From 8082fda92a86b34a37fe386266efbde5e30bca16 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Fri, 22 Feb 2008 01:39:13 +0000 Subject: [FIX] Frac now makes sure that the denominator is positive [FIX] Sprite-containing classes less repetative with determining paths [FIX] More include cleanup in pokemodr [FIX] Precision of Frac decimal equivalents now use a define [FIX] Species UI form is now more compact and complete [ADD] SpeciesUI.{h, cpp} (again; wasn't actually included last time and got lost) git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@68 6ecfd1a5-f3ed-3746-8530-beee90d26b22 --- Changelog | 21 + battle/battle.pro | 28 +- general/Frac.cpp | 2 +- menus/menus.pro | 19 +- overworld/overworld.pro | 19 +- pokegen/pokegen.pro | 25 +- pokemod/Badge.cpp | 12 +- pokemod/Species.cpp | 59 +- pokemod/Species.h | 10 +- pokemod/Tile.cpp | 21 +- pokemod/Tile.h | 3 +- pokemodr/AbilityUI.cpp | 1 + pokemodr/AbilityUI.h | 4 +- pokemodr/AuthorUI.cpp | 4 +- pokemodr/AuthorUI.h | 4 +- pokemodr/BadgeUI.cpp | 37 +- pokemodr/BadgeUI.h | 10 +- pokemodr/CoinListObjectUI.cpp | 14 +- pokemodr/CoinListObjectUI.h | 5 +- pokemodr/CoinListUI.cpp | 13 +- pokemodr/CoinListUI.h | 6 +- pokemodr/EggGroupUI.cpp | 1 + pokemodr/EggGroupUI.h | 6 +- pokemodr/ImageDialog.h | 1 + pokemodr/ItemTypeUI.cpp | 6 +- pokemodr/ItemTypeUI.h | 6 +- pokemodr/ItemUI.cpp | 9 +- pokemodr/ItemUI.h | 6 +- pokemodr/MapUI.cpp | 9 +- pokemodr/MapUI.h | 6 +- pokemodr/MoveUI.cpp | 11 +- pokemodr/MoveUI.h | 6 +- pokemodr/NatureUI.cpp | 19 +- pokemodr/NatureUI.h | 7 +- pokemodr/ObjectUI.h | 6 +- pokemodr/PokeModTreeItem.h | 3 +- pokemodr/PokeModr.cpp | 6 +- pokemodr/PokeModrUI.cpp | 8 +- pokemodr/PokeModrUI.h | 5 +- pokemodr/RulesUI.cpp | 8 +- pokemodr/RulesUI.h | 5 +- pokemodr/SpeciesAbilityUI.cpp | 14 +- pokemodr/SpeciesAbilityUI.h | 5 +- pokemodr/SpeciesEvolutionUI.cpp | 16 +- pokemodr/SpeciesEvolutionUI.h | 5 +- pokemodr/SpeciesItemUI.cpp | 14 +- pokemodr/SpeciesItemUI.h | 5 +- pokemodr/SpeciesMoveUI.cpp | 14 +- pokemodr/SpeciesMoveUI.h | 5 +- pokemodr/SpeciesUI.cpp | 446 +++++++++++++++ pokemodr/SpeciesUI.h | 87 +++ pokemodr/StoreUI.cpp | 13 +- pokemodr/StoreUI.h | 6 +- pokemodr/TileDelegate.cpp | 7 +- pokemodr/TileUI.cpp | 18 +- pokemodr/TileUI.h | 6 +- pokemodr/TilemapModel.cpp | 7 +- pokemodr/TilemapModel.h | 6 +- pokemodr/TimeUI.cpp | 6 +- pokemodr/TimeUI.h | 6 +- pokemodr/TypeUI.cpp | 8 +- pokemodr/TypeUI.h | 6 +- pokemodr/gui/badge.ui | 61 +- pokemodr/gui/move.ui | 4 +- pokemodr/gui/species.ui | 1197 +++++++++++++++++++++++---------------- 65 files changed, 1724 insertions(+), 689 deletions(-) create mode 100644 pokemodr/SpeciesUI.cpp create mode 100644 pokemodr/SpeciesUI.h diff --git a/Changelog b/Changelog index 3e95ce4f..f88d3c99 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,24 @@ +----------------- +Rev: 69 +Date: 21 February 2008 +User: MathStuf +----------------- +[FIX] Frac now makes sure that the denominator is positive +[FIX] Sprite-containing classes less repetative with determining paths +[FIX] More include cleanup in pokemodr +[FIX] Precision of Frac decimal equivalents now use a define +[FIX] Species UI form is now more compact and complete +[ADD] SpeciesUI.{h, cpp} (again; wasn't actually included last time and got lost) + +----------------- +Rev: 68 +Date: 21 February 2008 +User: MathStuf +----------------- +[FIX] Species form now uses tabs so its not as gigantically tall +[FIX] SpeciesUI files disappeared, so remade +[FIX] Include cleanup in pokemodr + ----------------- Rev: 67 Date: 20 February 2008 diff --git a/battle/battle.pro b/battle/battle.pro index a4bb134c..6d2538e3 100644 --- a/battle/battle.pro +++ b/battle/battle.pro @@ -1,10 +1,24 @@ OBJECTS_DIR = .obj -DESTDIR = ../../lib -LANGUAGE = C++ -TEMPLATE = lib -LIBS += -L../../lib -lgeneral -lpokemod +DESTDIR = ../../lib +TEMPLATE = lib +LIBS += -L../../lib -lgeneral -lpokemod -CONFIG += qt warn_on dll +CONFIG += qt \ +warn_on \ +dll \ +exceptions -SOURCES += *.cpp -HEADERS += *.h +INCLUDEPATH += ../pokemod \ +../general \ +/usr/lib64/kde4 +TARGETDEPS += ../../lib/libpokemod.so \ +../../lib/libgeneral.so +SOURCES += Arena.cpp \ +Ghost.cpp \ +Team.cpp +HEADERS += Arena.h \ +Bot.h \ +GhostBot.h \ +Ghost.h \ +Pokemon.h \ +Team.h diff --git a/general/Frac.cpp b/general/Frac.cpp index a47b005b..9cf47aca 100644 --- a/general/Frac.cpp +++ b/general/Frac.cpp @@ -24,7 +24,7 @@ void Frac::set(const int n, const int d) throw(Exception) { - if ((type == Improper) || ((n <= d) && (type == Proper)) || ((d < n) && (type == Over1))) + if (((type == Improper) || ((n <= d) && (type == Proper)) || ((d < n) && (type == Over1))) && (0 < d)) { num = n; denom = d; diff --git a/menus/menus.pro b/menus/menus.pro index a4bb134c..31799577 100644 --- a/menus/menus.pro +++ b/menus/menus.pro @@ -1,10 +1,13 @@ OBJECTS_DIR = .obj -DESTDIR = ../../lib -LANGUAGE = C++ -TEMPLATE = lib -LIBS += -L../../lib -lgeneral -lpokemod +DESTDIR = ../../lib +TEMPLATE = lib +LIBS += -L../../lib -lgeneral -lpokemod -CONFIG += qt warn_on dll - -SOURCES += *.cpp -HEADERS += *.h +CONFIG += qt \ +warn_on \ +dll \ +exceptions +INCLUDEPATH += ../pokemod \ +../general +TARGETDEPS += ../../lib/libpokemod.so \ +../../lib/libgeneral.so diff --git a/overworld/overworld.pro b/overworld/overworld.pro index a4bb134c..31799577 100644 --- a/overworld/overworld.pro +++ b/overworld/overworld.pro @@ -1,10 +1,13 @@ OBJECTS_DIR = .obj -DESTDIR = ../../lib -LANGUAGE = C++ -TEMPLATE = lib -LIBS += -L../../lib -lgeneral -lpokemod +DESTDIR = ../../lib +TEMPLATE = lib +LIBS += -L../../lib -lgeneral -lpokemod -CONFIG += qt warn_on dll - -SOURCES += *.cpp -HEADERS += *.h +CONFIG += qt \ +warn_on \ +dll \ +exceptions +INCLUDEPATH += ../pokemod \ +../general +TARGETDEPS += ../../lib/libpokemod.so \ +../../lib/libgeneral.so diff --git a/pokegen/pokegen.pro b/pokegen/pokegen.pro index 192c1b16..0ca2609c 100644 --- a/pokegen/pokegen.pro +++ b/pokegen/pokegen.pro @@ -1,10 +1,19 @@ OBJECTS_DIR = .obj -DESTDIR = ../../bin -LANGUAGE = C++ -TEMPLATE = app -LIBS += -L../../lib -lgeneral -lpokemod -loverworld -lbattle -laudio -lmenus +DESTDIR = ../../bin +TEMPLATE = app +LIBS += -L../../lib -lgeneral -lpokemod -loverworld -lbattle -laudio -lmenus -CONFIG += qt gui warn_on dll - -SOURCES += *.cpp -HEADERS += *.h +CONFIG += qt \ +gui \ +warn_on \ +exceptions +INCLUDEPATH += ../pokemod \ +../overworld \ +../menus \ +../general \ +../battle +TARGETDEPS += ../../lib/libpokemod.so \ +../../lib/liboverworld.so \ +../../lib/libmenus.so \ +../../lib/libgeneral.so \ +../../lib/libbattle.so diff --git a/pokemod/Badge.cpp b/pokemod/Badge.cpp index 2f444cef..cdc150d1 100644 --- a/pokemod/Badge.cpp +++ b/pokemod/Badge.cpp @@ -61,12 +61,12 @@ bool Badge::validate() const pokemod->validationMsg("Obey level out of range"); valid = false; } - if (!QFile(QString("%1/badge/%2/face.png").arg(pokemod->getPath()).arg(name)).exists()) + if (!QFile(getFace()).exists()) { pokemod->validationMsg("Cannot find the face sprite"); valid = false; } - if (!QFile(QString("%1/badge/%2/badge.png").arg(pokemod->getPath()).arg(name)).exists()) + if (!QFile(getBadge()).exists()) { pokemod->validationMsg("Cannot find the badge sprite"); valid = false; @@ -118,19 +118,19 @@ void Badge::setName(const QString& n) void Badge::setFace(const QString& f) throw(Exception) { - QFile file(QString("%1/badge/%2/face.png").arg(pokemod->getPath()).arg(name)); + QFile file(getFace()); if (file.exists() && !file.remove()) throw(ReplaceException(className, file.fileName())); - if (!QFile::copy(f, QString("%1/badge/%2/face.png").arg(pokemod->getPath()).arg(name))) + if (!QFile::copy(f, getFace())) throw(SaveException(className, file.fileName())); } void Badge::setBadge(const QString& b) throw(Exception) { - QFile file(QString("%1/badge/%2/badge.png").arg(pokemod->getPath()).arg(name)); + QFile file(getBadge()); if (file.exists() && !file.remove()) throw(ReplaceException(className, file.fileName())); - if (!QFile::copy(b, QString("%1/badge/%2/badge.png").arg(pokemod->getPath()).arg(name))) + if (!QFile::copy(b, getBadge())) throw(SaveException(className, file.fileName())); } diff --git a/pokemod/Species.cpp b/pokemod/Species.cpp index 2cb92749..14433c5f 100644 --- a/pokemod/Species.cpp +++ b/pokemod/Species.cpp @@ -43,7 +43,7 @@ Species::Species(const Pokemod* par, const int _id) : heightFeet(0), heightInches(0), pokedexEntry(""), - genderFactor(1, 1, true), + genderFactor(1, 1), eggSpecies(-1), eggSteps(0), nidoranGroup(-1) @@ -101,30 +101,30 @@ bool Species::validate() const pokemod->validationMsg("Invalid height inches"); valid = false; } - if (!QFile::exists(QString("%1/species/%2/front%3.png").arg(pokemod->getPath()).arg(name).arg(pokemod->getRules()->getGenderAllowed() ? "-male" : ""))) + if (!QFile::exists(getFrontMaleSprite())) { pokemod->validationMsg(QString("Cannot find the front%1 image").arg(pokemod->getRules()->getGenderAllowed() ? " male" : "")); valid = false; } - if (!QFile::exists(QString("%1/species/%2/back%3.png").arg(pokemod->getPath()).arg(name).arg(pokemod->getRules()->getGenderAllowed() ? "-male" : ""))) + if (!QFile::exists(getBackMaleSprite())) { pokemod->validationMsg(QString("Cannot find the back%1 image").arg(pokemod->getRules()->getGenderAllowed() ? " male" : "")); valid = false; } if (pokemod->getRules()->getGenderAllowed()) { - if (!QFile::exists(QString("%1/species/%2/front-female.png").arg(pokemod->getPath()).arg(name))) + if (!QFile::exists(getFrontFemaleSprite())) { pokemod->validationMsg("Cannot find the front female image"); valid = false; } - if (!QFile::exists(QString("%1/species/%2/back-female.png").arg(pokemod->getPath()).arg(name))) + if (!QFile::exists(getBackFemaleSprite())) { pokemod->validationMsg("Cannot find the back female image"); valid = false; } } - if (!QFile::exists(QString("%1/species/%2/list.png").arg(pokemod->getPath()).arg(name))) + if (!QFile::exists(getListSprite())) { pokemod->validationMsg("Cannot find the list sprite"); valid = false; @@ -230,7 +230,7 @@ bool Species::validate() const { if (1 < i.value()) { - pokemod->validationMsg(QString("There are %1 evoltions with the speices %2").arg(i.value()).arg(i.key())); + pokemod->validationMsg(QString("There are %1 evolutions with the speices %2").arg(i.value()).arg(i.key())); valid = false; } } @@ -553,19 +553,19 @@ void Species::setPokedexEntry(const QString& p) void Species::setFrontMaleSprite(const QString& fname) throw(Exception) { - QFile file(QString("%1/species/%2/front%3.png").arg(pokemod->getPath()).arg(name).arg(pokemod->getRules()->getGenderAllowed() ? "-male" : "")); + QFile file(getFrontMaleSprite()); if (file.exists() && !file.remove()) throw(RemoveException(className, file.fileName())); - if (!QFile::copy(fname, QString("%1/species/%2/front%3.png").arg(pokemod->getPath()).arg(name).arg(pokemod->getRules()->getGenderAllowed() ? "-male" : ""))) + if (!QFile::copy(fname, getFrontMaleSprite())) throw(SaveException(className, file.fileName())); } void Species::setBackMaleSprite(const QString& fname) throw(Exception) { - QFile file(QString("%1/species/%2/back%3.png").arg(pokemod->getPath()).arg(name).arg(pokemod->getRules()->getGenderAllowed() ? "-male" : "")); + QFile file(getBackMaleSprite()); if (file.exists() && !file.remove()) throw(RemoveException(className, file.fileName())); - if (!QFile::copy(fname, QString("%1/species/%2/back%3.png").arg(pokemod->getPath()).arg(name).arg(pokemod->getRules()->getGenderAllowed() ? "-male" : ""))) + if (!QFile::copy(fname, getBackMaleSprite())) throw(SaveException(className, file.fileName())); } @@ -573,10 +573,10 @@ void Species::setFrontFemaleSprite(const QString& fname) throw(Exception) { if (!pokemod->getRules()->getGenderAllowed()) throw(Exception(className, "gender is not allowed")); - QFile file(QString("%1/species/%2/front-female.png").arg(pokemod->getPath()).arg(name)); + QFile file(getFrontFemaleSprite()); if (file.exists() && !file.remove()) throw(RemoveException(className, file.fileName())); - if (!QFile::copy(fname, QString("%1/species/%2/front-female.png").arg(pokemod->getPath()).arg(name))) + if (!QFile::copy(fname, getFrontFemaleSprite())) throw(SaveException(className, file.fileName())); } @@ -584,19 +584,19 @@ void Species::setBackFemaleSprite(const QString& fname) throw(Exception) { if (!pokemod->getRules()->getGenderAllowed()) throw(Exception(className, "gender is not allowed")); - QFile file(QString("%1/species/%2/back-female.png").arg(pokemod->getPath()).arg(name)); + QFile file(getBackFemaleSprite()); if (file.exists() && !file.remove()) throw(RemoveException(className, file.fileName())); - if (!QFile::copy(fname, QString("%1/species/%2/back-female.png").arg(pokemod->getPath()).arg(name))) + if (!QFile::copy(fname, getBackFemaleSprite())) throw(SaveException(className, file.fileName())); } void Species::setListSprite(const QString& fname) throw(Exception) { - QFile file(QString("%1/species/%2/list.png").arg(pokemod->getPath()).arg(name)); + QFile file(getListSprite()); if (file.exists() && !file.remove()) throw(RemoveException(className, file.fileName())); - if (!QFile::copy(fname, QString("%1/species/%2/list.png").arg(pokemod->getPath()).arg(name))) + if (!QFile::copy(fname, getListSprite())) throw(SaveException(className, file.fileName())); } @@ -739,6 +739,31 @@ QString Species::getPokedexEntry() const return pokedexEntry; } +QString Species::getFrontMaleSprite() const +{ + return QString("%1/species/%2/front-male.png").arg(pokemod->getPath()).arg(name); +} + +QString Species::getBackMaleSprite() const +{ + return QString("%1/species/%2/back-male.png").arg(pokemod->getPath()).arg(name); +} + +QString Species::getFrontFemaleSprite() const +{ + return QString("%1/species/%2/front-female.png").arg(pokemod->getPath()).arg(name); +} + +QString Species::getBackFemaleSprite() const +{ + return QString("%1/species/%2/back-female.png").arg(pokemod->getPath()).arg(name); +} + +QString Species::getListSprite() const +{ + return QString("%1/species/%2/list.png").arg(pokemod->getPath()).arg(name); +} + Frac Species::getGenderFactor() const { return genderFactor; diff --git a/pokemod/Species.h b/pokemod/Species.h index 13e48ec6..11410b9e 100644 --- a/pokemod/Species.h +++ b/pokemod/Species.h @@ -105,11 +105,11 @@ class Species : public Object int getHeightFeet() const; int getHeightInches() const; QString getPokedexEntry() const; - bool getFrontMaleSprite() const; - bool getBackMaleSprite() const; - bool getFrontFemaleSprite() const; - bool getBackFemaleSprite() const; - bool getListSprite() const; + QString getFrontMaleSprite() const; + QString getBackMaleSprite() const; + QString getFrontFemaleSprite() const; + QString getBackFemaleSprite() const; + QString getListSprite() const; Frac getGenderFactor() const; int getEggSpecies() const; int getEggSteps() const; diff --git a/pokemod/Tile.cpp b/pokemod/Tile.cpp index 7f9e319e..11043882 100644 --- a/pokemod/Tile.cpp +++ b/pokemod/Tile.cpp @@ -28,7 +28,6 @@ const QStringList Tile::ForceStr = QStringList() << "Slip" << "Stop" << "Force" Tile::Tile(const Pokemod* par, const int _id) : Object("Tile", par, _id), name(""), - pic(""), wildChance(1, 1), hmType(-1), under(-1), @@ -46,8 +45,7 @@ Tile::Tile(const Pokemod* par, const Tile& t, const int _id) : } Tile::Tile(const Pokemod* par, const QString& fname, const int _id) : - Object("Tile", par, _id), - pic("") + Object("Tile", par, _id) { load(fname, _id); } @@ -61,7 +59,7 @@ bool Tile::validate() const pokemod->validationMsg("Name is not defined"); valid = false; } - if (!QFile::exists(QString("%1/image/tile/%2.png").arg(pokemod->getPath()).arg(pic))) + if (!QFile::exists(getPic())) { pokemod->validationMsg("Cannot find tile image"); valid = false; @@ -112,7 +110,6 @@ void Tile::load(const QString& fname, const int _id) throw(Exception) int i; int j; ini.getValue("name", name); - ini.getValue("pic", pic); ini.getValue("from-up", from[D_Up], false); ini.getValue("from-down", from[D_Down], false); ini.getValue("from-left", from[D_Left], false); @@ -131,7 +128,6 @@ void Tile::save() const throw(Exception) Ini ini; ini.addField("id", id); ini.addField("name", name); - ini.addField("pic", pic); ini.addField("from-up", from[D_Up]); ini.addField("from-down", from[D_Down]); ini.addField("from-left", from[D_Left]); @@ -150,11 +146,13 @@ void Tile::setName(const QString& n) name = n; } -void Tile::setPic(const QString& p) throw(OpenException) +void Tile::setPic(const QString& fname) throw(Exception) { - if (!QFile::exists(QString("%1/image/tile/%2.png").arg(pokemod->getPath()).arg(p))) - throw(OpenException(className, QString("%1/image/tile/%2.png").arg(pokemod->getPath()).arg(p))); - pic = p; + QFile file(getPic()); + if (file.exists() && !file.remove()) + throw(RemoveException(className, file.fileName())); + if (!QFile::copy(fname, getPic())) + throw(SaveException(className, file.fileName())); } void Tile::setFrom(const int d, const bool f) throw(BoundsException) @@ -225,7 +223,7 @@ QString Tile::getName() const QString Tile::getPic() const { - return pic; + return QString("%1/tile/%2.png").arg(pokemod->getPath()).arg(name); } bool Tile::getFrom(const int d) const throw(BoundsException) @@ -265,7 +263,6 @@ Tile& Tile::operator=(const Tile& rhs) if (this == &rhs) return *this; name = rhs.name; - pic = rhs.pic; for (int i = 0; i < D_End; ++i) from[i] = rhs.from[i]; wildChance = rhs.wildChance; diff --git a/pokemod/Tile.h b/pokemod/Tile.h index f2825be2..32441e92 100644 --- a/pokemod/Tile.h +++ b/pokemod/Tile.h @@ -55,7 +55,7 @@ class Tile : public Object void save() const throw(Exception); void setName(const QString& n); - void setPic(const QString& p) throw(OpenException); + void setPic(const QString& p) throw(Exception); void setFrom(const int d, const bool f) throw(BoundsException); void setWildChance(const int n, const int d) throw(Exception); void setWildChanceNum(const int n) throw(Exception); @@ -79,7 +79,6 @@ class Tile : public Object bool validate() const; QString name; - QString pic; bool from[D_End]; Frac wildChance; int hmType; diff --git a/pokemodr/AbilityUI.cpp b/pokemodr/AbilityUI.cpp index dccbfa2d..b41cadb1 100644 --- a/pokemodr/AbilityUI.cpp +++ b/pokemodr/AbilityUI.cpp @@ -21,6 +21,7 @@ ///////////////////////////////////////////////////////////////////////////// #include + #include "AbilityUI.h" AbilityUI::AbilityUI(Ability* a, QWidget* parent) : diff --git a/pokemodr/AbilityUI.h b/pokemodr/AbilityUI.h index 8f9c183f..52ddb22d 100644 --- a/pokemodr/AbilityUI.h +++ b/pokemodr/AbilityUI.h @@ -25,7 +25,9 @@ #include #include -#include "../pokemod/Ability.h" + +#include + #include "ObjectUI.h" #include "ui_ability.h" diff --git a/pokemodr/AuthorUI.cpp b/pokemodr/AuthorUI.cpp index eb143373..413ea775 100644 --- a/pokemodr/AuthorUI.cpp +++ b/pokemodr/AuthorUI.cpp @@ -21,7 +21,9 @@ ///////////////////////////////////////////////////////////////////////////// #include -#include "../general/Exception.h" + +#include + #include "AuthorUI.h" AuthorUI::AuthorUI(Author* a, QWidget* parent) : diff --git a/pokemodr/AuthorUI.h b/pokemodr/AuthorUI.h index 7ad46ba7..d94b1f54 100644 --- a/pokemodr/AuthorUI.h +++ b/pokemodr/AuthorUI.h @@ -25,7 +25,9 @@ #include #include -#include "../pokemod/Author.h" + +#include + #include "ObjectUI.h" #include "ui_author.h" diff --git a/pokemodr/BadgeUI.cpp b/pokemodr/BadgeUI.cpp index 5f0e46e5..c6edda26 100644 --- a/pokemodr/BadgeUI.cpp +++ b/pokemodr/BadgeUI.cpp @@ -22,17 +22,19 @@ #include #include -#include "../general/BugCatcher.h" -#include "../general/Exception.h" -#include "../general/ImageCache.h" -#include "../general/Ref.h" -#include "../pokemod/Pokemod.h" + +#include +#include +#include +#include + +#include + #include "ImageDialog.h" #include "BadgeUI.h" BadgeUI::BadgeUI(Badge* b, QWidget* parent) : ObjectUI(parent), - curStat(ST_HP), badge(b), badge_mod(new Badge(b->getPokemod(), *b, b->getId())) { @@ -55,20 +57,26 @@ void BadgeUI::setGui() varName->setText(badge_mod->getName()); varObey->setMaximum(badge->getPokemod()->getRules()->getMaxLevel()); varObey->setValue(badge_mod->getObey()); - varStat->setCurrentIndex(curStat); try { varFace->setIcon(ImageCache::open(badge_mod->getFace())); + } + catch (OpenException& e) + { + BugCatcher::report(e); + } + try + { varBadge->setIcon(ImageCache::open(badge_mod->getBadge())); } catch (OpenException& e) { BugCatcher::report(e); } - varMultiplierNum->setValue(badge_mod->getStat(curStat).getNum()); - varMultiplierDenom->setValue(badge_mod->getStat(curStat).getDenom()); - varMultiplierNum->setMaximum(badge_mod->getStat(curStat).getDenom()); - varMultiplier->setText(QString::number(badge_mod->getStat(curStat), 'g', 15)); + varMultiplierNum->setValue(badge_mod->getStat(varStat->currentIndex()).getNum()); + varMultiplierDenom->setValue(badge_mod->getStat(varStat->currentIndex()).getDenom()); + varMultiplierNum->setMaximum(badge_mod->getStat(varStat->currentIndex()).getDenom()); + varMultiplier->setText(QString::number(badge_mod->getStat(varStat->currentIndex()), 'g', DBL_PREC)); for (unsigned i = 0; i < HM_End_All; ++i) varHMs->item(i)->setSelected(badge_mod->getHm(i)); } @@ -138,9 +146,8 @@ void BadgeUI::on_varBadge_pressed() } } -void BadgeUI::on_varStat_currentIndexChanged(const int s) +void BadgeUI::on_varStat_currentIndexChanged() { - curStat = s; emit(setChanged(true)); setGui(); } @@ -149,7 +156,7 @@ void BadgeUI::on_varMultiplierNum_valueChanged(const int m) { try { - badge_mod->setStatNum(curStat, m); + badge_mod->setStatNum(varStat->currentIndex(), m); emit(setChanged(true)); } catch (Exception& e) @@ -163,7 +170,7 @@ void BadgeUI::on_varMultiplierDenom_valueChanged(const int m) { try { - badge_mod->setStatDenom(curStat, m); + badge_mod->setStatDenom(varStat->currentIndex(), m); emit(setChanged(true)); } catch (Exception& e) diff --git a/pokemodr/BadgeUI.h b/pokemodr/BadgeUI.h index 60579a0a..0f93152a 100644 --- a/pokemodr/BadgeUI.h +++ b/pokemodr/BadgeUI.h @@ -24,9 +24,13 @@ #define __POKEMODR_BADGEUI__ #include + #include -#include "../pokemod/Badge.h" + +#include + #include "ObjectUI.h" + #include "ui_badge.h" class BadgeUI : public ObjectUI, private Ui::formBadge @@ -48,15 +52,13 @@ class BadgeUI : public ObjectUI, private Ui::formBadge void on_varObey_valueChanged(const int o); void on_varFace_pressed(); void on_varBadge_pressed(); - void on_varStat_currentIndexChanged(const int s); + void on_varStat_currentIndexChanged(); void on_varMultiplierNum_valueChanged(const int m); void on_varMultiplierDenom_valueChanged(const int m); void on_varHMs_itemSelectionChanged(); private: void setGui(); - int curStat; - Badge* badge; Badge* badge_mod; }; diff --git a/pokemodr/CoinListObjectUI.cpp b/pokemodr/CoinListObjectUI.cpp index 55879c8a..5f5606e3 100644 --- a/pokemodr/CoinListObjectUI.cpp +++ b/pokemodr/CoinListObjectUI.cpp @@ -21,13 +21,15 @@ ///////////////////////////////////////////////////////////////////////////// #include -#include #include -#include "../general/BugCatcher.h" -#include "../general/Exception.h" -#include "../pokemod/Item.h" -#include "../pokemod/ItemEffect.h" -#include "../pokemod/Pokemod.h" + +#include +#include + +#include +#include +#include + #include "CoinListObjectUI.h" CoinListObjectUI::CoinListObjectUI(CoinListObject* c, QWidget* parent) : diff --git a/pokemodr/CoinListObjectUI.h b/pokemodr/CoinListObjectUI.h index 69890868..fbd7da60 100644 --- a/pokemodr/CoinListObjectUI.h +++ b/pokemodr/CoinListObjectUI.h @@ -24,8 +24,11 @@ #define __POKEMODR_COINLISTOBJECTUI__ #include -#include "../pokemod/CoinListObject.h" + +#include + #include "ObjectUI.h" + #include "ui_coinlistobject.h" class CoinListObjectUI : public ObjectUI, private Ui::formCoinListObject diff --git a/pokemodr/CoinListUI.cpp b/pokemodr/CoinListUI.cpp index b813d94f..539d086e 100644 --- a/pokemodr/CoinListUI.cpp +++ b/pokemodr/CoinListUI.cpp @@ -22,11 +22,14 @@ #include #include -#include "../general/BugCatcher.h" -#include "../general/Exception.h" -#include "../pokemod/Item.h" -#include "../pokemod/ItemEffect.h" -#include "../pokemod/Pokemod.h" + +#include +#include + +#include +#include +#include + #include "CoinListUI.h" CoinListUI::CoinListUI(CoinList* c, QWidget* parent) : diff --git a/pokemodr/CoinListUI.h b/pokemodr/CoinListUI.h index 28244954..6b32c534 100644 --- a/pokemodr/CoinListUI.h +++ b/pokemodr/CoinListUI.h @@ -24,9 +24,13 @@ #define __POKEMODR_COINLISTUI__ #include + #include -#include "../pokemod/CoinList.h" + +#include + #include "ObjectUI.h" + #include "ui_coinlist.h" class CoinListUI : public ObjectUI, private Ui::formCoinList diff --git a/pokemodr/EggGroupUI.cpp b/pokemodr/EggGroupUI.cpp index 6dd65441..15b716f5 100644 --- a/pokemodr/EggGroupUI.cpp +++ b/pokemodr/EggGroupUI.cpp @@ -21,6 +21,7 @@ ///////////////////////////////////////////////////////////////////////////// #include + #include "EggGroupUI.h" EggGroupUI::EggGroupUI(EggGroup* e, QWidget* parent) : diff --git a/pokemodr/EggGroupUI.h b/pokemodr/EggGroupUI.h index 7e14ead0..dcd89357 100644 --- a/pokemodr/EggGroupUI.h +++ b/pokemodr/EggGroupUI.h @@ -24,9 +24,13 @@ #define __POKEMODR_EGGGROUPUI__ #include + #include -#include "../pokemod/EggGroup.h" + +#include + #include "ObjectUI.h" + #include "ui_egggroup.h" class EggGroupUI : public ObjectUI, private Ui::formEggGroup diff --git a/pokemodr/ImageDialog.h b/pokemodr/ImageDialog.h index 8238d511..7c6ebee4 100644 --- a/pokemodr/ImageDialog.h +++ b/pokemodr/ImageDialog.h @@ -25,6 +25,7 @@ #include #include + #include class ImageDialog diff --git a/pokemodr/ItemTypeUI.cpp b/pokemodr/ItemTypeUI.cpp index 768dbcd8..7520303e 100644 --- a/pokemodr/ItemTypeUI.cpp +++ b/pokemodr/ItemTypeUI.cpp @@ -21,8 +21,10 @@ ///////////////////////////////////////////////////////////////////////////// #include -#include "../general/BugCatcher.h" -#include "../general/Exception.h" + +#include +#include + #include "ItemTypeUI.h" ItemTypeUI::ItemTypeUI(ItemType* i, QWidget* parent) : diff --git a/pokemodr/ItemTypeUI.h b/pokemodr/ItemTypeUI.h index a4b76d63..32c98df3 100644 --- a/pokemodr/ItemTypeUI.h +++ b/pokemodr/ItemTypeUI.h @@ -24,10 +24,14 @@ #define __POKEMODR_ITEMTYPEUI__ #include + #include #include -#include "../pokemod/ItemType.h" + +#include + #include "ObjectUI.h" + #include "ui_itemtype.h" class ItemTypeUI : public ObjectUI, private Ui::formItemType diff --git a/pokemodr/ItemUI.cpp b/pokemodr/ItemUI.cpp index 3bdaf83c..f54fb5c9 100644 --- a/pokemodr/ItemUI.cpp +++ b/pokemodr/ItemUI.cpp @@ -21,9 +21,12 @@ ///////////////////////////////////////////////////////////////////////////// #include -#include "../general/BugCatcher.h" -#include "../general/Exception.h" -#include "../pokemod/Pokemod.h" + +#include +#include + +#include + #include "ItemUI.h" ItemUI::ItemUI(Item* i, QWidget* parent) : diff --git a/pokemodr/ItemUI.h b/pokemodr/ItemUI.h index 9f488423..1047f881 100644 --- a/pokemodr/ItemUI.h +++ b/pokemodr/ItemUI.h @@ -24,9 +24,13 @@ #define __POKEMODR_ITEMUI__ #include + #include -#include "../pokemod/Item.h" + +#include + #include "ObjectUI.h" + #include "ui_item.h" class ItemUI : public ObjectUI, private Ui::formItem diff --git a/pokemodr/MapUI.cpp b/pokemodr/MapUI.cpp index f349cbc0..1be2db2d 100644 --- a/pokemodr/MapUI.cpp +++ b/pokemodr/MapUI.cpp @@ -22,9 +22,12 @@ #include #include -#include "../general/BugCatcher.h" -#include "../general/Exception.h" -#include "../pokemod/Pokemod.h" + +#include +#include + +#include + #include "TileDelegate.h" #include "TilemapModel.h" #include "MapUI.h" diff --git a/pokemodr/MapUI.h b/pokemodr/MapUI.h index 4e11c3d9..de24ce98 100644 --- a/pokemodr/MapUI.h +++ b/pokemodr/MapUI.h @@ -24,11 +24,15 @@ #define __POKEMODR_MAPUI__ #include + #include -#include "../pokemod/Map.h" + +#include + #include "ObjectUI.h" #include "TileDelegate.h" #include "TilemapModel.h" + #include "ui_map.h" class MapUI : public ObjectUI, private Ui::formMap diff --git a/pokemodr/MoveUI.cpp b/pokemodr/MoveUI.cpp index 072a431e..b1a0c51e 100644 --- a/pokemodr/MoveUI.cpp +++ b/pokemodr/MoveUI.cpp @@ -21,9 +21,12 @@ ///////////////////////////////////////////////////////////////////////////// #include -#include "../general/BugCatcher.h" -#include "../general/Exception.h" -#include "../pokemod/Pokemod.h" + +#include +#include + +#include + #include "MoveUI.h" MoveUI::MoveUI(Move* m, QWidget* parent) : @@ -57,7 +60,7 @@ void MoveUI::setGui() varAccuracyNum->setValue(move_mod->getAccuracy().getNum()); varAccuracyDenom->setValue(move_mod->getAccuracy().getDenom()); varAccuracyNum->setMaximum(move_mod->getAccuracy().getDenom()); - varAccuracy->setText(QString::number(move_mod->getAccuracy(), 'g', 15)); + varAccuracy->setText(QString::number(move_mod->getAccuracy(), 'g', DBL_PREC)); varType->setCurrentIndex(varType->findData(move_mod->getType())); varTarget->setCurrentIndex(move_mod->getTarget()); varNumTargets->setValue(move_mod->getNumTargets()); diff --git a/pokemodr/MoveUI.h b/pokemodr/MoveUI.h index 0ae049d1..a2ec8439 100644 --- a/pokemodr/MoveUI.h +++ b/pokemodr/MoveUI.h @@ -24,9 +24,13 @@ #define __POKEMODR_MOVEUI__ #include + #include -#include "../pokemod/Move.h" + +#include + #include "ObjectUI.h" + #include "ui_move.h" class MoveUI : public ObjectUI, private Ui::formMove diff --git a/pokemodr/NatureUI.cpp b/pokemodr/NatureUI.cpp index 946a7e48..b09823a3 100644 --- a/pokemodr/NatureUI.cpp +++ b/pokemodr/NatureUI.cpp @@ -22,10 +22,13 @@ #include #include -#include "../general/BugCatcher.h" -#include "../general/Exception.h" -#include "../general/Ref.h" -#include "../pokemod/Pokemod.h" + +#include +#include +#include + +#include + #include "NatureUI.h" NatureUI::NatureUI(Nature* n, QWidget* parent) : @@ -51,7 +54,7 @@ void NatureUI::setGui() varStatMultiplierNum->setValue(nature_mod->getStat(varStat->currentIndex()).getNum()); varStatMultiplierDenom->setValue(nature_mod->getStat(varStat->currentIndex()).getDenom()); varStatMultiplierNum->setMaximum(nature_mod->getStat(varStat->currentIndex()).getDenom()); - varStatMultiplier->setText(QString::number(nature_mod->getStat(varStat->currentIndex()), 'g', 15)); + varStatMultiplier->setText(QString::number(nature_mod->getStat(varStat->currentIndex()), 'g', DBL_PREC)); varWeight->setValue(nature_mod->getWeight()); } @@ -74,6 +77,12 @@ void NatureUI::on_varName_textChanged(const QString& n) emit(setChanged(true)); } +void NatureUI::on_varStatMultiplier_currentIndexChanged() +{ + emit(setChanged(true)); + setGui(); +} + void NatureUI::on_varStatMultiplierNum_valueChanged(const int s) { try diff --git a/pokemodr/NatureUI.h b/pokemodr/NatureUI.h index 8f5c2f32..4b6f9e56 100644 --- a/pokemodr/NatureUI.h +++ b/pokemodr/NatureUI.h @@ -24,9 +24,13 @@ #define __POKEMODR_NATUREUI__ #include + #include -#include "../pokemod/Nature.h" + +#include + #include "ObjectUI.h" + #include "ui_nature.h" class NatureUI : public ObjectUI, private Ui::formNature @@ -45,6 +49,7 @@ class NatureUI : public ObjectUI, private Ui::formNature void on_buttonApply_clicked(); void on_buttonDiscard_clicked(); void on_varName_textChanged(const QString& n); + void on_varStatMultiplier_currentIndexChanged(); void on_varStatMultiplierNum_valueChanged(const int s); void on_varStatMultiplierDenom_valueChanged(const int s); void on_varWeight_valueChanged(const int w); diff --git a/pokemodr/ObjectUI.h b/pokemodr/ObjectUI.h index 351612a7..b75b46a1 100644 --- a/pokemodr/ObjectUI.h +++ b/pokemodr/ObjectUI.h @@ -24,9 +24,13 @@ #define __POKEMODR_OBJECTUI__ #include + #include #include -#include "../pokemod/Object.h" + +#include + +#define DBL_PREC 15 class ObjectUI : public QWidget { diff --git a/pokemodr/PokeModTreeItem.h b/pokemodr/PokeModTreeItem.h index f430783c..c94886b0 100644 --- a/pokemodr/PokeModTreeItem.h +++ b/pokemodr/PokeModTreeItem.h @@ -26,7 +26,8 @@ #include #include -#include "../pokemod/Object.h" + +#include class PokeModTreeItem : public QObject, public QTreeWidgetItem { diff --git a/pokemodr/PokeModr.cpp b/pokemodr/PokeModr.cpp index 16cdd6b0..b1130634 100644 --- a/pokemodr/PokeModr.cpp +++ b/pokemodr/PokeModr.cpp @@ -25,8 +25,10 @@ #include #include #include -#include "../general/BugCatcher.h" -#include "../general/Exception.h" + +#include +#include + #include "ImageDialog.h" #include "PokeModrUI.h" #include "PokeModr.h" diff --git a/pokemodr/PokeModrUI.cpp b/pokemodr/PokeModrUI.cpp index 10bb1486..0fb19a70 100644 --- a/pokemodr/PokeModrUI.cpp +++ b/pokemodr/PokeModrUI.cpp @@ -23,11 +23,15 @@ #include #include #include + #include -#include "../general/BugCatcher.h" -#include "../general/Exception.h" + +#include +#include + #include "PokeModrUI.h" +// Debugging includes #include "AbilityUI.h" #include "AuthorUI.h" #include "BadgeUI.h" diff --git a/pokemodr/PokeModrUI.h b/pokemodr/PokeModrUI.h index fa4fbb8b..89bc85ad 100644 --- a/pokemodr/PokeModrUI.h +++ b/pokemodr/PokeModrUI.h @@ -26,10 +26,13 @@ #include #include #include + #include #include #include -#include "../pokemod/Pokemod.h" + +#include + #include "ui_pokemodr.h" class PokeModrUI : public QMainWindow, private Ui::formPokeModr diff --git a/pokemodr/RulesUI.cpp b/pokemodr/RulesUI.cpp index 7dcd004d..82ed6bb2 100644 --- a/pokemodr/RulesUI.cpp +++ b/pokemodr/RulesUI.cpp @@ -21,8 +21,10 @@ ///////////////////////////////////////////////////////////////////////////// #include -#include "../general/BugCatcher.h" -#include "../general/Exception.h" + +#include +#include + #include "RulesUI.h" RulesUI::RulesUI(Rules* r, QWidget* parent) : @@ -74,7 +76,7 @@ void RulesUI::setGui() varPokerusNum->setValue(rules_mod->getPokerusChance().getNum()); varPokerusDenom->setValue(rules_mod->getPokerusChance().getDenom()); varPokerusNum->setMaximum(rules_mod->getPokerusChance().getDenom()); - varPokerus->setText(QString::number(rules_mod->getPokerusChance(), 'g', 15)); + varPokerus->setText(QString::number(rules_mod->getPokerusChance(), 'g', DBL_PREC)); } void RulesUI::on_buttonApply_clicked() diff --git a/pokemodr/RulesUI.h b/pokemodr/RulesUI.h index c108a82a..bf2c043b 100644 --- a/pokemodr/RulesUI.h +++ b/pokemodr/RulesUI.h @@ -24,8 +24,11 @@ #define __POKEMODR_RULESUI__ #include -#include "../pokemod/Rules.h" + +#include + #include "ObjectUI.h" + #include "ui_rules.h" class RulesUI : public ObjectUI, private Ui::formRules diff --git a/pokemodr/SpeciesAbilityUI.cpp b/pokemodr/SpeciesAbilityUI.cpp index 88a6f1ad..b72d3200 100644 --- a/pokemodr/SpeciesAbilityUI.cpp +++ b/pokemodr/SpeciesAbilityUI.cpp @@ -21,13 +21,15 @@ ///////////////////////////////////////////////////////////////////////////// #include -#include #include -#include "../general/BugCatcher.h" -#include "../general/Exception.h" -#include "../pokemod/Ability.h" -#include "../pokemod/Pokemod.h" -#include "../pokemod/SpeciesAbility.h" + +#include +#include + +#include +#include +#include + #include "SpeciesAbilityUI.h" SpeciesAbilityUI::SpeciesAbilityUI(SpeciesAbility* s, QWidget* parent) : diff --git a/pokemodr/SpeciesAbilityUI.h b/pokemodr/SpeciesAbilityUI.h index bfb067cd..cc31ac54 100644 --- a/pokemodr/SpeciesAbilityUI.h +++ b/pokemodr/SpeciesAbilityUI.h @@ -24,8 +24,11 @@ #define __POKEMODR_SPECIESABILITYUI__ #include -#include "../pokemod/SpeciesAbility.h" + +#include + #include "ObjectUI.h" + #include "ui_speciesability.h" class SpeciesAbilityUI : public ObjectUI, private Ui::formSpeciesAbility diff --git a/pokemodr/SpeciesEvolutionUI.cpp b/pokemodr/SpeciesEvolutionUI.cpp index 0eb60163..9a034ecc 100644 --- a/pokemodr/SpeciesEvolutionUI.cpp +++ b/pokemodr/SpeciesEvolutionUI.cpp @@ -21,14 +21,16 @@ ///////////////////////////////////////////////////////////////////////////// #include -#include #include -#include "../general/BugCatcher.h" -#include "../general/Exception.h" -#include "../general/Ref.h" -#include "../pokemod/Pokemod.h" -#include "../pokemod/Species.h" -#include "../pokemod/SpeciesEvolution.h" + +#include +#include +#include + +#include +#include +#include + #include "SpeciesEvolutionUI.h" SpeciesEvolutionUI::SpeciesEvolutionUI(SpeciesEvolution* s, QWidget* parent) : diff --git a/pokemodr/SpeciesEvolutionUI.h b/pokemodr/SpeciesEvolutionUI.h index ca92e865..ee98673b 100644 --- a/pokemodr/SpeciesEvolutionUI.h +++ b/pokemodr/SpeciesEvolutionUI.h @@ -24,8 +24,11 @@ #define __POKEMODR_SPECIESEVOLUTIONUI__ #include -#include "../pokemod/SpeciesEvolution.h" + +#include + #include "ObjectUI.h" + #include "ui_speciesevolution.h" class SpeciesEvolutionUI : public ObjectUI, private Ui::formSpeciesEvolution diff --git a/pokemodr/SpeciesItemUI.cpp b/pokemodr/SpeciesItemUI.cpp index c4d140e8..84264e85 100644 --- a/pokemodr/SpeciesItemUI.cpp +++ b/pokemodr/SpeciesItemUI.cpp @@ -21,13 +21,15 @@ ///////////////////////////////////////////////////////////////////////////// #include -#include #include -#include "../general/BugCatcher.h" -#include "../general/Exception.h" -#include "../pokemod/Item.h" -#include "../pokemod/Pokemod.h" -#include "../pokemod/SpeciesItem.h" + +#include +#include + +#include +#include +#include + #include "SpeciesItemUI.h" SpeciesItemUI::SpeciesItemUI(SpeciesItem* s, QWidget* parent) : diff --git a/pokemodr/SpeciesItemUI.h b/pokemodr/SpeciesItemUI.h index 527fb592..2e9c19b7 100644 --- a/pokemodr/SpeciesItemUI.h +++ b/pokemodr/SpeciesItemUI.h @@ -24,8 +24,11 @@ #define __POKEMODR_SPECIESITEMUI__ #include -#include "../pokemod/SpeciesItem.h" + +#include + #include "ObjectUI.h" + #include "ui_speciesitem.h" class SpeciesItemUI : public ObjectUI, private Ui::formSpeciesItem diff --git a/pokemodr/SpeciesMoveUI.cpp b/pokemodr/SpeciesMoveUI.cpp index 9922d0d9..a529ec01 100644 --- a/pokemodr/SpeciesMoveUI.cpp +++ b/pokemodr/SpeciesMoveUI.cpp @@ -21,13 +21,15 @@ ///////////////////////////////////////////////////////////////////////////// #include -#include #include -#include "../general/BugCatcher.h" -#include "../general/Exception.h" -#include "../pokemod/Move.h" -#include "../pokemod/Pokemod.h" -#include "../pokemod/SpeciesMove.h" + +#include +#include + +#include +#include +#include + #include "SpeciesMoveUI.h" SpeciesMoveUI::SpeciesMoveUI(SpeciesMove* s, QWidget* parent) : diff --git a/pokemodr/SpeciesMoveUI.h b/pokemodr/SpeciesMoveUI.h index dcf62eed..7e3c6f93 100644 --- a/pokemodr/SpeciesMoveUI.h +++ b/pokemodr/SpeciesMoveUI.h @@ -24,8 +24,11 @@ #define __POKEMODR_SPECIESMOVEUI__ #include -#include "../pokemod/SpeciesMove.h" + +#include + #include "ObjectUI.h" + #include "ui_speciesmove.h" class SpeciesMoveUI : public ObjectUI, private Ui::formSpeciesMove diff --git a/pokemodr/SpeciesUI.cpp b/pokemodr/SpeciesUI.cpp new file mode 100644 index 00000000..3a5a914d --- /dev/null +++ b/pokemodr/SpeciesUI.cpp @@ -0,0 +1,446 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: pokegen/SpeciesUI.cpp +// Purpose: Species UI form handling +// Author: Ben Boeckel +// Modified by: Ben Boeckel +// Created: Thu Feb 21 12:55:08 2008 +// Copyright: ©2007-2008 Ben Boeckel and Nerdy Productions +// Licence: +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this program. If not, see . +///////////////////////////////////////////////////////////////////////////// + +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "SpeciesUI.h" + +SpeciesUI::SpeciesUI(Species* s, QWidget* parent) : + ObjectUI(parent), + species(s), + species_mod(new Species(s->getPokemod(), *s, s->getId())) +{ + setupUi(this); + QMetaObject::connectSlotsByName(this); + setObjects(species, species_mod); + const bool isSplit = species->getPokemod()->getRules()->getSpecialSplit(); + varBaseStat->addItems((isSplit ? StatGSCStr : StatRBYStr).mid(0, isSplit ? ST_End_GSC : ST_End_RBY)); + varEVStat->addItems((isSplit ? StatGSCStr : StatRBYStr).mid(0, isSplit ? ST_End_GSC : ST_End_RBY)); + varGrowth->addItems(Species::StyleStr); + if (species->getPokemod()->getRules()->getGenderAllowed()) + { + if (species->getPokemod()->getRules()->getBreedingAllowed()) + { + for (int i = 0; i < species->getPokemod()->getSpeciesCount(); ++i) + { + const Species* s = species->getPokemod()->getSpecies(i); + varEggSpecies->addItem(s->getName()); + varEggSpecies->setItemData(i, s->getId()); + } + for (int i = 0; i < species->getPokemod()->getEggGroupCount(); ++i) + { + const EggGroup* e = species->getPokemod()->getEggGroup(i); + QListWidgetItem* lwi = new QListWidgetItem(e->getName(), varEggGroups); + lwi->setData(Qt::UserRole, e->getId()); + } + } + else + { + boxEggSpecies->setEnabled(false); + varEggSteps->setEnabled(false); + varNidoranGroup->setEnabled(false); + boxEggGroups->setEnabled(false); + } + } + else + { + tabGenetics->setEnabled(false); + boxFemaleSprites->setEnabled(false); + } +} + +// KToolbar SpeciesUI::getToolbar(QWidget* parent) +// { +// +// } + +void SpeciesUI::setGui() +{ + varName->setText(species_mod->getName()); + varBaseStatValue->setValue(species_mod->getBaseStat(varBaseStat->currentIndex())); + varEffortValue->setValue(species_mod->getEffortValue(varBaseStat->currentIndex())); + varGrowth->setCurrentIndex(species_mod->getGrowth()); + varExperienceValue->setValue(species_mod->getExperienceValue()); + varCatchValue->setValue(species_mod->getCatchValue()); + varRunChanceNum->setValue(species_mod->getRunChance().getNum()); + varRunChanceDenom->setValue(species_mod->getRunChance().getDenom()); + varRunChanceNum->setMaximum(species_mod->getRunChance().getDenom()); + varRunChance->setText(QString::number(species_mod->getRunChance(), 'g', DBL_PREC)); + varItemChanceNum->setValue(species_mod->getItemChance().getNum()); + varItemChanceDenom->setValue(species_mod->getItemChance().getDenom()); + varItemChanceNum->setMaximum(species_mod->getItemChance().getDenom()); + varItemChance->setText(QString::number(species_mod->getItemChance(), 'g', DBL_PREC)); + varPokedexNumber->setValue(species_mod->getPokedexNumber()); + varWeight->setValue(species_mod->getWeight()); + varHeightFeet->setValue(species_mod->getHeightFeet()); + varHeightInches->setValue(species_mod->getHeightInches()); + varPokedexEntry->setText(species_mod->getPokedexEntry()); + try + { + varMaleFront->setIcon(ImageCache::open(species_mod->getFrontMaleSprite())); + } + catch (OpenException& e) + { + BugCatcher::report(e); + } + try + { + varMaleBack->setIcon(ImageCache::open(species_mod->getBackMaleSprite())); + } + catch (OpenException& e) + { + BugCatcher::report(e); + } + if (species->getPokemod()->getRules()->getGenderAllowed()) + { + try + { + varFemaleFront->setIcon(ImageCache::open(species_mod->getFrontFemaleSprite())); + } + catch (OpenException& e) + { + BugCatcher::report(e); + } + try + { + varFemaleBack->setIcon(ImageCache::open(species_mod->getBackFemaleSprite())); + } + catch (OpenException& e) + { + BugCatcher::report(e); + } + } + try + { + varList->setIcon(ImageCache::open(species_mod->getListSprite())); + } + catch (OpenException& e) + { + BugCatcher::report(e); + } + boxGenderChance->setChecked(species_mod->getGenderFactor().getNum() == -1); + varGenderChanceNum->setValue(species_mod->getGenderFactor().getNum()); + varGenderChanceDenom->setValue(species_mod->getGenderFactor().getDenom()); + varGenderChanceNum->setMaximum(species_mod->getGenderFactor().getDenom()); + varGenderChance->setText(QString::number(species_mod->getGenderFactor(), 'g', DBL_PREC)); + varEggSpecies->setCurrentIndex(varEggSpecies->findData(species_mod->getEggSpecies())); + varEggSteps->setValue(species_mod->getEggSteps()); + varNidoranGroup->setValue(species_mod->getNidoranGroup()); + for (int i = 0; i < varTypes->count(); ++i) + { + QListWidgetItem* lwi = varTypes->item(i); + lwi->setSelected(species_mod->getItem(lwi->data(Qt::UserRole).toInt())); + } + for (int i = 0; i < varEggGroups->count(); ++i) + { + QListWidgetItem* lwi = varEggGroups->item(i); + lwi->setSelected(species_mod->getItem(lwi->data(Qt::UserRole).toInt())); + } +} + +void SpeciesUI::on_buttonApply_clicked() +{ + *species = *species_mod; + emit(setChanged(false)); +} + +void SpeciesUI::on_buttonDiscard_clicked() +{ + *species_mod = *species; + emit(setChanged(false)); + setGui(); +} + +void SpeciesUI::on_varName_textChanged(const QString & n) +{ + species_mod->setName(n); + emit(setChanged(true)); +} + +void SpeciesUI::on_varBaseStat_currentIndexChanged() +{ + emit(setChanged(true)); + setGui(); +} + +void SpeciesUI::on_varBaseStatValue_valueChanged(const int b) +{ + try + { + species_mod->setBaseStat(varBaseStat->currentIndex(), b); + emit(setChanged(true)); + } + catch (BoundsException& e) + { + BugCatcher::report(e); + setGui(); + } +} + +void SpeciesUI::on_varEVStat_currentIndexChanged() +{ + emit(setChanged(true)); + setGui(); +} + +void SpeciesUI::on_varEffortValue_valueChanged(const int e) +{ + try + { + species_mod->setEffortValue(varEVStat->currentIndex(), e); + emit(setChanged(true)); + } + catch (BoundsException& e) + { + BugCatcher::report(e); + setGui(); + } +} + +void SpeciesUI::on_varGrowth_currentIndexChanged(const int g) +{ + try + { + species_mod->setGrowth(g); + emit(setChanged(true)); + } + catch (BoundsException& e) + { + BugCatcher::report(e); + setGui(); + } +} + +void SpeciesUI::on_varExperienceValue_valueChanged(const int e) +{ + species_mod->setExperienceValue(e); + emit(setChanged(true)); +} + +void SpeciesUI::on_varCatchValue_valueChanged(const int c) +{ + species_mod->setCatchValue(c); + emit(setChanged(true)); +} + +void SpeciesUI::on_varRunChanceNum_valueChanged(const int r) +{ + try + { + species_mod->setRunChanceNum(r); + emit(setChanged(true)); + } + catch (Exception& e) + { + BugCatcher::report(e); + setGui(); + } +} + +void SpeciesUI::on_varRunChanceDenom_valueChanged(const int r) +{ + try + { + species_mod->setRunChanceDenom(r); + emit(setChanged(true)); + } + catch (Exception& e) + { + BugCatcher::report(e); + setGui(); + } +} + +void SpeciesUI::on_varItemChanceNum_valueChanged(const int i) +{ + try + { + species_mod->setItemChanceNum(i); + emit(setChanged(true)); + } + catch (Exception& e) + { + BugCatcher::report(e); + setGui(); + } +} + +void SpeciesUI::on_varItemChanceDenom_valueChanged(const int i) +{ + try + { + species_mod->setItemChanceDenom(i); + emit(setChanged(true)); + } + catch (Exception& e) + { + BugCatcher::report(e); + setGui(); + } +} + + +void SpeciesUI::on_varPokedexNumber_valueChanged(const int p) +{ + species_mod->setPokedexNumber(p); + emit(setChanged(true)); +} + +void SpeciesUI::on_varWeight_valueChanged(const int w) +{ + species_mod->setWeight(w); + emit(setChanged(true)); +} + +void SpeciesUI::on_varHeightFeet_valueChanged(const int h) +{ + species_mod->setHeightFeet(h); + emit(setChanged(true)); +} + +void SpeciesUI::on_varHeightInches_valueChanged(const int h) +{ + try + { + species_mod->setHeightInches(h); + emit(setChanged(true)); + } + catch (BoundsException& e) + { + BugCatcher::report(e); + setGui(); + } +} + +void SpeciesUI::on_varPokedexEntry_textChanged() +{ + species_mod->setPokedexEntry(varPokedexEntry->toPlainText()); + emit(setChanged(true)); +} + +void SpeciesUI::on_boxGenderChance_toggled(const bool g) +{ + species_mod->setGenderFactor(g ? 1 : -1, 1); + emit(setChanged(true)); + setGui(); +} + +void SpeciesUI::on_varGenderChanceNum_valueChanged(const int g) +{ + try + { + species_mod->setGenderFactorNum(g); + emit(setChanged(true)); + } + catch (Exception& e) + { + BugCatcher::report(e); + setGui(); + } +} + +void SpeciesUI::on_varGenderChanceDenom_valueChanged(const int g) +{ + try + { + species_mod->setGenderFactorDenom(g); + emit(setChanged(true)); + } + catch (Exception& e) + { + BugCatcher::report(e); + setGui(); + } +} + +void SpeciesUI::on_varEggSpecies_currentIndexChanged(const int e) +{ + try + { + species_mod->setEggSpecies(varEggSpecies->itemData(e).toInt()); + emit(setChanged(true)); + } + catch (BoundsException& e) + { + BugCatcher::report(e); + setGui(); + } +} + +void SpeciesUI::on_varEggSteps_valueChanged(const int e) +{ + species_mod->setEggSteps(e); + emit(setChanged(true)); +} + +void SpeciesUI::on_varNidoranGroup_valueChanged(const int n) +{ + species_mod->setNidoranGroup(n); + emit(setChanged(true)); +} + +void SpeciesUI::on_varTypes_itemSelectionChanged() +{ + try + { + for (int i = 0; i < varTypes->count(); ++i) + { + const QListWidgetItem* lwi = varTypes->item(i); + species_mod->setType(lwi->data(Qt::UserRole).toInt(), lwi->isSelected()); + } + emit(setChanged(true)); + } + catch (BoundsException& e) + { + BugCatcher::report(e); + setGui(); + } +} + +void SpeciesUI::on_varEggGroups_itemSelectionChanged() +{ + try + { + for (int i = 0; i < varEggGroups->count(); ++i) + { + const QListWidgetItem* lwi = varEggGroups->item(i); + species_mod->setEggGroup(lwi->data(Qt::UserRole).toInt(), lwi->isSelected()); + } + emit(setChanged(true)); + } + catch (BoundsException& e) + { + BugCatcher::report(e); + setGui(); + } +} diff --git a/pokemodr/SpeciesUI.h b/pokemodr/SpeciesUI.h new file mode 100644 index 00000000..b00c48da --- /dev/null +++ b/pokemodr/SpeciesUI.h @@ -0,0 +1,87 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: pokegen/SpeciesUI.h +// Purpose: Species UI form handling +// Author: Ben Boeckel +// Modified by: Ben Boeckel +// Created: Thu Feb 21 12:33:04 2008 +// Copyright: ©2007-2008 Ben Boeckel and Nerdy Productions +// Licence: +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this program. If not, see . +///////////////////////////////////////////////////////////////////////////// + +#ifndef __POKEMODR_SPECIESUI__ +#define __POKEMODR_SPECIESUI__ + +#include + +#include + +#include + +#include "ObjectUI.h" +#include "ui_species.h" + +class SpeciesUI : public ObjectUI, private Ui::formSpecies +{ + Q_OBJECT + + public: + SpeciesUI(Species* s, QWidget* parent); + ~SpeciesUI() + { + delete species_mod; + } + +// KToolbar getToolbar(QWidget* parent); + public slots: + void on_buttonApply_clicked(); + void on_buttonDiscard_clicked(); + void on_varName_textChanged(const QString& n); + void on_varBaseStat_currentIndexChanged(); + void on_varBaseStatValue_valueChanged(const int b); + void on_varEVStat_currentIndexChanged(); + void on_varEffortValue_valueChanged(const int e); + void on_varGrowth_currentIndexChanged(const int g); + void on_varExperienceValue_valueChanged(const int e); + void on_varCatchValue_valueChanged(const int c); + void on_varRunChanceNum_valueChanged(const int r); + void on_varRunChanceDenom_valueChanged(const int r); + void on_varItemChanceNum_valueChanged(const int i); + void on_varItemChanceDenom_valueChanged(const int i); + void on_varPokedexNumber_valueChanged(const int p); + void on_varWeight_valueChanged(const int w); + void on_varHeightFeet_valueChanged(const int h); + void on_varHeightInches_valueChanged(const int h); + void on_varPokedexEntry_textChanged(); + void on_varFrontMaleSprite_pressed(); + void on_varBackMaleSprite_pressed(); + void on_varFrontFemaleSprite_pressed(); + void on_varBackFemaleSprite_pressed(); + void on_varListSprite_pressed(); + void on_boxGenderChance_toggled(const bool g); + void on_varGenderChanceNum_valueChanged(const int g); + void on_varGenderChanceDenom_valueChanged(const int g); + void on_varEggSpecies_currentIndexChanged(const int e); + void on_varEggSteps_valueChanged(const int e); + void on_varNidoranGroup_valueChanged(const int n); + void on_varTypes_itemSelectionChanged(); + void on_varEggGroups_itemSelectionChanged(); + private: + void setGui(); + + Species* species; + Species* species_mod; +}; + +#endif diff --git a/pokemodr/StoreUI.cpp b/pokemodr/StoreUI.cpp index ae92f24e..c6166324 100644 --- a/pokemodr/StoreUI.cpp +++ b/pokemodr/StoreUI.cpp @@ -23,11 +23,14 @@ #include #include #include -#include "../general/BugCatcher.h" -#include "../general/Exception.h" -#include "../pokemod/Item.h" -#include "../pokemod/Pokemod.h" -#include "../pokemod/Store.h" + +#include +#include + +#include +#include +#include + #include "StoreUI.h" StoreUI::StoreUI(Store* s, QWidget* parent) : diff --git a/pokemodr/StoreUI.h b/pokemodr/StoreUI.h index bb324712..bb11f5a5 100644 --- a/pokemodr/StoreUI.h +++ b/pokemodr/StoreUI.h @@ -24,9 +24,13 @@ #define __POKEMODR_STOREUI__ #include + #include -#include "../pokemod/Store.h" + +#include + #include "ObjectUI.h" + #include "ui_store.h" class StoreUI : public ObjectUI, private Ui::formStore diff --git a/pokemodr/TileDelegate.cpp b/pokemodr/TileDelegate.cpp index 57660976..d86bcfb4 100644 --- a/pokemodr/TileDelegate.cpp +++ b/pokemodr/TileDelegate.cpp @@ -21,9 +21,12 @@ ///////////////////////////////////////////////////////////////////////////// #include + #include "../general/ImageCache.h" -#include "../pokemod/Pokemod.h" -#include "../pokemod/Tile.h" + +#include +#include + #include "ObjectUI.h" #include "MapUI.h" #include "TileDelegate.h" diff --git a/pokemodr/TileUI.cpp b/pokemodr/TileUI.cpp index d95a4d22..ba217703 100644 --- a/pokemodr/TileUI.cpp +++ b/pokemodr/TileUI.cpp @@ -24,11 +24,14 @@ #include #include #include -#include "../general/BugCatcher.h" -#include "../general/Exception.h" -#include "../general/ImageCache.h" -#include "../general/Ref.h" -#include "../pokemod/Pokemod.h" + +#include +#include +#include +#include + +#include + #include "ImageDialog.h" #include "TileUI.h" @@ -77,7 +80,7 @@ void TileUI::setGui() varWildNum->setValue(tile_mod->getWildChance().getNum()); varWildDenom->setValue(tile_mod->getWildChance().getDenom()); varWildNum->setMaximum(tile_mod->getWildChance().getDenom()); - varWild->setText(QString::number(tile_mod->getWildChance(), 'g', 15)); + varWild->setText(QString::number(tile_mod->getWildChance(), 'g', DBL_PREC)); boxHMs->setChecked((tile_mod->getHMType() == -1) ? Qt::Unchecked : Qt::Checked); varHMType->setCurrentIndex(tile_mod->getHMType()); varHMUnder->setCurrentIndex(varHMUnder->findData(tile_mod->getUnder())); @@ -128,7 +131,6 @@ void TileUI::on_varWildNum_valueChanged(const int m) try { tile_mod->setWildChanceNum(m); - varWild->setText(QString::number(tile_mod->getWildChance(), 'g', 15)); emit(setChanged(true)); } catch (BoundsException& e) @@ -143,8 +145,6 @@ void TileUI::on_varWildDenom_valueChanged(const int m) try { tile_mod->setWildChanceDenom(m); - varWildNum->setMaximum(m); - varWild->setText(QString::number(tile_mod->getWildChance(), 'g', 15)); emit(setChanged(true)); } catch (BoundsException& e) diff --git a/pokemodr/TileUI.h b/pokemodr/TileUI.h index 1c428d36..eb758b54 100644 --- a/pokemodr/TileUI.h +++ b/pokemodr/TileUI.h @@ -24,10 +24,14 @@ #define __POKEMODR_TILEUI__ #include + #include #include -#include "../pokemod/Tile.h" + +#include + #include "ObjectUI.h" + #include "ui_tile.h" class TileUI : public ObjectUI, private Ui::formTile diff --git a/pokemodr/TilemapModel.cpp b/pokemodr/TilemapModel.cpp index f21c6371..5312fb21 100644 --- a/pokemodr/TilemapModel.cpp +++ b/pokemodr/TilemapModel.cpp @@ -21,8 +21,11 @@ ///////////////////////////////////////////////////////////////////////////// #include -#include "../general/ImageCache.h" -#include "../pokemod/Tile.h" + +#include + +#include + #include "ObjectUI.h" #include "MapUI.h" #include "TilemapModel.h" diff --git a/pokemodr/TilemapModel.h b/pokemodr/TilemapModel.h index 59bd441f..5a570c6d 100644 --- a/pokemodr/TilemapModel.h +++ b/pokemodr/TilemapModel.h @@ -26,8 +26,10 @@ #include #include #include -#include "../general/Matrix.h" -#include "../pokemod/Pokemod.h" + +#include + +#include class TilemapModel : public QAbstractTableModel { diff --git a/pokemodr/TimeUI.cpp b/pokemodr/TimeUI.cpp index 68e9d628..67347f04 100644 --- a/pokemodr/TimeUI.cpp +++ b/pokemodr/TimeUI.cpp @@ -21,8 +21,10 @@ ///////////////////////////////////////////////////////////////////////////// #include -#include "../general/BugCatcher.h" -#include "../general/Exception.h" + +#include +#include + #include "TimeUI.h" TimeUI::TimeUI(Time* t, QWidget* parent) : diff --git a/pokemodr/TimeUI.h b/pokemodr/TimeUI.h index d8cb823d..404519e8 100644 --- a/pokemodr/TimeUI.h +++ b/pokemodr/TimeUI.h @@ -24,10 +24,14 @@ #define __POKEMODR_TIMEUI__ #include + #include #include -#include "../pokemod/Time.h" + +#include + #include "ObjectUI.h" + #include "ui_time.h" class TimeUI : public ObjectUI, private Ui::formTime diff --git a/pokemodr/TypeUI.cpp b/pokemodr/TypeUI.cpp index 327b317b..d5f31fba 100644 --- a/pokemodr/TypeUI.cpp +++ b/pokemodr/TypeUI.cpp @@ -22,8 +22,10 @@ #include #include -#include "../general/BugCatcher.h" -#include "../general/Exception.h" + +#include +#include + #include "TypeUI.h" TypeUI::TypeUI(Type* t, QWidget* parent) : @@ -47,7 +49,7 @@ void TypeUI::setGui() varSTABNum->setValue(type_mod->getStab().getNum()); varSTABDenom->setValue(type_mod->getStab().getDenom()); varSTABNum->setMaximum(type_mod->getStab().getDenom()); - varSTAB->setText(QString::number(type_mod->getStab(), 'g', 15)); + varSTAB->setText(QString::number(type_mod->getStab(), 'g', DBL_PREC)); } void TypeUI::on_buttonApply_clicked() diff --git a/pokemodr/TypeUI.h b/pokemodr/TypeUI.h index 221d9121..d77f6cb7 100644 --- a/pokemodr/TypeUI.h +++ b/pokemodr/TypeUI.h @@ -24,9 +24,13 @@ #define __POKEMODR_TYPEUI__ #include + #include -#include "../pokemod/Type.h" + +#include + #include "ObjectUI.h" + #include "ui_type.h" class TypeUI : public ObjectUI, private Ui::formType diff --git a/pokemodr/gui/badge.ui b/pokemodr/gui/badge.ui index e97605f7..0a4d9bcb 100644 --- a/pokemodr/gui/badge.ui +++ b/pokemodr/gui/badge.ui @@ -5,8 +5,8 @@ 0 0 - 254 - 742 + 244 + 722 @@ -84,10 +84,63 @@ - + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + - + + + Qt::Horizontal + + + + 40 + 20 + + + diff --git a/pokemodr/gui/move.ui b/pokemodr/gui/move.ui index 1aff7016..af6c2835 100644 --- a/pokemodr/gui/move.ui +++ b/pokemodr/gui/move.ui @@ -5,8 +5,8 @@ 0 0 - 254 - 1146 + 244 + 1126 diff --git a/pokemodr/gui/species.ui b/pokemodr/gui/species.ui index 97779cd1..c3de93a5 100644 --- a/pokemodr/gui/species.ui +++ b/pokemodr/gui/species.ui @@ -7,7 +7,7 @@ 0 0 254 - 2097 + 715 @@ -50,486 +50,714 @@ - - - Name - - - - - - Name of the species - - - true - - - - - - - - - - Base Stats - - - - - - Stat - - - - - - - Base value for the stat - - - - - - 0 - - - - - - - - - - Effort Values - - - - - - Stat - - - QComboBox::NoInsert - - - QComboBox::AdjustToContents - - - - - - - Number of effort value points given when defeated for given stat - - - 0 - - - - - - - - - - Growth - - - - - - Level growth pattern - - - false - - - QComboBox::NoInsert - - - QComboBox::AdjustToContents - - - false - - - - - - - - - - Experience Value - - - - - - Base value for experience points earned - - - 0 - - - - - - - - - - Catch Value - - - - - - How easy it is to catch the species - - - 0 - - - 255 - - - - - - - - - - Run Chance - - - - - - Chance the species runs from a wild battle - - - true - - - - - - - - - - Numerator - - - 0 - - - - - - - - - - Denominator - - - 1 - - - - - - - - - - Item Chance - - - - - - Chance the species is carrying an item in a wild battle - - - true - - - - - - - - - - Numerator - - - 0 - - - - - - - - - - Denominator - - - 1 - - - - - - - - - - PokéDex Information + + + 0 - - - - - The PokéDex number of the species - - - Number - - - 0 - - - - - - - The weight of the species - - - Weight - - - 0 - - - - - - - Height - - - - - - Height of the species - - - Feet - - - 0 - - - - - - - - - - Height of the species - - - Inches - - - 0 - - - 11 - - - - - - - - - - - - - Entry - - - - - - The information on the species given in the PokéDex - - - - - - - - - - - - - Gender Chance - - - - - - Chance of getting a female version of the species (negative is genderless) - - - true - - - - - - - - - - Numerator - - - -1 - - - - - - - - - - Denominator - - - 1 - - - - - - - - - - Egg - - - - - - Species - - - - - - The species that hatches from an egg from this species - - - QComboBox::NoInsert - - - QComboBox::AdjustToContents - - - - - - - - - - The number of steps it takes to hatch the egg of the species - - - Steps - - - 0 - - - - - - - - - - Nidoran Group - - - - - - Nidoran group the species belongs to - - - - - - 0 - - - - - - - - - - Types - - - - - - The types of the species - - - QAbstractItemView::ExtendedSelection - - - - - - - - - - Egg Groups - - - - - - The egg groups the species belongs to - - - QAbstractItemView::ExtendedSelection - - - - + + + General + + + + + + Name + + + + + + Name of the species + + + true + + + + + + + + + + Types + + + + + + The types of the species + + + QAbstractItemView::ExtendedSelection + + + + + + + + + + Run Chance + + + + + + Chance the species runs from a wild battle + + + true + + + + + + + + + + Numerator + + + 0 + + + + + + + + + + Denominator + + + 1 + + + + + + + + + + Item Chance + + + + + + Chance the species is carrying an item in a wild battle + + + true + + + + + + + + + + Numerator + + + 0 + + + + + + + + + + Denominator + + + 1 + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Stats + + + + + + Base Stats + + + + + + Stat + + + + + + + Base value for the stat + + + + + + 0 + + + + + + + + + + Effort Values + + + + + + Stat + + + QComboBox::NoInsert + + + QComboBox::AdjustToContents + + + + + + + Number of effort value points given when defeated for given stat + + + 0 + + + + + + + + + + Growth + + + + + + Level growth pattern + + + false + + + QComboBox::NoInsert + + + QComboBox::AdjustToContents + + + false + + + + + + + + + + Experience Value + + + + + + Base value for experience points earned + + + 0 + + + + + + + + + + Catch Value + + + + + + How easy it is to catch the species + + + 0 + + + 255 + + + + + + + + + + Qt::Vertical + + + + 20 + 16 + + + + + + + + + PokéDex + + + + + + The PokéDex number of the species + + + Number + + + 0 + + + + + + + The weight of the species + + + Weight + + + 0 + + + + + + + Height + + + + + + Height of the species + + + Feet + + + 0 + + + + + + + + + + Height of the species + + + Inches + + + 0 + + + 11 + + + + + + + + + + + + + Entry + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Genetics + + + + + + Gender Chance + + + true + + + false + + + + + + Chance of getting a female version of the species (negative is genderless) + + + true + + + + + + + + + + Numerator + + + -1 + + + + + + + + + + Denominator + + + 1 + + + + + + + + + + Egg Species + + + + + + The species that hatches from an egg from this species + + + QComboBox::NoInsert + + + QComboBox::AdjustToContents + + + + + + + + + + The number of steps it takes to hatch the egg of the species + + + Steps + + + 0 + + + + + + + Nidoran group the species belongs to + + + Nidoran Group + + + 0 + + + + + + + Egg Groups + + + + + + The egg groups the species belongs to + + + QAbstractItemView::ExtendedSelection + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Sprites + + + + + + Male + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + Female + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + List + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + @@ -539,8 +767,8 @@ - 20 - 40 + 236 + 16 @@ -554,6 +782,11 @@ QComboBox
kcombobox.h
+ + KIconButton + QPushButton +
kicondialog.h
+
KIntNumInput QWidget -- cgit