diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2008-02-20 16:35:26 +0000 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2008-02-20 16:35:26 +0000 |
| commit | 9461b5df0fbd27db2688820892494fcc2af477a7 (patch) | |
| tree | 071e1d2b21ea84d39e6796c60114c8588e94503e | |
| parent | 6551bb8f486ed2cc83c4d35e3c59a21f2f27e0d4 (diff) | |
[ADD] SpeciesUI.{h, cpp}
[FIX] Missing semicolon in general/Hat.h
[FIX] Shortened method names in Species
[FIX] Cleaned up some includes in UI logic
[FIX] NatureUI now gets the curStat right from varStat
[FIX] NatureUI sets varStat in ctor rather than setGui
[FIX] .pro files now controled by KDevelop
[FIX] Minor UI form fixes
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@66 6ecfd1a5-f3ed-3746-8530-beee90d26b22
| -rw-r--r-- | Changelog | 14 | ||||
| -rw-r--r-- | general/Hat.h | 2 | ||||
| -rw-r--r-- | pokemod/Species.cpp | 8 | ||||
| -rw-r--r-- | pokemod/Species.h | 8 | ||||
| -rw-r--r-- | pokemod/pokemod.pro | 14 | ||||
| -rw-r--r-- | pokemodr/CoinListObjectUI.h | 1 | ||||
| -rw-r--r-- | pokemodr/NatureUI.cpp | 38 | ||||
| -rw-r--r-- | pokemodr/NatureUI.h | 3 | ||||
| -rw-r--r-- | pokemodr/SpeciesAbilityUI.h | 1 | ||||
| -rw-r--r-- | pokemodr/SpeciesEvolutionUI.h | 1 | ||||
| -rw-r--r-- | pokemodr/SpeciesItemUI.h | 1 | ||||
| -rw-r--r-- | pokemodr/SpeciesMoveUI.h | 1 | ||||
| -rw-r--r-- | pokemodr/TODO | 4 | ||||
| -rw-r--r-- | pokemodr/gui/species.ui | 8 | ||||
| -rw-r--r-- | pokemodr/gui/speciesitem.ui | 4 | ||||
| -rw-r--r-- | pokemodr/gui/typechart.ui | 4 |
16 files changed, 49 insertions, 63 deletions
@@ -1,4 +1,18 @@ ----------------- +Rev: 66 +Date: 20 February 2008 +User: MathStuf +----------------- +[ADD] SpeciesUI.{h, cpp} +[FIX] Missing semicolon in general/Hat.h +[FIX] Shortened method names in Species +[FIX] Cleaned up some includes in UI logic +[FIX] NatureUI now gets the curStat right from varStat +[FIX] NatureUI sets varStat in ctor rather than setGui +[FIX] .pro files now controled by KDevelop +[FIX] Minor UI form fixes + +----------------- Rev: 65 Date: 19 February 2008 User: MathStuf diff --git a/general/Hat.h b/general/Hat.h index 7b526b6d..ac4acec0 100644 --- a/general/Hat.h +++ b/general/Hat.h @@ -34,7 +34,7 @@ template<class T> class Hat Hat() : totalWeight(1) { - std::srand(std::time(NULL)) + std::srand(std::time(NULL)); } T pick() const diff --git a/pokemod/Species.cpp b/pokemod/Species.cpp index 8e5db881..99a523d9 100644 --- a/pokemod/Species.cpp +++ b/pokemod/Species.cpp @@ -498,12 +498,12 @@ void Species::setRunChance(const int n, const int d) throw(Exception) runChance.set(n, d); } -void Species::setRunChanceNumerator(const int n) throw(Exception) +void Species::setRunChanceNum(const int n) throw(Exception) { runChance.setNum(n); } -void Species::setRunChanceDenominator(const int d) throw(Exception) +void Species::setRunChanceDenom(const int d) throw(Exception) { runChance.setDenom(d); } @@ -513,12 +513,12 @@ void Species::setItemChance(const int n, const int d) throw(Exception) itemChance.set(n, d); } -void Species::setItemChanceNumerator(const int n) throw(Exception) +void Species::setItemChanceNum(const int n) throw(Exception) { itemChance.setNum(n); } -void Species::setItemChanceDenominator(const int d) throw(Exception) +void Species::setItemChanceDenom(const int d) throw(Exception) { itemChance.setDenom(d); } diff --git a/pokemod/Species.h b/pokemod/Species.h index 48d7f0f7..a2791299 100644 --- a/pokemod/Species.h +++ b/pokemod/Species.h @@ -66,11 +66,11 @@ class Species : public Object void setExperienceValue(const int e); void setCatchValue(const unsigned char c); void setRunChance(const int n, const int d) throw(Exception); - void setRunChanceNumerator(const int n) throw(Exception); - void setRunChanceDenominator(const int d) throw(Exception); + void setRunChanceNum(const int n) throw(Exception); + void setRunChanceDenom(const int d) throw(Exception); void setItemChance(const int n, const int d) throw(Exception); - void setItemChanceNumerator(const int n) throw(Exception); - void setItemChanceDenominator(const int d) throw(Exception); + void setItemChanceNum(const int n) throw(Exception); + void setItemChanceDenom(const int d) throw(Exception); void setPokedexNumber(const int p); void setWeight(const int w); void setHeightFeet(const int f); diff --git a/pokemod/pokemod.pro b/pokemod/pokemod.pro index 3e40ad85..a726c5f8 100644 --- a/pokemod/pokemod.pro +++ b/pokemod/pokemod.pro @@ -1,14 +1,14 @@ OBJECTS_DIR = .obj -DESTDIR = ../../lib -LANGUAGE = C++ -TEMPLATE = lib -LIBS += -L../../lib -lgeneral +DESTDIR = ../../lib +LANGUAGE = C++ +TEMPLATE = lib +LIBS += -L../../lib -lgeneral win32 { CONFIG += exceptions } -CONFIG += qt warn_on dll +CONFIG += qt warn_on dll -SOURCES += *.cpp -HEADERS += *.h +SOURCES += *.cpp +HEADERS += *.h diff --git a/pokemodr/CoinListObjectUI.h b/pokemodr/CoinListObjectUI.h index 3ab8150e..69890868 100644 --- a/pokemodr/CoinListObjectUI.h +++ b/pokemodr/CoinListObjectUI.h @@ -24,7 +24,6 @@ #define __POKEMODR_COINLISTOBJECTUI__ #include <ktoolbar.h> -#include <QString> #include "../pokemod/CoinListObject.h" #include "ObjectUI.h" #include "ui_coinlistobject.h" diff --git a/pokemodr/NatureUI.cpp b/pokemodr/NatureUI.cpp index d98cb990..946a7e48 100644 --- a/pokemodr/NatureUI.cpp +++ b/pokemodr/NatureUI.cpp @@ -30,13 +30,14 @@ NatureUI::NatureUI(Nature* n, QWidget* parent) : ObjectUI(parent), - curStat(ST_HP), nature(n), nature_mod(new Nature(n->getPokemod(), *n, n->getId())) { setupUi(this); QMetaObject::connectSlotsByName(this); setObjects(nature, nature_mod); + const bool isSplit = nature->getPokemod()->getRules()->getSpecialSplit(); + varStat->addItems((isSplit ? StatRBYStr : StatGSCStr).mid(0, isSplit ? ST_End_RBY : ST_End_GSC)); setGui(); } @@ -46,16 +47,11 @@ NatureUI::NatureUI(Nature* n, QWidget* parent) : void NatureUI::setGui() { - const bool isSplit = nature->getPokemod()->getRules()->getSpecialSplit(); - const QStringList& statList = isSplit ? StatRBYStr : StatGSCStr; varName->setText(nature_mod->getName()); - varStat->clear(); - varStat->addItems(statList.mid(0, isSplit ? ST_End_RBY : ST_End_GSC)); - varStat->setCurrentItem(statList[curStat]); - varStatMultiplierNum->setValue(nature_mod->getStat(curStat).getNum()); - varStatMultiplierDenom->setValue(nature_mod->getStat(curStat).getDenom()); - varStatMultiplierNum->setMaximum(nature_mod->getStat(curStat).getDenom()); - varStatMultiplier->setText(QString::number(nature_mod->getStat(curStat), 'g', 15)); + 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)); varWeight->setValue(nature_mod->getWeight()); } @@ -78,29 +74,11 @@ void NatureUI::on_varName_textChanged(const QString& n) emit(setChanged(true)); } -void NatureUI::on_varStat_currentIndexChanged(const QString& s) -{ - try - { - const QStringList& statList = nature->getPokemod()->getRules()->getSpecialSplit() ? StatRBYStr : StatGSCStr; - if (statList.contains(s)) - curStat = statList.indexOf(s); - else - throw(BoundsException("NatureUI", "stat")); - emit(setChanged(true)); - } - catch (BoundsException& e) - { - BugCatcher::report(e); - } - setGui(); -} - void NatureUI::on_varStatMultiplierNum_valueChanged(const int s) { try { - nature_mod->setStatNum(curStat, s); + nature_mod->setStatNum(varStat->currentIndex(), s); emit(setChanged(true)); } catch (Exception& e) @@ -114,7 +92,7 @@ void NatureUI::on_varStatMultiplierDenom_valueChanged(const int s) { try { - nature_mod->setStatDenom(curStat, s); + nature_mod->setStatDenom(varStat->currentIndex(), s); emit(setChanged(true)); } catch (Exception& e) diff --git a/pokemodr/NatureUI.h b/pokemodr/NatureUI.h index a8dfbe48..8f5c2f32 100644 --- a/pokemodr/NatureUI.h +++ b/pokemodr/NatureUI.h @@ -45,15 +45,12 @@ class NatureUI : public ObjectUI, private Ui::formNature void on_buttonApply_clicked(); void on_buttonDiscard_clicked(); void on_varName_textChanged(const QString& n); - void on_varStat_currentIndexChanged(const QString& s); void on_varStatMultiplierNum_valueChanged(const int s); void on_varStatMultiplierDenom_valueChanged(const int s); void on_varWeight_valueChanged(const int w); private: void setGui(); - unsigned curStat; - Nature* nature; Nature* nature_mod; }; diff --git a/pokemodr/SpeciesAbilityUI.h b/pokemodr/SpeciesAbilityUI.h index b9b6bb0f..bfb067cd 100644 --- a/pokemodr/SpeciesAbilityUI.h +++ b/pokemodr/SpeciesAbilityUI.h @@ -24,7 +24,6 @@ #define __POKEMODR_SPECIESABILITYUI__ #include <ktoolbar.h> -#include <QString> #include "../pokemod/SpeciesAbility.h" #include "ObjectUI.h" #include "ui_speciesability.h" diff --git a/pokemodr/SpeciesEvolutionUI.h b/pokemodr/SpeciesEvolutionUI.h index 196e8bdf..ca92e865 100644 --- a/pokemodr/SpeciesEvolutionUI.h +++ b/pokemodr/SpeciesEvolutionUI.h @@ -24,7 +24,6 @@ #define __POKEMODR_SPECIESEVOLUTIONUI__ #include <ktoolbar.h> -#include <QString> #include "../pokemod/SpeciesEvolution.h" #include "ObjectUI.h" #include "ui_speciesevolution.h" diff --git a/pokemodr/SpeciesItemUI.h b/pokemodr/SpeciesItemUI.h index 828dce37..527fb592 100644 --- a/pokemodr/SpeciesItemUI.h +++ b/pokemodr/SpeciesItemUI.h @@ -24,7 +24,6 @@ #define __POKEMODR_SPECIESITEMUI__ #include <ktoolbar.h> -#include <QString> #include "../pokemod/SpeciesItem.h" #include "ObjectUI.h" #include "ui_speciesitem.h" diff --git a/pokemodr/SpeciesMoveUI.h b/pokemodr/SpeciesMoveUI.h index fbd6f466..dcf62eed 100644 --- a/pokemodr/SpeciesMoveUI.h +++ b/pokemodr/SpeciesMoveUI.h @@ -24,7 +24,6 @@ #define __POKEMODR_SPECIESMOVEUI__ #include <ktoolbar.h> -#include <QString> #include "../pokemod/SpeciesMove.h" #include "ObjectUI.h" #include "ui_speciesmove.h" diff --git a/pokemodr/TODO b/pokemodr/TODO index 409eadee..c331f1bd 100644 --- a/pokemodr/TODO +++ b/pokemodr/TODO @@ -10,7 +10,9 @@ MapWildList MapWildListEncounter MoveEffect Pokemod -Species + +Skins +TypeChart Tree Handling Toolbar loading diff --git a/pokemodr/gui/species.ui b/pokemodr/gui/species.ui index 3febcc25..97779cd1 100644 --- a/pokemodr/gui/species.ui +++ b/pokemodr/gui/species.ui @@ -6,8 +6,8 @@ <rect> <x>0</x> <y>0</y> - <width>244</width> - <height>2077</height> + <width>254</width> + <height>2097</height> </rect> </property> <property name="windowTitle" > @@ -371,7 +371,7 @@ </property> <layout class="QHBoxLayout" > <item> - <widget class="KTextEdit" name="ktextedit" > + <widget class="KTextEdit" name="varPokedexEntry" > <property name="toolTip" > <string>The information on the species given in the PokéDex</string> </property> @@ -473,7 +473,7 @@ </widget> </item> <item> - <widget class="QGroupBox" name="boxNidoraGroup" > + <widget class="QGroupBox" name="boxNidoranGroup" > <property name="title" > <string>Nidoran Group</string> </property> diff --git a/pokemodr/gui/speciesitem.ui b/pokemodr/gui/speciesitem.ui index 0bde162e..cf906dda 100644 --- a/pokemodr/gui/speciesitem.ui +++ b/pokemodr/gui/speciesitem.ui @@ -5,8 +5,8 @@ <rect> <x>0</x> <y>0</y> - <width>248</width> - <height>263</height> + <width>236</width> + <height>258</height> </rect> </property> <property name="windowTitle" > diff --git a/pokemodr/gui/typechart.ui b/pokemodr/gui/typechart.ui index 912c3ad2..c70f687e 100644 --- a/pokemodr/gui/typechart.ui +++ b/pokemodr/gui/typechart.ui @@ -5,8 +5,8 @@ <rect> <x>0</x> <y>0</y> - <width>226</width> - <height>226</height> + <width>242</width> + <height>225</height> </rect> </property> <property name="windowTitle" > |
