diff options
author | Ben Boeckel <MathStuf@gmail.com> | 2008-01-21 00:44:23 +0000 |
---|---|---|
committer | Ben Boeckel <MathStuf@gmail.com> | 2008-01-21 00:44:23 +0000 |
commit | 2b653821cc31f18adb5d50bb0bc19048939670dc (patch) | |
tree | d333bbf0d1dde8fe0c1633bea60785b20ac07841 | |
parent | e27ba66952a1e851bb417611e0ed7df1fbf5f945 (diff) | |
download | sigen-2b653821cc31f18adb5d50bb0bc19048939670dc.tar.gz sigen-2b653821cc31f18adb5d50bb0bc19048939670dc.tar.xz sigen-2b653821cc31f18adb5d50bb0bc19048939670dc.zip |
[ADD] More GUI classes (only MoveEffect left)
[FIX] Polished up GUI classes
[FIX] renamed methods get*ByID -> get*Index instead for more logical get*ByID
[FIX] Renaming in pokemod to remove mention of Pokémon
[FIX] minor .pro fixes (aesthetic mainly)
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@35 6ecfd1a5-f3ed-3746-8530-beee90d26b22
84 files changed, 5199 insertions, 981 deletions
@@ -1,4 +1,15 @@ ----------------- +Rev: 35 +Date: 20 January 2008 +User: MathStuf +----------------- +[ADD] More GUI classes (only MoveEffect left) +[FIX] Polished up GUI classes +[FIX] renamed methods get*ByID -> get*Index instead for more logical get*ByID +[FIX] Renaming in pokemod to remove mention of Pokémon +[FIX] minor .pro fixes (aesthetic mainly) + +----------------- Rev: 34 Date: 19 January 2008 User: MathStuf diff --git a/battle/battle.pro b/battle/battle.pro index daa0d9b6..f24900da 100644 --- a/battle/battle.pro +++ b/battle/battle.pro @@ -3,7 +3,7 @@ DESTDIR = ../../lib TEMPLATE = lib LIBS += -L../../lib -lgeneral -lpokemod -CONFIG += qt warn_on dll +CONFIG += qt warn_on dll -SOURCES += *.cpp -HEADERS += *.h +SOURCES += *.cpp +HEADERS += *.h diff --git a/general/general.pro b/general/general.pro index c212fb2c..dc8166d3 100644 --- a/general/general.pro +++ b/general/general.pro @@ -2,7 +2,7 @@ OBJECTS_DIR = ../../obj/general DESTDIR = ../../lib TEMPLATE = lib -CONFIG += qt warn_on dll +CONFIG += qt warn_on dll -SOURCES += *.cpp -HEADERS += *.h +SOURCES += *.cpp +HEADERS += *.h diff --git a/menus/menus.pro b/menus/menus.pro index cc232704..96d70111 100644 --- a/menus/menus.pro +++ b/menus/menus.pro @@ -3,7 +3,7 @@ DESTDIR = ../../lib TEMPLATE = lib LIBS += -L../../lib -lgeneral -lpokemod -CONFIG += qt warn_on dll +CONFIG += qt warn_on dll -SOURCES += *.cpp -HEADERS += *.h +SOURCES += *.cpp +HEADERS += *.h diff --git a/overworld/overworld.pro b/overworld/overworld.pro index d9fa2fe5..1cbb6fa6 100644 --- a/overworld/overworld.pro +++ b/overworld/overworld.pro @@ -3,7 +3,7 @@ DESTDIR = ../../lib TEMPLATE = lib LIBS += -L../../lib -lgeneral -lpokemod -CONFIG += qt warn_on dll +CONFIG += qt warn_on dll -SOURCES += *.cpp -HEADERS += *.h +SOURCES += *.cpp +HEADERS += *.h diff --git a/pokegen/pokegen.pro b/pokegen/pokegen.pro index 88406d08..f251f962 100644 --- a/pokegen/pokegen.pro +++ b/pokegen/pokegen.pro @@ -3,7 +3,7 @@ DESTDIR = ../../bin TEMPLATE = app LIBS += -L../../lib -lgeneral -lpokemod -loverworld -lbattle -laudio -lmenus -CONFIG += qt gui warn_on dll +CONFIG += qt gui warn_on dll -SOURCES += *.cpp -HEADERS += *.h +SOURCES += *.cpp +HEADERS += *.h diff --git a/pokemod/Ability.cpp b/pokemod/Ability.cpp index 576161c0..d5ff41d0 100644 --- a/pokemod/Ability.cpp +++ b/pokemod/Ability.cpp @@ -79,7 +79,7 @@ bool PokeMod::Ability::validate() const unsigned PokeMod::Ability::getNewId() const { unsigned i = 0; - for (; (i < getEffectCount()) && (getEffectByID(i) != UINT_MAX); ++i) + for (; (i < getEffectCount()) && (getEffectIndex(i) != UINT_MAX); ++i) ; return i; } @@ -137,7 +137,17 @@ PokeMod::AbilityEffect& PokeMod::Ability::getEffect(const unsigned i) throw(Inde return effects[i]; } -unsigned PokeMod::Ability::getEffectByID(const unsigned _id) const +const PokeMod::AbilityEffect& PokeMod::Ability::getEffectByID(const unsigned i) const throw(IndexException) +{ + return getEffect(getEffectIndex(i)); +} + +PokeMod::AbilityEffect& PokeMod::Ability::getEffectByID(const unsigned i) throw(IndexException) +{ + return getEffect(getEffectIndex(i)); +} + +unsigned PokeMod::Ability::getEffectIndex(const unsigned _id) const { for (unsigned i = 0; i < getEffectCount(); ++i) { diff --git a/pokemod/Ability.h b/pokemod/Ability.h index 4e2ec210..61865ae8 100644 --- a/pokemod/Ability.h +++ b/pokemod/Ability.h @@ -54,7 +54,9 @@ namespace PokeMod const AbilityEffect& getEffect(const unsigned i) const throw(IndexException); AbilityEffect& getEffect(const unsigned i) throw(IndexException); - unsigned getEffectByID(const unsigned _id) const; + const AbilityEffect& getEffectByID(const unsigned i) const throw(IndexException); + AbilityEffect& getEffectByID(const unsigned i) throw(IndexException); + unsigned getEffectIndex(const unsigned _id) const; unsigned getEffectCount() const; AbilityEffect& newEffect(); AbilityEffect& newEffect(const QString& fname); diff --git a/pokemod/AbilityEffect.cpp b/pokemod/AbilityEffect.cpp index e0e855a1..eb4f5b1e 100644 --- a/pokemod/AbilityEffect.cpp +++ b/pokemod/AbilityEffect.cpp @@ -75,7 +75,7 @@ bool PokeMod::AbilityEffect::validate() const ok = false; break; case E_Ability: - if (pokemod.getAbilityByID(val1) == UINT_MAX) + if (pokemod.getAbilityIndex(val1) == UINT_MAX) ok = false; break; case E_AccuracyPowerTrade: @@ -87,7 +87,7 @@ bool PokeMod::AbilityEffect::validate() const ok = false; break; case E_Type: - if (pokemod.getTypeByID(val1) == UINT_MAX) + if (pokemod.getTypeIndex(val1) == UINT_MAX) ok = false; break; case E_Weather: @@ -167,7 +167,7 @@ bool PokeMod::AbilityEffect::validate() const ok = false; break; case T_Type: - if (pokemod.getTypeByID(tval1) == UINT_MAX) + if (pokemod.getTypeIndex(tval1) == UINT_MAX) ok = false; break; case T_HPBoundary: @@ -275,7 +275,7 @@ void PokeMod::AbilityEffect::setVal1(const unsigned v1) throw(Exception) throw(BoundsException("AbilityEffect", "val1")); break; case E_Ability: - if (pokemod.getAbilityByID(v1) == UINT_MAX) + if (pokemod.getAbilityIndex(v1) == UINT_MAX) throw(BoundsException("AbilityEffect", "val1")); break; case E_AccuracyPowerTrade: @@ -287,7 +287,7 @@ void PokeMod::AbilityEffect::setVal1(const unsigned v1) throw(Exception) throw(BoundsException("AbilityEffect", "val1")); break; case E_Type: - if (pokemod.getTypeByID(v1) == UINT_MAX) + if (pokemod.getTypeIndex(v1) == UINT_MAX) throw(BoundsException("AbilityEffect", "val1")); break; case E_Weather: @@ -373,7 +373,7 @@ void PokeMod::AbilityEffect::setTval1(const unsigned tv1) throw(Exception) throw(BoundsException("AbilityEffect", "tval1")); break; case T_Type: - if (pokemod.getTypeByID(tv1) == UINT_MAX) + if (pokemod.getTypeIndex(tv1) == UINT_MAX) throw(BoundsException("AbilityEffect", "tval1")); break; case T_HPBoundary: diff --git a/pokemod/CoinList.cpp b/pokemod/CoinList.cpp index c4ca7f98..b7d1d55e 100644 --- a/pokemod/CoinList.cpp +++ b/pokemod/CoinList.cpp @@ -55,7 +55,7 @@ bool PokeMod::CoinList::validate() const { QMap<unsigned, unsigned> idChecker; QMap<unsigned, unsigned> itemChecker; - QMap<unsigned, unsigned> pokemonChecker; + QMap<unsigned, unsigned> speciesChecker; for (QListIterator<CoinListObject> i(items); i.hasNext(); i.next()) { if (!i.peekNext().isValid()) @@ -64,7 +64,7 @@ bool PokeMod::CoinList::validate() const if (i.peekNext().getType() == CoinListObject::Item) ++itemChecker[i.peekNext().getObject()]; else if (i.peekNext().getType() == CoinListObject::Pokemon) - ++pokemonChecker[i.peekNext().getObject()]; + ++speciesChecker[i.peekNext().getObject()]; } for (QMapIterator<unsigned, unsigned> i(idChecker); i.hasNext(); i.next()) { @@ -82,7 +82,7 @@ bool PokeMod::CoinList::validate() const valid = false; } } - for (QMapIterator<unsigned, unsigned> i(pokemonChecker); i.hasNext(); i.next()) + for (QMapIterator<unsigned, unsigned> i(speciesChecker); i.hasNext(); i.next()) { if (1 < i.value()) { @@ -116,7 +116,7 @@ bool PokeMod::CoinList::validate() const unsigned PokeMod::CoinList::getNewId() const { unsigned i = 0; - for (; (i < getItemCount()) && (getItemByID(i) != UINT_MAX); ++i) + for (; (i < getItemCount()) && (getItemIndex(i) != UINT_MAX); ++i) ; return i; } @@ -197,7 +197,17 @@ PokeMod::CoinListObject& PokeMod::CoinList::getItem(const unsigned i) throw(Inde return items[i]; } -unsigned PokeMod::CoinList::getItemByID(const unsigned _id) const +const PokeMod::CoinListObject& PokeMod::CoinList::getItemByID(const unsigned i) const throw(IndexException) +{ + return getItem(getItemIndex(i)); +} + +PokeMod::CoinListObject& PokeMod::CoinList::getItemByID(const unsigned i) throw(IndexException) +{ + return getItem(getItemIndex(i)); +} + +unsigned PokeMod::CoinList::getItemIndex(const unsigned _id) const { for (unsigned i = 0; i < getItemCount(); ++i) { diff --git a/pokemod/CoinList.h b/pokemod/CoinList.h index 1254f5f6..35bfa4ee 100644 --- a/pokemod/CoinList.h +++ b/pokemod/CoinList.h @@ -58,7 +58,9 @@ namespace PokeMod const CoinListObject& getItem(const unsigned i) const throw(IndexException); CoinListObject& getItem(const unsigned i) throw(IndexException); - unsigned getItemByID(const unsigned _id) const; + const CoinListObject& getItemByID(const unsigned i) const throw(IndexException); + CoinListObject& getItemByID(const unsigned i) throw(IndexException); + unsigned getItemIndex(const unsigned _id) const; unsigned getItemCount() const; CoinListObject& newItem(); CoinListObject& newItem(const QString& fname); diff --git a/pokemod/CoinListObject.cpp b/pokemod/CoinListObject.cpp index 74f09878..d29a8061 100644 --- a/pokemod/CoinListObject.cpp +++ b/pokemod/CoinListObject.cpp @@ -51,7 +51,7 @@ bool PokeMod::CoinListObject::validate() const pokemod.validationMsg(QString("------Object with id %1---").arg(id), Pokemod::V_Msg); if (type == Item) { - if (pokemod.getItemByID(object) == UINT_MAX) + if (pokemod.getItemIndex(object) == UINT_MAX) { pokemod.validationMsg("Invalid item"); valid = false; @@ -59,7 +59,7 @@ bool PokeMod::CoinListObject::validate() const } else if (type == Pokemon) { - if (pokemod.getSpeciesByID(object) == UINT_MAX) + if (pokemod.getSpeciesIndex(object) == UINT_MAX) { pokemod.validationMsg("Invalid Species"); valid = false; @@ -112,7 +112,7 @@ void PokeMod::CoinListObject::setType(const unsigned t) throw(BoundsException) void PokeMod::CoinListObject::setObject(const unsigned o) throw(BoundsException) { - if (((type == Item) && (pokemod.getItemByID(object) == UINT_MAX)) || ((type == Pokemon) && (pokemod.getSpeciesByID(object) == UINT_MAX))) + if (((type == Item) && (pokemod.getItemIndex(object) == UINT_MAX)) || ((type == Pokemon) && (pokemod.getSpeciesIndex(object) == UINT_MAX))) throw(BoundsException("CoinListObject", "object")); object = o; } diff --git a/pokemod/Dialog.cpp b/pokemod/Dialog.cpp index d934d4ae..ca91e14b 100644 --- a/pokemod/Dialog.cpp +++ b/pokemod/Dialog.cpp @@ -144,7 +144,7 @@ bool PokeMod::Dialog::validate() const break; case 3: case 4: - if (!okU || (pokemod.getDialogByID(tempU) == UINT_MAX)) + if (!okU || (pokemod.getDialogIndex(tempU) == UINT_MAX)) invError = numArgs; } break; @@ -156,7 +156,7 @@ bool PokeMod::Dialog::validate() const } else if (numArgs == 2) { - if (!okU || (pokemod.getDialogByID(tempU) == UINT_MAX)) + if (!okU || (pokemod.getDialogIndex(tempU) == UINT_MAX)) invError = 2; } break; @@ -170,14 +170,14 @@ bool PokeMod::Dialog::validate() const break; case 2: case 3: - if (!okU || (pokemod.getDialogByID(tempU) == UINT_MAX)) + if (!okU || (pokemod.getDialogIndex(tempU) == UINT_MAX)) invError = numArgs; } break; case ItemShop: if (numArgs == 1) { - if (!okU || (pokemod.getStoreByID(tempU) == UINT_MAX)) + if (!okU || (pokemod.getStoreIndex(tempU) == UINT_MAX)) invError = 1; } break; @@ -191,12 +191,12 @@ bool PokeMod::Dialog::validate() const invError = 1; break; case 2: - if (!okU || (pokemod.getItemByID(tempU) == UINT_MAX)) + if (!okU || (pokemod.getItemIndex(tempU) == UINT_MAX)) invError = 2; break; case 3: case 4: - if (!okU || (pokemod.getDialogByID(tempU) == UINT_MAX)) + if (!okU || (pokemod.getDialogIndex(tempU) == UINT_MAX)) invError = numArgs; break; } @@ -204,7 +204,7 @@ bool PokeMod::Dialog::validate() const case CoinList: if (numArgs == 1) { - if (!okU || (pokemod.getCoinListByID(tempU) == UINT_MAX)) + if (!okU || (pokemod.getCoinListIndex(tempU) == UINT_MAX)) invError = 1; } break; @@ -216,13 +216,13 @@ bool PokeMod::Dialog::validate() const invError = 1; break; case 2: - if (!okU || (pokemod.getMoveByID(tempU) == UINT_MAX)) + if (!okU || (pokemod.getMoveIndex(tempU) == UINT_MAX)) invError = 2; break; case 3: case 4: case 5: - if (!okU || (pokemod.getDialogByID(tempU) == UINT_MAX)) + if (!okU || (pokemod.getDialogIndex(tempU) == UINT_MAX)) invError = numArgs; break; } @@ -239,12 +239,12 @@ bool PokeMod::Dialog::validate() const invError = 2; break; case 3: - if (!okU || (pokemod.getMoveByID(tempU) == UINT_MAX)) + if (!okU || (pokemod.getMoveIndex(tempU) == UINT_MAX)) invError = 3; break; case 4: case 5: - if (!okU || (pokemod.getDialogByID(tempU) == UINT_MAX)) + if (!okU || (pokemod.getDialogIndex(tempU) == UINT_MAX)) invError = numArgs; break; } @@ -257,7 +257,7 @@ bool PokeMod::Dialog::validate() const invError = 1; break; case 2: - if (!okU || (pokemod.getSpeciesByID(tempU) ==UINT_MAX)) + if (!okU || (pokemod.getSpeciesIndex(tempU) ==UINT_MAX)) invError = 2; break; case 3: @@ -282,7 +282,7 @@ bool PokeMod::Dialog::validate() const break; case 6: case 7: - if (!okU || (pokemod.getDialogByID(tempU) == UINT_MAX)) + if (!okU || (pokemod.getDialogIndex(tempU) == UINT_MAX)) invError = numArgs; break; } @@ -297,12 +297,12 @@ bool PokeMod::Dialog::validate() const invError = 1; break; case 2: - if (!okU || (pokemod.getSpeciesByID(tempU) == UINT_MAX)) + if (!okU || (pokemod.getSpeciesIndex(tempU) == UINT_MAX)) invError = 2; break; case 3: case 4: - if (!okU || (pokemod.getDialogByID(tempU) == UINT_MAX)) + if (!okU || (pokemod.getDialogIndex(tempU) == UINT_MAX)) invError = numArgs; break; } @@ -310,7 +310,7 @@ bool PokeMod::Dialog::validate() const case ShowPokemon: if (numArgs == 1) { - if (!okU || (pokemod.getSpeciesByID(tempU) == UINT_MAX)) + if (!okU || (pokemod.getSpeciesIndex(tempU) == UINT_MAX)) invError = 1; } break; @@ -350,7 +350,7 @@ bool PokeMod::Dialog::validate() const break; case 3: case 4: - if (!okU || (pokemod.getDialogByID(tempU) == UINT_MAX)) + if (!okU || (pokemod.getDialogIndex(tempU) == UINT_MAX)) invError = numArgs; break; } @@ -364,15 +364,15 @@ bool PokeMod::Dialog::validate() const invError = 1; break; case 2: - if (!okU || (pokemod.getMapByID(tempU) == UINT_MAX)) + if (!okU || (pokemod.getMapIndex(tempU) == UINT_MAX)) invError = 2; else - map = &pokemod.getMap(pokemod.getMapByID(tempU)); + map = &pokemod.getMap(pokemod.getMapIndex(tempU)); break; case 3: if (map) { - if (!okU || (map->getEffectByID(tempU) == UINT_MAX)) + if (!okU || (map->getEffectIndex(tempU) == UINT_MAX)) invError = 3; } else if ((arg != "Player") && (arg != "-1")) @@ -384,7 +384,7 @@ bool PokeMod::Dialog::validate() const break; case 5: case 6: - if (!okU || (pokemod.getDialogByID(tempU) == UINT_MAX)) + if (!okU || (pokemod.getDialogIndex(tempU) == UINT_MAX)) invError = numArgs; break; } @@ -393,15 +393,15 @@ bool PokeMod::Dialog::validate() const switch (numArgs) { case 1: - if (!okU || (pokemod.getMapByID(tempU) == UINT_MAX)) + if (!okU || (pokemod.getMapIndex(tempU) == UINT_MAX)) invError = 1; else - map = &pokemod.getMap(pokemod.getMapByID(tempU)); + map = &pokemod.getMap(pokemod.getMapIndex(tempU)); break; case 2: if (map) { - if (!okU || (map->getEffectByID(tempU) == UINT_MAX)) + if (!okU || (map->getEffectIndex(tempU) == UINT_MAX)) invError = 2; } else if ((arg != "Player") && (arg != "-1")) @@ -441,7 +441,7 @@ bool PokeMod::Dialog::validate() const break; case 4: case 5: - if (!okU || (pokemod.getDialogByID(tempU) == UINT_MAX)) + if (!okU || (pokemod.getDialogIndex(tempU) == UINT_MAX)) invError = numArgs; break; } @@ -456,7 +456,7 @@ bool PokeMod::Dialog::validate() const case 2: case 3: case 4: - if (!okU || (pokemod.getDialogByID(tempU) == UINT_MAX)) + if (!okU || (pokemod.getDialogIndex(tempU) == UINT_MAX)) invError = numArgs; } break; @@ -469,7 +469,7 @@ bool PokeMod::Dialog::validate() const break; case 2: case 3: - if (!okU || (pokemod.getSpeciesByID(tempU) == UINT_MAX)) + if (!okU || (pokemod.getSpeciesIndex(tempU) == UINT_MAX)) invError = numArgs; case 4: if (!okUL) @@ -477,7 +477,7 @@ bool PokeMod::Dialog::validate() const break; case 5: case 6: - if (!okU || (pokemod.getDialogByID(tempU) == UINT_MAX)) + if (!okU || (pokemod.getDialogIndex(tempU) == UINT_MAX)) invError = numArgs; break; } @@ -492,16 +492,16 @@ bool PokeMod::Dialog::validate() const case Battle: if (numArgs == 1) { - if (!okU || (pokemod.getMapByID(tempU) == UINT_MAX)) + if (!okU || (pokemod.getMapIndex(tempU) == UINT_MAX)) invError = 1; else - map = &pokemod.getMap(pokemod.getMapByID(tempU)); + map = &pokemod.getMap(pokemod.getMapIndex(tempU)); } else if (numArgs == 2) { if (map) { - if (!okU || (map->getTrainerByID(tempU) == UINT_MAX)) + if (!okU || (map->getTrainerIndex(tempU) == UINT_MAX)) invError = 2; } else @@ -512,23 +512,23 @@ bool PokeMod::Dialog::validate() const case Badge: if (numArgs == 1) { - if (!okU || (pokemod.getBadgeByID(tempU) == UINT_MAX)) + if (!okU || (pokemod.getBadgeIndex(tempU) == UINT_MAX)) invError = 1; } break; case Warp: if (numArgs == 1) { - if (!okU || (pokemod.getMapByID(tempU) == UINT_MAX)) + if (!okU || (pokemod.getMapIndex(tempU) == UINT_MAX)) invError = 1; else - map = &pokemod.getMap(pokemod.getMapByID(tempU)); + map = &pokemod.getMap(pokemod.getMapIndex(tempU)); } else if (numArgs == 2) { if (map) { - if (!okU || (map->getWarpByID(tempU) == UINT_MAX)) + if (!okU || (map->getWarpIndex(tempU) == UINT_MAX)) invError = 2; } else @@ -575,7 +575,7 @@ bool PokeMod::Dialog::validate() const invError = 2; break; case 3: - if (!okU || (pokemod.getDialogByID(tempU) == UINT_MAX)) + if (!okU || (pokemod.getDialogIndex(tempU) == UINT_MAX)) invError = 3; break; } @@ -591,9 +591,9 @@ bool PokeMod::Dialog::validate() const switch (numArgs) { case 1: - if (okU && (pokemod.getItemByID(tempU) != UINT_MAX)) + if (okU && (pokemod.getItemIndex(tempU) != UINT_MAX)) { - const Item& item = pokemod.getItem(pokemod.getItemByID(tempU)); + const Item& item = pokemod.getItem(pokemod.getItemIndex(tempU)); bool temp = false; for (unsigned i = 0; (i < item.getEffectCount()) || !temp; ++i) { @@ -629,7 +629,7 @@ bool PokeMod::Dialog::validate() const { if (okU) { - if (pokemod.getDialogByID(tempU) == UINT_MAX) + if (pokemod.getDialogIndex(tempU) == UINT_MAX) invError = numArgs; } else diff --git a/pokemod/Item.cpp b/pokemod/Item.cpp index 5ce51cf8..5af126a2 100644 --- a/pokemod/Item.cpp +++ b/pokemod/Item.cpp @@ -53,7 +53,7 @@ bool PokeMod::Item::validate() const pokemod.validationMsg("Name is not defined"); valid = false; } - if (pokemod.getItemTypeByID(type) == UINT_MAX) + if (pokemod.getItemTypeIndex(type) == UINT_MAX) { pokemod.validationMsg("Invalid item type"); valid = false; @@ -87,7 +87,7 @@ bool PokeMod::Item::validate() const unsigned PokeMod::Item::getNewId() const { unsigned i = 0; - for (; (i < getEffectCount()) && (getEffectByID(i) != UINT_MAX); ++i) + for (; (i < getEffectCount()) && (getEffectIndex(i) != UINT_MAX); ++i) ; return i; } @@ -141,7 +141,7 @@ void PokeMod::Item::setSellable(const bool s) void PokeMod::Item::setType(const unsigned t) throw(BoundsException) { - if (pokemod.getItemTypeByID(t) == UINT_MAX) + if (pokemod.getItemTypeIndex(t) == UINT_MAX) throw(BoundsException("Item", "type")); type = t; } @@ -188,14 +188,24 @@ const PokeMod::ItemEffect& PokeMod::Item::getEffect(const unsigned i) const thro return effects.at(i); } -PokeMod::ItemEffect& PokeMod::Item::getEffect(const unsigned i) throw(IndexException) +PokeMod::ItemEffect& PokeMod::Item::getEffectByID(const unsigned i) throw(IndexException) { if (getEffectCount() <= i) throw(IndexException("Item")); return effects[i]; } -unsigned PokeMod::Item::getEffectByID(const unsigned _id) const +const PokeMod::ItemEffect& PokeMod::Item::getEffectByID(const unsigned i) const throw(IndexException) +{ + return getEffect(getEffectIndex(i)); +} + +PokeMod::ItemEffect& PokeMod::Item::getEffect(const unsigned i) throw(IndexException) +{ + return getEffect(getEffectIndex(i)); +} + +unsigned PokeMod::Item::getEffectIndex(const unsigned _id) const { for (unsigned i = 0; i < getEffectCount(); ++i) { diff --git a/pokemod/Item.h b/pokemod/Item.h index a1547182..5d13068c 100644 --- a/pokemod/Item.h +++ b/pokemod/Item.h @@ -62,7 +62,9 @@ namespace PokeMod const ItemEffect& getEffect(const unsigned i) const throw(IndexException); ItemEffect& getEffect(const unsigned i) throw(IndexException); - unsigned getEffectByID(const unsigned _id) const; + const ItemEffect& getEffectByID(const unsigned i) const throw(IndexException); + ItemEffect& getEffectByID(const unsigned i) throw(IndexException); + unsigned getEffectIndex(const unsigned _id) const; unsigned getEffectCount() const; ItemEffect& newEffect(); ItemEffect& newEffect(const QString& fname); diff --git a/pokemod/ItemEffect.cpp b/pokemod/ItemEffect.cpp index 6a92a781..b3542460 100644 --- a/pokemod/ItemEffect.cpp +++ b/pokemod/ItemEffect.cpp @@ -185,7 +185,7 @@ bool PokeMod::ItemEffect::validate() const ok = false; break; case E_TypeBoost: - if (pokemod.getTypeByID(val2) == UINT_MAX) + if (pokemod.getTypeIndex(val2) == UINT_MAX) ok = false; break; case E_PPRestore: @@ -202,7 +202,7 @@ bool PokeMod::ItemEffect::validate() const break; case E_TM: case E_HM: - if (pokemod.getMoveByID(val2) == UINT_MAX) + if (pokemod.getMoveIndex(val2) == UINT_MAX) ok = false; break; case E_Ball: @@ -219,7 +219,7 @@ bool PokeMod::ItemEffect::validate() const ok = false; break; case E_Acorn: - if (pokemod.getItemByID(val2) == UINT_MAX) + if (pokemod.getItemIndex(val2) == UINT_MAX) ok = false; break; } @@ -251,7 +251,7 @@ bool PokeMod::ItemEffect::validate() const ok = false; break; case B_Time: - if (pokemod.getTimeByID(val3) == UINT_MAX) + if (pokemod.getTimeIndex(val3) == UINT_MAX) ok = false; break; case B_Stat: @@ -259,7 +259,7 @@ bool PokeMod::ItemEffect::validate() const ok = false; break; case B_Type: - if (pokemod.getTypeByID(val3) == UINT_MAX) + if (pokemod.getTypeIndex(val3) == UINT_MAX) ok = false; break; } @@ -517,7 +517,7 @@ void PokeMod::ItemEffect::setVal2(const unsigned v2) throw(Exception) throw(BoundsException("ItemEffect", "val2")); break; case E_TypeBoost: - if (pokemod.getTypeByID(val2) == UINT_MAX) + if (pokemod.getTypeIndex(val2) == UINT_MAX) throw(BoundsException("ItemEffect", "val2")); break; case E_PPRestore: @@ -534,7 +534,7 @@ void PokeMod::ItemEffect::setVal2(const unsigned v2) throw(Exception) break; case E_TM: case E_HM: - if (pokemod.getMoveByID(val2) == UINT_MAX) + if (pokemod.getMoveIndex(val2) == UINT_MAX) throw(BoundsException("ItemEffect", "val2")); break; case E_Ball: @@ -553,7 +553,7 @@ void PokeMod::ItemEffect::setVal2(const unsigned v2) throw(Exception) throw(BoundsException("ItemEffect", "val2")); break; case E_Acorn: - if (pokemod.getItemByID(val2) == UINT_MAX) + if (pokemod.getItemIndex(val2) == UINT_MAX) throw(BoundsException("ItemEffect", "val2")); break; default: @@ -583,7 +583,7 @@ void PokeMod::ItemEffect::setVal3(const unsigned v3) throw(Exception) throw(BoundsException("ItemEffect", "val3")); break; case B_Time: - if (pokemod.getTimeByID(val3) == UINT_MAX) + if (pokemod.getTimeIndex(val3) == UINT_MAX) throw(BoundsException("ItemEffect", "val3")); break; case B_Stat: @@ -591,7 +591,7 @@ void PokeMod::ItemEffect::setVal3(const unsigned v3) throw(Exception) throw(BoundsException("ItemEffect", "val3")); break; case B_Type: - if (pokemod.getTypeByID(val3) == UINT_MAX) + if (pokemod.getTypeIndex(val3) == UINT_MAX) throw(BoundsException("ItemEffect", "val3")); break; case B_Regular: diff --git a/pokemod/Map.cpp b/pokemod/Map.cpp index ea8ed60e..e6c0d162 100644 --- a/pokemod/Map.cpp +++ b/pokemod/Map.cpp @@ -53,7 +53,7 @@ bool PokeMod::Map::validate() const pokemod.validationMsg("name is not defined"); valid = false; } - if ((flyWarp != UINT_MAX) && (getWarpByID(flyWarp) == UINT_MAX)) + if ((flyWarp != UINT_MAX) && (getWarpIndex(flyWarp) == UINT_MAX)) { pokemod.validationMsg("Invalid fly destination warp"); valid = false; @@ -71,12 +71,12 @@ bool PokeMod::Map::validate() const { if (!i.peekNext().isValid()) valid = false; - if (getWidth() <= i.peekNext().getCoordinateX()) + if (getWidth() <= i.peekNext().getCoordinate().getX()) { pokemod.validationMsg("Invalid x coordinate"); valid = false; } - if (getHeight() <= i.peekNext().getCoordinateY()) + if (getHeight() <= i.peekNext().getCoordinate().getY()) { pokemod.validationMsg("Invalid y coordinate"); valid = false; @@ -111,12 +111,12 @@ bool PokeMod::Map::validate() const { if (!i.peekNext().isValid()) valid = false; - if (getWidth() <= i.peekNext().getCoordinateX()) + if (getWidth() <= i.peekNext().getCoordinate().getX()) { pokemod.validationMsg("Invalid x coordinate"); valid = false; } - if (getHeight() <= i.peekNext().getCoordinateY()) + if (getHeight() <= i.peekNext().getCoordinate().getY()) { pokemod.validationMsg("Invalid y coordinate"); valid = false; @@ -151,12 +151,12 @@ bool PokeMod::Map::validate() const { if (!i.peekNext().isValid()) valid = false; - if (getWidth() <= i.peekNext().getCoordinateX()) + if (getWidth() <= i.peekNext().getCoordinate().getX()) { pokemod.validationMsg("Invalid x coordinate"); valid = false; } - if (getHeight() <= i.peekNext().getCoordinateY()) + if (getHeight() <= i.peekNext().getCoordinate().getY()) { pokemod.validationMsg("Invalid y coordinate"); valid = false; @@ -212,7 +212,7 @@ bool PokeMod::Map::validate() const { for (unsigned j = 0; j < getHeight(); ++j) { - if (pokemod.getTileByID(tiles(i, j)) == UINT_MAX) + if (pokemod.getTileIndex(tiles(i, j)) == UINT_MAX) { pokemod.validationMsg(QString("Invalid tile at (%1, %2)").arg(i).arg(j)); valid = false; @@ -222,6 +222,38 @@ bool PokeMod::Map::validate() const return valid; } +unsigned PokeMod::Map::getNewEffectId() const +{ + unsigned i = 0; + for (; (i < getEffectCount()) && (getEffectIndex(i) != UINT_MAX); ++i) + ; + return i; +} + +unsigned PokeMod::Map::getNewTrainerId() const +{ + unsigned i = 0; + for (; (i < getTrainerCount()) && (getTrainerIndex(i) != UINT_MAX); ++i) + ; + return i; +} + +unsigned PokeMod::Map::getNewWarpId() const +{ + unsigned i = 0; + for (; (i < getWarpCount()) && (getWarpIndex(i) != UINT_MAX); ++i) + ; + return i; +} + +unsigned PokeMod::Map::getNewWildListId() const +{ + unsigned i = 0; + for (; (i < getWarpCount()) && (getWarpIndex(i) != UINT_MAX); ++i) + ; + return i; +} + void PokeMod::Map::load(const QString& fname, const unsigned _id) throw(Exception) { Ini ini(fname); @@ -306,7 +338,7 @@ void PokeMod::Map::setName(const QString& n) void PokeMod::Map::setFlyWarp(const unsigned f) throw(BoundsException) { - if (getWarpByID(f) == UINT_MAX) + if (getWarpIndex(f) == UINT_MAX) throw(BoundsException("Map", "warp")); flyWarp = f; } @@ -335,7 +367,7 @@ unsigned PokeMod::Map::getType() const void PokeMod::Map::setTile(unsigned x, unsigned y, unsigned _id) throw(BoundsException) { - if (pokemod.getTileByID(_id) == UINT_MAX) + if (pokemod.getTileIndex(_id) == UINT_MAX) throw(BoundsException("Map", "tile")); tiles(x, y) = _id; } @@ -399,7 +431,17 @@ PokeMod::MapEffect& PokeMod::Map::getEffect(const unsigned i) throw(IndexExcepti return effects[i]; } -unsigned PokeMod::Map::getEffectByID(const unsigned _id) const +const PokeMod::MapEffect& PokeMod::Map::getEffectByID(const unsigned i) const throw(IndexException) +{ + return getEffect(getEffectIndex(i)); +} + +PokeMod::MapEffect& PokeMod::Map::getEffectByID(const unsigned i) throw(IndexException) +{ + return getEffect(getEffectIndex(i)); +} + +unsigned PokeMod::Map::getEffectIndex(const unsigned _id) const { for (unsigned i = 0; i < getEffectCount(); ++i) { @@ -453,7 +495,17 @@ PokeMod::MapTrainer& PokeMod::Map::getTrainer(const unsigned i) throw(IndexExcep return trainers[i]; } -unsigned PokeMod::Map::getTrainerByID(const unsigned _id) const +const PokeMod::MapTrainer& PokeMod::Map::getTrainerByID(const unsigned i) const throw(IndexException) +{ + return getTrainer(getTrainerIndex(i)); +} + +PokeMod::MapTrainer& PokeMod::Map::getTrainerByID(const unsigned i) throw(IndexException) +{ + return getTrainer(getTrainerIndex(i)); +} + +unsigned PokeMod::Map::getTrainerIndex(const unsigned _id) const { for (unsigned i = 0; i < getTrainerCount(); ++i) { @@ -507,7 +559,17 @@ PokeMod::MapWarp& PokeMod::Map::getWarp(const unsigned i) throw(IndexException) return warps[i]; } -unsigned PokeMod::Map::getWarpByID(const unsigned _id) const +const PokeMod::MapWarp& PokeMod::Map::getWarpByID(const unsigned i) const throw(IndexException) +{ + return getWarp(getWarpIndex(i)); +} + +PokeMod::MapWarp& PokeMod::Map::getWarpByID(const unsigned i) throw(IndexException) +{ + return getWarp(getWarpIndex(i)); +} + +unsigned PokeMod::Map::getWarpIndex(const unsigned _id) const { for (unsigned i = 0; i < getWarpCount(); ++i) { @@ -551,10 +613,27 @@ const PokeMod::MapWildList& PokeMod::Map::getWildList(const unsigned i) const th { if (getWildListCount() <= i) throw(IndexException("Map")); + return wildLists.at(i); +} + +PokeMod::MapWildList& PokeMod::Map::getWildList(const unsigned i) throw(IndexException) +{ + if (getWildListCount() <= i) + throw(IndexException("Map")); return wildLists[i]; } -unsigned PokeMod::Map::getWildListByID(const unsigned _id) const +const PokeMod::MapWildList& PokeMod::Map::getWildListByID(const unsigned i) const throw(IndexException) +{ + return getWildList(getWildListIndex(i)); +} + +PokeMod::MapWildList& PokeMod::Map::getWildListByID(const unsigned i) throw(IndexException) +{ + return getWildList(getWildListIndex(i)); +} + +unsigned PokeMod::Map::getWildListIndex(const unsigned _id) const { for (unsigned i = 0; i < getWildListCount(); ++i) { diff --git a/pokemod/Map.h b/pokemod/Map.h index d808c793..60dba551 100644 --- a/pokemod/Map.h +++ b/pokemod/Map.h @@ -81,7 +81,9 @@ namespace PokeMod const MapEffect& getEffect(const unsigned i) const throw(IndexException); MapEffect& getEffect(const unsigned i) throw(IndexException); - unsigned getEffectByID(const unsigned _id) const; + const MapEffect& getEffectByID(const unsigned i) const throw(IndexException); + MapEffect& getEffectByID(const unsigned i) throw(IndexException); + unsigned getEffectIndex(const unsigned _id) const; unsigned getEffectCount() const; MapEffect& newEffect(); MapEffect& newEffect(const QString& fname); @@ -90,7 +92,9 @@ namespace PokeMod const MapTrainer& getTrainer(const unsigned i) const throw(IndexException); MapTrainer& getTrainer(const unsigned i) throw(IndexException); - unsigned getTrainerByID(const unsigned _id) const; + const MapTrainer& getTrainerByID(const unsigned i) const throw(IndexException); + MapTrainer& getTrainerByID(const unsigned i) throw(IndexException); + unsigned getTrainerIndex(const unsigned _id) const; unsigned getTrainerCount() const; MapTrainer& newTrainer(); MapTrainer& newTrainer(const QString& fname); @@ -99,7 +103,9 @@ namespace PokeMod const MapWarp& getWarp(const unsigned i) const throw(IndexException); MapWarp& getWarp(const unsigned i) throw(IndexException); - unsigned getWarpByID(const unsigned _id) const; + const MapWarp& getWarpByID(const unsigned i) const throw(IndexException); + MapWarp& getWarpByID(const unsigned i) throw(IndexException); + unsigned getWarpIndex(const unsigned _id) const; unsigned getWarpCount() const; MapWarp& newWarp(); MapWarp& newWarp(const QString& fname); @@ -108,7 +114,9 @@ namespace PokeMod const MapWildList& getWildList(const unsigned i) const throw(IndexException); MapWildList& getWildList(const unsigned i) throw(IndexException); - unsigned getWildListByID(const unsigned _id) const; + const MapWildList& getWildListByID(const unsigned i) const throw(IndexException); + MapWildList& getWildListByID(const unsigned i) throw(IndexException); + unsigned getWildListIndex(const unsigned _id) const; unsigned getWildListCount() const; MapWildList& newWildList(); MapWildList& newWildList(const QString& fname); diff --git a/pokemod/MapEffect.cpp b/pokemod/MapEffect.cpp index 252c456a..d6290436 100644 --- a/pokemod/MapEffect.cpp +++ b/pokemod/MapEffect.cpp @@ -78,7 +78,7 @@ bool PokeMod::MapEffect::validate() const switch (effect) { case E_Item: - if (pokemod.getItemByID(val2) == UINT_MAX) + if (pokemod.getItemIndex(val2) == UINT_MAX) ok = false; break; case E_PC: @@ -107,7 +107,7 @@ bool PokeMod::MapEffect::validate() const pokemod.validationMsg("Invalid driection"); valid = false; } - if (pokemod.getDialogByID(dialog) == UINT_MAX) + if (pokemod.getDialogIndex(dialog) == UINT_MAX) { pokemod.validationMsg("Invalid dialog"); valid = false; @@ -224,7 +224,7 @@ void PokeMod::MapEffect::setVal2(const unsigned v2) throw(Exception) switch (effect) { case E_Item: - if (pokemod.getItemByID(val2) == UINT_MAX) + if (pokemod.getItemIndex(val2) == UINT_MAX) throw(BoundsException("MapEffect", "val2")); break; case E_PC: @@ -262,7 +262,7 @@ void PokeMod::MapEffect::setCanMove(const bool c) void PokeMod::MapEffect::setDialog(const unsigned d) throw(BoundsException) { - if (pokemod.getDialogByID(d) == UINT_MAX) + if (pokemod.getDialogIndex(d) == UINT_MAX) throw(BoundsException("MapEffect", "dialog")); dialog = d; } @@ -277,31 +277,11 @@ Point PokeMod::MapEffect::getCoordinate() const return coordinate; } -unsigned PokeMod::MapEffect::getCoordinateX() const -{ - return coordinate.getX(); -} - -unsigned PokeMod::MapEffect::getCoordinateY() const -{ - return coordinate.getY(); -} - Flag PokeMod::MapEffect::getExistFlag() const { return existFlag; } -unsigned PokeMod::MapEffect::getExistFlagFlag() const -{ - return existFlag.getFlag(); -} - -unsigned PokeMod::MapEffect::getExistFlagStatus() const -{ - return existFlag.getStatus(); -} - QString PokeMod::MapEffect::getSkin() const { return skin; diff --git a/pokemod/MapEffect.h b/pokemod/MapEffect.h index 700b257d..5517a212 100644 --- a/pokemod/MapEffect.h +++ b/pokemod/MapEffect.h @@ -83,11 +83,7 @@ namespace PokeMod QString getName() const; Point getCoordinate() const; - unsigned getCoordinateX() const; - unsigned getCoordinateY() const; Flag getExistFlag() const; - unsigned getExistFlagFlag() const; - unsigned getExistFlagStatus() const; QString getSkin() const; unsigned getEffect() const; unsigned getVal1() const; diff --git a/pokemod/MapTrainer.cpp b/pokemod/MapTrainer.cpp index 6ce711eb..ad287393 100644 --- a/pokemod/MapTrainer.cpp +++ b/pokemod/MapTrainer.cpp @@ -35,7 +35,7 @@ PokeMod::MapTrainer::MapTrainer(const Pokemod& par, const unsigned _id) : overworldDialog(UINT_MAX), winDialog(UINT_MAX), loseDialog(UINT_MAX), - leadPokemon(UINT_MAX) + leadTeamMember(UINT_MAX) { } @@ -80,30 +80,30 @@ bool PokeMod::MapTrainer::validate() const pokemod.validationMsg("AI file couldn\'t be found"); valid = false; } - if (pokemod.getDialogByID(overworldDialog) == UINT_MAX) + if (pokemod.getDialogIndex(overworldDialog) == UINT_MAX) { pokemod.validationMsg("Invalid overworld dialog"); valid = false; } - if (pokemod.getDialogByID(winDialog) == UINT_MAX) + if (pokemod.getDialogIndex(winDialog) == UINT_MAX) { pokemod.validationMsg("Invalid win dialog"); valid = false; } - if (pokemod.getDialogByID(loseDialog) == UINT_MAX) + if (pokemod.getDialogIndex(loseDialog) == UINT_MAX) { pokemod.validationMsg("Invalid lose dialog"); valid = false; } - if (getPokemonCount() <= leadPokemon) + if (getTeamMemberCount() <= leadTeamMember) { - pokemod.validationMsg("Invalid lead Pokémon"); + pokemod.validationMsg("Invalid lead member"); valid = false; } - if (getPokemonCount()) + if (getTeamMemberCount()) { QMap<unsigned, unsigned> idChecker; - for (QListIterator<MapTrainerPokemon> i(team); i.hasNext(); i.next()) + for (QListIterator<MapTrainerTeamMember> i(teamMembers); i.hasNext(); i.next()) { if (!i.peekNext().isValid()) valid = false; @@ -113,14 +113,14 @@ bool PokeMod::MapTrainer::validate() const { if (1 < i.value()) { - pokemod.validationMsg(QString("There are %1 Pokémon with id %2").arg(i.value()).arg(i.key())); + pokemod.validationMsg(QString("There are %1 team members with id %2").arg(i.value()).arg(i.key())); valid = false; } } } else { - pokemod.validationMsg("There are no Pokémon"); + pokemod.validationMsg("There are no team members"); valid = false; } return valid; @@ -129,9 +129,9 @@ bool PokeMod::MapTrainer::validate() const unsigned PokeMod::MapTrainer::getNewId() const { unsigned i = 0; - for (; i < getPokemonCount(); ++i) + for (; i < getTeamMemberCount(); ++i) { - if (getPokemonByID(i) == UINT_MAX) + if (getTeamMemberIndex(i) == UINT_MAX) return i; } return UINT_MAX; @@ -161,15 +161,15 @@ void PokeMod::MapTrainer::load(const QString& fname, const unsigned _id) throw(E ini.getValue("overworldDialog", overworldDialog); ini.getValue("winDialog", winDialog); ini.getValue("loseDialog", loseDialog); - ini.getValue("leadPokemon", leadPokemon); + ini.getValue("leadTeamMember", leadTeamMember); QStringList path = pokemod.getPath().split('/'); path.removeLast(); QDir fdir(path.join("/")); - team.clear(); + teamMembers.clear(); if (fdir.cd("team")) { for (QStringListIterator i(fdir.entryList(QStringList("*.pini"), QDir::Files, QDir::Name)); i.hasNext(); ) - newPokemon(i.next()); + newTeamMember(i.next()); } } @@ -191,9 +191,9 @@ void PokeMod::MapTrainer::save(const QString& map) const throw(Exception) ini.addField("overworldDialog", overworldDialog); ini.addField("winDialog", winDialog); ini.addField("loseDialog", loseDialog); - ini.addField("leadPokemon", leadPokemon); + ini.addField("leadTeamMember", leadTeamMember); ini.save(QString("%1/map/%2/trainer/%3/data.pini").arg(pokemod.getPath()).arg(map).arg(name)); - for (QListIterator<MapTrainerPokemon> i(team); i.hasNext(); ) + for (QListIterator<MapTrainerTeamMember> i(teamMembers); i.hasNext(); ) i.next().save(map, name); } @@ -267,30 +267,30 @@ void PokeMod::MapTrainer::setAppearFlagStatus(const unsigned s) void PokeMod::MapTrainer::setOverworldDialog(const unsigned o) throw(BoundsException) { - if (pokemod.getDialogByID(o) == UINT_MAX) + if (pokemod.getDialogIndex(o) == UINT_MAX) throw(BoundsException("MapTrainer", "overworldDialog")); overworldDialog = o; } void PokeMod::MapTrainer::setWinDialog(const unsigned w) throw(BoundsException) { - if (pokemod.getDialogByID(w) == UINT_MAX) + if (pokemod.getDialogIndex(w) == UINT_MAX) throw(BoundsException("MapTrainer", "winDialog")); winDialog = w; } void PokeMod::MapTrainer::setLoseDialog(const unsigned l) throw(BoundsException) { - if (pokemod.getDialogByID(l) == UINT_MAX) + if (pokemod.getDialogIndex(l) == UINT_MAX) throw(BoundsException("MapTrainer", "loseDialog")); loseDialog = l; } -void PokeMod::MapTrainer::setLeadPokemon(const unsigned l) throw(BoundsException) +void PokeMod::MapTrainer::setLeadTeamMember(const unsigned l) throw(BoundsException) { - if (getPokemonCount() <= l) - throw(BoundsException("MapTrainer", "leadPokemon")); - leadPokemon = l; + if (getTeamMemberCount() <= l) + throw(BoundsException("MapTrainer", "leadTeamMember")); + leadTeamMember = l; } QString PokeMod::MapTrainer::getName() const @@ -303,16 +303,6 @@ Point PokeMod::MapTrainer::getCoordinate() const return coordinate; } -unsigned PokeMod::MapTrainer::getCoordinateX() const -{ - return coordinate.getX(); -} - -unsigned PokeMod::MapTrainer::getCoordinateY() const -{ - return coordinate.getY(); -} - QString PokeMod::MapTrainer::getSkin() const { return skin; @@ -343,16 +333,6 @@ Flag PokeMod::MapTrainer::getAppearFlag() const return appearFlag; } -unsigned PokeMod::MapTrainer::getAppearFlagFlag() const -{ - return appearFlag.getFlag(); -} - -unsigned PokeMod::MapTrainer::getAppearFlagStatus() const -{ - return appearFlag.getStatus(); -} - unsigned PokeMod::MapTrainer::getOverworldDialog() const { return overworldDialog; @@ -368,63 +348,73 @@ unsigned PokeMod::MapTrainer::getLoseDialog() const return loseDialog; } -unsigned PokeMod::MapTrainer::getLeadPokemon() const +unsigned PokeMod::MapTrainer::getLeadTeamMember() const { - return leadPokemon; + return leadTeamMember; } -const PokeMod::MapTrainerPokemon& PokeMod::MapTrainer::getPokemon(const unsigned i) const throw(IndexException) +const PokeMod::MapTrainerTeamMember& PokeMod::MapTrainer::getTeamMember(const unsigned i) const throw(IndexException) { - if (getPokemonCount() <= i) + if (getTeamMemberCount() <= i) throw(IndexException("MapTrainer")); - return team.at(i); + return teamMembers.at(i); } -PokeMod::MapTrainerPokemon& PokeMod::MapTrainer::getPokemon(const unsigned i) throw(IndexException) +PokeMod::MapTrainerTeamMember& PokeMod::MapTrainer::getTeamMember(const unsigned i) throw(IndexException) { - if (getPokemonCount() <= i) + if (getTeamMemberCount() <= i) throw(IndexException("MapTrainer")); - return team[i]; + return teamMembers[i]; +} + +const PokeMod::MapTrainerTeamMember& PokeMod::MapTrainer::getTeamMemberByID(const unsigned i) const throw(IndexException) +{ + return getTeamMember(getTeamMemberIndex(i)); +} + +PokeMod::MapTrainerTeamMember& PokeMod::MapTrainer::getTeamMemberByID(const unsigned i) throw(IndexException) +{ + return getTeamMember(getTeamMemberIndex(i)); } -unsigned PokeMod::MapTrainer::getPokemonByID(const unsigned _id) const +unsigned PokeMod::MapTrainer::getTeamMemberIndex(const unsigned _id) const { - for (unsigned i = 0; i < getPokemonCount(); ++i) + for (unsigned i = 0; i < getTeamMemberCount(); ++i) { - if (team[i].getId() == _id) + if (teamMembers[i].getId() == _id) return i; } return UINT_MAX; } -unsigned PokeMod::MapTrainer::getPokemonCount() const +unsigned PokeMod::MapTrainer::getTeamMemberCount() const { - return team.size(); + return teamMembers.size(); } -PokeMod::MapTrainerPokemon& PokeMod::MapTrainer::newPokemon() +PokeMod::MapTrainerTeamMember& PokeMod::MapTrainer::newTeamMember() { - team.append(MapTrainerPokemon(pokemod, getNewId())); - return team[getPokemonCount() - 1]; + teamMembers.append(MapTrainerTeamMember(pokemod, getNewId())); + return teamMembers[getTeamMemberCount() - 1]; } -PokeMod::MapTrainerPokemon& PokeMod::MapTrainer::newPokemon(const QString& fname) +PokeMod::MapTrainerTeamMember& PokeMod::MapTrainer::newTeamMember(const QString& fname) { - team.append(MapTrainerPokemon(pokemod, fname, getNewId())); - return team[getPokemonCount() - 1]; + teamMembers.append(MapTrainerTeamMember(pokemod, fname, getNewId())); + return teamMembers[getTeamMemberCount() - 1]; } -PokeMod::MapTrainerPokemon& PokeMod::MapTrainer::newPokemon(const MapTrainerPokemon& p) +PokeMod::MapTrainerTeamMember& PokeMod::MapTrainer::newTeamMember(const MapTrainerTeamMember& p) { - team.append(MapTrainerPokemon(pokemod, p, getNewId())); - return team[getPokemonCount() - 1]; + teamMembers.append(MapTrainerTeamMember(pokemod, p, getNewId())); + return teamMembers[getTeamMemberCount() - 1]; } -void PokeMod::MapTrainer::deletePokemon(const unsigned i) throw(IndexException) +void PokeMod::MapTrainer::deleteTeamMember(const unsigned i) throw(IndexException) { - if (getPokemonCount() <= i) + if (getTeamMemberCount() <= i) throw(IndexException("MapTrainer")); - team.removeAt(i); + teamMembers.removeAt(i); } PokeMod::MapTrainer& PokeMod::MapTrainer::operator=(const MapTrainer& rhs) @@ -442,8 +432,9 @@ PokeMod::MapTrainer& PokeMod::MapTrainer::operator=(const MapTrainer& rhs) overworldDialog = rhs.overworldDialog; winDialog = rhs.winDialog; loseDialog = rhs.loseDialog; - team.clear(); - for (unsigned i = 0; i < rhs.getPokemonCount(); ++i) - newPokemon(rhs.getPokemon(i)); + leadTeamMember = rhs.leadTeamMember; + teamMembers.clear(); + for (unsigned i = 0; i < rhs.getTeamMemberCount(); ++i) + newTeamMember(rhs.getTeamMember(i)); return *this; } diff --git a/pokemod/MapTrainer.h b/pokemod/MapTrainer.h index e80fa782..784facf7 100644 --- a/pokemod/MapTrainer.h +++ b/pokemod/MapTrainer.h @@ -36,7 +36,7 @@ #include "../general/Point.h" #include "Object.h" #include "Dialog.h" -#include "MapTrainerPokemon.h" +#include "MapTrainerTeamMember.h" namespace PokeMod { @@ -65,12 +65,10 @@ namespace PokeMod void setOverworldDialog(const unsigned o) throw(BoundsException); void setWinDialog(const unsigned w) throw(BoundsException); void setLoseDialog(const unsigned l) throw(BoundsException); - void setLeadPokemon(const unsigned l) throw(BoundsException); + void setLeadTeamMember(const unsigned l) throw(BoundsException); QString getName() const; Point getCoordinate() const; - unsigned getCoordinateX() const; - unsigned getCoordinateY() const; QString getSkin() const; bool getSkinExists() const; unsigned getSight() const; @@ -79,21 +77,21 @@ namespace PokeMod bool getAIExists() const; QString getAI() const; Flag getAppearFlag() const; - unsigned getAppearFlagFlag() const; - unsigned getAppearFlagStatus() const; unsigned getOverworldDialog() const; unsigned getWinDialog() const; unsigned getLoseDialog() const; - unsigned getLeadPokemon() const; + unsigned getLeadTeamMember() const; - const MapTrainerPokemon& getPokemon(const unsigned i) const throw(IndexException); - MapTrainerPokemon& getPokemon(const unsigned i) throw(IndexException); - unsigned getPokemonByID(const unsigned _id) const; - unsigned getPokemonCount() const; - MapTrainerPokemon& newPokemon(); - MapTrainerPokemon& newPokemon(const QString& fname); - MapTrainerPokemon& newPokemon(const MapTrainerPokemon& t); - void deletePokemon(const unsigned i) throw(IndexException); + const MapTrainerTeamMember& getTeamMember(const unsigned i) const throw(IndexException); + MapTrainerTeamMember& getTeamMember(const unsigned i) throw(IndexException); + const MapTrainerTeamMember& getTeamMemberByID(const unsigned i) const throw(IndexException); + MapTrainerTeamMember& getTeamMemberByID(const unsigned i) throw(IndexException); + unsigned getTeamMemberIndex(const unsigned _id) const; + unsigned getTeamMemberCount() const; + MapTrainerTeamMember& newTeamMember(); + MapTrainerTeamMember& newTeamMember(const QString& fname); + MapTrainerTeamMember& newTeamMember(const MapTrainerTeamMember& t); + void deleteTeamMember(const unsigned i) throw(IndexException); MapTrainer& operator=(const MapTrainer& rhs); private: @@ -111,9 +109,9 @@ namespace PokeMod unsigned overworldDialog; unsigned winDialog; unsigned loseDialog; - unsigned leadPokemon; + unsigned leadTeamMember; - QList<MapTrainerPokemon> team; + QList<MapTrainerTeamMember> teamMembers; }; } diff --git a/pokemod/MapTrainerPokemon.cpp b/pokemod/MapTrainerTeamMember.cpp index 531e4052..eb7fa0d1 100644 --- a/pokemod/MapTrainerPokemon.cpp +++ b/pokemod/MapTrainerTeamMember.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: pokemod/MapTrainerPokemon.cpp +// Name: pokemod/MapTrainerTeamMember.cpp // Purpose: Define a Pokémon on a trainer's team // Author: Ben Boeckel // Modified by: Ben Boeckel @@ -20,9 +20,9 @@ // with this program. If not, see <http://www.gnu.org/licenses/>. ///////////////////////////////////////////////////////////////////////////// -#include "MapTrainerPokemon.h" +#include "MapTrainerTeamMember.h" -PokeMod::MapTrainerPokemon::MapTrainerPokemon(const Pokemod& par, const unsigned _id) : +PokeMod::MapTrainerTeamMember::MapTrainerTeamMember(const Pokemod& par, const unsigned _id) : Object(par, _id), species(UINT_MAX), level(UINT_MAX), @@ -30,17 +30,17 @@ PokeMod::MapTrainerPokemon::MapTrainerPokemon(const Pokemod& par, const unsigned { } -PokeMod::MapTrainerPokemon::MapTrainerPokemon(const Pokemod& par, const QString& fname, const unsigned _id) : +PokeMod::MapTrainerTeamMember::MapTrainerTeamMember(const Pokemod& par, const QString& fname, const unsigned _id) : Object(par, _id) { load(fname, _id); } -bool PokeMod::MapTrainerPokemon::validate() const +bool PokeMod::MapTrainerTeamMember::validate() const { bool valid = true; - pokemod.validationMsg(QString("---------Pokémon with id %1---").arg(id), Pokemod::V_Msg); - if (pokemod.getSpeciesByID(species) == UINT_MAX) + pokemod.validationMsg(QString("---------Team Member with id %1---").arg(id), Pokemod::V_Msg); + if (pokemod.getSpeciesIndex(species) == UINT_MAX) { pokemod.validationMsg("Invalid species"); valid = false; @@ -50,12 +50,12 @@ bool PokeMod::MapTrainerPokemon::validate() const pokemod.validationMsg("Invalid level"); valid = false; } - if (getItemCount() <= pokemod.getRules().getHoldItems()) + if (unsigned(items.size()) <= pokemod.getRules().getHoldItems()) { QMap<unsigned, unsigned> idChecker; for (QListIterator<unsigned> i(items); i.hasNext(); i.next()) { - if (pokemod.getItemByID(i.peekNext()) == UINT_MAX) + if (pokemod.getItemIndex(i.peekNext()) == UINT_MAX) { pokemod.validationMsg("Invalid item"); valid = false; @@ -78,7 +78,7 @@ bool PokeMod::MapTrainerPokemon::validate() const } if (pokemod.getRules().getNatureAllowed()) { - if (pokemod.getNatureByID(nature) == UINT_MAX) + if (pokemod.getNatureIndex(nature) == UINT_MAX) { pokemod.validationMsg("Invalid nature"); valid = false; @@ -87,7 +87,7 @@ bool PokeMod::MapTrainerPokemon::validate() const return valid; } -void PokeMod::MapTrainerPokemon::load(const QString& fname, const unsigned _id) throw(Exception) +void PokeMod::MapTrainerTeamMember::load(const QString& fname, const unsigned _id) throw(Exception) { Ini ini(fname); if (_id == UINT_MAX) @@ -109,94 +109,87 @@ void PokeMod::MapTrainerPokemon::load(const QString& fname, const unsigned _id) } } -void PokeMod::MapTrainerPokemon::save(const QString& map, const QString& trainer) const throw(Exception) +void PokeMod::MapTrainerTeamMember::save(const QString& map, const QString& trainer) const throw(Exception) { Ini ini; ini.addField("id", id); ini.addField("species", species); ini.addField("level", level); ini.addField("nature", nature); - ini.addField("numItems", getItemCount()); - for (unsigned i = 0; i < getItemCount(); ++i) + ini.addField("numItems", unsigned(items.size())); + for (unsigned i = 0; i < unsigned(items.size()); ++i) ini.addField(QString("item-%1").arg(i), items[i]); ini.save(QString("%1/map/%2/trainer/%3/team/%4.pini").arg(pokemod.getPath()).arg(map).arg(trainer).arg(id)); } -void PokeMod::MapTrainerPokemon::setSpecies(const unsigned s) throw(BoundsException) +void PokeMod::MapTrainerTeamMember::setSpecies(const unsigned s) throw(BoundsException) { - if (pokemod.getSpeciesByID(s) == UINT_MAX) - throw(BoundsException("MapTrainerPokemon", "species")); + if (pokemod.getSpeciesIndex(s) == UINT_MAX) + throw(BoundsException("MapTrainerTeamMember", "species")); species = s; } -void PokeMod::MapTrainerPokemon::setLevel(const unsigned l) throw(BoundsException) +void PokeMod::MapTrainerTeamMember::setLevel(const unsigned l) throw(BoundsException) { if (pokemod.getRules().getMaxLevel() < l) - throw(BoundsException("MapTrainerPokemon", "level")); + throw(BoundsException("MapTrainerTeamMember", "level")); level = l; } -void PokeMod::MapTrainerPokemon::setNature(const unsigned n) throw(BoundsException) +void PokeMod::MapTrainerTeamMember::setItem(const unsigned itm, const bool it) throw(Exception) { - if (!pokemod.getRules().getNatureAllowed() || (pokemod.getNatureByID(n) == UINT_MAX)) - throw(BoundsException("MapTrainerPokemon", "nature")); + if (pokemod.getItemIndex(itm) == UINT_MAX) + throw(BoundsException("MpTrainerPokemon", "item")); + for (QMutableListIterator<unsigned> i(items); i.hasNext(); ) + { + if (i.next() == itm) + { + if (it) + throw(Exception("MapTrainerTeamMember", "item already used")); + else + i.remove(); + } + } + if (!it) + throw(Exception("MapTrainerTeamMember", "item wasn\'t being used anyway")); + if (pokemod.getRules().getHoldItems() <= unsigned(items.size())) + throw(Exception("MapTrainerTeamMember", "too many items")); + items.append(itm); +} + +void PokeMod::MapTrainerTeamMember::setNature(const unsigned n) throw(BoundsException) +{ + if (!pokemod.getRules().getNatureAllowed() || (pokemod.getNatureIndex(n) == UINT_MAX)) + throw(BoundsException("MapTrainerTeamMember", "nature")); nature = n; } -unsigned PokeMod::MapTrainerPokemon::getSpecies() const +unsigned PokeMod::MapTrainerTeamMember::getSpecies() const { return species; } -unsigned PokeMod::MapTrainerPokemon::getLevel() const +unsigned PokeMod::MapTrainerTeamMember::getLevel() const { return level; } -unsigned PokeMod::MapTrainerPokemon::getNature() const +unsigned PokeMod::MapTrainerTeamMember::getNature() const { return nature; } -unsigned PokeMod::MapTrainerPokemon::getItem(const unsigned i) const throw(IndexException) -{ - if (getItemCount() <= i) - throw(IndexException("MapTrainerPokemon")); - return items.at(i); -} - -unsigned PokeMod::MapTrainerPokemon::getItemByID(const unsigned _id) const +bool PokeMod::MapTrainerTeamMember::getItem(const unsigned itm) const { - for (unsigned i = 0; i < getItemCount(); ++i) + for (QListIterator<unsigned> i(items); i.hasNext(); ) { - if (items[i] == _id) - return i; + if (i.next() == itm) + return true; } - return UINT_MAX; -} - -unsigned PokeMod::MapTrainerPokemon::getItemCount() const -{ - return items.size(); -} - -void PokeMod::MapTrainerPokemon::newItem(const unsigned i) throw(Exception) -{ - if (pokemod.getRules().getHoldItems() <= getItemCount()) - throw(Exception("MapTrainerPokemon", "too many items")); - if (pokemod.getItemByID(i) == UINT_MAX) - throw(BoundsException("MapTrainerPokemon", "item")); - items.append(i); -} - -void PokeMod::MapTrainerPokemon::deleteItem(const unsigned i) throw(IndexException) -{ - if (getItemCount() <= i) - throw(IndexException("MapTrainerPokemon")); - items.erase(items.begin() + i); + return false; } -PokeMod::MapTrainerPokemon& PokeMod::MapTrainerPokemon::operator=(const MapTrainerPokemon& rhs) +PokeMod::MapTrainerTeamMember& PokeMod::MapTrainerTeamMember::operator=(const MapTrainerTeamMember& rhs) { if (this == &rhs) return *this; diff --git a/pokemod/MapTrainerPokemon.h b/pokemod/MapTrainerTeamMember.h index de7b4c69..37dc7c5d 100644 --- a/pokemod/MapTrainerPokemon.h +++ b/pokemod/MapTrainerTeamMember.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: pokemod/MapTrainerPokemon.h +// Name: pokemod/MapTrainerTeamMember.h // Purpose: Define a Pokémon on a trainer's team // Author: Ben Boeckel // Modified by: Ben Boeckel @@ -20,8 +20,8 @@ // with this program. If not, see <http://www.gnu.org/licenses/>. ///////////////////////////////////////////////////////////////////////////// -#ifndef __POKEMOD_MAPTRAINERPOKEMON__ -#define __POKEMOD_MAPTRAINERPOKEMON__ +#ifndef __POKEMOD_MAPTRAINERTEAMMEMBER__ +#define __POKEMOD_MAPTRAINERTEAMMEMBER__ #include <QList> #include <QListIterator> @@ -34,12 +34,12 @@ namespace PokeMod { - class MapTrainerPokemon : public Object + class MapTrainerTeamMember : public Object { public: - MapTrainerPokemon(const Pokemod& par, const unsigned _id); - MapTrainerPokemon(const Pokemod& par, const MapTrainerPokemon& p, const unsigned _id); - MapTrainerPokemon(const Pokemod& par, const QString& fname, const unsigned _id = UINT_MAX); + MapTrainerTeamMember(const Pokemod& par, const unsigned _id); + MapTrainerTeamMember(const Pokemod& par, const MapTrainerTeamMember& p, const unsigned _id); + MapTrainerTeamMember(const Pokemod& par, const QString& fname, const unsigned _id = UINT_MAX); void load(const QString& fname, const unsigned _id = UINT_MAX) throw(Exception); void save(const QString& map, const QString& trainer) const throw(Exception); @@ -47,18 +47,14 @@ namespace PokeMod void setSpecies(const unsigned s) throw(BoundsException); void setLevel(const unsigned l) throw(BoundsException); void setNature(const unsigned n) throw(BoundsException); + void setItem(const unsigned itm, const bool it) throw(Exception); unsigned getSpecies() const; unsigned getLevel() const; unsigned getNature() const; + bool getItem(const unsigned itm) const; - unsigned getItem(const unsigned i) const throw(IndexException); - unsigned getItemByID(const unsigned _id) const; - unsigned getItemCount() const; - void newItem(const unsigned i) throw(Exception); - void deleteItem(const unsigned i) throw(IndexException); - - MapTrainerPokemon& operator=(const MapTrainerPokemon& p); + MapTrainerTeamMember& operator=(const MapTrainerTeamMember& p); private: bool validate() const; diff --git a/pokemod/MapWarp.cpp b/pokemod/MapWarp.cpp index 33a85a2b..0a29d16f 100644 --- a/pokemod/MapWarp.cpp +++ b/pokemod/MapWarp.cpp @@ -78,20 +78,20 @@ bool PokeMod::MapWarp::validate() const pokemod.validationMsg("Invalid type"); valid = false; } - if (pokemod.getMapByID(toMap) == UINT_MAX) + if (pokemod.getMapIndex(toMap) == UINT_MAX) { pokemod.validationMsg("Invalid destination map"); valid = false; } else { - if (pokemod.getMap(pokemod.getMapByID(toMap)).getWarpByID(toWarp) == UINT_MAX) + if (pokemod.getMapByID(toMap).getWarpIndex(toWarp) == UINT_MAX) { pokemod.validationMsg("Invalid destnation warp"); valid = false; } } - if (pokemod.getDialogByID(dialog) == UINT_MAX) + if (pokemod.getDialogIndex(dialog) == UINT_MAX) { pokemod.validationMsg("Invalid dialog"); valid = false; @@ -210,7 +210,7 @@ void PokeMod::MapWarp::setIsFoggy(const bool i) void PokeMod::MapWarp::setToMap(const unsigned t) throw(BoundsException) { - if (pokemod.getMapByID(t) == UINT_MAX) + if (pokemod.getMapIndex(t) == UINT_MAX) throw(BoundsException("MapWarp", "toMap")); toMap = t; toWarp = UINT_MAX; @@ -218,9 +218,9 @@ void PokeMod::MapWarp::setToMap(const unsigned t) throw(BoundsException) void PokeMod::MapWarp::setToWarp(const unsigned t) throw(BoundsException) { - if (pokemod.getMapByID(toMap) == UINT_MAX) + if (pokemod.getMapIndex(toMap) == UINT_MAX) throw(BoundsException("MapWarp", "toMap")); - if (pokemod.getMap(pokemod.getMapByID(toMap)).getWarpByID(t) == UINT_MAX) + if (pokemod.getMapByID(toMap).getWarpIndex(t) == UINT_MAX) throw(BoundsException("MapWarp", "toWarp")); } @@ -241,7 +241,7 @@ void PokeMod::MapWarp::setWorkingFlagStatus(const unsigned s) void PokeMod::MapWarp::setDialog(const unsigned d) throw(BoundsException) { - if (pokemod.getDialogByID(d) == UINT_MAX) + if (pokemod.getDialogIndex(d) == UINT_MAX) throw(BoundsException("MapWarp", "dialog")); dialog = d; } @@ -256,16 +256,6 @@ Point PokeMod::MapWarp::getCoordinate() const return coordinate; } -unsigned PokeMod::MapWarp::getCoordinateX() const -{ - return coordinate.getX(); -} - -unsigned PokeMod::MapWarp::getCoordinateY() const -{ - return coordinate.getY(); -} - bool PokeMod::MapWarp::getFrom(const unsigned d) const throw(BoundsException) { if (D_End <= d) @@ -313,16 +303,6 @@ Flag PokeMod::MapWarp::getWorkingFlag() const return workingFlag; } -unsigned PokeMod::MapWarp::getWorkingFlagFlag() const -{ - return workingFlag.getFlag(); -} - -unsigned PokeMod::MapWarp::getWorkingFlagStatus() const -{ - return workingFlag.getStatus(); -} - unsigned PokeMod::MapWarp::getDialog() const { return dialog; diff --git a/pokemod/MapWarp.h b/pokemod/MapWarp.h index 1eff57f0..7430ed97 100644 --- a/pokemod/MapWarp.h +++ b/pokemod/MapWarp.h @@ -72,8 +72,6 @@ namespace PokeMod QString getName() const; Point getCoordinate() const; - unsigned getCoordinateX() const; - unsigned getCoordinateY() const; bool getFrom(const unsigned d) const throw(BoundsException); unsigned getDirectionOut() const; unsigned getWarpType() const; @@ -83,8 +81,6 @@ namespace PokeMod unsigned getToMap() const; unsigned getToWarp() const; Flag getWorkingFlag() const; - unsigned getWorkingFlagFlag() const; - unsigned getWorkingFlagStatus() const; unsigned getDialog() const; MapWarp& operator=(const MapWarp& rhs); diff --git a/pokemod/MapWildList.cpp b/pokemod/MapWildList.cpp index 44f7f42b..79fd2fbc 100644 --- a/pokemod/MapWildList.cpp +++ b/pokemod/MapWildList.cpp @@ -73,7 +73,7 @@ bool PokeMod::MapWildList::validate() const QMap<unsigned, unsigned> idChecker; for (QListIterator<unsigned> i(times); i.hasNext(); i.next()) { - if (pokemod.getTimeByID(i.peekNext()) == UINT_MAX) + if (pokemod.getTimeIndex(i.peekNext()) == UINT_MAX) { pokemod.validationMsg("Invalid time"); valid = false; @@ -111,7 +111,7 @@ bool PokeMod::MapWildList::validate() const unsigned PokeMod::MapWildList::getNewId() const { unsigned i = 0; - for (; (i < getPokemonCount()) && (getPokemonByID(i) != UINT_MAX); ++i) + for (; (i < getEncounterCount()) && (getEncounterIndex(i) != UINT_MAX); ++i) ; return i; } @@ -139,11 +139,11 @@ void PokeMod::MapWildList::load(const QString& fname, const unsigned _id) throw( QStringList path = pokemod.getPath().split('/'); path.removeLast(); QDir fdir(path.join("/")); - pokemon.clear(); - if (fdir.cd("pokemon")) + encounters.clear(); + if (fdir.cd("encounter")) { for (QStringListIterator i(fdir.entryList(QStringList("*.pini"), QDir::Files, QDir::Name)); i.hasNext(); ) - newPokemon(i.next()); + newEncounter(i.next()); } } @@ -158,7 +158,7 @@ void PokeMod::MapWildList::save(const QString& map) const throw(Exception) ini.addField(QString("time-%1").arg(i), times[i]); ini.addField("scope", scope); ini.save(QString("%1/map/%2/wildlist/%3/data.pini").arg(pokemod.getPath()).arg(map).arg(id)); - for (QListIterator<MapWildListPokemon> i(pokemon); i.hasNext(); ) + for (QListIterator<MapWildListEncounter> i(encounters); i.hasNext(); ) i.next().save(map, id); } @@ -221,58 +221,68 @@ int PokeMod::MapWildList::getScope() const return scope; } -const PokeMod::MapWildListPokemon& PokeMod::MapWildList::getPokemon(const unsigned i) const throw(IndexException) +const PokeMod::MapWildListEncounter& PokeMod::MapWildList::getEncounter(const unsigned i) const throw(IndexException) { - if (getPokemonCount() <= i) + if (getEncounterCount() <= i) throw(IndexException("MapWildList")); - return pokemon.at(i); + return encounters.at(i); } -PokeMod::MapWildListPokemon& PokeMod::MapWildList::getPokemon(const unsigned i) throw(IndexException) +PokeMod::MapWildListEncounter& PokeMod::MapWildList::getEncounter(const unsigned i) throw(IndexException) { - if (getPokemonCount() <= i) + if (getEncounterCount() <= i) throw(IndexException("MapWildList")); - return pokemon[i]; + return encounters[i]; } -unsigned PokeMod::MapWildList::getPokemonByID(const unsigned _id) const +const PokeMod::MapWildListEncounter& PokeMod::MapWildList::getEncounterByID(const unsigned i) const throw(IndexException) { - for (unsigned i = 0; i < getPokemonCount(); ++i) + return getEncounter(getEncounterIndex(i)); +} + +PokeMod::MapWildListEncounter& PokeMod::MapWildList::getEncounterByID(const unsigned i) throw(IndexException) +{ + return getEncounter(getEncounterIndex(i)); +} + +unsigned PokeMod::MapWildList::getEncounterIndex(const unsigned _id) const +{ + for (unsigned i = 0; i < getEncounterCount(); ++i) { - if (pokemon[i].getId() == _id) + if (encounters[i].getId() == _id) return i; } return UINT_MAX; } -unsigned PokeMod::MapWildList::getPokemonCount() const +unsigned PokeMod::MapWildList::getEncounterCount() const { - return pokemon.size(); + return encounters.size(); } -PokeMod::MapWildListPokemon& PokeMod::MapWildList::newPokemon() +PokeMod::MapWildListEncounter& PokeMod::MapWildList::newEncounter() { - pokemon.append(MapWildListPokemon(pokemod, getNewId())); - return pokemon[getPokemonCount() - 1]; + encounters.append(MapWildListEncounter(pokemod, getNewId())); + return encounters[getEncounterCount() - 1]; } -PokeMod::MapWildListPokemon& PokeMod::MapWildList::newPokemon(const QString& fname) +PokeMod::MapWildListEncounter& PokeMod::MapWildList::newEncounter(const QString& fname) { - pokemon.append(MapWildListPokemon(pokemod, fname, getNewId())); - return pokemon[getPokemonCount() - 1]; + encounters.append(MapWildListEncounter(pokemod, fname, getNewId())); + return encounters[getEncounterCount() - 1]; } -PokeMod::MapWildListPokemon& PokeMod::MapWildList::newPokemon(const MapWildListPokemon& p) +PokeMod::MapWildListEncounter& PokeMod::MapWildList::newEncounter(const MapWildListEncounter& p) { - pokemon.append(MapWildListPokemon(pokemod, p, getNewId())); - return pokemon[getPokemonCount() - 1]; + encounters.append(MapWildListEncounter(pokemod, p, getNewId())); + return encounters[getEncounterCount() - 1]; } -void PokeMod::MapWildList::deletePokemon(const unsigned i) throw(IndexException) +void PokeMod::MapWildList::deleteEncounter(const unsigned i) throw(IndexException) { - if (getPokemonCount() <= i) + if (getEncounterCount() <= i) throw(IndexException("MapWildList")); - pokemon.removeAt(i); + encounters.removeAt(i); } PokeMod::MapWildList& PokeMod::MapWildList::operator=(const MapWildList& rhs) @@ -283,8 +293,8 @@ PokeMod::MapWildList& PokeMod::MapWildList::operator=(const MapWildList& rhs) value = rhs.value; times = rhs.times; scope = rhs.scope; - pokemon.clear(); - for (unsigned i = 0; i < rhs.getPokemonCount(); ++i) - newPokemon(rhs.getPokemon(i)); + encounters.clear(); + for (unsigned i = 0; i < rhs.getEncounterCount(); ++i) + newEncounter(rhs.getEncounter(i)); return *this; } diff --git a/pokemod/MapWildList.h b/pokemod/MapWildList.h index d8c8f35a..5c722726 100644 --- a/pokemod/MapWildList.h +++ b/pokemod/MapWildList.h @@ -37,7 +37,7 @@ #include "Pokemod.h" #include "Item.h" #include "ItemEffect.h" -#include "MapWildListPokemon.h" +#include "MapWildListEncounter.h" namespace PokeMod { @@ -73,14 +73,16 @@ namespace PokeMod bool getTime(const unsigned ts) const; int getScope() const; - const MapWildListPokemon& getPokemon(const unsigned i) const throw(IndexException); - MapWildListPokemon& getPokemon(const unsigned i) throw(IndexException); - unsigned getPokemonByID(const unsigned _id) const; - unsigned getPokemonCount() const; - MapWildListPokemon& newPokemon(); - MapWildListPokemon& newPokemon(const QString& fname); - MapWildListPokemon& newPokemon(const MapWildListPokemon& w); - void deletePokemon(const unsigned i) throw(IndexException); + const MapWildListEncounter& getEncounter(const unsigned i) const throw(IndexException); + MapWildListEncounter& getEncounter(const unsigned i) throw(IndexException); + const MapWildListEncounter& getEncounterByID(const unsigned i) const throw(IndexException); + MapWildListEncounter& getEncounterByID(const unsigned i) throw(IndexException); + unsigned getEncounterIndex(const unsigned _id) const; + unsigned getEncounterCount() const; + MapWildListEncounter& newEncounter(); + MapWildListEncounter& newEncounter(const QString& fname); + MapWildListEncounter& newEncounter(const MapWildListEncounter& w); + void deleteEncounter(const unsigned i) throw(IndexException); MapWildList& operator=(const MapWildList& rhs); private: @@ -92,7 +94,7 @@ namespace PokeMod QList<unsigned> times; unsigned scope; - QList<MapWildListPokemon> pokemon; + QList<MapWildListEncounter> encounters; }; } diff --git a/pokemod/MapWildListPokemon.cpp b/pokemod/MapWildListEncounter.cpp index 046c18c3..329a2768 100644 --- a/pokemod/MapWildListPokemon.cpp +++ b/pokemod/MapWildListEncounter.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: pokemod/MapWildListPokemon.cpp +// Name: pokemod/MapWildListEncounter.cpp // Purpose: Define a species that can be found in the wild // Author: Ben Boeckel // Modified by: Ben Boeckel @@ -20,9 +20,9 @@ // with this program. If not, see <http://www.gnu.org/licenses/>. ///////////////////////////////////////////////////////////////////////////// -#include "MapWildListPokemon.h" +#include "MapWildListEncounter.h" -PokeMod::MapWildListPokemon::MapWildListPokemon(const Pokemod& par, const unsigned _id) : +PokeMod::MapWildListEncounter::MapWildListEncounter(const Pokemod& par, const unsigned _id) : Object(par, _id), species(UINT_MAX), level(1), @@ -30,23 +30,23 @@ PokeMod::MapWildListPokemon::MapWildListPokemon(const Pokemod& par, const unsign { } -PokeMod::MapWildListPokemon::MapWildListPokemon(const Pokemod& par, const MapWildListPokemon& p, const unsigned _id) : +PokeMod::MapWildListEncounter::MapWildListEncounter(const Pokemod& par, const MapWildListEncounter& p, const unsigned _id) : Object(par, _id) { *this = p; } -PokeMod::MapWildListPokemon::MapWildListPokemon(const Pokemod& par, const QString& fname, const unsigned _id) : +PokeMod::MapWildListEncounter::MapWildListEncounter(const Pokemod& par, const QString& fname, const unsigned _id) : Object(par, _id) { load(fname, _id); } -bool PokeMod::MapWildListPokemon::validate() const +bool PokeMod::MapWildListEncounter::validate() const { bool valid = true; - pokemod.validationMsg(QString("---------Pokémon with id %1---").arg(id), Pokemod::V_Msg); - if (pokemod.getSpeciesByID(species) == UINT_MAX) + pokemod.validationMsg(QString("---------Encounter with id %1---").arg(id), Pokemod::V_Msg); + if (pokemod.getSpeciesIndex(species) == UINT_MAX) { pokemod.validationMsg("Invalid species"); valid = false; @@ -64,7 +64,7 @@ bool PokeMod::MapWildListPokemon::validate() const return valid; } -void PokeMod::MapWildListPokemon::load(const QString& fname, const unsigned _id) throw(Exception) +void PokeMod::MapWildListEncounter::load(const QString& fname, const unsigned _id) throw(Exception) { Ini ini(fname); if (_id == UINT_MAX) @@ -76,53 +76,53 @@ void PokeMod::MapWildListPokemon::load(const QString& fname, const unsigned _id) ini.getValue("weight", weight, 1); } -void PokeMod::MapWildListPokemon::save(const QString& map, const unsigned listId) const throw(Exception) +void PokeMod::MapWildListEncounter::save(const QString& map, const unsigned listId) const throw(Exception) { Ini ini; ini.addField("id", id); ini.addField("species", species); ini.addField("level", level); ini.addField("weight", weight); - ini.save(QString("%1/map/%2/wildlist/%3/pokemon/%4.pini").arg(pokemod.getPath()).arg(map).arg(listId).arg(id)); + ini.save(QString("%1/map/%2/wildlist/%3/encounter/%4.pini").arg(pokemod.getPath()).arg(map).arg(listId).arg(id)); } -void PokeMod::MapWildListPokemon::setSpecies(const unsigned s) throw(BoundsException) +void PokeMod::MapWildListEncounter::setSpecies(const unsigned s) throw(BoundsException) { - if (pokemod.getSpeciesByID(s) == UINT_MAX) - throw(BoundsException("MapWildListPokemon", "species")); + if (pokemod.getSpeciesIndex(s) == UINT_MAX) + throw(BoundsException("MapWildListEncounter", "species")); species = s; } -void PokeMod::MapWildListPokemon::setLevel(const unsigned l) throw(BoundsException) +void PokeMod::MapWildListEncounter::setLevel(const unsigned l) throw(BoundsException) { if (!level || (pokemod.getRules().getMaxLevel() <= level)) - throw(BoundsException("MapWildListPokemon", "level")); + throw(BoundsException("MapWildListEncounter", "level")); level = l; } -void PokeMod::MapWildListPokemon::setWeight(const unsigned w) throw(BoundsException) +void PokeMod::MapWildListEncounter::setWeight(const unsigned w) throw(BoundsException) { if (!w) - throw(BoundsException("MapWildListPokemon", "weight")); + throw(BoundsException("MapWildListEncounter", "weight")); weight = w; } -unsigned PokeMod::MapWildListPokemon::getSpecies() const +unsigned PokeMod::MapWildListEncounter::getSpecies() const { return species; } -unsigned PokeMod::MapWildListPokemon::getLevel() const +unsigned PokeMod::MapWildListEncounter::getLevel() const { return level; } -unsigned PokeMod::MapWildListPokemon::getWeight() const +unsigned PokeMod::MapWildListEncounter::getWeight() const { return weight; } -PokeMod::MapWildListPokemon& PokeMod::MapWildListPokemon::operator=(const MapWildListPokemon& rhs) +PokeMod::MapWildListEncounter& PokeMod::MapWildListEncounter::operator=(const MapWildListEncounter& rhs) { if (this == &rhs) return *this; diff --git a/pokemod/MapWildListPokemon.h b/pokemod/MapWildListEncounter.h index cb367b83..04ec43d0 100644 --- a/pokemod/MapWildListPokemon.h +++ b/pokemod/MapWildListEncounter.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: pokemod/MapWildListPokemon.h +// Name: pokemod/MapWildListEncounter.h // Purpose: Define a species that can be found in the wild // Author: Ben Boeckel // Modified by: Ben Boeckel @@ -20,8 +20,8 @@ // with this program. If not, see <http://www.gnu.org/licenses/>. ///////////////////////////////////////////////////////////////////////////// -#ifndef __POKEMOD_MAPWILDLISTPOKEMON__ -#define __POKEMOD_MAPWILDLISTPOKEMON__ +#ifndef __POKEMOD_MAPWILDLISTENCOUNTER__ +#define __POKEMOD_MAPWILDLISTENCOUNTER__ #include <QString> #include "../general/Exception.h" @@ -31,12 +31,12 @@ namespace PokeMod { - class MapWildListPokemon: public Object + class MapWildListEncounter: public Object { public: - MapWildListPokemon(const Pokemod& par, const unsigned _id); - MapWildListPokemon(const Pokemod& par, const MapWildListPokemon& p, const unsigned _id); - MapWildListPokemon(const Pokemod& par, const QString& fname, const unsigned _id = UINT_MAX); + MapWildListEncounter(const Pokemod& par, const unsigned _id); + MapWildListEncounter(const Pokemod& par, const MapWildListEncounter& p, const unsigned _id); + MapWildListEncounter(const Pokemod& par, const QString& fname, const unsigned _id = UINT_MAX); void load(const QString& fname, const unsigned _id = UINT_MAX) throw(Exception); void save(const QString& map, const unsigned listId) const throw(Exception); @@ -49,7 +49,7 @@ namespace PokeMod unsigned getLevel() const; unsigned getWeight() const; - MapWildListPokemon& operator=(const MapWildListPokemon& rhs); + MapWildListEncounter& operator=(const MapWildListEncounter& rhs); private: bool validate() const; diff --git a/pokemod/Move.cpp b/pokemod/Move.cpp index 5933d34f..b29ca946 100644 --- a/pokemod/Move.cpp +++ b/pokemod/Move.cpp @@ -1,6 +1,6 @@ ///////////////////////////////////////////////////////////////////////////// // Name: pokemod/Move.cpp -// Purpose: Define a move that species can learn +// Purpose: Define a move that can be learned // Author: Ben Boeckel // Modified by: Ben Boeckel // Created: Sat May 26 2007 22:51:21 @@ -65,7 +65,7 @@ bool PokeMod::Move::validate() const pokemod.validationMsg("Name is not defined"); valid = ""; } - if (pokemod.getTypeByID(type) == UINT_MAX) + if (pokemod.getTypeIndex(type) == UINT_MAX) { pokemod.validationMsg("Invalid type"); valid = false; @@ -119,7 +119,7 @@ bool PokeMod::Move::validate() const unsigned PokeMod::Move::getNewId() const { unsigned i = 0; - for (; (i < getEffectCount()) && (getEffectByID(i) != UINT_MAX); ++i) + for (; (i < getEffectCount()) && (getEffectIndex(i) != UINT_MAX); ++i) ; return i; } @@ -208,7 +208,7 @@ void PokeMod::Move::setAccuracyDenom(const unsigned d) throw(Exception) void PokeMod::Move::setType(const unsigned t) throw(BoundsException) { - if (pokemod.getTypeByID(t) == UINT_MAX) + if (pokemod.getTypeIndex(t) == UINT_MAX) throw(BoundsException("Move", "type")); type = t; } @@ -355,7 +355,17 @@ PokeMod::MoveEffect& PokeMod::Move::getEffect(const unsigned i) throw(IndexExcep return effects[i]; } -unsigned PokeMod::Move::getEffectByID(const unsigned _id) const +const PokeMod::MoveEffect& PokeMod::Move::getEffectByID(const unsigned i) const throw(IndexException) +{ + return getEffect(getEffectIndex(i)); +} + +PokeMod::MoveEffect& PokeMod::Move::getEffectByID(const unsigned i) throw(IndexException) +{ + return getEffect(getEffectIndex(i)); +} + +unsigned PokeMod::Move::getEffectIndex(const unsigned _id) const { for (unsigned i = 0; i < getEffectCount(); ++i) { diff --git a/pokemod/Move.h b/pokemod/Move.h index a47975ce..5f643401 100644 --- a/pokemod/Move.h +++ b/pokemod/Move.h @@ -1,6 +1,6 @@ ///////////////////////////////////////////////////////////////////////////// // Name: pokemod/Move.h -// Purpose: Define a move that Pokémon can learn +// Purpose: Define a move that can be learned // Author: Ben Boeckel // Modified by: Ben Boeckel // Created: Sat May 26 2007 08:57:13 @@ -100,7 +100,9 @@ namespace PokeMod const MoveEffect& getEffect(const unsigned i) const throw(IndexException); MoveEffect& getEffect(const unsigned i) throw(IndexException); - unsigned getEffectByID(const unsigned _id) const; + const MoveEffect& getEffectByID(const unsigned i) const throw(IndexException); + MoveEffect& getEffectByID(const unsigned i) throw(IndexException); + unsigned getEffectIndex(const unsigned _id) const; unsigned getEffectCount() const; MoveEffect& newEffect(); MoveEffect& newEffect(const QString& fname); diff --git a/pokemod/Object.h b/pokemod/Object.h index 9ac559ad..b936179a 100644 --- a/pokemod/Object.h +++ b/pokemod/Object.h @@ -13,7 +13,7 @@ // // 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 +// MERCHANTCLASS 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 diff --git a/pokemod/Pokemod.cpp b/pokemod/Pokemod.cpp index da034a59..74b8b7c4 100644 --- a/pokemod/Pokemod.cpp +++ b/pokemod/Pokemod.cpp @@ -29,10 +29,7 @@ PokeMod::Pokemod::Pokemod(const QString& fname) : version(""), description(""), startMap(UINT_MAX), - startMoney(0), - startCoordinate(0, 0), - startDirection(UINT_MAX), - startDialog(UINT_MAX), + startWarp(UINT_MAX), superPCUname(""), superPCPasswd(""), typeChart(1, 1, Frac(1, 1, Frac::Improper)), @@ -57,16 +54,11 @@ bool PokeMod::Pokemod::validate() const } if (description == "") validationMsg("Description is not defined", V_Warn); - if (getMapByID(startMap)) + if (getMapIndex(startMap)) { - if (getMap(getMapByID(startMap)).getWidth() <= startCoordinate.getX()) + if (getMapByID(startMap).getWarpIndex(startWarp) == UINT_MAX) { - validationMsg("Invalid starting x coordinate"); - valid = false; - } - if (getMap(getMapByID(startMap)).getHeight() <= startCoordinate.getY()) - { - validationMsg("Invalid starting y coordinate"); + validationMsg("Invalid starting warp"); valid = false; } } @@ -75,16 +67,6 @@ bool PokeMod::Pokemod::validate() const validationMsg("Invalid starting map"); valid = false; } - if (D_End <= startDirection) - { - validationMsg("Invalid starting direction"); - valid = false; - } - if (getDialogByID(startDialog) == UINT_MAX) - { - validationMsg("Invalid starting dialog"); - valid = false; - } if (!QFile::exists(QString("%1/image/skin/walk.png").arg(getPath()))) { validationMsg("Cannot find walking skin"); @@ -452,7 +434,7 @@ bool PokeMod::Pokemod::validate() const } if (!getSpeciesCount()) { - validationMsg("There are no Pokémon"); + validationMsg("There are no species"); valid = false; } for (QListIterator<Species> i(species); i.hasNext(); i.next()) @@ -466,7 +448,7 @@ bool PokeMod::Pokemod::validate() const { if (1 < i.value()) { - validationMsg(QString("There are %1 Pokémon with id %2").arg(i.value()).arg(i.key())); + validationMsg(QString("There are %1 species with id %2").arg(i.value()).arg(i.key())); valid = false; } } @@ -474,7 +456,7 @@ bool PokeMod::Pokemod::validate() const { if (1 < i.value()) { - validationMsg(QString("There are %1 Pokémon with the name \"%2\"").arg(i.value()).arg(i.key())); + validationMsg(QString("There are %1 species with the name \"%2\"").arg(i.value()).arg(i.key())); valid = false; } } @@ -621,18 +603,11 @@ void PokeMod::Pokemod::load(const QString& fname) throw(Exception) QStringList fpath = fname.split('\\', QString::SkipEmptyParts).join("/").split('\\', QString::SkipEmptyParts); fpath.removeLast(); path = fpath.join("/"); - unsigned i; - unsigned j; ini.getValue("title", title); ini.getValue("version", version); ini.getValue("description", description); ini.getValue("startMap", startMap); - ini.getValue("startMoney", startMoney, 0); - ini.getValue("startCoordinate-x", i, 0); - ini.getValue("startCoordinate-y", j, 0); - startCoordinate.set(i, j); - ini.getValue("startDirection", startDirection); - ini.getValue("startDialog", startDialog); + ini.getValue("startWarp", startWarp); ini.getValue("superPCUname", superPCUname); ini.getValue("superPCPasswd", superPCPasswd); for (unsigned i = 0; i < pokemod.getTypeCount(); ++i) @@ -769,11 +744,7 @@ void PokeMod::Pokemod::save() const throw(Exception) ini.addField("version", version); ini.addField("description", description); ini.addField("startMap", startMap); - ini.addField("startMoney", startMoney); - ini.addField("startCoordinate-x", startCoordinate.getX()); - ini.addField("startCoordinate-y", startCoordinate.getY()); - ini.addField("startDirection", startDirection); - ini.addField("startDialog", startDialog); + ini.addField("startWarp", startWarp); ini.addField("superPCUname", superPCUname); ini.addField("superPCPasswd", superPCPasswd); for (unsigned i = 1; i < typeChart.getWidth(); ++i) @@ -842,57 +813,18 @@ void PokeMod::Pokemod::setDescription(const QString& d) void PokeMod::Pokemod::setStartMap(const unsigned s) throw(BoundsException) { - if (getMapByID(s) == UINT_MAX) + if (getMapIndex(s) == UINT_MAX) throw(BoundsException("Pokemod", "startMap")); startMap = s; } -void PokeMod::Pokemod::setStartMoney(const unsigned s) -{ - startMoney = s; -} - -void PokeMod::Pokemod::setStartCoordinate(const unsigned x, const unsigned y) throw(BoundsException) -{ - if (getMapByID(startMap) == UINT_MAX) - throw(BoundsException("Pokemod", "startMap")); - if (getMap(getMapByID(startMap)).getWidth() <= x) - throw(BoundsException("Pokemod", "startX")); - if (getMap(getMapByID(startMap)).getHeight() <= y) - throw(BoundsException("Pokemod", "startY")); - startCoordinate.set(x, y); -} - -void PokeMod::Pokemod::setStartCoordinateX(const unsigned x) throw(BoundsException) +void PokeMod::Pokemod::setStartWarp(const unsigned s) throw(BoundsException) { - if (getMapByID(startMap) == UINT_MAX) + if (getMapIndex(startMap) == UINT_MAX) throw(BoundsException("Pokemod", "startMap")); - if (getMap(getMapByID(startMap)).getWidth() <= x) - throw(BoundsException("Pokemod", "startX")); - startCoordinate.setX(x); -} - -void PokeMod::Pokemod::setStartCoordinateY(const unsigned y) throw(BoundsException) -{ - if (getMapByID(startMap) == UINT_MAX) - throw(BoundsException("Pokemod", "startMap")); - if (getMap(getMapByID(startMap)).getHeight() <= y) - throw(BoundsException("Pokemod", "startY")); - startCoordinate.setY(y); -} - -void PokeMod::Pokemod::setStartDirection(const unsigned s) throw(BoundsException) -{ - if (D_End <= s) - throw(BoundsException("Pokemod", "startDirection")); - startDirection = s; -} - -void PokeMod::Pokemod::setStartDialog(const unsigned s) throw(BoundsException) -{ - if (getDialogByID(s) == UINT_MAX) - throw(BoundsException("Pokemod", "startDialog")); - startDialog = s; + if (getMapByID(startMap).getWarpIndex(s) == UINT_MAX) + throw(BoundsException("Pokemod", "startWarp")); + startWarp = s; } void PokeMod::Pokemod::setWalkSkin(const QString& fname) throw(Exception) @@ -1004,24 +936,9 @@ unsigned PokeMod::Pokemod::getStartMap() const return startMap; } -unsigned PokeMod::Pokemod::getStartMoney() const -{ - return startMoney; -} - -Point PokeMod::Pokemod::getStartCoordinate() const -{ - return startCoordinate; -} - -unsigned PokeMod::Pokemod::getStartDirection() const +unsigned PokeMod::Pokemod::getStartWarp() const { - return startDirection; -} - -unsigned PokeMod::Pokemod::getStartDialog() const -{ - return startDialog; + return startWarp; } QString PokeMod::Pokemod::getSuperPCUname() const @@ -1073,7 +990,17 @@ PokeMod::Ability& PokeMod::Pokemod::getAbility(const unsigned i) throw(IndexExce return abilities[i]; } -unsigned PokeMod::Pokemod::getAbilityByID(const unsigned _id) const +const PokeMod::Ability& PokeMod::Pokemod::getAbilityByID(const unsigned i) const throw(IndexException) +{ + return getAbility(getAbilityIndex(i)); +} + +PokeMod::Ability& PokeMod::Pokemod::getAbilityByID(const unsigned i) throw(IndexException) +{ + return getAbility(getAbilityIndex(i)); +} + +unsigned PokeMod::Pokemod::getAbilityIndex(const unsigned _id) const { for (unsigned i = 0; i < getAbilityCount(); ++i) { @@ -1127,7 +1054,17 @@ PokeMod::Author& PokeMod::Pokemod::getAuthor(const unsigned i) throw(IndexExcept return authors[i]; } -unsigned PokeMod::Pokemod::getAuthorByID(const unsigned _id) const +const PokeMod::Author& PokeMod::Pokemod::getAuthorByID(const unsigned i) const throw(IndexException) +{ + return getAuthor(getAuthorIndex(i)); +} + +PokeMod::Author& PokeMod::Pokemod::getAuthorByID(const unsigned i) throw(IndexException) +{ + return getAuthor(getAuthorIndex(i)); +} + +unsigned PokeMod::Pokemod::getAuthorIndex(const unsigned _id) const { for (unsigned i = 0; i < getAuthorCount(); ++i) { @@ -1169,7 +1106,17 @@ PokeMod::Badge& PokeMod::Pokemod::getBadge(const unsigned i) throw(IndexExceptio return badges[i]; } -unsigned PokeMod::Pokemod::getBadgeByID(const unsigned _id) const +const PokeMod::Badge& PokeMod::Pokemod::getBadgeByID(const unsigned i) const throw(IndexException) +{ + return getBadge(getBadgeIndex(i)); +} + +PokeMod::Badge& PokeMod::Pokemod::getBadgeByID(const unsigned i) throw(IndexException) +{ + return getBadge(getBadgeIndex(i)); +} + +unsigned PokeMod::Pokemod::getBadgeIndex(const unsigned _id) const { for (unsigned i = 0; i < getBadgeCount(); ++i) { @@ -1223,7 +1170,17 @@ PokeMod::CoinList& PokeMod::Pokemod::getCoinList(const unsigned i) throw(IndexEx return coinLists[i]; } -unsigned PokeMod::Pokemod::getCoinListByID(const unsigned _id) const +const PokeMod::CoinList& PokeMod::Pokemod::getCoinListByID(const unsigned i) const throw(IndexException) +{ + return getCoinList(getCoinListIndex(i)); +} + +PokeMod::CoinList& PokeMod::Pokemod::getCoinListByID(const unsigned i) throw(IndexException) +{ + return getCoinList(getCoinListIndex(i)); +} + +unsigned PokeMod::Pokemod::getCoinListIndex(const unsigned _id) const { for (unsigned i = 0; i < getCoinListCount(); ++i) { @@ -1277,7 +1234,17 @@ PokeMod::Dialog& PokeMod::Pokemod::getDialog(const unsigned i) throw(IndexExcept return dialogs[i]; } -unsigned PokeMod::Pokemod::getDialogByID(const unsigned _id) const +const PokeMod::Dialog& PokeMod::Pokemod::getDialogByID(const unsigned i) const throw(IndexException) +{ + return getDialog(getDialogIndex(i)); +} + +PokeMod::Dialog& PokeMod::Pokemod::getDialogByID(const unsigned i) throw(IndexException) +{ + return getDialog(getDialogIndex(i)); +} + +unsigned PokeMod::Pokemod::getDialogIndex(const unsigned _id) const { for (unsigned i = 0; i < getDialogCount(); ++i) { @@ -1331,7 +1298,17 @@ PokeMod::EggGroup& PokeMod::Pokemod::getEggGroup(const unsigned i) throw(IndexEx return eggGroups[i]; } -unsigned PokeMod::Pokemod::getEggGroupByID(const unsigned _id) const +const PokeMod::EggGroup& PokeMod::Pokemod::getEggGroupByID(const unsigned i) const throw(IndexException) +{ + return getEggGroup(getEggGroupIndex(i)); +} + +PokeMod::EggGroup& PokeMod::Pokemod::getEggGroupByID(const unsigned i) throw(IndexException) +{ + return getEggGroup(getEggGroupIndex(i)); +} + +unsigned PokeMod::Pokemod::getEggGroupIndex(const unsigned _id) const { for (unsigned i = 0; i < getEggGroupCount(); ++i) { @@ -1385,7 +1362,17 @@ PokeMod::Item& PokeMod::Pokemod::getItem(const unsigned i) throw(IndexException) return items[i]; } -unsigned PokeMod::Pokemod::getItemByID(const unsigned _id) const +const PokeMod::Item& PokeMod::Pokemod::getItemByID(const unsigned i) const throw(IndexException) +{ + return getItem(getItemIndex(i)); +} + +PokeMod::Item& PokeMod::Pokemod::getItemByID(const unsigned i) throw(IndexException) +{ + return getItem(getItemIndex(i)); +} + +unsigned PokeMod::Pokemod::getItemIndex(const unsigned _id) const { for (unsigned i = 0; i < getItemCount(); ++i) { @@ -1439,7 +1426,17 @@ PokeMod::ItemType& PokeMod::Pokemod::getItemType(const unsigned i) throw(IndexEx return itemTypes[i]; } -unsigned PokeMod::Pokemod::getItemTypeByID(const unsigned _id) const +const PokeMod::ItemType& PokeMod::Pokemod::getItemTypeByID(const unsigned i) const throw(IndexException) +{ + return getItemType(getItemTypeIndex(i)); +} + +PokeMod::ItemType& PokeMod::Pokemod::getItemTypeByID(const unsigned i) throw(IndexException) +{ + return getItemType(getItemTypeIndex(i)); +} + +unsigned PokeMod::Pokemod::getItemTypeIndex(const unsigned _id) const { for (unsigned i = 0; i < getItemTypeCount(); ++i) { @@ -1493,7 +1490,17 @@ PokeMod::Map& PokeMod::Pokemod::getMap(const unsigned i) throw(IndexException) return maps[i]; } -unsigned PokeMod::Pokemod::getMapByID(const unsigned _id) const +const PokeMod::Map& PokeMod::Pokemod::getMapByID(const unsigned i) const throw(IndexException) +{ + return getMap(getMapIndex(i)); +} + +PokeMod::Map& PokeMod::Pokemod::getMapByID(const unsigned i) throw(IndexException) +{ + return getMap(getMapIndex(i)); +} + +unsigned PokeMod::Pokemod::getMapIndex(const unsigned _id) const { for (unsigned i = 0; i < getMapCount(); ++i) { @@ -1547,7 +1554,17 @@ PokeMod::Move& PokeMod::Pokemod::getMove(const unsigned i) throw(IndexException) return moves[i]; } -unsigned PokeMod::Pokemod::getMoveByID(const unsigned _id) const +const PokeMod::Move& PokeMod::Pokemod::getMoveByID(const unsigned i) const throw(IndexException) +{ + return getMove(getMoveIndex(i)); +} + +PokeMod::Move& PokeMod::Pokemod::getMoveByID(const unsigned i) throw(IndexException) +{ + return getMove(getMoveIndex(i)); +} + +unsigned PokeMod::Pokemod::getMoveIndex(const unsigned _id) const { for (unsigned i = 0; i < getMoveCount(); ++i) { @@ -1601,7 +1618,17 @@ PokeMod::Nature& PokeMod::Pokemod::getNature(const unsigned i) throw(IndexExcept return natures[i]; } -unsigned PokeMod::Pokemod::getNatureByID(const unsigned _id) const +const PokeMod::Nature& PokeMod::Pokemod::getNatureByID(const unsigned i) const throw(IndexException) +{ + return getNature(getNatureIndex(i)); +} + +PokeMod::Nature& PokeMod::Pokemod::getNatureByID(const unsigned i) throw(IndexException) +{ + return getNature(getNatureIndex(i)); +} + +unsigned PokeMod::Pokemod::getNatureIndex(const unsigned _id) const { for (unsigned i = 0; i < getNatureCount(); ++i) { @@ -1655,7 +1682,17 @@ PokeMod::Species& PokeMod::Pokemod::getSpecies(const unsigned i) throw(IndexExce return species[i]; } -unsigned PokeMod::Pokemod::getSpeciesByID(const unsigned _id) const +const PokeMod::Species& PokeMod::Pokemod::getSpeciesByID(const unsigned i) const throw(IndexException) +{ + return getSpecies(getSpeciesIndex(i)); +} + +PokeMod::Species& PokeMod::Pokemod::getSpeciesByID(const unsigned i) throw(IndexException) +{ + return getSpecies(getSpeciesIndex(i)); +} + +unsigned PokeMod::Pokemod::getSpeciesIndex(const unsigned _id) const { for (unsigned i = 0; i < getSpeciesCount(); ++i) { @@ -1709,7 +1746,17 @@ PokeMod::Store& PokeMod::Pokemod::getStore(const unsigned i) throw(IndexExceptio return stores[i]; } -unsigned PokeMod::Pokemod::getStoreByID(const unsigned _id) const +const PokeMod::Store& PokeMod::Pokemod::getStoreByID(const unsigned i) const throw(IndexException) +{ + return getStore(getStoreIndex(i)); +} + +PokeMod::Store& PokeMod::Pokemod::getStoreByID(const unsigned i) throw(IndexException) +{ + return getStore(getStoreIndex(i)); +} + +unsigned PokeMod::Pokemod::getStoreIndex(const unsigned _id) const { for (unsigned i = 0; i < getStoreCount(); ++i) { @@ -1763,7 +1810,17 @@ PokeMod::Tile& PokeMod::Pokemod::getTile(const unsigned i) throw(IndexException) return tiles[i]; } -unsigned PokeMod::Pokemod::getTileByID(const unsigned _id) const +const PokeMod::Tile& PokeMod::Pokemod::getTileByID(const unsigned i) const throw(IndexException) +{ + return getTile(getTileIndex(i)); +} + +PokeMod::Tile& PokeMod::Pokemod::getTileByID(const unsigned i) throw(IndexException) +{ + return getTile(getTileIndex(i)); +} + +unsigned PokeMod::Pokemod::getTileIndex(const unsigned _id) const { for (unsigned i = 0; i < getTileCount(); ++i) { @@ -1817,7 +1874,17 @@ PokeMod::Time& PokeMod::Pokemod::getTime(const unsigned i) throw(IndexException) return times[i]; } -unsigned PokeMod::Pokemod::getTimeByID(const unsigned _id) const +const PokeMod::Time& PokeMod::Pokemod::getTimeByID(const unsigned i) const throw(IndexException) +{ + return getTime(getTimeIndex(i)); +} + +PokeMod::Time& PokeMod::Pokemod::getTimeByID(const unsigned i) throw(IndexException) +{ + return getTime(getTimeIndex(i)); +} + +unsigned PokeMod::Pokemod::getTimeIndex(const unsigned _id) const { for (unsigned i = 0; i < getTimeCount(); ++i) { @@ -1871,7 +1938,17 @@ PokeMod::Type& PokeMod::Pokemod::getType(const unsigned i) throw(IndexException) return types[i]; } -unsigned PokeMod::Pokemod::getTypeByID(const unsigned _id) const +const PokeMod::Type& PokeMod::Pokemod::getTypeByID(const unsigned i) const throw(IndexException) +{ + return getType(getTypeIndex(i)); +} + +PokeMod::Type& PokeMod::Pokemod::getTypeByID(const unsigned i) throw(IndexException) +{ + return getType(getTypeIndex(i)); +} + +unsigned PokeMod::Pokemod::getTypeIndex(const unsigned _id) const { for (unsigned i = 0; i < getTypeCount(); ++i) { diff --git a/pokemod/Pokemod.h b/pokemod/Pokemod.h index fc4a8e75..8f2453b7 100644 --- a/pokemod/Pokemod.h +++ b/pokemod/Pokemod.h @@ -84,12 +84,7 @@ namespace PokeMod void setVersion(const QString& v); void setDescription(const QString& d); void setStartMap(const unsigned s) throw(BoundsException); - void setStartMoney(const unsigned s); - void setStartCoordinate(const unsigned x, const unsigned y) throw(BoundsException); - void setStartCoordinateX(const unsigned x) throw(BoundsException); - void setStartCoordinateY(const unsigned y) throw(BoundsException); - void setStartDirection(const unsigned s) throw(BoundsException); - void setStartDialog(const unsigned s) throw(BoundsException); + void setStartWarp(const unsigned s) throw(BoundsException); void setWalkSkin(const QString& fname) throw(Exception); void setBikeSkin(const QString& fname) throw(Exception); void setSurfSkin(const QString& fname) throw(Exception); @@ -108,10 +103,7 @@ namespace PokeMod QString getVersion() const; QString getDescription() const; unsigned getStartMap() const; - unsigned getStartMoney() const; - Point getStartCoordinate() const; - unsigned getStartDirection() const; - unsigned getStartDialog() const; + unsigned getStartWarp() const; QString getSuperPCUname() const; QString getSuperPCPasswd() const; const FracMatrix& getTypeChart() const; @@ -122,7 +114,9 @@ namespace PokeMod const Ability& getAbility(const unsigned i) const throw(IndexException); Ability& getAbility(const unsigned i) throw(IndexException); - unsigned getAbilityByID(const unsigned i) const; + const Ability& getAbilityByID(const unsigned i) const throw(IndexException); + Ability& getAbilityByID(const unsigned i) throw(IndexException); + unsigned getAbilityIndex(const unsigned i) const; unsigned getAbilityCount() const; Ability& newAbility(); Ability& newAbility(const QString& fname); @@ -131,7 +125,9 @@ namespace PokeMod const Author& getAuthor(const unsigned i) const throw(IndexException); Author& getAuthor(const unsigned i) throw(IndexException); - unsigned getAuthorByID(const unsigned i) const; + const Author& getAuthorByID(const unsigned i) const throw(IndexException); + Author& getAuthorByID(const unsigned i) throw(IndexException); + unsigned getAuthorIndex(const unsigned i) const; unsigned getAuthorCount() const; Author& newAuthor(); Author& newAuthor(const QString& fname); @@ -140,7 +136,9 @@ namespace PokeMod const Badge& getBadge(const unsigned i) const throw(IndexException); Badge& getBadge(const unsigned i) throw(IndexException); - unsigned getBadgeByID(const unsigned i) const; + const Badge& getBadgeByID(const unsigned i) const throw(IndexException); + Badge& getBadgeByID(const unsigned i) throw(IndexException); + unsigned getBadgeIndex(const unsigned i) const; unsigned getBadgeCount() const; Badge& newBadge(); Badge& newBadge(const QString& fname); @@ -149,7 +147,9 @@ namespace PokeMod const CoinList& getCoinList(const unsigned i) const throw(IndexException); CoinList& getCoinList(const unsigned i) throw(IndexException); - unsigned getCoinListByID(const unsigned i) const; + const CoinList& getCoinListByID(const unsigned i) const throw(IndexException); + CoinList& getCoinListByID(const unsigned i) throw(IndexException); + unsigned getCoinListIndex(const unsigned i) const; unsigned getCoinListCount() const; CoinList& newCoinList(); CoinList& newCoinList(const QString& fname); @@ -158,7 +158,9 @@ namespace PokeMod const Dialog& getDialog(const unsigned i) const throw(IndexException); Dialog& getDialog(const unsigned i) throw(IndexException); - unsigned getDialogByID(const unsigned i) const; + const Dialog& getDialogByID(const unsigned i) const throw(IndexException); + Dialog& getDialogByID(const unsigned i) throw(IndexException); + unsigned getDialogIndex(const unsigned i) const; unsigned getDialogCount() const; Dialog& newDialog(); Dialog& newDialog(const QString& fname); @@ -167,7 +169,9 @@ namespace PokeMod const EggGroup& getEggGroup(const unsigned i) const throw(IndexException); EggGroup& getEggGroup(const unsigned i) throw(IndexException); - unsigned getEggGroupByID(const unsigned i) const; + const EggGroup& getEggGroupByID(const unsigned i) const throw(IndexException); + EggGroup& getEggGroupByID(const unsigned i) throw(IndexException); + unsigned getEggGroupIndex(const unsigned i) const; unsigned getEggGroupCount() const; EggGroup& newEggGroup(); EggGroup& newEggGroup(const QString& fname); @@ -176,7 +180,9 @@ namespace PokeMod const Item& getItem(const unsigned i) const throw(IndexException); Item& getItem(const unsigned i) throw(IndexException); - unsigned getItemByID(const unsigned i) const; + const Item& getItemByID(const unsigned i) const throw(IndexException); + Item& getItemByID(const unsigned i) throw(IndexException); + unsigned getItemIndex(const unsigned i) const; unsigned getItemCount() const; Item& newItem(); Item& newItem(const QString& fname); @@ -185,7 +191,9 @@ namespace PokeMod const ItemType& getItemType(const unsigned i) const throw(IndexException); ItemType& getItemType(const unsigned i) throw(IndexException); - unsigned getItemTypeByID(const unsigned i) const; + const ItemType& getItemTypeByID(const unsigned i) const throw(IndexException); + ItemType& getItemTypeByID(const unsigned i) throw(IndexException); + unsigned getItemTypeIndex(const unsigned i) const; unsigned getItemTypeCount() const; ItemType& newItemType(); ItemType& newItemType(const QString& fname); @@ -194,7 +202,9 @@ namespace PokeMod const Map& getMap(const unsigned i) const throw(IndexException); Map& getMap(const unsigned i) throw(IndexException); - unsigned getMapByID(const unsigned i) const; + const Map& getMapByID(const unsigned i) const throw(IndexException); + Map& getMapByID(const unsigned i) throw(IndexException); + unsigned getMapIndex(const unsigned i) const; unsigned getMapCount() const; Map& newMap(); Map& newMap(const QString& fname); @@ -203,7 +213,9 @@ namespace PokeMod const Move& getMove(const unsigned i) const throw(IndexException); Move& getMove(const unsigned i) throw(IndexException); - unsigned getMoveByID(const unsigned i) const; + const Move& getMoveByID(const unsigned i) const throw(IndexException); + Move& getMoveByID(const unsigned i) throw(IndexException); + unsigned getMoveIndex(const unsigned i) const; unsigned getMoveCount() const; Move& newMove(); Move& newMove(const QString& fname); @@ -212,7 +224,9 @@ namespace PokeMod const Nature& getNature(const unsigned i) const throw(IndexException); Nature& getNature(const unsigned i) throw(IndexException); - unsigned getNatureByID(const unsigned i) const; + const Nature& getNatureByID(const unsigned i) const throw(IndexException); + Nature& getNatureByID(const unsigned i) throw(IndexException); + unsigned getNatureIndex(const unsigned i) const; unsigned getNatureCount() const; Nature& newNature(); Nature& newNature(const QString& fname); @@ -221,7 +235,9 @@ namespace PokeMod const Species& getSpecies(const unsigned i) const throw(IndexException); Species& getSpecies(const unsigned i) throw(IndexException); - unsigned getSpeciesByID(const unsigned i) const; + const Species& getSpeciesByID(const unsigned i) const throw(IndexException); + Species& getSpeciesByID(const unsigned i) throw(IndexException); + unsigned getSpeciesIndex(const unsigned i) const; unsigned getSpeciesCount() const; Species& newSpecies(); Species& newSpecies(const QString& fname); @@ -230,7 +246,9 @@ namespace PokeMod const Store& getStore(const unsigned i) const throw(IndexException); Store& getStore(const unsigned i) throw(IndexException); - unsigned getStoreByID(const unsigned i) const; + const Store& getStoreByID(const unsigned i) const throw(IndexException); + Store& getStoreByID(const unsigned i) throw(IndexException); + unsigned getStoreIndex(const unsigned i) const; unsigned getStoreCount() const; Store& newStore(); Store& newStore(const QString& fname); @@ -239,7 +257,9 @@ namespace PokeMod const Tile& getTile(const unsigned i) const throw(IndexException); Tile& getTile(const unsigned i) throw(IndexException); - unsigned getTileByID(const unsigned i) const; + const Tile& getTileByID(const unsigned i) const throw(IndexException); + Tile& getTileByID(const unsigned i) throw(IndexException); + unsigned getTileIndex(const unsigned i) const; unsigned getTileCount() const; Tile& newTile(); Tile& newTile(const QString& fname); @@ -248,7 +268,9 @@ namespace PokeMod const Time& getTime(const unsigned i) const throw(IndexException); Time& getTime(const unsigned i) throw(IndexException); - unsigned getTimeByID(const unsigned i) const; + const Time& getTimeByID(const unsigned i) const throw(IndexException); + Time& getTimeByID(const unsigned i) throw(IndexException); + unsigned getTimeIndex(const unsigned i) const; unsigned getTimeCount() const; Time& newTime(); Time& newTime(const QString& fname); @@ -257,7 +279,9 @@ namespace PokeMod const Type& getType(const unsigned i) const throw(IndexException); Type& getType(const unsigned i) throw(IndexException); - unsigned getTypeByID(const unsigned i) const; + const Type& getTypeByID(const unsigned i) const throw(IndexException); + Type& getTypeByID(const unsigned i) throw(IndexException); + unsigned getTypeIndex(const unsigned i) const; unsigned getTypeCount() const; Type& newType(); Type& newType(const QString& fname); @@ -288,10 +312,7 @@ namespace PokeMod QString version; QString description; unsigned startMap; - unsigned startMoney; - Point startCoordinate; - unsigned startDirection; - unsigned startDialog; + unsigned startWarp; QString superPCUname; QString superPCPasswd; FracMatrix typeChart; diff --git a/pokemod/Rules.cpp b/pokemod/Rules.cpp index 41776b2a..92461eca 100644 --- a/pokemod/Rules.cpp +++ b/pokemod/Rules.cpp @@ -30,8 +30,8 @@ PokeMod::Rules::Rules(const Pokemod& par) : criticalDomains(false), abilityAllowed(false), natureAllowed(false), - numPokemonBoxes(0), - numPokemonPerBox(1), + numBoxes(0), + boxSize(1), maxParty(1), maxFight(1), maxMoves(1), @@ -62,26 +62,26 @@ bool PokeMod::Rules::validate() const { bool valid = true; pokemod.validationMsg("---Rules", Pokemod::V_Msg); - if (!numPokemonBoxes) - pokemod.validationMsg("Invalid number of Pokémon boxes", Pokemod::V_Warn); - else if (!numPokemonPerBox) + if (!numBoxes) + pokemod.validationMsg("No box storage", Pokemod::V_Warn); + else if (!boxSize) { - pokemod.validationMsg("Invalid number of Pokémon per box"); + pokemod.validationMsg("Invalid box size"); valid = false; } if (!maxParty) { - pokemod.validationMsg("Invalid number of Pokémon for max party"); + pokemod.validationMsg("Invalid party size"); valid = false; } if (!maxParty || (maxParty < maxFight)) { - pokemod.validationMsg("More Pokémon can fight than are allowed in the party"); + pokemod.validationMsg("Larger active than party"); valid = false; } if (!maxMoves) { - pokemod.validationMsg("Pokémon cannot learn any moves"); + pokemod.validationMsg("No moves can be learned"); valid = false; } if (!maxMoney) @@ -99,7 +99,7 @@ bool PokeMod::Rules::validate() const valid = false; } } - if (.05 < pokerusChance) + if (.005 < pokerusChance) pokemod.validationMsg("Pokérus chance is unusually high", Pokemod::V_Warn); return valid; } @@ -115,8 +115,8 @@ void PokeMod::Rules::load(const QString& fname) throw(Exception) ini.getValue("criticalDomains", criticalDomains, false); ini.getValue("abilityAllowed", abilityAllowed, false); ini.getValue("natureAllowed", natureAllowed, false); - ini.getValue("numPokemonBoxes", numPokemonBoxes, 0); - ini.getValue("numPokemonPerBox", numPokemonPerBox, 1); + ini.getValue("numBoxes", numBoxes, 0); + ini.getValue("boxSize", boxSize, 1); ini.getValue("maxParty", maxParty, 1); ini.getValue("maxFight", maxFight, 1); ini.getValue("maxMoves", maxMoves, 1); @@ -147,8 +147,8 @@ void PokeMod::Rules::save() const throw(Exception) ini.addField("criticalDomains", criticalDomains); ini.addField("abilityAllowed", abilityAllowed); ini.addField("natureAllowed", natureAllowed); - ini.addField("numPokemonBoxes", numPokemonBoxes); - ini.addField("numPokemonPerBox", numPokemonPerBox); + ini.addField("numBoxes", numBoxes); + ini.addField("boxSize", boxSize); ini.addField("maxParty", maxParty); ini.addField("maxFight", maxFight); ini.addField("maxMoves", maxMoves); @@ -204,14 +204,14 @@ void PokeMod::Rules::setNatureAllowed(const bool n) natureAllowed = n; } -void PokeMod::Rules::setNumPokemonBoxes(const unsigned n) +void PokeMod::Rules::setNumBoxes(const unsigned n) { - numPokemonBoxes = n; + numBoxes = n; } -void PokeMod::Rules::setNumPokemonPerBox(const unsigned n) +void PokeMod::Rules::setBoxSize(const unsigned b) { - numPokemonPerBox = n; + boxSize = b; } void PokeMod::Rules::setMaxParty(const unsigned m) throw(BoundsException) @@ -355,14 +355,14 @@ bool PokeMod::Rules::getNatureAllowed() const return natureAllowed; } -unsigned PokeMod::Rules::getNumPokemonBoxes() const +unsigned PokeMod::Rules::getNumBoxes() const { - return numPokemonBoxes; + return numBoxes; } -unsigned PokeMod::Rules::getNumPokemonPerBox() const +unsigned PokeMod::Rules::getBoxSize() const { - return numPokemonPerBox; + return boxSize; } unsigned PokeMod::Rules::getMaxParty() const @@ -460,8 +460,8 @@ PokeMod::Rules& PokeMod::Rules::operator=(const Rules& rhs) criticalDomains = rhs.criticalDomains; abilityAllowed = rhs.abilityAllowed; natureAllowed = rhs.natureAllowed; - numPokemonBoxes = rhs.numPokemonBoxes; - numPokemonPerBox = rhs.numPokemonPerBox; + numBoxes = rhs.numBoxes; + boxSize = rhs.boxSize; maxParty = rhs.maxParty; maxFight = rhs.maxFight; maxMoves = rhs.maxMoves; diff --git a/pokemod/Rules.h b/pokemod/Rules.h index f3447f5c..db0289b7 100644 --- a/pokemod/Rules.h +++ b/pokemod/Rules.h @@ -48,8 +48,8 @@ namespace PokeMod void setCriticalDomains(const bool c); void setAbilityAllowed(const bool a); void setNatureAllowed(const bool n); - void setNumPokemonBoxes(const unsigned n); - void setNumPokemonPerBox(const unsigned n); + void setNumBoxes(const unsigned n); + void setBoxSize(const unsigned b); void setMaxParty(const unsigned m) throw(BoundsException); void setMaxFight(const unsigned m) throw(BoundsException); void setMaxMoves(const unsigned m) throw(BoundsException); @@ -76,8 +76,8 @@ namespace PokeMod bool getCriticalDomains() const; bool getAbilityAllowed() const; bool getNatureAllowed() const; - unsigned getNumPokemonBoxes() const; - unsigned getNumPokemonPerBox() const; + unsigned getNumBoxes() const; + unsigned getBoxSize() const; unsigned getMaxParty() const; unsigned getMaxFight() const; unsigned getMaxMoves() const; @@ -106,8 +106,8 @@ namespace PokeMod bool criticalDomains; bool abilityAllowed; bool natureAllowed; - unsigned numPokemonBoxes; - unsigned numPokemonPerBox; + unsigned numBoxes; + unsigned boxSize; unsigned maxParty; unsigned maxFight; unsigned maxMoves; diff --git a/pokemod/Species.cpp b/pokemod/Species.cpp index 55b315b9..b0c5593b 100644 --- a/pokemod/Species.cpp +++ b/pokemod/Species.cpp @@ -39,7 +39,6 @@ PokeMod::Species::Species(const Pokemod& par, const unsigned _id) : genderFactor(1, 1, true), eggSpecies(UINT_MAX), eggSteps(0), - isDitto(false), nidoranGroup(UINT_MAX) { for (unsigned i = 0; i < ST_End_GSC; ++i) @@ -95,35 +94,35 @@ bool PokeMod::Species::validate() const pokemod.validationMsg("Invalid height inches"); valid = false; } - if (!QFile::exists(QString("%1/pokemon/%2/front%3.png").arg(pokemod.getPath()).arg(name).arg(pokemod.getRules().getGenderAllowed() ? "-male" : ""))) + if (!QFile::exists(QString("%1/species/%2/front%3.png").arg(pokemod.getPath()).arg(name).arg(pokemod.getRules().getGenderAllowed() ? "-male" : ""))) { pokemod.validationMsg(QString("Cannot find the front%1 image").arg(pokemod.getRules().getGenderAllowed() ? " male" : "")); valid = false; } - if (!QFile::exists(QString("%1/pokemon/%2/back%3.png").arg(pokemod.getPath()).arg(name).arg(pokemod.getRules().getGenderAllowed() ? "-male" : ""))) + if (!QFile::exists(QString("%1/species/%2/back%3.png").arg(pokemod.getPath()).arg(name).arg(pokemod.getRules().getGenderAllowed() ? "-male" : ""))) { 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/pokemon/%2/front-female.png").arg(pokemod.getPath()).arg(name))) + if (!QFile::exists(QString("%1/species/%2/front-female.png").arg(pokemod.getPath()).arg(name))) { pokemod.validationMsg("Cannot find the front female image"); valid = false; } - if (!QFile::exists(QString("%1/pokemon/%2/back-female.png").arg(pokemod.getPath()).arg(name))) + if (!QFile::exists(QString("%1/species/%2/back-female.png").arg(pokemod.getPath()).arg(name))) { pokemod.validationMsg("Cannot find the back female image"); valid = false; } } - if (!QFile::exists(QString("%1/pokemon/%2/list.png").arg(pokemod.getPath()).arg(name))) + if (!QFile::exists(QString("%1/species/%2/list.png").arg(pokemod.getPath()).arg(name))) { pokemod.validationMsg("Cannot find the list sprite"); valid = false; } - if (pokemod.getSpeciesByID(eggSpecies) == UINT_MAX) + if (pokemod.getSpeciesIndex(eggSpecies) == UINT_MAX) pokemod.validationMsg("Invalid egg species", Pokemod::V_Warn); else if (!eggSteps) { @@ -134,7 +133,7 @@ bool PokeMod::Species::validate() const QMap<unsigned, unsigned> nameChecker; for (QListIterator<unsigned> i(types); i.hasNext(); i.next()) { - if (pokemod.getTypeByID(i.peekNext()) == UINT_MAX) + if (pokemod.getTypeIndex(i.peekNext()) == UINT_MAX) { pokemod.validationMsg("Invalid type"); valid = false; @@ -152,7 +151,7 @@ bool PokeMod::Species::validate() const nameChecker.clear(); for (QListIterator<unsigned> i(eggGroups); i.hasNext(); i.next()) { - if (pokemod.getEggGroupByID(i.peekNext()) == UINT_MAX) + if (pokemod.getEggGroupIndex(i.peekNext()) == UINT_MAX) { pokemod.validationMsg("Invalid egg group"); valid = false; @@ -296,7 +295,7 @@ bool PokeMod::Species::validate() const unsigned PokeMod::Species::getNewAbilityId() const { unsigned i = 0; - for (; (i < getAbilityCount()) && (getAbilityByID(i) != UINT_MAX); ++i) + for (; (i < getAbilityCount()) && (getAbilityIndex(i) != UINT_MAX); ++i) ; return i; } @@ -304,7 +303,7 @@ unsigned PokeMod::Species::getNewAbilityId() const unsigned PokeMod::Species::getNewEvolutionId() const { unsigned i = 0; - for (; (i < getEvolutionCount()) && (getEvolutionByID(i) != UINT_MAX); ++i) + for (; (i < getEvolutionCount()) && (getEvolutionIndex(i) != UINT_MAX); ++i) ; return i; } @@ -312,7 +311,7 @@ unsigned PokeMod::Species::getNewEvolutionId() const unsigned PokeMod::Species::getNewItemId() const { unsigned i = 0; - for (; (i < getItemCount()) && (getItemByID(i) != UINT_MAX); ++i) + for (; (i < getItemCount()) && (getItemIndex(i) != UINT_MAX); ++i) ; return i; } @@ -320,7 +319,7 @@ unsigned PokeMod::Species::getNewItemId() const unsigned PokeMod::Species::getNewMoveId() const { unsigned i = 0; - for (; (i < getMoveCount()) && (getMoveByID(i) != UINT_MAX); ++i) + for (; (i < getMoveCount()) && (getMoveIndex(i) != UINT_MAX); ++i) ; return i; } @@ -358,7 +357,6 @@ void PokeMod::Species::load(const QString& fname, const unsigned _id) throw(Exce genderFactor.set(i, j, true); ini.getValue("eggSpecies", eggSpecies); ini.getValue("eggSteps", eggSteps, 0); - ini.getValue("isDitto", isDitto, false); ini.getValue("nidoranGroup", nidoranGroup); ini.getValue("numTypes", i); for (unsigned k = 0; k < i; ++k) @@ -431,7 +429,6 @@ void PokeMod::Species::save() const throw(Exception) ini.addField("genderFactor-d", genderFactor.getDenom()); ini.addField("eggSpecies", eggSpecies); ini.addField("eggSteps", eggSteps); - ini.addField("isDitto", isDitto); ini.addField("nidoranGroup", nidoranGroup); ini.addField("numTypes", types.size()); for (unsigned i = 0; i < unsigned(types.size()); ++i) @@ -613,7 +610,7 @@ void PokeMod::Species::setGenderFactorDenom(const unsigned d) throw(Exception) void PokeMod::Species::setEggSpecies(const unsigned e) throw(BoundsException) { - if (pokemod.getSpeciesByID(e) == UINT_MAX) + if (pokemod.getSpeciesIndex(e) == UINT_MAX) throw(BoundsException("Species", "eggSpecies")); eggSpecies = e; } @@ -623,11 +620,6 @@ void PokeMod::Species::setEggSteps(const unsigned e) eggSteps = e; } -void PokeMod::Species::setIsDitto(const bool i) -{ - isDitto = i; -} - void PokeMod::Species::setNidoranGroup(const unsigned n) { nidoranGroup = n; @@ -635,6 +627,8 @@ void PokeMod::Species::setNidoranGroup(const unsigned n) void PokeMod::Species::setType(const unsigned ty, const bool t) throw(Exception) { + if (pokemod.getTypeIndex(ty) == UINT_MAX) + throw(BoundsException("Species", "type")); for (QMutableListIterator<unsigned> i(types); i.hasNext(); ) { if (i.next() == ty) @@ -652,6 +646,8 @@ void PokeMod::Species::setType(const unsigned ty, const bool t) throw(Exception) void PokeMod::Species::setEggGroup(const unsigned eg, const bool e) throw(Exception) { + if (pokemod.getEggGroupIndex(eg) == UINT_MAX) + throw(BoundsException("Species", "eggGroup")); for (QMutableListIterator<unsigned> i(eggGroups); i.hasNext(); ) { if (i.next() == eg) @@ -751,11 +747,6 @@ unsigned PokeMod::Species::getEggSteps() const return eggSteps; } -bool PokeMod::Species::getIsDitto() const -{ - return isDitto; -} - unsigned PokeMod::Species::getNidoranGroup() const { return nidoranGroup; @@ -795,7 +786,17 @@ PokeMod::SpeciesAbility& PokeMod::Species::getAbility(const unsigned i) throw(In return abilities[i]; } -unsigned PokeMod::Species::getAbilityByID(const unsigned _id) const +const PokeMod::SpeciesAbility& PokeMod::Species::getAbilityByID(const unsigned i) const throw(IndexException) +{ + return getAbility(getAbilityIndex(i)); +} + +PokeMod::SpeciesAbility& PokeMod::Species::getAbilityByID(const unsigned i) throw(IndexException) +{ + return getAbility(getAbilityIndex(i)); +} + +unsigned PokeMod::Species::getAbilityIndex(const unsigned _id) const { for (unsigned i = 0; i < getAbilityCount(); ++i) { @@ -849,7 +850,17 @@ PokeMod::SpeciesEvolution& PokeMod::Species::getEvolution(const unsigned i) thro return evolutions[i]; } -unsigned PokeMod::Species::getEvolutionByID(const unsigned _id) const +const PokeMod::SpeciesEvolution& PokeMod::Species::getEvolutionByID(const unsigned i) const throw(IndexException) +{ + return getEvolution(getEvolutionIndex(i)); +} + +PokeMod::SpeciesEvolution& PokeMod::Species::getEvolutionByID(const unsigned i) throw(IndexException) +{ + return getEvolution(getEvolutionIndex(i)); +} + +unsigned PokeMod::Species::getEvolutionIndex(const unsigned _id) const { for (unsigned i = 0; i < getEvolutionCount(); ++i) { @@ -903,7 +914,17 @@ PokeMod::SpeciesItem& PokeMod::Species::getItem(const unsigned i) throw(IndexExc return items[i]; } -unsigned PokeMod::Species::getItemByID(const unsigned _id) const +const PokeMod::SpeciesItem& PokeMod::Species::getItemByID(const unsigned i) const throw(IndexException) +{ + return getItem(getItemIndex(i)); +} + +PokeMod::SpeciesItem& PokeMod::Species::getItemByID(const unsigned i) throw(IndexException) +{ + return getItem(getItemIndex(i)); +} + +unsigned PokeMod::Species::getItemIndex(const unsigned _id) const { for (unsigned i = 0; i < getItemCount(); ++i) { @@ -957,7 +978,17 @@ PokeMod::SpeciesMove& PokeMod::Species::getMove(const unsigned i) throw(IndexExc return moves[i]; } -unsigned PokeMod::Species::getMoveByID(const unsigned _id) const +const PokeMod::SpeciesMove& PokeMod::Species::getMoveByID(const unsigned i) const throw(IndexException) +{ + return getMove(getMoveIndex(i)); +} + +PokeMod::SpeciesMove& PokeMod::Species::getMoveByID(const unsigned i) throw(IndexException) +{ + return getMove(getMoveIndex(i)); +} + +unsigned PokeMod::Species::getMoveIndex(const unsigned _id) const { for (unsigned i = 0; i < getMoveCount(); ++i) { @@ -1020,7 +1051,6 @@ PokeMod::Species& PokeMod::Species::operator=(const Species& rhs) genderFactor = rhs.genderFactor; eggSpecies = rhs.eggSpecies; eggSteps = rhs.eggSteps; - isDitto = rhs.isDitto; nidoranGroup = rhs.nidoranGroup; types = rhs.types; eggGroups = rhs.eggGroups; diff --git a/pokemod/Species.h b/pokemod/Species.h index b199896d..2da580a7 100644 --- a/pokemod/Species.h +++ b/pokemod/Species.h @@ -91,7 +91,6 @@ namespace PokeMod void setGenderFactorDenom(const unsigned d) throw(Exception); void setEggSpecies(const unsigned e) throw(BoundsException); void setEggSteps(const unsigned e); - void setIsDitto(const bool i); void setNidoranGroup(const unsigned n); void setType(const unsigned ty, const bool t) throw(Exception); void setEggGroup(const unsigned eg, const bool e) throw(Exception); @@ -117,14 +116,15 @@ namespace PokeMod Frac getGenderFactor() const; unsigned getEggSpecies() const; unsigned getEggSteps() const; - bool getIsDitto() const; unsigned getNidoranGroup() const; bool getType(const unsigned ty) const; bool getEggGroup(const unsigned eg) const; const SpeciesAbility& getAbility(const unsigned i) const throw(IndexException); SpeciesAbility& getAbility(const unsigned i) throw(IndexException); - unsigned getAbilityByID(const unsigned _id) const; + const SpeciesAbility& getAbilityByID(const unsigned i) const throw(IndexException); + SpeciesAbility& getAbilityByID(const unsigned i) throw(IndexException); + unsigned getAbilityIndex(const unsigned _id) const; unsigned getAbilityCount() const; SpeciesAbility& newAbility(); SpeciesAbility& newAbility(const QString& fname); @@ -133,7 +133,9 @@ namespace PokeMod const SpeciesEvolution& getEvolution(const unsigned i) const throw(IndexException); SpeciesEvolution& getEvolution(const unsigned i) throw(IndexException); - unsigned getEvolutionByID(const unsigned _id) const; + const SpeciesEvolution& getEvolutionByID(const unsigned i) const throw(IndexException); + SpeciesEvolution& getEvolutionByID(const unsigned i) throw(IndexException); + unsigned getEvolutionIndex(const unsigned _id) const; unsigned getEvolutionCount() const; SpeciesEvolution& newEvolution(); SpeciesEvolution& newEvolution(const QString& fname); @@ -142,7 +144,9 @@ namespace PokeMod const SpeciesItem& getItem(const unsigned i) const throw(IndexException); SpeciesItem& getItem(const unsigned i) throw(IndexException); - unsigned getItemByID(const unsigned _id) const; + const SpeciesItem& getItemByID(const unsigned i) const throw(IndexException); + SpeciesItem& getItemByID(const unsigned i) throw(IndexException); + unsigned getItemIndex(const unsigned _id) const; unsigned getItemCount() const; SpeciesItem& newItem(); SpeciesItem& newItem(const QString& fname); @@ -151,7 +155,9 @@ namespace PokeMod const SpeciesMove& getMove(const unsigned i) const throw(IndexException); SpeciesMove& getMove(const unsigned i) throw(IndexException); - unsigned getMoveByID(const unsigned _id) const; + const SpeciesMove& getMoveByID(const unsigned i) const throw(IndexException); + SpeciesMove& getMoveByID(const unsigned i) throw(IndexException); + unsigned getMoveIndex(const unsigned _id) const; unsigned getMoveCount() const; SpeciesMove& newMove(); SpeciesMove& newMove(const QString& fname); @@ -182,7 +188,6 @@ namespace PokeMod Frac genderFactor; unsigned eggSpecies; unsigned eggSteps; - bool isDitto; unsigned nidoranGroup; QList<unsigned> types; QList<unsigned> eggGroups; diff --git a/pokemod/SpeciesAbility.cpp b/pokemod/SpeciesAbility.cpp index f6dfc1eb..6728c1b0 100644 --- a/pokemod/SpeciesAbility.cpp +++ b/pokemod/SpeciesAbility.cpp @@ -45,7 +45,7 @@ bool PokeMod::SpeciesAbility::validate() const { bool valid = true; pokemod.validationMsg(QString("------Ability with id %1---").arg(id), Pokemod::V_Msg); - if (pokemod.getAbilityByID(ability) == UINT_MAX) + if (pokemod.getAbilityIndex(ability) == UINT_MAX) { pokemod.validationMsg("Invalid ability"); valid = false; @@ -80,7 +80,7 @@ void PokeMod::SpeciesAbility::save(const QString& species) const throw(Exception void PokeMod::SpeciesAbility::setAbility(const unsigned a) throw(BoundsException) { - if (pokemod.getAbilityByID(a) == UINT_MAX) + if (pokemod.getAbilityIndex(a) == UINT_MAX) throw(BoundsException("SpeciesAbility", "ability")); ability = a; } diff --git a/pokemod/SpeciesAbility.h b/pokemod/SpeciesAbility.h index 0c424f49..6fbfcbb9 100644 --- a/pokemod/SpeciesAbility.h +++ b/pokemod/SpeciesAbility.h @@ -11,7 +11,7 @@ // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // -// This program is distributPokemoned in the hope that it will be useful, +// 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. diff --git a/pokemod/SpeciesEvolution.cpp b/pokemod/SpeciesEvolution.cpp index b41f82fc..36e81686 100644 --- a/pokemod/SpeciesEvolution.cpp +++ b/pokemod/SpeciesEvolution.cpp @@ -52,7 +52,7 @@ bool PokeMod::SpeciesEvolution::validate() const { bool valid = true; pokemod.validationMsg(QString("------Evolution with id %1---").arg(id), Pokemod::V_Msg); - if (pokemod.getSpeciesByID(species) == UINT_MAX) + if (pokemod.getSpeciesIndex(species) == UINT_MAX) { pokemod.validationMsg("Invalid species"); valid = false; @@ -69,13 +69,13 @@ bool PokeMod::SpeciesEvolution::validate() const break; case S_Item: case S_TradeItem: - if (pokemod.getItemByID(val1) == UINT_MAX) + if (pokemod.getItemIndex(val1) == UINT_MAX) ok = false; else { - for (unsigned i = 0; (i < pokemod.getItem(pokemod.getItemByID(val1)).getEffectCount()) && !ok; ++i) + for (unsigned i = 0; (i < pokemod.getItem(pokemod.getItemIndex(val1)).getEffectCount()) && !ok; ++i) { - if (pokemod.getItem(pokemod.getItemByID(val1)).getEffect(i).getEffect() == ItemEffect::E_Evolution) + if (pokemod.getItem(pokemod.getItemIndex(val1)).getEffect(i).getEffect() == ItemEffect::E_Evolution) ok = true; } } @@ -156,7 +156,7 @@ void PokeMod::SpeciesEvolution::save(const QString& species) const throw(Excepti void PokeMod::SpeciesEvolution::setSpecies(const unsigned s) throw(BoundsException) { - if (pokemod.getSpeciesByID(s) == UINT_MAX) + if (pokemod.getSpeciesIndex(s) == UINT_MAX) throw(BoundsException("SpeciesEvolution", "species")); species = s; } @@ -182,11 +182,11 @@ void PokeMod::SpeciesEvolution::setVal1(const unsigned v1) throw(Exception) break; case S_Item: case S_TradeItem: - if (pokemod.getItemByID(val1) == UINT_MAX) + if (pokemod.getItemIndex(val1) == UINT_MAX) throw(BoundsException("SpeciesEvolution", "val1")); - for (unsigned i = 0; (i < pokemod.getItem(pokemod.getItemByID(val1)).getEffectCount()) && !ok; ++i) + for (unsigned i = 0; (i < pokemod.getItem(pokemod.getItemIndex(val1)).getEffectCount()) && !ok; ++i) { - if (pokemod.getItem(pokemod.getItemByID(val1)).getEffect(i).getEffect() == ItemEffect::E_Evolution) + if (pokemod.getItem(pokemod.getItemIndex(val1)).getEffect(i).getEffect() == ItemEffect::E_Evolution) ok = true; } if (!ok) diff --git a/pokemod/SpeciesItem.cpp b/pokemod/SpeciesItem.cpp index 4d132670..ebd20187 100644 --- a/pokemod/SpeciesItem.cpp +++ b/pokemod/SpeciesItem.cpp @@ -45,7 +45,7 @@ bool PokeMod::SpeciesItem::validate() const { bool valid = true; pokemod.validationMsg(QString("------Item with id %1---").arg(id), Pokemod::V_Msg); - if (pokemod.getItemByID(item) == UINT_MAX) + if (pokemod.getItemIndex(item) == UINT_MAX) { pokemod.validationMsg("Invalid item"); valid = false; @@ -80,7 +80,7 @@ void PokeMod::SpeciesItem::save(const QString& species) const throw(Exception) void PokeMod::SpeciesItem::setItem(const unsigned i) throw(BoundsException) { - if (pokemod.getItemByID(i) == UINT_MAX) + if (pokemod.getItemIndex(i) == UINT_MAX) throw(BoundsException("SpeciesItem", "item")); item = i; } diff --git a/pokemod/SpeciesItem.h b/pokemod/SpeciesItem.h index 9fa9fda8..532e4730 100644 --- a/pokemod/SpeciesItem.h +++ b/pokemod/SpeciesItem.h @@ -3,7 +3,7 @@ // Purpose: Define an item that a species can be found with in the wild // Author: Ben Boeckel // Modified by: Ben Boeckel -// Created: Tue Mar 20 18:40:28 2007Pokémon +// Created: Tue Mar 20 18:40:28 2007 // Copyright: ©2007-2008 Ben Boeckel and Nerdy Productions // Licence: // This program is free software: you can redistribute it and/or modify diff --git a/pokemod/SpeciesMove.cpp b/pokemod/SpeciesMove.cpp index 36606966..d7e0ad2e 100644 --- a/pokemod/SpeciesMove.cpp +++ b/pokemod/SpeciesMove.cpp @@ -46,7 +46,7 @@ bool PokeMod::SpeciesMove::validate() const { bool valid = true; pokemod.validationMsg(QString("------Move with id %1---").arg(id), Pokemod::V_Msg); - if (pokemod.getMoveByID(move) == UINT_MAX) + if (pokemod.getMoveIndex(move) == UINT_MAX) { pokemod.validationMsg("Invalid move"); valid = false; @@ -88,7 +88,7 @@ void PokeMod::SpeciesMove::save(const QString& species) const throw(Exception) void PokeMod::SpeciesMove::setMove(const unsigned m) throw(BoundsException) { - if (pokemod.getMoveByID(m) == UINT_MAX) + if (pokemod.getMoveIndex(m) == UINT_MAX) throw(BoundsException("SpeciesMove", "move")); move = m; } diff --git a/pokemod/Store.cpp b/pokemod/Store.cpp index 626b249d..ab20947b 100644 --- a/pokemod/Store.cpp +++ b/pokemod/Store.cpp @@ -57,7 +57,7 @@ bool PokeMod::Store::validate() const QMap<unsigned, unsigned> nameChecker; for (QListIterator<unsigned> i(items); i.hasNext(); i.next()) { - if (pokemod.getItemByID(i.peekNext()) == UINT_MAX) + if (pokemod.getItemIndex(i.peekNext()) == UINT_MAX) { pokemod.validationMsg("Invalid item"); valid = false; @@ -113,6 +113,8 @@ void PokeMod::Store::setName(const QString& n) void PokeMod::Store::setItem(const unsigned itm, const bool it) throw(Exception) { + if (pokemod.getItemIndex(itm) == UINT_MAX) + throw(BoundsException("Store", "item")); for (QMutableListIterator<unsigned> i(items); i.hasNext(); ) { if (i.next() == itm) @@ -133,11 +135,11 @@ QString PokeMod::Store::getName() const return name; } -bool PokeMod::Store::getItem(const unsigned it) const +bool PokeMod::Store::getItem(const unsigned itm) const { for (QListIterator<unsigned> i(items); i.hasNext(); ) { - if (i.next() == it) + if (i.next() == itm) return true; } return false; diff --git a/pokemod/TODO b/pokemod/TODO index 4cc23837..82f9633f 100644 --- a/pokemod/TODO +++ b/pokemod/TODO @@ -5,7 +5,7 @@ Urgent ---------------
Effect Switches
---------------
-MoveEffect
+MoveEffects
------------------
PokéMod comparison
diff --git a/pokemod/Tile.cpp b/pokemod/Tile.cpp index 60486b9f..7d941bf6 100644 --- a/pokemod/Tile.cpp +++ b/pokemod/Tile.cpp @@ -72,12 +72,12 @@ bool PokeMod::Tile::validate() const pokemod.validationMsg("A waterfall tile must be accessible from above and below"); valid = false; } - else if ((hmType == H_Whirlpool) && ((under == id) || (pokemod.getTileByID(under) == UINT_MAX) || (pokemod.getTile(pokemod.getTileByID(under)).getHMType() != H_Surf) || (pokemod.getTile(pokemod.getTileByID(under)).getHMType() != H_Dive))) + else if ((hmType == H_Whirlpool) && ((under == id) || (pokemod.getTileIndex(under) == UINT_MAX) || (pokemod.getTile(pokemod.getTileIndex(under)).getHMType() != H_Surf) || (pokemod.getTile(pokemod.getTileIndex(under)).getHMType() != H_Dive))) { pokemod.validationMsg("Invalid under tile"); valid = false; } - else if ((hmType == H_Whirlpool) && ((under == id) || (pokemod.getTileByID(under) == UINT_MAX) || (pokemod.getTile(pokemod.getTileByID(under)).getHMType() != H_None))) + else if ((hmType == H_Whirlpool) && ((under == id) || (pokemod.getTileIndex(under) == UINT_MAX) || (pokemod.getTile(pokemod.getTileIndex(under)).getHMType() != H_None))) { pokemod.validationMsg("Invalid under tile"); valid = false; @@ -192,7 +192,7 @@ void PokeMod::Tile::setUnder(const unsigned u) throw(Exception) { if ((hmType != H_Whirlpool) || (hmType != H_Cut) || (hmType != H_RockSmash)) throw(UnusedException("Tile", "under")); - if ((u == id) || (pokemod.getTileByID(u) == UINT_MAX)) + if ((u == id) || (pokemod.getTileIndex(u) == UINT_MAX)) throw(BoundsException("Tile", "under")); under = u; } diff --git a/pokemod/Type.h b/pokemod/Type.h index 2cf62e16..6195c80a 100644 --- a/pokemod/Type.h +++ b/pokemod/Type.h @@ -1,6 +1,6 @@ ///////////////////////////////////////////////////////////////////////////// // Name: pokemod/Type.h -// Purpose: Define a type for a Pokémon +// Purpose: Define a type for species and moves // Author: Ben Boeckel // Modified by: Ben Boeckel // Created: Tue Mar 20 18:05:05 2007 diff --git a/pokemod/pokemod.pro b/pokemod/pokemod.pro index 44cd6041..0d927da4 100644 --- a/pokemod/pokemod.pro +++ b/pokemod/pokemod.pro @@ -3,7 +3,7 @@ DESTDIR = ../../lib TEMPLATE = lib LIBS += -L../../lib -lgeneral -CONFIG += qt warn_on dll +CONFIG += qt warn_on dll -SOURCES += *.cpp -HEADERS += *.h +SOURCES += *.cpp +HEADERS += *.h diff --git a/pokemod/pokemod_inc.h b/pokemod/pokemod_inc.h index 3923f2e5..202972fb 100644 --- a/pokemod/pokemod_inc.h +++ b/pokemod/pokemod_inc.h @@ -39,10 +39,10 @@ namespace PokeMod class Map; class MapEffect; class MapTrainer; - class MapTrainerPokemon; + class MapTrainerTeamMember; class MapWarp; class MapWildList; - class MapWildListPokemon; + class MapWildListEncounter; class Move; class MoveEffect; class Nature; diff --git a/pokemodr/gui/ability.ui b/pokemodr/gui/ability.ui index 94648215..539b2e72 100644 --- a/pokemodr/gui/ability.ui +++ b/pokemodr/gui/ability.ui @@ -1,40 +1,55 @@ <ui version="4.0" > - <class>panelAbility</class> - <widget class="QWidget" name="panelAbility" > + <class>formAbility</class> + <widget class="QWidget" name="formAbility" > <property name="geometry" > <rect> <x>0</x> <y>0</y> - <width>92</width> - <height>95</height> + <width>201</width> + <height>179</height> </rect> </property> <layout class="QVBoxLayout" > <item> - <widget class="QGroupBox" name="boxName" > + <widget class="QGroupBox" name="boxButtons" > + <property name="title" > + <string/> + </property> <layout class="QHBoxLayout" > <item> - <widget class="QLabel" name="labelName" > + <widget class="KPushButton" name="buttonApply" > <property name="text" > - <string>Name</string> + <string>&Apply</string> + </property> + <property name="shortcut" > + <string>Ctrl+Return</string> </property> </widget> </item> <item> - <spacer> - <property name="orientation" > - <enum>Qt::Horizontal</enum> + <widget class="KPushButton" name="buttonDiscard" > + <property name="text" > + <string>&Discard</string> </property> - <property name="sizeHint" > - <size> - <width>20</width> - <height>40</height> - </size> + <property name="shortcut" > + <string>Esc</string> </property> - </spacer> + </widget> </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxName" > + <property name="title" > + <string>Name</string> + </property> + <layout class="QHBoxLayout" > <item> <widget class="KLineEdit" name="varName" > + <property name="toolTip" > + <string>Name of the ability</string> + </property> <property name="showClearButton" stdset="0" > <bool>true</bool> </property> @@ -64,6 +79,11 @@ <extends>QLineEdit</extends> <header>klineedit.h</header> </customwidget> + <customwidget> + <class>KPushButton</class> + <extends>QPushButton</extends> + <header>kpushbutton.h</header> + </customwidget> </customwidgets> <resources/> <connections/> diff --git a/pokemodr/gui/abilityeffect.ui b/pokemodr/gui/abilityeffect.ui index cbc22ca1..c9826b23 100644 --- a/pokemodr/gui/abilityeffect.ui +++ b/pokemodr/gui/abilityeffect.ui @@ -1,21 +1,78 @@ <ui version="4.0" > - <class>panelAbilityEffect</class> - <widget class="QWidget" name="panelAbilityEffect" > + <class>formAbilityEffect</class> + <widget class="QWidget" name="formAbilityEffect" > <property name="geometry" > <rect> <x>0</x> <y>0</y> <width>244</width> - <height>658</height> + <height>922</height> </rect> </property> <layout class="QVBoxLayout" > <item> + <widget class="QGroupBox" name="boxButtons" > + <property name="title" > + <string/> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KPushButton" name="buttonApply" > + <property name="text" > + <string>&Apply</string> + </property> + <property name="shortcut" > + <string>Ctrl+Return</string> + </property> + </widget> + </item> + <item> + <widget class="KPushButton" name="buttonDiscard" > + <property name="text" > + <string>&Discard</string> + </property> + <property name="shortcut" > + <string>Esc</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> <widget class="QGroupBox" name="boxChance" > <property name="title" > <string>Chance</string> </property> - <layout class="QHBoxLayout" /> + <layout class="QVBoxLayout" > + <item> + <widget class="KLineEdit" name="varChance" > + <property name="toolTip" > + <string>Chance the effect is activated</string> + </property> + </widget> + </item> + <item> + <widget class="KIntNumInput" name="varChanceNum" > + <property name="label" > + <string>Numerator</string> + </property> + <property name="minimum" > + <number>0</number> + </property> + </widget> + </item> + <item> + <widget class="KIntNumInput" name="varChanceDenom" > + <property name="label" > + <string>Denominator</string> + </property> + <property name="minimum" > + <number>1</number> + </property> + </widget> + </item> + </layout> </widget> </item> <item> @@ -25,7 +82,17 @@ </property> <layout class="QVBoxLayout" > <item> - <widget class="KComboBox" name="varEffect" /> + <widget class="KComboBox" name="varEffect" > + <property name="toolTip" > + <string>Effect the ability has</string> + </property> + <property name="insertPolicy" > + <enum>QComboBox::NoInsert</enum> + </property> + <property name="sizeAdjustPolicy" > + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> </item> <item> <widget class="QGroupBox" name="boxValue1" > @@ -34,7 +101,17 @@ </property> <layout class="QHBoxLayout" > <item> - <widget class="KComboBox" name="varVal1" /> + <widget class="KComboBox" name="varVal1" > + <property name="toolTip" > + <string>Value 1</string> + </property> + <property name="insertPolicy" > + <enum>QComboBox::NoInsert</enum> + </property> + <property name="sizeAdjustPolicy" > + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> </item> </layout> </widget> @@ -46,7 +123,17 @@ </property> <layout class="QHBoxLayout" > <item> - <widget class="KComboBox" name="varVal2" /> + <widget class="KComboBox" name="varVal2" > + <property name="toolTip" > + <string>Value 2</string> + </property> + <property name="insertPolicy" > + <enum>QComboBox::NoInsert</enum> + </property> + <property name="sizeAdjustPolicy" > + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> </item> </layout> </widget> @@ -59,6 +146,9 @@ <layout class="QHBoxLayout" > <item> <widget class="KIntNumInput" name="varVal3" > + <property name="toolTip" > + <string>Value 3</string> + </property> <property name="minimum" > <number>0</number> </property> @@ -77,7 +167,17 @@ </property> <layout class="QVBoxLayout" > <item> - <widget class="KComboBox" name="varTrigger" /> + <widget class="KComboBox" name="varTrigger" > + <property name="toolTip" > + <string>What triggers the effect to happen</string> + </property> + <property name="insertPolicy" > + <enum>QComboBox::NoInsert</enum> + </property> + <property name="sizeAdjustPolicy" > + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> </item> <item> <widget class="QGroupBox" name="boxTriggerValue1" > @@ -86,7 +186,17 @@ </property> <layout class="QHBoxLayout" > <item> - <widget class="KComboBox" name="varTval1" /> + <widget class="KComboBox" name="varTval1" > + <property name="toolTip" > + <string>Trigger value 1</string> + </property> + <property name="insertPolicy" > + <enum>QComboBox::NoInsert</enum> + </property> + <property name="sizeAdjustPolicy" > + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> </item> </layout> </widget> @@ -99,6 +209,9 @@ <layout class="QVBoxLayout" > <item> <widget class="KLineEdit" name="varTval2" > + <property name="toolTip" > + <string>Trigger value 2</string> + </property> <property name="readOnly" > <bool>true</bool> </property> @@ -161,6 +274,11 @@ <extends>QLineEdit</extends> <header>klineedit.h</header> </customwidget> + <customwidget> + <class>KPushButton</class> + <extends>QPushButton</extends> + <header>kpushbutton.h</header> + </customwidget> </customwidgets> <resources/> <connections/> diff --git a/pokemodr/gui/author.ui b/pokemodr/gui/author.ui index 814f5865..33cfee23 100644 --- a/pokemodr/gui/author.ui +++ b/pokemodr/gui/author.ui @@ -1,16 +1,45 @@ <ui version="4.0" > - <class>panelAuthor</class> - <widget class="QWidget" name="panelAuthor" > + <class>formAuthor</class> + <widget class="QWidget" name="formAuthor" > <property name="geometry" > <rect> <x>0</x> <y>0</y> - <width>80</width> - <height>236</height> + <width>191</width> + <height>311</height> </rect> </property> <layout class="QVBoxLayout" > <item> + <widget class="QGroupBox" name="boxButtons" > + <property name="title" > + <string/> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KPushButton" name="buttonApply" > + <property name="text" > + <string>&Apply</string> + </property> + <property name="shortcut" > + <string>Ctrl+Return</string> + </property> + </widget> + </item> + <item> + <widget class="KPushButton" name="buttonDiscard" > + <property name="text" > + <string>&Discard</string> + </property> + <property name="shortcut" > + <string>Esc</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> <widget class="QGroupBox" name="boxName" > <property name="title" > <string>Name</string> @@ -18,6 +47,9 @@ <layout class="QHBoxLayout" > <item> <widget class="KLineEdit" name="varName" > + <property name="toolTip" > + <string>Name of an author of the PokéMod</string> + </property> <property name="showClearButton" stdset="0" > <bool>true</bool> </property> @@ -34,6 +66,9 @@ <layout class="QHBoxLayout" > <item> <widget class="KLineEdit" name="varEmail" > + <property name="toolTip" > + <string>Email address of the author</string> + </property> <property name="showClearButton" stdset="0" > <bool>true</bool> </property> @@ -50,6 +85,9 @@ <layout class="QHBoxLayout" > <item> <widget class="KLineEdit" name="varRole" > + <property name="toolTip" > + <string>What the author did</string> + </property> <property name="showClearButton" stdset="0" > <bool>true</bool> </property> @@ -79,6 +117,11 @@ <extends>QLineEdit</extends> <header>klineedit.h</header> </customwidget> + <customwidget> + <class>KPushButton</class> + <extends>QPushButton</extends> + <header>kpushbutton.h</header> + </customwidget> </customwidgets> <resources/> <connections/> diff --git a/pokemodr/gui/badge.ui b/pokemodr/gui/badge.ui index 8dc6a455..7c3da553 100644 --- a/pokemodr/gui/badge.ui +++ b/pokemodr/gui/badge.ui @@ -1,16 +1,45 @@ <ui version="4.0" > - <class>panelBadge</class> - <widget class="QWidget" name="panelBadge" > + <class>formBadge</class> + <widget class="QWidget" name="formBadge" > <property name="geometry" > <rect> <x>0</x> <y>0</y> - <width>226</width> - <height>534</height> + <width>244</width> + <height>720</height> </rect> </property> <layout class="QVBoxLayout" > <item> + <widget class="QGroupBox" name="boxButtons" > + <property name="title" > + <string/> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KPushButton" name="buttonApply" > + <property name="text" > + <string>&Apply</string> + </property> + <property name="shortcut" > + <string>Ctrl+Return</string> + </property> + </widget> + </item> + <item> + <widget class="KPushButton" name="buttonDiscard" > + <property name="text" > + <string>&Discard</string> + </property> + <property name="shortcut" > + <string>Esc</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> <widget class="QGroupBox" name="boxName" > <property name="title" > <string>Name</string> @@ -18,6 +47,9 @@ <layout class="QHBoxLayout" > <item> <widget class="KLineEdit" name="varName" > + <property name="toolTip" > + <string>The name of the badge</string> + </property> <property name="showClearButton" stdset="0" > <bool>true</bool> </property> @@ -34,6 +66,9 @@ <layout class="QHBoxLayout" > <item> <widget class="KIntNumInput" name="varObey" > + <property name="toolTip" > + <string>The maximum level where the player will always be obeyed</string> + </property> <property name="minimum" > <number>0</number> </property> @@ -43,48 +78,120 @@ </widget> </item> <item> - <widget class="QGroupBox" name="boxStat" > + <widget class="QGroupBox" name="groupBox" > <property name="title" > - <string>Stat</string> + <string>Images</string> </property> <layout class="QHBoxLayout" > <item> - <widget class="KComboBox" name="varStat" /> + <widget class="QGraphicsView" name="graphicsView_2" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="Fixed" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize" > + <size> + <width>64</width> + <height>64</height> + </size> + </property> + <property name="maximumSize" > + <size> + <width>64</width> + <height>64</height> + </size> + </property> + <property name="toolTip" > + <string>The face displayed when the badge has not been earned</string> + </property> + </widget> + </item> + <item> + <widget class="QGraphicsView" name="graphicsView" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="Fixed" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize" > + <size> + <width>64</width> + <height>64</height> + </size> + </property> + <property name="maximumSize" > + <size> + <width>64</width> + <height>64</height> + </size> + </property> + <property name="toolTip" > + <string>The badge</string> + </property> + </widget> </item> </layout> </widget> </item> <item> - <widget class="QGroupBox" name="boxMultiplier" > + <widget class="QGroupBox" name="boxStat" > <property name="title" > - <string>Multiplier</string> + <string>Stat</string> </property> <layout class="QVBoxLayout" > <item> - <widget class="KLineEdit" name="varMultiplier" > - <property name="readOnly" > - <bool>true</bool> + <widget class="KComboBox" name="varStat" > + <property name="toolTip" > + <string>The stat the badge boosts</string> </property> - </widget> - </item> - <item> - <widget class="KIntNumInput" name="varMultiplierNum" > - <property name="label" > - <string>Numerator</string> + <property name="insertPolicy" > + <enum>QComboBox::NoInsert</enum> </property> - <property name="minimum" > - <number>0</number> + <property name="sizeAdjustPolicy" > + <enum>QComboBox::AdjustToContents</enum> </property> </widget> </item> <item> - <widget class="KIntNumInput" name="varMultiplierDenom" > - <property name="label" > - <string>Denominator</string> - </property> - <property name="minimum" > - <number>1</number> + <widget class="QGroupBox" name="boxMultiplier" > + <property name="title" > + <string>Multiplier</string> </property> + <layout class="QVBoxLayout" > + <item> + <widget class="KLineEdit" name="varMultiplier" > + <property name="toolTip" > + <string>The multiplier the badge gives to the stat (internal battles only)</string> + </property> + <property name="readOnly" > + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="KIntNumInput" name="varMultiplierNum" > + <property name="label" > + <string>Numerator</string> + </property> + <property name="minimum" > + <number>0</number> + </property> + </widget> + </item> + <item> + <widget class="KIntNumInput" name="varMultiplierDenom" > + <property name="label" > + <string>Denominator</string> + </property> + <property name="minimum" > + <number>1</number> + </property> + </widget> + </item> + </layout> </widget> </item> </layout> @@ -104,6 +211,9 @@ <height>75</height> </size> </property> + <property name="toolTip" > + <string>The list of HMs the badge allows to be used in the overworld</string> + </property> <property name="dragEnabled" > <bool>true</bool> </property> @@ -146,6 +256,11 @@ <extends>QLineEdit</extends> <header>klineedit.h</header> </customwidget> + <customwidget> + <class>KPushButton</class> + <extends>QPushButton</extends> + <header>kpushbutton.h</header> + </customwidget> </customwidgets> <resources/> <connections/> diff --git a/pokemodr/gui/coinlist.ui b/pokemodr/gui/coinlist.ui index 36093592..a06e49a5 100644 --- a/pokemodr/gui/coinlist.ui +++ b/pokemodr/gui/coinlist.ui @@ -1,16 +1,45 @@ <ui version="4.0" > - <class>panelCoinList</class> - <widget class="QWidget" name="panelCoinList" > + <class>formCoinList</class> + <widget class="QWidget" name="formCoinList" > <property name="geometry" > <rect> <x>0</x> <y>0</y> - <width>134</width> - <height>161</height> + <width>226</width> + <height>238</height> </rect> </property> <layout class="QVBoxLayout" > <item> + <widget class="QGroupBox" name="boxButtons" > + <property name="title" > + <string/> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KPushButton" name="buttonApply" > + <property name="text" > + <string>&Apply</string> + </property> + <property name="shortcut" > + <string>Ctrl+Return</string> + </property> + </widget> + </item> + <item> + <widget class="KPushButton" name="buttonDiscard" > + <property name="text" > + <string>&Discard</string> + </property> + <property name="shortcut" > + <string>Esc</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> <widget class="QGroupBox" name="boxName" > <property name="title" > <string>Name</string> @@ -18,6 +47,9 @@ <layout class="QHBoxLayout" > <item> <widget class="KLineEdit" name="varName" > + <property name="toolTip" > + <string>Name of the coin list</string> + </property> <property name="showClearButton" stdset="0" > <bool>true</bool> </property> @@ -33,7 +65,14 @@ </property> <layout class="QHBoxLayout" > <item> - <widget class="KIntNumInput" name="varValue" /> + <widget class="KIntNumInput" name="varValue" > + <property name="toolTip" > + <string>Type of coin needed</string> + </property> + <property name="minimum" > + <number>0</number> + </property> + </widget> </item> </layout> </widget> @@ -64,6 +103,11 @@ <extends>QLineEdit</extends> <header>klineedit.h</header> </customwidget> + <customwidget> + <class>KPushButton</class> + <extends>QPushButton</extends> + <header>kpushbutton.h</header> + </customwidget> </customwidgets> <resources/> <connections/> diff --git a/pokemodr/gui/coinlistobject.ui b/pokemodr/gui/coinlistobject.ui index 08e9490a..01f60892 100644 --- a/pokemodr/gui/coinlistobject.ui +++ b/pokemodr/gui/coinlistobject.ui @@ -1,35 +1,84 @@ <ui version="4.0" > - <class>panelCoinListObject</class> - <widget class="QWidget" name="panelCoinListObject" > + <class>formCoinListObject</class> + <widget class="QWidget" name="formCoinListObject" > <property name="geometry" > <rect> <x>0</x> <y>0</y> <width>226</width> - <height>318</height> + <height>393</height> </rect> </property> <layout class="QVBoxLayout" > <item> - <widget class="QGroupBox" name="boxType" > + <widget class="QGroupBox" name="boxButtons" > <property name="title" > - <string>Type</string> + <string/> </property> <layout class="QHBoxLayout" > <item> - <widget class="KComboBox" name="varType" /> + <widget class="KPushButton" name="buttonApply" > + <property name="text" > + <string>&Apply</string> + </property> + <property name="shortcut" > + <string>Ctrl+Return</string> + </property> + </widget> + </item> + <item> + <widget class="KPushButton" name="buttonDiscard" > + <property name="text" > + <string>&Discard</string> + </property> + <property name="shortcut" > + <string>Esc</string> + </property> + </widget> </item> </layout> </widget> </item> <item> - <widget class="QGroupBox" name="boxObject" > + <widget class="QGroupBox" name="boxType" > <property name="title" > - <string>Object</string> + <string>Type</string> </property> - <layout class="QHBoxLayout" > + <layout class="QVBoxLayout" > <item> - <widget class="KComboBox" name="varObject" /> + <widget class="KComboBox" name="varType" > + <property name="toolTip" > + <string>Type of object</string> + </property> + <property name="insertPolicy" > + <enum>QComboBox::NoInsert</enum> + </property> + <property name="sizeAdjustPolicy" > + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxObject" > + <property name="title" > + <string>Object</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KComboBox" name="varObject" > + <property name="toolTip" > + <string>Object to be sold</string> + </property> + <property name="insertPolicy" > + <enum>QComboBox::NoInsert</enum> + </property> + <property name="sizeAdjustPolicy" > + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> + </item> + </layout> + </widget> </item> </layout> </widget> @@ -42,6 +91,9 @@ <layout class="QHBoxLayout" > <item> <widget class="KIntNumInput" name="varAmount" > + <property name="toolTip" > + <string>How many are sold</string> + </property> <property name="minimum" > <number>1</number> </property> @@ -58,6 +110,9 @@ <layout class="QHBoxLayout" > <item> <widget class="KIntNumInput" name="varCost" > + <property name="toolTip" > + <string>How much the object(s) cost</string> + </property> <property name="minimum" > <number>0</number> </property> @@ -73,8 +128,8 @@ </property> <property name="sizeHint" > <size> - <width>20</width> - <height>40</height> + <width>218</width> + <height>16</height> </size> </property> </spacer> @@ -92,6 +147,11 @@ <extends>QWidget</extends> <header>knuminput.h</header> </customwidget> + <customwidget> + <class>KPushButton</class> + <extends>QPushButton</extends> + <header>kpushbutton.h</header> + </customwidget> </customwidgets> <resources/> <connections/> diff --git a/pokemodr/gui/dialog.ui b/pokemodr/gui/dialog.ui index ad5e778b..69c6dbdb 100644 --- a/pokemodr/gui/dialog.ui +++ b/pokemodr/gui/dialog.ui @@ -1,23 +1,56 @@ <ui version="4.0" > - <class>panelDialog</class> - <widget class="QWidget" name="panelDialog" > + <class>formDialog</class> + <widget class="QWidget" name="formDialog" > <property name="geometry" > <rect> <x>0</x> <y>0</y> - <width>109</width> - <height>189</height> + <width>191</width> + <height>264</height> </rect> </property> <layout class="QVBoxLayout" > <item> + <widget class="QGroupBox" name="boxButtons" > + <property name="title" > + <string/> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KPushButton" name="buttonApply" > + <property name="text" > + <string>&Apply</string> + </property> + <property name="shortcut" > + <string>Ctrl+Return</string> + </property> + </widget> + </item> + <item> + <widget class="KPushButton" name="buttonDiscard" > + <property name="text" > + <string>&Discard</string> + </property> + <property name="shortcut" > + <string>Esc</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> <widget class="QGroupBox" name="boxDialog" > <property name="title" > <string>Dialog</string> </property> <layout class="QHBoxLayout" > <item> - <widget class="KTextEdit" name="varDialog" /> + <widget class="KTextEdit" name="varDialog" > + <property name="toolTip" > + <string>Dialog text and commands</string> + </property> + </widget> </item> </layout> </widget> @@ -29,7 +62,17 @@ </property> <layout class="QHBoxLayout" > <item> - <widget class="KComboBox" name="varCommand" /> + <widget class="KComboBox" name="varCommand" > + <property name="toolTip" > + <string>Insert a command into the dialog</string> + </property> + <property name="insertPolicy" > + <enum>QComboBox::NoInsert</enum> + </property> + <property name="sizeAdjustPolicy" > + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> </item> </layout> </widget> @@ -56,6 +99,11 @@ <header>kcombobox.h</header> </customwidget> <customwidget> + <class>KPushButton</class> + <extends>QPushButton</extends> + <header>kpushbutton.h</header> + </customwidget> + <customwidget> <class>KTextEdit</class> <extends>QTextEdit</extends> <header>ktextedit.h</header> diff --git a/pokemodr/gui/egggroup.ui b/pokemodr/gui/egggroup.ui index 6c940215..cc0d7f6d 100644 --- a/pokemodr/gui/egggroup.ui +++ b/pokemodr/gui/egggroup.ui @@ -1,16 +1,45 @@ <ui version="4.0" > - <class>panelEggGroup</class> - <widget class="QWidget" name="panelEggGroup" > + <class>formEggGroup</class> + <widget class="QWidget" name="formEggGroup" > <property name="geometry" > <rect> <x>0</x> <y>0</y> - <width>80</width> - <height>84</height> + <width>191</width> + <height>159</height> </rect> </property> <layout class="QVBoxLayout" > <item> + <widget class="QGroupBox" name="boxButtons" > + <property name="title" > + <string/> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KPushButton" name="buttonApply" > + <property name="text" > + <string>&Apply</string> + </property> + <property name="shortcut" > + <string>Ctrl+Return</string> + </property> + </widget> + </item> + <item> + <widget class="KPushButton" name="buttonDiscard" > + <property name="text" > + <string>&Discard</string> + </property> + <property name="shortcut" > + <string>Esc</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> <widget class="QGroupBox" name="boxName" > <property name="title" > <string>Name</string> @@ -18,6 +47,9 @@ <layout class="QHBoxLayout" > <item> <widget class="KLineEdit" name="varName" > + <property name="toolTip" > + <string>Name of the egg group</string> + </property> <property name="showClearButton" stdset="0" > <bool>true</bool> </property> @@ -47,6 +79,11 @@ <extends>QLineEdit</extends> <header>klineedit.h</header> </customwidget> + <customwidget> + <class>KPushButton</class> + <extends>QPushButton</extends> + <header>kpushbutton.h</header> + </customwidget> </customwidgets> <resources/> <connections/> diff --git a/pokemodr/gui/item.ui b/pokemodr/gui/item.ui index d52f421f..f51c5daa 100644 --- a/pokemodr/gui/item.ui +++ b/pokemodr/gui/item.ui @@ -1,16 +1,45 @@ <ui version="4.0" > - <class>panelItem</class> - <widget class="QWidget" name="panelItem" > + <class>formItem</class> + <widget class="QWidget" name="formItem" > <property name="geometry" > <rect> <x>0</x> <y>0</y> <width>226</width> - <height>391</height> + <height>466</height> </rect> </property> <layout class="QVBoxLayout" > <item> + <widget class="QGroupBox" name="boxButtons" > + <property name="title" > + <string/> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KPushButton" name="buttonApply" > + <property name="text" > + <string>&Apply</string> + </property> + <property name="shortcut" > + <string>Ctrl+Return</string> + </property> + </widget> + </item> + <item> + <widget class="KPushButton" name="buttonDiscard" > + <property name="text" > + <string>&Discard</string> + </property> + <property name="shortcut" > + <string>Esc</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> <widget class="QGroupBox" name="boxName" > <property name="title" > <string>Name</string> @@ -18,6 +47,9 @@ <layout class="QHBoxLayout" > <item> <widget class="KLineEdit" name="varName" > + <property name="toolTip" > + <string>Name of the item</string> + </property> <property name="showClearButton" stdset="0" > <bool>true</bool> </property> @@ -28,6 +60,9 @@ </item> <item> <widget class="QGroupBox" name="boxSellable" > + <property name="toolTip" > + <string>Whether the item is sellable at a store or not</string> + </property> <property name="title" > <string>Sellable</string> </property> @@ -44,7 +79,17 @@ </property> <layout class="QHBoxLayout" > <item> - <widget class="KComboBox" name="varType" /> + <widget class="KComboBox" name="varType" > + <property name="toolTip" > + <string>Type of item</string> + </property> + <property name="insertPolicy" > + <enum>QComboBox::NoInsert</enum> + </property> + <property name="sizeAdjustPolicy" > + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> </item> </layout> </widget> @@ -57,6 +102,9 @@ <layout class="QHBoxLayout" > <item> <widget class="KIntNumInput" name="varPrice" > + <property name="toolTip" > + <string>Price of the item at the store (resell value is 50%; 25% for "Hard Cash" mode)</string> + </property> <property name="minimum" > <number>0</number> </property> @@ -72,7 +120,11 @@ </property> <layout class="QHBoxLayout" > <item> - <widget class="KTextEdit" name="varDescription" /> + <widget class="KTextEdit" name="varDescription" > + <property name="toolTip" > + <string>Description of the item</string> + </property> + </widget> </item> </layout> </widget> @@ -109,6 +161,11 @@ <header>klineedit.h</header> </customwidget> <customwidget> + <class>KPushButton</class> + <extends>QPushButton</extends> + <header>kpushbutton.h</header> + </customwidget> + <customwidget> <class>KTextEdit</class> <extends>QTextEdit</extends> <header>ktextedit.h</header> diff --git a/pokemodr/gui/itemeffect.ui b/pokemodr/gui/itemeffect.ui index da017c62..99fa3b4b 100644 --- a/pokemodr/gui/itemeffect.ui +++ b/pokemodr/gui/itemeffect.ui @@ -1,55 +1,81 @@ <ui version="4.0" > - <class>panelItemEffect</class> - <widget class="QWidget" name="panelItemEffect" > + <class>formItemEffect</class> + <widget class="QWidget" name="formItemEffect" > <property name="geometry" > <rect> <x>0</x> <y>0</y> - <width>152</width> - <height>598</height> + <width>244</width> + <height>704</height> </rect> </property> <layout class="QVBoxLayout" > <item> - <widget class="QGroupBox" name="boxOverworld" > + <widget class="QGroupBox" name="boxButtons" > <property name="title" > - <string>Overworld</string> + <string/> </property> - <property name="checkable" > - <bool>true</bool> - </property> - <property name="checked" > - <bool>false</bool> - </property> - <layout class="QHBoxLayout" /> - </widget> - </item> - <item> - <widget class="QGroupBox" name="boxBattle" > - <property name="title" > - <string>Battle</string> - </property> - <property name="checkable" > - <bool>true</bool> - </property> - <property name="checked" > - <bool>false</bool> - </property> - <layout class="QHBoxLayout" /> + <layout class="QHBoxLayout" > + <item> + <widget class="KPushButton" name="buttonApply" > + <property name="text" > + <string>&Apply</string> + </property> + <property name="shortcut" > + <string>Ctrl+Return</string> + </property> + </widget> + </item> + <item> + <widget class="KPushButton" name="buttonDiscard" > + <property name="text" > + <string>&Discard</string> + </property> + <property name="shortcut" > + <string>Esc</string> + </property> + </widget> + </item> + </layout> </widget> </item> <item> - <widget class="QGroupBox" name="boxHeld" > + <widget class="QGroupBox" name="boxFlags" > <property name="title" > - <string>Held</string> - </property> - <property name="checkable" > - <bool>true</bool> + <string>Flags</string> </property> - <property name="checked" > - <bool>false</bool> - </property> - <layout class="QHBoxLayout" /> + <layout class="QVBoxLayout" > + <item> + <widget class="QCheckBox" name="varOverworld" > + <property name="toolTip" > + <string>If checked, effect only works in the overworld</string> + </property> + <property name="text" > + <string>Overworld</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="varBattle" > + <property name="toolTip" > + <string>If checked, effect only works in battle</string> + </property> + <property name="text" > + <string>Battle</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="varHeld" > + <property name="toolTip" > + <string>If checked, effect only works when item is being held</string> + </property> + <property name="text" > + <string>Held</string> + </property> + </widget> + </item> + </layout> </widget> </item> <item> @@ -59,7 +85,17 @@ </property> <layout class="QVBoxLayout" > <item> - <widget class="KComboBox" name="varEffect" /> + <widget class="KComboBox" name="varEffect" > + <property name="toolTip" > + <string>Effect</string> + </property> + <property name="insertPolicy" > + <enum>QComboBox::NoInsert</enum> + </property> + <property name="sizeAdjustPolicy" > + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> </item> <item> <widget class="QGroupBox" name="boxValue1" > @@ -68,7 +104,14 @@ </property> <layout class="QHBoxLayout" > <item> - <widget class="KIntNumInput" name="varVal1" /> + <widget class="KIntNumInput" name="varVal1" > + <property name="toolTip" > + <string>Value 1</string> + </property> + <property name="minimum" > + <number>0</number> + </property> + </widget> </item> </layout> </widget> @@ -80,7 +123,17 @@ </property> <layout class="QHBoxLayout" > <item> - <widget class="KComboBox" name="varVal2" /> + <widget class="KComboBox" name="varVal2" > + <property name="toolTip" > + <string>Value 2</string> + </property> + <property name="insertPolicy" > + <enum>QComboBox::NoInsert</enum> + </property> + <property name="sizeAdjustPolicy" > + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> </item> </layout> </widget> @@ -92,7 +145,17 @@ </property> <layout class="QHBoxLayout" > <item> - <widget class="KComboBox" name="valVal3" /> + <widget class="KComboBox" name="valVal3" > + <property name="toolTip" > + <string>Value 3</string> + </property> + <property name="insertPolicy" > + <enum>QComboBox::NoInsert</enum> + </property> + <property name="sizeAdjustPolicy" > + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> </item> </layout> </widget> @@ -105,6 +168,9 @@ <layout class="QVBoxLayout" > <item> <widget class="KLineEdit" name="varVal4" > + <property name="toolTip" > + <string>Value 4</string> + </property> <property name="readOnly" > <bool>true</bool> </property> @@ -167,6 +233,11 @@ <extends>QLineEdit</extends> <header>klineedit.h</header> </customwidget> + <customwidget> + <class>KPushButton</class> + <extends>QPushButton</extends> + <header>kpushbutton.h</header> + </customwidget> </customwidgets> <resources/> <connections/> diff --git a/pokemodr/gui/itemtype.ui b/pokemodr/gui/itemtype.ui index 408cdd33..4ba1eb4a 100644 --- a/pokemodr/gui/itemtype.ui +++ b/pokemodr/gui/itemtype.ui @@ -1,16 +1,45 @@ <ui version="4.0" > - <class>panelItemType</class> - <widget class="QWidget" name="panelItemType" > + <class>formItemType</class> + <widget class="QWidget" name="formItemType" > <property name="geometry" > <rect> <x>0</x> <y>0</y> <width>226</width> - <height>242</height> + <height>317</height> </rect> </property> <layout class="QVBoxLayout" > <item> + <widget class="QGroupBox" name="boxButtons" > + <property name="title" > + <string/> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KPushButton" name="buttonApply" > + <property name="text" > + <string>&Apply</string> + </property> + <property name="shortcut" > + <string>Ctrl+Return</string> + </property> + </widget> + </item> + <item> + <widget class="KPushButton" name="buttonDiscard" > + <property name="text" > + <string>&Discard</string> + </property> + <property name="shortcut" > + <string>Esc</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> <widget class="QGroupBox" name="boxName" > <property name="title" > <string>Name</string> @@ -18,6 +47,9 @@ <layout class="QHBoxLayout" > <item> <widget class="KLineEdit" name="varName" > + <property name="toolTip" > + <string>Name of the item type</string> + </property> <property name="dragEnabled" > <bool>false</bool> </property> @@ -37,6 +69,9 @@ <layout class="QHBoxLayout" > <item> <widget class="KIntNumInput" name="varComputer" > + <property name="toolTip" > + <string>How many of the items can be stored on the computer system</string> + </property> <property name="minimum" > <number>0</number> </property> @@ -53,6 +88,9 @@ <layout class="QHBoxLayout" > <item> <widget class="KIntNumInput" name="varPlayer" > + <property name="toolTip" > + <string>How many of the item the player can carry</string> + </property> <property name="minimum" > <number>1</number> </property> @@ -87,6 +125,11 @@ <extends>QLineEdit</extends> <header>klineedit.h</header> </customwidget> + <customwidget> + <class>KPushButton</class> + <extends>QPushButton</extends> + <header>kpushbutton.h</header> + </customwidget> </customwidgets> <resources/> <connections/> diff --git a/pokemodr/gui/map.ui b/pokemodr/gui/map.ui index d9c7bb3c..beebbfd3 100644 --- a/pokemodr/gui/map.ui +++ b/pokemodr/gui/map.ui @@ -1,32 +1,57 @@ <ui version="4.0" > - <class>panelMap</class> - <widget class="QWidget" name="panelMap" > + <class>formMap</class> + <widget class="QWidget" name="formMap" > <property name="geometry" > <rect> <x>0</x> <y>0</y> - <width>109</width> - <height>236</height> + <width>191</width> + <height>311</height> </rect> </property> <layout class="QVBoxLayout" > <item> - <widget class="QGroupBox" name="boxName" > + <widget class="QGroupBox" name="boxButtons" > <property name="title" > - <string>Name</string> + <string/> </property> <layout class="QHBoxLayout" > <item> - <widget class="KLineEdit" name="klineedit" > - <property name="showClearButton" stdset="0" > - <bool>true</bool> + <widget class="KPushButton" name="buttonApply" > + <property name="text" > + <string>&Apply</string> + </property> + <property name="shortcut" > + <string>Ctrl+Return</string> </property> </widget> </item> <item> - <widget class="QLabel" name="labelName" > + <widget class="KPushButton" name="buttonDiscard" > <property name="text" > - <string/> + <string>&Discard</string> + </property> + <property name="shortcut" > + <string>Esc</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxName" > + <property name="title" > + <string>Name</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KLineEdit" name="varName" > + <property name="toolTip" > + <string>Name of the map</string> + </property> + <property name="showClearButton" stdset="0" > + <bool>true</bool> </property> </widget> </item> @@ -38,9 +63,25 @@ <property name="title" > <string>Fly Warp</string> </property> + <property name="checkable" > + <bool>true</bool> + </property> + <property name="checked" > + <bool>false</bool> + </property> <layout class="QHBoxLayout" > <item> - <widget class="KComboBox" name="kcombobox" /> + <widget class="KComboBox" name="varFlyWarp" > + <property name="toolTip" > + <string>The destination when flown to the map</string> + </property> + <property name="insertPolicy" > + <enum>QComboBox::NoInsert</enum> + </property> + <property name="sizeAdjustPolicy" > + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> </item> </layout> </widget> @@ -52,7 +93,17 @@ </property> <layout class="QHBoxLayout" > <item> - <widget class="KComboBox" name="kcombobox_2" /> + <widget class="KComboBox" name="varType" > + <property name="toolTip" > + <string>They type of map</string> + </property> + <property name="insertPolicy" > + <enum>QComboBox::NoInsert</enum> + </property> + <property name="sizeAdjustPolicy" > + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> </item> </layout> </widget> @@ -83,6 +134,11 @@ <extends>QLineEdit</extends> <header>klineedit.h</header> </customwidget> + <customwidget> + <class>KPushButton</class> + <extends>QPushButton</extends> + <header>kpushbutton.h</header> + </customwidget> </customwidgets> <resources/> <connections/> diff --git a/pokemodr/gui/mapeffect.ui b/pokemodr/gui/mapeffect.ui index 438d22d7..9242fd38 100644 --- a/pokemodr/gui/mapeffect.ui +++ b/pokemodr/gui/mapeffect.ui @@ -1,16 +1,45 @@ <ui version="4.0" > - <class>panelMapEffect</class> - <widget class="QWidget" name="panelMapEffect" > + <class>formMapEffect</class> + <widget class="QWidget" name="formMapEffect" > <property name="geometry" > <rect> <x>0</x> <y>0</y> <width>290</width> - <height>969</height> + <height>1047</height> </rect> </property> <layout class="QVBoxLayout" > <item> + <widget class="QGroupBox" name="boxButtons" > + <property name="title" > + <string/> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KPushButton" name="buttonApply" > + <property name="text" > + <string>&Apply</string> + </property> + <property name="shortcut" > + <string>Ctrl+Return</string> + </property> + </widget> + </item> + <item> + <widget class="KPushButton" name="buttonDiscard" > + <property name="text" > + <string>&Discard</string> + </property> + <property name="shortcut" > + <string>Esc</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> <widget class="QGroupBox" name="boxName" > <property name="title" > <string>Name</string> @@ -18,6 +47,9 @@ <layout class="QHBoxLayout" > <item> <widget class="KLineEdit" name="varName" > + <property name="toolTip" > + <string>Name of the effect</string> + </property> <property name="showClearButton" stdset="0" > <bool>true</bool> </property> @@ -37,6 +69,9 @@ <layout class="QVBoxLayout" > <item> <widget class="KIntNumInput" name="varXCoordinate" > + <property name="toolTip" > + <string>x coordinate of the effect</string> + </property> <property name="label" > <string>x</string> </property> @@ -47,6 +82,9 @@ </item> <item> <widget class="KIntNumInput" name="varYCoordinate" > + <property name="toolTip" > + <string>y coordinate of the effect</string> + </property> <property name="label" > <string>y</string> </property> @@ -66,6 +104,9 @@ <layout class="QHBoxLayout" > <item> <widget class="KIntNumInput" name="varExistFlag" > + <property name="toolTip" > + <string>flag which determines if the effect is on the overworld</string> + </property> <property name="label" > <string/> </property> @@ -76,6 +117,9 @@ </item> <item> <widget class="QCheckBox" name="varState" > + <property name="toolTip" > + <string>Whether the flag has to be on, off, or is ignored</string> + </property> <property name="text" > <string>State</string> </property> @@ -107,6 +151,9 @@ <height>128</height> </size> </property> + <property name="toolTip" > + <string>Skin of the effect</string> + </property> </widget> </item> </layout> @@ -120,6 +167,9 @@ <layout class="QVBoxLayout" > <item> <widget class="KComboBox" name="varEffect" > + <property name="toolTip" > + <string>The effect the effect has</string> + </property> <property name="insertPolicy" > <enum>QComboBox::NoInsert</enum> </property> @@ -139,6 +189,9 @@ <layout class="QHBoxLayout" > <item> <widget class="KComboBox" name="varVal1" > + <property name="toolTip" > + <string>Value 1</string> + </property> <property name="insertPolicy" > <enum>QComboBox::NoInsert</enum> </property> @@ -161,6 +214,9 @@ <layout class="QHBoxLayout" > <item> <widget class="KComboBox" name="varVal2" > + <property name="toolTip" > + <string>Value 2</string> + </property> <property name="insertPolicy" > <enum>QComboBox::NoInsert</enum> </property> @@ -186,6 +242,9 @@ <layout class="QHBoxLayout" > <item> <widget class="KComboBox" name="varDirection" > + <property name="toolTip" > + <string>The direction the effect faces</string> + </property> <property name="insertPolicy" > <enum>QComboBox::NoInsert</enum> </property> @@ -201,31 +260,32 @@ </widget> </item> <item> - <widget class="QGroupBox" name="boxGhost" > - <property name="title" > - <string>Ghost</string> - </property> - <property name="checkable" > - <bool>true</bool> - </property> - <property name="checked" > - <bool>false</bool> - </property> - <layout class="QHBoxLayout" /> - </widget> - </item> - <item> - <widget class="QGroupBox" name="boxMovable" > + <widget class="QGroupBox" name="boxFlags" > <property name="title" > - <string>Movable</string> - </property> - <property name="checkable" > - <bool>true</bool> - </property> - <property name="checked" > - <bool>false</bool> + <string>Flags</string> </property> - <layout class="QHBoxLayout" /> + <layout class="QVBoxLayout" > + <item> + <widget class="QCheckBox" name="varGhost" > + <property name="toolTip" > + <string>If checked, the effect is able to be walked through</string> + </property> + <property name="text" > + <string>Ghost</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="varMovable" > + <property name="toolTip" > + <string>If checked, the effect will move around the map randomly</string> + </property> + <property name="text" > + <string>Movable</string> + </property> + </widget> + </item> + </layout> </widget> </item> <item> @@ -235,7 +295,17 @@ </property> <layout class="QHBoxLayout" > <item> - <widget class="KComboBox" name="varDialog" /> + <widget class="KComboBox" name="varDialog" > + <property name="toolTip" > + <string>The dialog to use when talked to</string> + </property> + <property name="insertPolicy" > + <enum>QComboBox::NoInsert</enum> + </property> + <property name="sizeAdjustPolicy" > + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> </item> </layout> </widget> @@ -271,6 +341,11 @@ <extends>QLineEdit</extends> <header>klineedit.h</header> </customwidget> + <customwidget> + <class>KPushButton</class> + <extends>QPushButton</extends> + <header>kpushbutton.h</header> + </customwidget> </customwidgets> <resources/> <connections/> diff --git a/pokemodr/gui/maptrainer.ui b/pokemodr/gui/maptrainer.ui new file mode 100644 index 00000000..a1b72fa2 --- /dev/null +++ b/pokemodr/gui/maptrainer.ui @@ -0,0 +1,383 @@ +<ui version="4.0" > + <class>Form</class> + <widget class="QWidget" name="Form" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>290</width> + <height>1227</height> + </rect> + </property> + <property name="windowTitle" > + <string>Form</string> + </property> + <layout class="QVBoxLayout" > + <item> + <widget class="QGroupBox" name="boxButtons" > + <property name="title" > + <string/> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KPushButton" name="buttonApply" > + <property name="text" > + <string>&Apply</string> + </property> + <property name="shortcut" > + <string>Ctrl+Return</string> + </property> + </widget> + </item> + <item> + <widget class="KPushButton" name="buttonDiscard" > + <property name="text" > + <string>&Discard</string> + </property> + <property name="shortcut" > + <string>Esc</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxName" > + <property name="title" > + <string>Name</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KLineEdit" name="varName" > + <property name="toolTip" > + <string>Name of the trainer</string> + </property> + <property name="showClearButton" stdset="0" > + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxCoordinate" > + <property name="title" > + <string>Coordinate</string> + </property> + <layout class="QVBoxLayout" > + <item> + <widget class="KIntNumInput" name="varCoordinateX" > + <property name="toolTip" > + <string>x coordinate of the trainer</string> + </property> + <property name="label" > + <string>x</string> + </property> + <property name="minimum" > + <number>0</number> + </property> + </widget> + </item> + <item> + <widget class="KIntNumInput" name="varCoordinateY" > + <property name="toolTip" > + <string>y coordinate of the trainer</string> + </property> + <property name="label" > + <string>y</string> + </property> + <property name="minimum" > + <number>0</number> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxSkin" > + <property name="title" > + <string>Skin</string> + </property> + <property name="checkable" > + <bool>false</bool> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="QGraphicsView" name="varSkin" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="Fixed" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize" > + <size> + <width>192</width> + <height>128</height> + </size> + </property> + <property name="maximumSize" > + <size> + <width>192</width> + <height>128</height> + </size> + </property> + <property name="toolTip" > + <string>Skin of the trainer</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxSight" > + <property name="title" > + <string>Sight</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KIntNumInput" name="varSight" > + <property name="toolTip" > + <string>How far the trainer can see</string> + </property> + <property name="minimum" > + <number>0</number> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxDirection" > + <property name="title" > + <string>Direction</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KComboBox" name="varDirection" > + <property name="toolTip" > + <string>Direction the trainer faces</string> + </property> + <property name="insertPolicy" > + <enum>QComboBox::NoInsert</enum> + </property> + <property name="sizeAdjustPolicy" > + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxNumFight" > + <property name="title" > + <string>Number Fight</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KIntNumInput" name="varNumFight" > + <property name="toolTip" > + <string>How many team members from each side fight at a time</string> + </property> + <property name="minimum" > + <number>0</number> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxAI" > + <property name="title" > + <string>AI</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KComboBox" name="varAI" > + <property name="toolTip" > + <string>The AI scheme used</string> + </property> + <property name="insertPolicy" > + <enum>QComboBox::NoInsert</enum> + </property> + <property name="sizeAdjustPolicy" > + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxAppearFlag" > + <property name="title" > + <string>Appear Flag</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KIntNumInput" name="varFlag" > + <property name="toolTip" > + <string>The flag that determines if the trainer is on the map or not</string> + </property> + <property name="minimum" > + <number>0</number> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="varFlagState" > + <property name="toolTip" > + <string>Whether the flag has to be on, off, or is ignored</string> + </property> + <property name="text" > + <string>State</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxDialogs" > + <property name="title" > + <string>Dialogs</string> + </property> + <layout class="QVBoxLayout" > + <item> + <widget class="QGroupBox" name="boxOverworldDialog" > + <property name="title" > + <string>Overworld</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KComboBox" name="varOverworlDialog" > + <property name="toolTip" > + <string>The dialog used when talked to in the overworld</string> + </property> + <property name="insertPolicy" > + <enum>QComboBox::NoInsert</enum> + </property> + <property name="sizeAdjustPolicy" > + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxLoseDialog" > + <property name="title" > + <string>Lose</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KComboBox" name="varLoseDialog" > + <property name="toolTip" > + <string>The dialog used when the trainer loses</string> + </property> + <property name="insertPolicy" > + <enum>QComboBox::NoInsert</enum> + </property> + <property name="sizeAdjustPolicy" > + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxWinDialog" > + <property name="title" > + <string>Win</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KComboBox" name="varWinDialog" > + <property name="toolTip" > + <string>The dialog used when the trainer wins</string> + </property> + <property name="insertPolicy" > + <enum>QComboBox::NoInsert</enum> + </property> + <property name="sizeAdjustPolicy" > + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxLeadTeamMember" > + <property name="title" > + <string>Lead Team Member</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KComboBox" name="varLeadTeamMember" > + <property name="toolTip" > + <string>The lead team member</string> + </property> + <property name="insertPolicy" > + <enum>QComboBox::NoInsert</enum> + </property> + <property name="sizeAdjustPolicy" > + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <spacer> + <property name="orientation" > + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" > + <size> + <width>282</width> + <height>16</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <customwidgets> + <customwidget> + <class>KComboBox</class> + <extends>QComboBox</extends> + <header>kcombobox.h</header> + </customwidget> + <customwidget> + <class>KIntNumInput</class> + <extends>QWidget</extends> + <header>knuminput.h</header> + </customwidget> + <customwidget> + <class>KLineEdit</class> + <extends>QLineEdit</extends> + <header>klineedit.h</header> + </customwidget> + <customwidget> + <class>KPushButton</class> + <extends>QPushButton</extends> + <header>kpushbutton.h</header> + </customwidget> + </customwidgets> + <resources/> + <connections/> +</ui> diff --git a/pokemodr/gui/maptrainerteammember.ui b/pokemodr/gui/maptrainerteammember.ui new file mode 100644 index 00000000..646d1c4f --- /dev/null +++ b/pokemodr/gui/maptrainerteammember.ui @@ -0,0 +1,160 @@ +<ui version="4.0" > + <class>forMapTrainerTeamMember</class> + <widget class="QWidget" name="forMapTrainerTeamMember" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>226</width> + <height>419</height> + </rect> + </property> + <property name="windowTitle" > + <string/> + </property> + <layout class="QVBoxLayout" > + <item> + <widget class="QGroupBox" name="boxButtons" > + <property name="title" > + <string/> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KPushButton" name="buttonApply" > + <property name="text" > + <string>&Apply</string> + </property> + <property name="shortcut" > + <string>Ctrl+Return</string> + </property> + </widget> + </item> + <item> + <widget class="KPushButton" name="buttonDiscard" > + <property name="text" > + <string>&Discard</string> + </property> + <property name="shortcut" > + <string>Esc</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxSpecies" > + <property name="title" > + <string>Species</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KComboBox" name="varSpecies" > + <property name="toolTip" > + <string>Species of the team member</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxLevel" > + <property name="title" > + <string>Level</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KIntNumInput" name="varLevel" > + <property name="toolTip" > + <string>Level</string> + </property> + <property name="minimum" > + <number>1</number> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxNature" > + <property name="title" > + <string>Nature</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KComboBox" name="varNature" > + <property name="toolTip" > + <string>Nature the team member has</string> + </property> + <property name="insertPolicy" > + <enum>QComboBox::NoInsert</enum> + </property> + <property name="sizeAdjustPolicy" > + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxItems" > + <property name="title" > + <string>Items</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KListWidget" name="varItems" > + <property name="toolTip" > + <string>Items held</string> + </property> + <property name="selectionMode" > + <enum>QAbstractItemView::ExtendedSelection</enum> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <spacer> + <property name="orientation" > + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" > + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <customwidgets> + <customwidget> + <class>KComboBox</class> + <extends>QComboBox</extends> + <header>kcombobox.h</header> + </customwidget> + <customwidget> + <class>KIntNumInput</class> + <extends>QWidget</extends> + <header>knuminput.h</header> + </customwidget> + <customwidget> + <class>KListWidget</class> + <extends>QListWidget</extends> + <header>klistwidget.h</header> + </customwidget> + <customwidget> + <class>KPushButton</class> + <extends>QPushButton</extends> + <header>kpushbutton.h</header> + </customwidget> + </customwidgets> + <resources/> + <connections/> +</ui> diff --git a/pokemodr/gui/mapwarp.ui b/pokemodr/gui/mapwarp.ui new file mode 100644 index 00000000..cd88416e --- /dev/null +++ b/pokemodr/gui/mapwarp.ui @@ -0,0 +1,368 @@ +<ui version="4.0" > + <class>Form</class> + <widget class="QWidget" name="Form" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>290</width> + <height>1051</height> + </rect> + </property> + <property name="windowTitle" > + <string>Form</string> + </property> + <layout class="QVBoxLayout" > + <item> + <widget class="QGroupBox" name="boxButtons" > + <property name="title" > + <string/> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KPushButton" name="buttonApply" > + <property name="text" > + <string>&Apply</string> + </property> + <property name="shortcut" > + <string>Ctrl+Return</string> + </property> + </widget> + </item> + <item> + <widget class="KPushButton" name="buttonDiscard" > + <property name="text" > + <string>&Discard</string> + </property> + <property name="shortcut" > + <string>Esc</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxName" > + <property name="title" > + <string>Name</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KLineEdit" name="varName" > + <property name="toolTip" > + <string>Name of the warp</string> + </property> + <property name="showClearButton" stdset="0" > + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxCoordinate" > + <property name="title" > + <string>Coordinate</string> + </property> + <layout class="QVBoxLayout" > + <item> + <widget class="KIntNumInput" name="varCoordinateX" > + <property name="toolTip" > + <string>x coordinate of the warp</string> + </property> + <property name="label" > + <string>x</string> + </property> + <property name="minimum" > + <number>0</number> + </property> + </widget> + </item> + <item> + <widget class="KIntNumInput" name="varCoordinateY" > + <property name="toolTip" > + <string>y coordinate of the warp</string> + </property> + <property name="label" > + <string>y</string> + </property> + <property name="minimum" > + <number>0</number> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxActivation" > + <property name="title" > + <string>Activation</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KListWidget" name="varActivation" > + <property name="toolTip" > + <string>Directions, that when walked into FROM, the warp is activated</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxDirectionOut" > + <property name="title" > + <string>Direction Out</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KComboBox" name="varDirectionOut" > + <property name="toolTip" > + <string>Direction the warp pushes things when arrived at</string> + </property> + <property name="insertPolicy" > + <enum>QComboBox::NoInsert</enum> + </property> + <property name="sizeAdjustPolicy" > + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxType" > + <property name="title" > + <string>Type</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KComboBox" name="varType" > + <property name="toolTip" > + <string>The type of warp</string> + </property> + <property name="insertPolicy" > + <enum>QComboBox::NoInsert</enum> + </property> + <property name="sizeAdjustPolicy" > + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="groupBox" > + <property name="title" > + <string>Flags</string> + </property> + <layout class="QVBoxLayout" > + <item> + <widget class="QCheckBox" name="varBiking" > + <property name="toolTip" > + <string>Whether to force, allow, of disable biking when going through</string> + </property> + <property name="text" > + <string>Biking</string> + </property> + <property name="tristate" > + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="varFlash" > + <property name="toolTip" > + <string>Whether to force, allow, of disable darkness when going through</string> + </property> + <property name="text" > + <string>Flash</string> + </property> + <property name="tristate" > + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="varFog" > + <property name="toolTip" > + <string>Whether to force, allow, of disable fog when going through</string> + </property> + <property name="text" > + <string>Fog</string> + </property> + <property name="tristate" > + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxDestination" > + <property name="title" > + <string>Destination</string> + </property> + <layout class="QVBoxLayout" > + <item> + <widget class="QGroupBox" name="boxMap" > + <property name="title" > + <string>Map</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KComboBox" name="varToMap" > + <property name="toolTip" > + <string>Map the warp goes to</string> + </property> + <property name="insertPolicy" > + <enum>QComboBox::NoInsert</enum> + </property> + <property name="sizeAdjustPolicy" > + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxWarp" > + <property name="title" > + <string>Warp</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KComboBox" name="varToWarp" > + <property name="toolTip" > + <string>Warp on the map the warp goes to</string> + </property> + <property name="insertPolicy" > + <enum>QComboBox::NoInsert</enum> + </property> + <property name="sizeAdjustPolicy" > + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxFlag" > + <property name="title" > + <string>Flag</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KIntNumInput" name="varFlag" > + <property name="toolTip" > + <string>The flag that determines if the warp works or not</string> + </property> + <property name="minimum" > + <number>0</number> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="varState" > + <property name="toolTip" > + <string>Whether the flag must be on, off, or it is ignored</string> + </property> + <property name="text" > + <string>State</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxDialog" > + <property name="title" > + <string>Dialog</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KComboBox" name="varDialog" > + <property name="toolTip" > + <string>The dialog to parse when the warp is activated</string> + </property> + <property name="insertPolicy" > + <enum>QComboBox::NoInsert</enum> + </property> + <property name="sizeAdjustPolicy" > + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <spacer> + <property name="orientation" > + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" > + <size> + <width>20</width> + <height>16</height> + </size> + </property> + </spacer> + </item> + <item> + <spacer> + <property name="orientation" > + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" > + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <customwidgets> + <customwidget> + <class>KComboBox</class> + <extends>QComboBox</extends> + <header>kcombobox.h</header> + </customwidget> + <customwidget> + <class>KIntNumInput</class> + <extends>QWidget</extends> + <header>knuminput.h</header> + </customwidget> + <customwidget> + <class>KLineEdit</class> + <extends>QLineEdit</extends> + <header>klineedit.h</header> + </customwidget> + <customwidget> + <class>KListWidget</class> + <extends>QListWidget</extends> + <header>klistwidget.h</header> + </customwidget> + <customwidget> + <class>KPushButton</class> + <extends>QPushButton</extends> + <header>kpushbutton.h</header> + </customwidget> + </customwidgets> + <resources/> + <connections/> +</ui> diff --git a/pokemodr/gui/mapwildlist.ui b/pokemodr/gui/mapwildlist.ui new file mode 100644 index 00000000..f95b1178 --- /dev/null +++ b/pokemodr/gui/mapwildlist.ui @@ -0,0 +1,157 @@ +<ui version="4.0" > + <class>formMapWildList</class> + <widget class="QWidget" name="formMapWildList" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>244</width> + <height>400</height> + </rect> + </property> + <property name="windowTitle" > + <string/> + </property> + <layout class="QVBoxLayout" > + <item> + <widget class="QGroupBox" name="boxButtons" > + <property name="title" > + <string/> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KPushButton" name="buttonApply" > + <property name="text" > + <string>&Apply</string> + </property> + <property name="shortcut" > + <string>Ctrl+Return</string> + </property> + </widget> + </item> + <item> + <widget class="KPushButton" name="buttonDiscard" > + <property name="text" > + <string>&Discard</string> + </property> + <property name="shortcut" > + <string>Esc</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxControl" > + <property name="title" > + <string>Control</string> + </property> + <layout class="QVBoxLayout" > + <item> + <widget class="KComboBox" name="varControl" > + <property name="toolTip" > + <string>Type of wild list</string> + </property> + <property name="insertPolicy" > + <enum>QComboBox::NoInsert</enum> + </property> + <property name="sizeAdjustPolicy" > + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> + </item> + <item> + <widget class="KIntNumInput" name="varValue" > + <property name="toolTip" > + <string>Value of the controlling factor</string> + </property> + <property name="label" > + <string>Value</string> + </property> + <property name="minimum" > + <number>0</number> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxTimes" > + <property name="title" > + <string>Times</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KListWidget" name="varTimes" > + <property name="toolTip" > + <string>Times when the list is active</string> + </property> + <property name="selectionMode" > + <enum>QAbstractItemView::ExtendedSelection</enum> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxScope" > + <property name="title" > + <string>Scope</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KIntNumInput" name="varScope" > + <property name="toolTip" > + <string>Scope needed to see encounters (-1 for none)</string> + </property> + <property name="minimum" > + <number>-1</number> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <spacer> + <property name="orientation" > + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" > + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <customwidgets> + <customwidget> + <class>KComboBox</class> + <extends>QComboBox</extends> + <header>kcombobox.h</header> + </customwidget> + <customwidget> + <class>KIntNumInput</class> + <extends>QWidget</extends> + <header>knuminput.h</header> + </customwidget> + <customwidget> + <class>KListWidget</class> + <extends>QListWidget</extends> + <header>klistwidget.h</header> + </customwidget> + <customwidget> + <class>KPushButton</class> + <extends>QPushButton</extends> + <header>kpushbutton.h</header> + </customwidget> + </customwidgets> + <resources/> + <connections/> +</ui> diff --git a/pokemodr/gui/mapwildlistencounter.ui b/pokemodr/gui/mapwildlistencounter.ui new file mode 100644 index 00000000..4af39f15 --- /dev/null +++ b/pokemodr/gui/mapwildlistencounter.ui @@ -0,0 +1,139 @@ +<ui version="4.0" > + <class>formMapWildListEncounter</class> + <widget class="QWidget" name="formMapWildListEncounter" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>226</width> + <height>317</height> + </rect> + </property> + <property name="windowTitle" > + <string/> + </property> + <layout class="QVBoxLayout" > + <item> + <widget class="QGroupBox" name="boxButtons" > + <property name="title" > + <string/> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KPushButton" name="buttonApply" > + <property name="text" > + <string>&Apply</string> + </property> + <property name="shortcut" > + <string>Ctrl+Return</string> + </property> + </widget> + </item> + <item> + <widget class="KPushButton" name="buttonDiscard" > + <property name="text" > + <string>&Discard</string> + </property> + <property name="shortcut" > + <string>Esc</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="groupBox" > + <property name="title" > + <string>Species</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KComboBox" name="varSpecies" > + <property name="toolTip" > + <string>Species of the encounter</string> + </property> + <property name="insertPolicy" > + <enum>QComboBox::NoInsert</enum> + </property> + <property name="sizeAdjustPolicy" > + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="groupBox_2" > + <property name="title" > + <string>Level</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KIntNumInput" name="varLevel" > + <property name="toolTip" > + <string>Level of the encounter</string> + </property> + <property name="minimum" > + <number>0</number> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="groupBox_3" > + <property name="title" > + <string>Weight</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KIntNumInput" name="varWeight" > + <property name="toolTip" > + <string>Weighting</string> + </property> + <property name="minimum" > + <number>1</number> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <spacer> + <property name="orientation" > + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" > + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <customwidgets> + <customwidget> + <class>KComboBox</class> + <extends>QComboBox</extends> + <header>kcombobox.h</header> + </customwidget> + <customwidget> + <class>KIntNumInput</class> + <extends>QWidget</extends> + <header>knuminput.h</header> + </customwidget> + <customwidget> + <class>KPushButton</class> + <extends>QPushButton</extends> + <header>kpushbutton.h</header> + </customwidget> + </customwidgets> + <resources/> + <connections/> +</ui> diff --git a/pokemodr/gui/move.ui b/pokemodr/gui/move.ui new file mode 100644 index 00000000..6ae05ab9 --- /dev/null +++ b/pokemodr/gui/move.ui @@ -0,0 +1,337 @@ +<ui version="4.0" > + <class>formMove</class> + <widget class="QWidget" name="formMove" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>244</width> + <height>1124</height> + </rect> + </property> + <property name="windowTitle" > + <string/> + </property> + <layout class="QVBoxLayout" > + <item> + <widget class="QGroupBox" name="boxButtons" > + <property name="title" > + <string/> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KPushButton" name="buttonApply" > + <property name="text" > + <string>&Apply</string> + </property> + <property name="shortcut" > + <string>Ctrl+Return</string> + </property> + </widget> + </item> + <item> + <widget class="KPushButton" name="buttonDiscard" > + <property name="text" > + <string>&Discard</string> + </property> + <property name="shortcut" > + <string>Esc</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxName" > + <property name="title" > + <string>Name</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KLineEdit" name="varName" > + <property name="toolTip" > + <string>Name of the move</string> + </property> + <property name="showClearButton" stdset="0" > + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxAccuracy" > + <property name="title" > + <string>Accuracy</string> + </property> + <layout class="QVBoxLayout" > + <item> + <widget class="KLineEdit" name="varAccuracy" > + <property name="toolTip" > + <string>Chance the move hits</string> + </property> + <property name="readOnly" > + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="KIntNumInput" name="varAccuracyNum" > + <property name="label" > + <string>Numerator</string> + </property> + <property name="minimum" > + <number>0</number> + </property> + </widget> + </item> + <item> + <widget class="KIntNumInput" name="varAccuracyDenom" > + <property name="label" > + <string>Denominator</string> + </property> + <property name="minimum" > + <number>1</number> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxPower" > + <property name="title" > + <string>Power</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KIntNumInput" name="varPower" > + <property name="toolTip" > + <string>The power of the move</string> + </property> + <property name="minimum" > + <number>0</number> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxType" > + <property name="title" > + <string>Type</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KComboBox" name="varType" > + <property name="toolTip" > + <string>The type of the move</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxPowerPoints" > + <property name="title" > + <string>Power Points</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KIntNumInput" name="varPowerPoints" > + <property name="toolTip" > + <string>How many power points the move has</string> + </property> + <property name="minimum" > + <number>1</number> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxTarget" > + <property name="title" > + <string>Target</string> + </property> + <layout class="QVBoxLayout" > + <item> + <widget class="KComboBox" name="varTarget" > + <property name="toolTip" > + <string>The target of the move</string> + </property> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxTargetChoice" > + <property name="title" > + <string>Target Choice</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KComboBox" name="varTargetChoice" > + <property name="toolTip" > + <string>Whose choice the target is</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxNumTargets" > + <property name="title" > + <string>NumTargets</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KIntNumInput" name="varNumTargets" > + <property name="toolTip" > + <string>The number of targets</string> + </property> + <property name="minimum" > + <number>0</number> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxFlags" > + <property name="title" > + <string>Flags</string> + </property> + <layout class="QVBoxLayout" > + <item> + <widget class="QCheckBox" name="varSpecial" > + <property name="toolTip" > + <string>If checked, the move uses the Special stat(s) rather than the physical</string> + </property> + <property name="text" > + <string>Special</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="varIgnoreAccuracy" > + <property name="toolTip" > + <string>If checked, the move ignores any accuracy-affecting items the enemy may be holding</string> + </property> + <property name="text" > + <string>Ignore Accuracy</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="varCanFlinch" > + <property name="toolTip" > + <string>If checked, the move can make the target flinch with items</string> + </property> + <property name="text" > + <string>Can Flinch</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="varCanRandom" > + <property name="toolTip" > + <string>If checked, Metronome-like moves can use this move</string> + </property> + <property name="text" > + <string>Randomizable</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="varCanSnatch" > + <property name="toolTip" > + <string>If checked, the effects can be stolen</string> + </property> + <property name="text" > + <string>Can Snatch</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="varMakesSound" > + <property name="toolTip" > + <string>If checked, the move makes sound</string> + </property> + <property name="text" > + <string>Makes Sound</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxDescription" > + <property name="title" > + <string>Description</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KTextEdit" name="varDescription" > + <property name="toolTip" > + <string>Description of the move</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <spacer> + <property name="orientation" > + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" > + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <customwidgets> + <customwidget> + <class>KComboBox</class> + <extends>QComboBox</extends> + <header>kcombobox.h</header> + </customwidget> + <customwidget> + <class>KIntNumInput</class> + <extends>QWidget</extends> + <header>knuminput.h</header> + </customwidget> + <customwidget> + <class>KLineEdit</class> + <extends>QLineEdit</extends> + <header>klineedit.h</header> + </customwidget> + <customwidget> + <class>KPushButton</class> + <extends>QPushButton</extends> + <header>kpushbutton.h</header> + </customwidget> + <customwidget> + <class>KTextEdit</class> + <extends>QTextEdit</extends> + <header>ktextedit.h</header> + </customwidget> + </customwidgets> + <resources/> + <connections/> +</ui> diff --git a/pokemodr/gui/nature.ui b/pokemodr/gui/nature.ui new file mode 100644 index 00000000..5fd54691 --- /dev/null +++ b/pokemodr/gui/nature.ui @@ -0,0 +1,180 @@ +<ui version="4.0" > + <class>formNature</class> + <widget class="QWidget" name="formNature" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>244</width> + <height>504</height> + </rect> + </property> + <property name="windowTitle" > + <string/> + </property> + <layout class="QVBoxLayout" > + <item> + <widget class="QGroupBox" name="boxButtons" > + <property name="title" > + <string/> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KPushButton" name="buttonApply" > + <property name="text" > + <string>&Apply</string> + </property> + <property name="shortcut" > + <string>Ctrl+Return</string> + </property> + </widget> + </item> + <item> + <widget class="KPushButton" name="buttonDiscard" > + <property name="text" > + <string>&Discard</string> + </property> + <property name="shortcut" > + <string>Esc</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxName" > + <property name="title" > + <string>Name</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KLineEdit" name="varName" > + <property name="toolTip" > + <string>Name of the nature</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxStats" > + <property name="title" > + <string>Stat</string> + </property> + <layout class="QVBoxLayout" > + <item> + <widget class="KComboBox" name="varStat" > + <property name="toolTip" > + <string>Stat the nature affects</string> + </property> + <property name="insertPolicy" > + <enum>QComboBox::NoInsert</enum> + </property> + <property name="sizeAdjustPolicy" > + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxStatMultiplier" > + <property name="title" > + <string>Multiplier</string> + </property> + <layout class="QVBoxLayout" > + <item> + <widget class="KLineEdit" name="varStatMultiplier" > + <property name="toolTip" > + <string>Stat multiplier</string> + </property> + <property name="readOnly" > + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="KIntNumInput" name="varStatMultiplierNum" > + <property name="label" > + <string>Numerator</string> + </property> + <property name="minimum" > + <number>0</number> + </property> + </widget> + </item> + <item> + <widget class="KIntNumInput" name="varStatMultiplierDenom" > + <property name="label" > + <string>Denominator</string> + </property> + <property name="minimum" > + <number>1</number> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxWeight" > + <property name="title" > + <string>Weight</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KIntNumInput" name="varWeight" > + <property name="toolTip" > + <string>Weighting</string> + </property> + <property name="minimum" > + <number>1</number> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <spacer> + <property name="orientation" > + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" > + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <customwidgets> + <customwidget> + <class>KComboBox</class> + <extends>QComboBox</extends> + <header>kcombobox.h</header> + </customwidget> + <customwidget> + <class>KIntNumInput</class> + <extends>QWidget</extends> + <header>knuminput.h</header> + </customwidget> + <customwidget> + <class>KLineEdit</class> + <extends>QLineEdit</extends> + <header>klineedit.h</header> + </customwidget> + <customwidget> + <class>KPushButton</class> + <extends>QPushButton</extends> + <header>kpushbutton.h</header> + </customwidget> + </customwidgets> + <resources/> + <connections/> +</ui> diff --git a/pokemodr/gui/pokemod.ui b/pokemodr/gui/pokemod.ui index 1d512ad3..86becf1b 100644 --- a/pokemodr/gui/pokemod.ui +++ b/pokemodr/gui/pokemod.ui @@ -1,23 +1,55 @@ <ui version="4.0" > - <class>panelInfo</class> - <widget class="QWidget" name="panelInfo" > + <class>formPokemod</class> + <widget class="QWidget" name="formPokemod" > <property name="geometry" > <rect> <x>0</x> <y>0</y> <width>244</width> - <height>925</height> + <height>687</height> </rect> </property> <layout class="QVBoxLayout" > <item> + <widget class="QGroupBox" name="boxButtons" > + <property name="title" > + <string/> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KPushButton" name="buttonApply" > + <property name="text" > + <string>&Apply</string> + </property> + <property name="shortcut" > + <string>Ctrl+Return</string> + </property> + </widget> + </item> + <item> + <widget class="KPushButton" name="buttonDiscard" > + <property name="text" > + <string>&Discard</string> + </property> + <property name="shortcut" > + <string>Esc</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> <widget class="QGroupBox" name="boxTitle" > <property name="title" > <string>Title</string> </property> <layout class="QHBoxLayout" > <item> - <widget class="KLineEdit" name="klineedit" > + <widget class="KLineEdit" name="varTitle" > + <property name="toolTip" > + <string>The title of the PokéMod</string> + </property> <property name="showClearButton" stdset="0" > <bool>true</bool> </property> @@ -33,7 +65,10 @@ </property> <layout class="QHBoxLayout" > <item> - <widget class="KLineEdit" name="klineedit_2" > + <widget class="KLineEdit" name="varVersion" > + <property name="toolTip" > + <string>PokéMod version</string> + </property> <property name="showClearButton" stdset="0" > <bool>true</bool> </property> @@ -49,92 +84,56 @@ </property> <layout class="QHBoxLayout" > <item> - <widget class="KTextEdit" name="ktextedit" /> + <widget class="KTextEdit" name="varDescription" > + <property name="toolTip" > + <string>Description of the PokéMod</string> + </property> + </widget> </item> </layout> </widget> </item> <item> - <widget class="QGroupBox" name="boxInitialConditions" > + <widget class="QGroupBox" name="boxStartPosition" > <property name="title" > - <string>Initial Conditions</string> + <string>Start Position</string> </property> <layout class="QVBoxLayout" > <item> - <widget class="QGroupBox" name="boxMap" > - <property name="title" > - <string>Map</string> + <widget class="KComboBox" name="varMap" > + <property name="toolTip" > + <string>Map the player starts on</string> </property> - <layout class="QHBoxLayout" > - <item> - <widget class="KComboBox" name="kcombobox_2" /> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="boxCoordinate" > - <property name="title" > - <string>Coordinates</string> + <property name="insertPolicy" > + <enum>QComboBox::NoInsert</enum> </property> - <layout class="QVBoxLayout" > - <item> - <widget class="KIntNumInput" name="kintnuminput_2" > - <property name="minimum" > - <number>0</number> - </property> - </widget> - </item> - <item> - <widget class="KIntNumInput" name="kintnuminput" > - <property name="minimum" > - <number>0</number> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="boxStartDirection" > - <property name="title" > - <string>Direction</string> + <property name="sizeAdjustPolicy" > + <enum>QComboBox::AdjustToContents</enum> </property> - <layout class="QHBoxLayout" > - <item> - <widget class="KComboBox" name="kcombobox" /> - </item> - </layout> </widget> </item> <item> - <widget class="QGroupBox" name="boxMoney" > + <widget class="QGroupBox" name="boxWarp" > <property name="title" > - <string>Money</string> + <string>Warp</string> </property> <layout class="QHBoxLayout" > <item> - <widget class="KIntNumInput" name="kintnuminput_3" > - <property name="minimum" > - <number>0</number> + <widget class="KComboBox" name="varWarp" > + <property name="toolTip" > + <string>Warp the player starts on</string> + </property> + <property name="insertPolicy" > + <enum>QComboBox::NoInsert</enum> + </property> + <property name="sizeAdjustPolicy" > + <enum>QComboBox::AdjustToContents</enum> </property> </widget> </item> </layout> </widget> </item> - <item> - <widget class="QGroupBox" name="boxDialog" > - <property name="title" > - <string>Dialog</string> - </property> - <layout class="QHBoxLayout" > - <item> - <widget class="KComboBox" name="kcombobox_3" /> - </item> - </layout> - </widget> - </item> </layout> </widget> </item> @@ -151,7 +150,10 @@ </property> <layout class="QHBoxLayout" > <item> - <widget class="KLineEdit" name="klineedit_3" > + <widget class="KLineEdit" name="varSuperPCUsername" > + <property name="toolTip" > + <string>Username to access the Super PC</string> + </property> <property name="showClearButton" stdset="0" > <bool>true</bool> </property> @@ -167,7 +169,10 @@ </property> <layout class="QHBoxLayout" > <item> - <widget class="KLineEdit" name="klineedit_4" > + <widget class="KLineEdit" name="varSuperPCPassword" > + <property name="toolTip" > + <string>Password to access the Super PC</string> + </property> <property name="showClearButton" stdset="0" > <bool>true</bool> </property> @@ -201,16 +206,16 @@ <header>kcombobox.h</header> </customwidget> <customwidget> - <class>KIntNumInput</class> - <extends>QWidget</extends> - <header>knuminput.h</header> - </customwidget> - <customwidget> <class>KLineEdit</class> <extends>QLineEdit</extends> <header>klineedit.h</header> </customwidget> <customwidget> + <class>KPushButton</class> + <extends>QPushButton</extends> + <header>kpushbutton.h</header> + </customwidget> + <customwidget> <class>KTextEdit</class> <extends>QTextEdit</extends> <header>ktextedit.h</header> diff --git a/pokemodr/gui/rules.ui b/pokemodr/gui/rules.ui index 07f2bc0b..473ec1a6 100644 --- a/pokemodr/gui/rules.ui +++ b/pokemodr/gui/rules.ui @@ -1,27 +1,59 @@ <ui version="4.0" > - <class>panelRules</class> - <widget class="QWidget" name="panelRules" > + <class>formRules</class> + <widget class="QWidget" name="formRules" > <property name="geometry" > <rect> <x>0</x> <y>0</y> <width>418</width> - <height>764</height> + <height>847</height> </rect> </property> <layout class="QVBoxLayout" > <item> - <widget class="QTabWidget" name="notebookRules" > + <widget class="QGroupBox" name="boxButtons" > + <property name="title" > + <string/> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KPushButton" name="buttonApply" > + <property name="text" > + <string>&Apply</string> + </property> + <property name="shortcut" > + <string>Ctrl+Return</string> + </property> + </widget> + </item> + <item> + <widget class="KPushButton" name="buttonDiscard" > + <property name="text" > + <string>&Discard</string> + </property> + <property name="shortcut" > + <string>Esc</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="KTabWidget" name="notebookRules" > <property name="currentIndex" > <number>2</number> </property> - <widget class="QPanel" name="tabGeneral" > + <widget class="QWidget" name="tabGeneral" > <attribute name="title" > <string>General</string> </attribute> <layout class="QVBoxLayout" > <item> <widget class="QGroupBox" name="boxGenders" > + <property name="toolTip" > + <string>If checked, species will be able to have male and female counterparts</string> + </property> <property name="title" > <string>Genders</string> </property> @@ -35,10 +67,10 @@ <item> <widget class="QCheckBox" name="varBreeding" > <property name="toolTip" > - <string>If checked, Pokémon are allowed to have genders</string> + <string>If checked, breeding will be enabled</string> </property> <property name="statusTip" > - <string>If checked, Pokémon are allowed to have genders</string> + <string/> </property> <property name="text" > <string>Breeding</string> @@ -56,6 +88,9 @@ <layout class="QHBoxLayout" > <item> <widget class="KIntNumInput" name="varHeldItems" > + <property name="toolTip" > + <string>How many items can be held at once</string> + </property> <property name="label" > <string/> </property> @@ -69,6 +104,9 @@ </item> <item> <widget class="QGroupBox" name="boxCriticalDomains" > + <property name="toolTip" > + <string>If checked, critical hit chances will be determined by generation II and newer formulas</string> + </property> <property name="title" > <string>Critical Domains</string> </property> @@ -83,6 +121,9 @@ </item> <item> <widget class="QGroupBox" name="boxAllowAbilities" > + <property name="toolTip" > + <string>If checked, abilities will be enabled</string> + </property> <property name="title" > <string>Abilities</string> </property> @@ -97,6 +138,9 @@ </item> <item> <widget class="QGroupBox" name="boxAllowNatures" > + <property name="toolTip" > + <string>If checked, natures will be enabled</string> + </property> <property name="title" > <string>Natures</string> </property> @@ -124,7 +168,7 @@ </item> </layout> </widget> - <widget class="QPanel" name="tabStorage" > + <widget class="QWidget" name="tabStorage" > <attribute name="title" > <string>Storage</string> </attribute> @@ -132,13 +176,16 @@ <item> <widget class="QGroupBox" name="boxPokemonBoxes" > <property name="title" > - <string>Pokémon Storage</string> + <string>Storage</string> </property> <layout class="QVBoxLayout" > <item> - <widget class="KIntNumInput" name="varPokemonBoxes" > + <widget class="KIntNumInput" name="varBoxes" > + <property name="toolTip" > + <string>How many boxes on the computer will be available</string> + </property> <property name="label" > - <string>Pokémon Boxes</string> + <string>Boxes</string> </property> <property name="minimum" > <number>0</number> @@ -148,7 +195,7 @@ <item> <widget class="KIntNumInput" name="varPokemonPerBox" > <property name="label" > - <string>Pokémon Per Box</string> + <string>Box Size</string> </property> <property name="minimum" > <number>1</number> @@ -166,6 +213,9 @@ <layout class="QHBoxLayout" > <item> <widget class="KIntNumInput" name="varMaxParty" > + <property name="toolTip" > + <string>The size of the largest party possible</string> + </property> <property name="label" > <string/> </property> @@ -185,6 +235,9 @@ <layout class="QHBoxLayout" > <item> <widget class="KIntNumInput" name="varMaxFight" > + <property name="toolTip" > + <string>Maximum amount of team members active at one time per side</string> + </property> <property name="label" > <string/> </property> @@ -204,6 +257,9 @@ <layout class="QHBoxLayout" > <item> <widget class="KIntNumInput" name="varMaxMoves" > + <property name="toolTip" > + <string>Maximum amount of knowable moves</string> + </property> <property name="label" > <string/> </property> @@ -223,6 +279,9 @@ <layout class="QHBoxLayout" > <item> <widget class="KIntNumInput" name="varMaxLevel" > + <property name="toolTip" > + <string>Maximum level allowed</string> + </property> <property name="label" > <string/> </property> @@ -236,11 +295,17 @@ </item> <item> <widget class="QGroupBox" name="boxMaxMoney" > + <property name="title" > + <string>Max Money</string> + </property> <layout class="QHBoxLayout" > <item> <widget class="KIntNumInput" name="varMaxMoney" > + <property name="toolTip" > + <string>Maximum amount of money allowed</string> + </property> <property name="label" > - <string>Max Money</string> + <string/> </property> <property name="minimum" > <number>1</number> @@ -252,6 +317,9 @@ </item> <item> <widget class="QGroupBox" name="boxHardCash" > + <property name="toolTip" > + <string>If checked, money will be harder to come across (only check for challenge games)</string> + </property> <property name="title" > <string>Hard Cash</string> </property> @@ -279,13 +347,16 @@ </item> </layout> </widget> - <widget class="QPanel" name="tabStats" > + <widget class="QWidget" name="tabStats" > <attribute name="title" > <string>Stats</string> </attribute> <layout class="QVBoxLayout" > <item> <widget class="QGroupBox" name="boxSplitSpecial" > + <property name="toolTip" > + <string>If checked, the special stat will be split into separate attack and defense stats</string> + </property> <property name="title" > <string>Split Special</string> </property> @@ -298,6 +369,9 @@ <layout class="QHBoxLayout" > <item> <widget class="QCheckBox" name="varSplitSpecialDV" > + <property name="toolTip" > + <string>If checked, the each special stat will have their own DV</string> + </property> <property name="text" > <string>Split Special DV</string> </property> @@ -313,13 +387,26 @@ </property> <layout class="QHBoxLayout" > <item> - <widget class="KComboBox" name="varMaxDV" /> + <widget class="KComboBox" name="varMaxDV" > + <property name="toolTip" > + <string>The highest a DV may be</string> + </property> + <property name="insertPolicy" > + <enum>QComboBox::NoInsert</enum> + </property> + <property name="sizeAdjustPolicy" > + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> </item> </layout> </widget> </item> <item> <widget class="QGroupBox" name="boxHappiness" > + <property name="toolTip" > + <string>If checked, happiness will be enabled</string> + </property> <property name="title" > <string>Happiness</string> </property> @@ -332,6 +419,9 @@ <layout class="QVBoxLayout" > <item> <widget class="KIntNumInput" name="varFaintLoss" > + <property name="toolTip" > + <string>How many happiness points are lost when fainting</string> + </property> <property name="label" > <string>Loss From Faint</string> </property> @@ -342,6 +432,9 @@ </item> <item> <widget class="KIntNumInput" name="varLevelGain" > + <property name="toolTip" > + <string>How many happiness points are gained along with the level</string> + </property> <property name="label" > <string>Gain From Level</string> </property> @@ -352,6 +445,9 @@ </item> <item> <widget class="KIntNumInput" name="varMaxSteps" > + <property name="toolTip" > + <string>The number of steps it takes to raise happiness by 1</string> + </property> <property name="label" > <string>Steps</string> </property> @@ -365,6 +461,9 @@ </item> <item> <widget class="QGroupBox" name="boxEffortValues" > + <property name="toolTip" > + <string>If checked, stats will have effort values</string> + </property> <property name="title" > <string>Effort Values</string> </property> @@ -377,6 +476,9 @@ <layout class="QVBoxLayout" > <item> <widget class="KIntNumInput" name="varMaxEV" > + <property name="toolTip" > + <string>The maximum amount of effort values allowed</string> + </property> <property name="label" > <string>Max EV</string> </property> @@ -387,6 +489,9 @@ </item> <item> <widget class="KIntNumInput" name="varMaxEVPerStat" > + <property name="toolTip" > + <string>The maximum amount of effort values allowed for a single stat</string> + </property> <property name="label" > <string>Max EV Per Stat</string> </property> @@ -406,6 +511,9 @@ <layout class="QVBoxLayout" > <item> <widget class="KLineEdit" name="varPokerus" > + <property name="toolTip" > + <string>The chance of contracting the Pokérus virus</string> + </property> <property name="readOnly" > <bool>true</bool> </property> @@ -483,9 +591,9 @@ <header>klineedit.h</header> </customwidget> <customwidget> - <class>QPanel</class> - <extends>QWidget</extends> - <header>qpanel.h</header> + <class>KPushButton</class> + <extends>QPushButton</extends> + <header>kpushbutton.h</header> </customwidget> </customwidgets> <resources/> diff --git a/pokemodr/gui/skins.ui b/pokemodr/gui/skins.ui index 81010e8f..e8928cc3 100644 --- a/pokemodr/gui/skins.ui +++ b/pokemodr/gui/skins.ui @@ -1,16 +1,45 @@ <ui version="4.0" > - <class>panelSkins</class> - <widget class="QWidget" name="panelSkins" > + <class>formSkins</class> + <widget class="QWidget" name="formSkins" > <property name="geometry" > <rect> <x>0</x> <y>0</y> <width>432</width> - <height>533</height> + <height>608</height> </rect> </property> <layout class="QGridLayout" > - <item row="0" column="0" > + <item row="0" column="0" colspan="2" > + <widget class="QGroupBox" name="boxButtons" > + <property name="title" > + <string/> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KPushButton" name="buttonApply_2" > + <property name="text" > + <string>&Apply</string> + </property> + <property name="shortcut" > + <string>Ctrl+Return</string> + </property> + </widget> + </item> + <item> + <widget class="KPushButton" name="buttonDiscard_2" > + <property name="text" > + <string>&Discard</string> + </property> + <property name="shortcut" > + <string>Esc</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item row="1" column="0" > <widget class="QGroupBox" name="boxWalkingSkin" > <property name="title" > <string>Walking</string> @@ -35,7 +64,7 @@ </layout> </widget> </item> - <item row="0" column="1" > + <item row="1" column="1" > <widget class="QGroupBox" name="boxBikingSkin" > <property name="title" > <string>Biking</string> @@ -60,7 +89,7 @@ </layout> </widget> </item> - <item row="1" column="0" > + <item row="2" column="0" > <widget class="QGroupBox" name="boxFlyingSkin" > <property name="title" > <string>Flying</string> @@ -85,7 +114,7 @@ </layout> </widget> </item> - <item row="1" column="1" > + <item row="2" column="1" > <widget class="QGroupBox" name="boxSurfingSkin" > <property name="title" > <string>Surfing</string> @@ -110,7 +139,7 @@ </layout> </widget> </item> - <item row="2" column="0" > + <item row="3" column="0" > <widget class="QGroupBox" name="boxFishingSkin" > <property name="title" > <string>Fishing</string> @@ -135,7 +164,7 @@ </layout> </widget> </item> - <item row="2" column="1" > + <item row="3" column="1" > <widget class="QGroupBox" name="boxSurfFishingSkin" > <property name="title" > <string>Surf Fishing</string> @@ -160,21 +189,28 @@ </layout> </widget> </item> - <item row="3" column="0" colspan="2" > + <item row="4" column="0" colspan="2" > <spacer> <property name="orientation" > <enum>Qt::Vertical</enum> </property> <property name="sizeHint" > <size> - <width>20</width> - <height>40</height> + <width>424</width> + <height>16</height> </size> </property> </spacer> </item> </layout> </widget> + <customwidgets> + <customwidget> + <class>KPushButton</class> + <extends>QPushButton</extends> + <header>kpushbutton.h</header> + </customwidget> + </customwidgets> <resources/> <connections/> </ui> diff --git a/pokemodr/gui/species.ui b/pokemodr/gui/species.ui new file mode 100644 index 00000000..5de86c39 --- /dev/null +++ b/pokemodr/gui/species.ui @@ -0,0 +1,585 @@ +<ui version="4.0" > + <author>Ben Boeckel</author> + <class>formSpecies</class> + <widget class="QWidget" name="formSpecies" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>244</width> + <height>2064</height> + </rect> + </property> + <property name="windowTitle" > + <string/> + </property> + <layout class="QVBoxLayout" > + <item> + <widget class="QGroupBox" name="boxButtons" > + <property name="title" > + <string/> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KPushButton" name="buttonApply" > + <property name="toolTip" > + <string/> + </property> + <property name="text" > + <string>&Apply</string> + </property> + <property name="shortcut" > + <string>Ctrl+Return</string> + </property> + </widget> + </item> + <item> + <widget class="KPushButton" name="buttonDiscard" > + <property name="toolTip" > + <string/> + </property> + <property name="text" > + <string>&Discard</string> + </property> + <property name="shortcut" > + <string>Esc</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxName" > + <property name="title" > + <string>Name</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KLineEdit" name="varName" > + <property name="toolTip" > + <string>Name of the species</string> + </property> + <property name="showClearButton" stdset="0" > + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxBaseStats" > + <property name="title" > + <string>Base Stats</string> + </property> + <layout class="QVBoxLayout" > + <item> + <widget class="KComboBox" name="varBaseStat" > + <property name="toolTip" > + <string>Stat</string> + </property> + </widget> + </item> + <item> + <widget class="KIntNumInput" name="varBaseStatValue" > + <property name="toolTip" > + <string>Base value for the stat</string> + </property> + <property name="label" > + <string/> + </property> + <property name="minimum" > + <number>0</number> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxEffortValues" > + <property name="title" > + <string>Effort Values</string> + </property> + <layout class="QVBoxLayout" > + <item> + <widget class="KComboBox" name="varEVStat" > + <property name="toolTip" > + <string>Stat</string> + </property> + <property name="insertPolicy" > + <enum>QComboBox::NoInsert</enum> + </property> + <property name="sizeAdjustPolicy" > + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> + </item> + <item> + <widget class="KIntNumInput" name="varEffortValue" > + <property name="toolTip" > + <string>Number of effort value points given when defeated for given stat</string> + </property> + <property name="minimum" > + <number>0</number> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxGrowth" > + <property name="title" > + <string>Growth</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KComboBox" name="varGrowth" > + <property name="toolTip" > + <string>Level growth pattern</string> + </property> + <property name="editable" > + <bool>false</bool> + </property> + <property name="insertPolicy" > + <enum>QComboBox::NoInsert</enum> + </property> + <property name="sizeAdjustPolicy" > + <enum>QComboBox::AdjustToContents</enum> + </property> + <property name="autoCompletion" > + <bool>false</bool> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxExperienceValue" > + <property name="title" > + <string>Experience Value</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KIntNumInput" name="varExperienceValue" > + <property name="toolTip" > + <string>Base value for experience points earned</string> + </property> + <property name="minimum" > + <number>0</number> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxCatchValue" > + <property name="title" > + <string>Catch Value</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KIntNumInput" name="varCatchValue" > + <property name="toolTip" > + <string>How easy it is to catch the species</string> + </property> + <property name="minimum" > + <number>0</number> + </property> + <property name="maximum" > + <number>255</number> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxRunChance" > + <property name="title" > + <string>Run Chance</string> + </property> + <layout class="QVBoxLayout" > + <item> + <widget class="KLineEdit" name="varRunChance" > + <property name="toolTip" > + <string>Chance the species runs from a wild battle</string> + </property> + <property name="readOnly" > + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="KIntNumInput" name="varRunChanceNum" > + <property name="toolTip" > + <string/> + </property> + <property name="label" > + <string>Numerator</string> + </property> + <property name="minimum" > + <number>0</number> + </property> + </widget> + </item> + <item> + <widget class="KIntNumInput" name="varRunChanceDenom" > + <property name="toolTip" > + <string/> + </property> + <property name="label" > + <string>Denominator</string> + </property> + <property name="minimum" > + <number>1</number> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxItemChance" > + <property name="title" > + <string>Item Chance</string> + </property> + <layout class="QVBoxLayout" > + <item> + <widget class="KLineEdit" name="varItemChance" > + <property name="toolTip" > + <string>Chance the species is carrying an item in a wild battle</string> + </property> + <property name="readOnly" > + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="KIntNumInput" name="varItemChanceNum" > + <property name="toolTip" > + <string/> + </property> + <property name="label" > + <string>Numerator</string> + </property> + <property name="minimum" > + <number>0</number> + </property> + </widget> + </item> + <item> + <widget class="KIntNumInput" name="varItemChanceDenom" > + <property name="toolTip" > + <string/> + </property> + <property name="label" > + <string>Denominator</string> + </property> + <property name="minimum" > + <number>1</number> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxPokedexInformation" > + <property name="title" > + <string>PokéDex Information</string> + </property> + <layout class="QVBoxLayout" > + <item> + <widget class="KIntNumInput" name="varPokedexNumber" > + <property name="toolTip" > + <string>The PokéDex number of the species</string> + </property> + <property name="label" > + <string>Number</string> + </property> + <property name="minimum" > + <number>0</number> + </property> + </widget> + </item> + <item> + <widget class="KIntNumInput" name="varWeight" > + <property name="toolTip" > + <string>The weight of the species</string> + </property> + <property name="label" > + <string>Weight</string> + </property> + <property name="minimum" > + <number>0</number> + </property> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxHeight" > + <property name="title" > + <string>Height</string> + </property> + <layout class="QVBoxLayout" > + <item> + <widget class="KIntNumInput" name="varHeightFeet" > + <property name="toolTip" > + <string>Height of the species</string> + </property> + <property name="label" > + <string>Feet</string> + </property> + <property name="minimum" > + <number>0</number> + </property> + <property name="suffix" > + <string/> + </property> + </widget> + </item> + <item> + <widget class="KIntNumInput" name="varHeightInches" > + <property name="toolTip" > + <string>Height of the species</string> + </property> + <property name="label" > + <string>Inches</string> + </property> + <property name="minimum" > + <number>0</number> + </property> + <property name="maximum" > + <number>11</number> + </property> + <property name="suffix" > + <string/> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxPokedexEntry" > + <property name="title" > + <string>Entry</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KTextEdit" name="ktextedit" > + <property name="toolTip" > + <string>The information on the species given in the PokéDex</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxGenderChance" > + <property name="title" > + <string>Gender Chance</string> + </property> + <layout class="QVBoxLayout" > + <item> + <widget class="KLineEdit" name="varGenderChance" > + <property name="toolTip" > + <string>Chance of getting a female version of the species (negative is genderless)</string> + </property> + <property name="readOnly" > + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="KIntNumInput" name="varGenderChanceNum" > + <property name="toolTip" > + <string/> + </property> + <property name="label" > + <string>Numerator</string> + </property> + <property name="minimum" > + <number>-1</number> + </property> + </widget> + </item> + <item> + <widget class="KIntNumInput" name="varGenderChanceDenom" > + <property name="toolTip" > + <string/> + </property> + <property name="label" > + <string>Denominator</string> + </property> + <property name="minimum" > + <number>1</number> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxEgg" > + <property name="title" > + <string>Egg</string> + </property> + <layout class="QVBoxLayout" > + <item> + <widget class="QGroupBox" name="boxSpecies" > + <property name="title" > + <string>Species</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KComboBox" name="varEggSpecies" > + <property name="toolTip" > + <string>The species that hatches from an egg from this species</string> + </property> + <property name="insertPolicy" > + <enum>QComboBox::NoInsert</enum> + </property> + <property name="sizeAdjustPolicy" > + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="KIntNumInput" name="varEggSteps" > + <property name="toolTip" > + <string>The number of steps it takes to hatch the egg of the species</string> + </property> + <property name="label" > + <string>Steps</string> + </property> + <property name="minimum" > + <number>0</number> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxNidoraGroup" > + <property name="title" > + <string>Nidoran Group</string> + </property> + <layout class="QVBoxLayout" > + <item> + <widget class="KIntNumInput" name="varNidoranGroup" > + <property name="toolTip" > + <string>Nidoran group the species belongs to</string> + </property> + <property name="label" > + <string/> + </property> + <property name="minimum" > + <number>0</number> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxTypes" > + <property name="title" > + <string>Types</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KListWidget" name="varTypes" > + <property name="toolTip" > + <string>The types of the species</string> + </property> + <property name="selectionMode" > + <enum>QAbstractItemView::ExtendedSelection</enum> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxEggGroups" > + <property name="title" > + <string>Egg Groups</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KListWidget" name="varEggGroups" > + <property name="toolTip" > + <string>The egg groups the species belongs to</string> + </property> + <property name="selectionMode" > + <enum>QAbstractItemView::ExtendedSelection</enum> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <spacer> + <property name="orientation" > + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" > + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <layoutdefault spacing="4" margin="4" /> + <customwidgets> + <customwidget> + <class>KComboBox</class> + <extends>QComboBox</extends> + <header>kcombobox.h</header> + </customwidget> + <customwidget> + <class>KIntNumInput</class> + <extends>QWidget</extends> + <header>knuminput.h</header> + </customwidget> + <customwidget> + <class>KLineEdit</class> + <extends>QLineEdit</extends> + <header>klineedit.h</header> + </customwidget> + <customwidget> + <class>KListWidget</class> + <extends>QListWidget</extends> + <header>klistwidget.h</header> + </customwidget> + <customwidget> + <class>KPushButton</class> + <extends>QPushButton</extends> + <header>kpushbutton.h</header> + </customwidget> + <customwidget> + <class>KTextEdit</class> + <extends>QTextEdit</extends> + <header>ktextedit.h</header> + </customwidget> + </customwidgets> + <resources/> + <connections/> +</ui> diff --git a/pokemodr/gui/speciesability.ui b/pokemodr/gui/speciesability.ui new file mode 100644 index 00000000..707584ae --- /dev/null +++ b/pokemodr/gui/speciesability.ui @@ -0,0 +1,120 @@ +<ui version="4.0" > + <class>Form</class> + <widget class="QWidget" name="Form" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>226</width> + <height>238</height> + </rect> + </property> + <property name="windowTitle" > + <string>Form</string> + </property> + <layout class="QVBoxLayout" > + <item> + <widget class="QGroupBox" name="boxButtons" > + <property name="title" > + <string/> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KPushButton" name="buttonApply" > + <property name="text" > + <string>&Apply</string> + </property> + <property name="shortcut" > + <string>Ctrl+Return</string> + </property> + </widget> + </item> + <item> + <widget class="KPushButton" name="buttonDiscard" > + <property name="text" > + <string>&Discard</string> + </property> + <property name="shortcut" > + <string>Esc</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxItem" > + <property name="title" > + <string>Ability</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KComboBox" name="varAbility" > + <property name="toolTip" > + <string>Ability available</string> + </property> + <property name="insertPolicy" > + <enum>QComboBox::NoInsert</enum> + </property> + <property name="sizeAdjustPolicy" > + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxWeight" > + <property name="title" > + <string>Weight</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KIntNumInput" name="varWeight" > + <property name="toolTip" > + <string>Weighting</string> + </property> + <property name="minimum" > + <number>1</number> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <spacer> + <property name="orientation" > + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" > + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <customwidgets> + <customwidget> + <class>KComboBox</class> + <extends>QComboBox</extends> + <header>kcombobox.h</header> + </customwidget> + <customwidget> + <class>KIntNumInput</class> + <extends>QWidget</extends> + <header>knuminput.h</header> + </customwidget> + <customwidget> + <class>KPushButton</class> + <extends>QPushButton</extends> + <header>kpushbutton.h</header> + </customwidget> + </customwidgets> + <resources/> + <connections/> +</ui> diff --git a/pokemodr/gui/speciesevolution.ui b/pokemodr/gui/speciesevolution.ui new file mode 100644 index 00000000..b41cba16 --- /dev/null +++ b/pokemodr/gui/speciesevolution.ui @@ -0,0 +1,208 @@ +<ui version="4.0" > + <class>formSpeciesEvolution</class> + <widget class="QWidget" name="formSpeciesEvolution" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>226</width> + <height>542</height> + </rect> + </property> + <property name="windowTitle" > + <string/> + </property> + <layout class="QVBoxLayout" > + <item> + <widget class="QGroupBox" name="boxButtons" > + <property name="title" > + <string/> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KPushButton" name="buttonApply" > + <property name="text" > + <string>&Apply</string> + </property> + <property name="shortcut" > + <string>Ctrl+Return</string> + </property> + </widget> + </item> + <item> + <widget class="KPushButton" name="buttonDiscard" > + <property name="text" > + <string>&Discard</string> + </property> + <property name="shortcut" > + <string>Esc</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxSpecies" > + <property name="title" > + <string>Species</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KComboBox" name="varSpecies" > + <property name="toolTip" > + <string>Species evolved into</string> + </property> + <property name="insertPolicy" > + <enum>QComboBox::NoInsert</enum> + </property> + <property name="sizeAdjustPolicy" > + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxStyle" > + <property name="title" > + <string>Style</string> + </property> + <layout class="QVBoxLayout" > + <item> + <widget class="KComboBox" name="varStyle" > + <property name="toolTip" > + <string>How the evolution is triggered</string> + </property> + <property name="insertPolicy" > + <enum>QComboBox::NoInsert</enum> + </property> + <property name="sizeAdjustPolicy" > + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxVal1" > + <property name="title" > + <string>Value 1</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KComboBox" name="varVal1" > + <property name="toolTip" > + <string>Value 1</string> + </property> + <property name="insertPolicy" > + <enum>QComboBox::NoInsert</enum> + </property> + <property name="sizeAdjustPolicy" > + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxVal2" > + <property name="title" > + <string>Value 2</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KComboBox" name="varVal2" > + <property name="toolTip" > + <string>Value 2</string> + </property> + <property name="insertPolicy" > + <enum>QComboBox::NoInsert</enum> + </property> + <property name="sizeAdjustPolicy" > + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxVal3" > + <property name="title" > + <string>Value 3</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KComboBox" name="varVal3" > + <property name="toolTip" > + <string>Value 3</string> + </property> + <property name="insertPolicy" > + <enum>QComboBox::NoInsert</enum> + </property> + <property name="sizeAdjustPolicy" > + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxLevel" > + <property name="title" > + <string>Level</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KIntNumInput" name="varLevel" > + <property name="toolTip" > + <string>Minimum level necessary</string> + </property> + <property name="minimum" > + <number>0</number> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <spacer> + <property name="orientation" > + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" > + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <customwidgets> + <customwidget> + <class>KComboBox</class> + <extends>QComboBox</extends> + <header>kcombobox.h</header> + </customwidget> + <customwidget> + <class>KIntNumInput</class> + <extends>QWidget</extends> + <header>knuminput.h</header> + </customwidget> + <customwidget> + <class>KPushButton</class> + <extends>QPushButton</extends> + <header>kpushbutton.h</header> + </customwidget> + </customwidgets> + <resources/> + <connections/> +</ui> diff --git a/pokemodr/gui/speciesitem.ui b/pokemodr/gui/speciesitem.ui new file mode 100644 index 00000000..51a9f46f --- /dev/null +++ b/pokemodr/gui/speciesitem.ui @@ -0,0 +1,86 @@ +<ui version="4.0" > + <class>formSpeciesItem</class> + <widget class="QWidget" name="formSpeciesItem" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>226</width> + <height>163</height> + </rect> + </property> + <property name="windowTitle" > + <string/> + </property> + <layout class="QVBoxLayout" > + <item> + <widget class="QGroupBox" name="boxItem" > + <property name="title" > + <string>Item</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KComboBox" name="varItem" > + <property name="toolTip" > + <string>Item that can be held</string> + </property> + <property name="insertPolicy" > + <enum>QComboBox::NoInsert</enum> + </property> + <property name="sizeAdjustPolicy" > + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxWeight" > + <property name="title" > + <string>Weight</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KIntNumInput" name="varWeight" > + <property name="toolTip" > + <string>Weighting</string> + </property> + <property name="minimum" > + <number>1</number> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <spacer> + <property name="orientation" > + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" > + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <customwidgets> + <customwidget> + <class>KComboBox</class> + <extends>QComboBox</extends> + <header>kcombobox.h</header> + </customwidget> + <customwidget> + <class>KIntNumInput</class> + <extends>QWidget</extends> + <header>knuminput.h</header> + </customwidget> + </customwidgets> + <resources/> + <connections/> +</ui> diff --git a/pokemodr/gui/speciesmove.ui b/pokemodr/gui/speciesmove.ui new file mode 100644 index 00000000..e1661924 --- /dev/null +++ b/pokemodr/gui/speciesmove.ui @@ -0,0 +1,139 @@ +<ui version="4.0" > + <class>forSpeciesMove</class> + <widget class="QWidget" name="forSpeciesMove" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>226</width> + <height>317</height> + </rect> + </property> + <property name="windowTitle" > + <string>Form</string> + </property> + <layout class="QVBoxLayout" > + <item> + <widget class="QGroupBox" name="boxButtons" > + <property name="title" > + <string/> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KPushButton" name="buttonApply" > + <property name="text" > + <string>&Apply</string> + </property> + <property name="shortcut" > + <string>Ctrl+Return</string> + </property> + </widget> + </item> + <item> + <widget class="KPushButton" name="buttonDiscard" > + <property name="text" > + <string>&Discard</string> + </property> + <property name="shortcut" > + <string>Esc</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxMove" > + <property name="title" > + <string>Move</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KComboBox" name="varMove" > + <property name="toolTip" > + <string>Move that is learned</string> + </property> + <property name="insertPolicy" > + <enum>QComboBox::NoInsert</enum> + </property> + <property name="sizeAdjustPolicy" > + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxLevel" > + <property name="title" > + <string>Level</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KIntNumInput" name="varLevel" > + <property name="toolTip" > + <string>Level learned when the player levels up</string> + </property> + <property name="minimum" > + <number>0</number> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxWildLevel" > + <property name="title" > + <string>Wild Level</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KIntNumInput" name="varWildLevel" > + <property name="toolTip" > + <string>Level learned in the wild (used to give wilds better moves)</string> + </property> + <property name="minimum" > + <number>0</number> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <spacer> + <property name="orientation" > + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" > + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <customwidgets> + <customwidget> + <class>KComboBox</class> + <extends>QComboBox</extends> + <header>kcombobox.h</header> + </customwidget> + <customwidget> + <class>KIntNumInput</class> + <extends>QWidget</extends> + <header>knuminput.h</header> + </customwidget> + <customwidget> + <class>KPushButton</class> + <extends>QPushButton</extends> + <header>kpushbutton.h</header> + </customwidget> + </customwidgets> + <resources/> + <connections/> +</ui> diff --git a/pokemodr/gui/tile.ui b/pokemodr/gui/tile.ui index 641c5f45..dbfc1f73 100644 --- a/pokemodr/gui/tile.ui +++ b/pokemodr/gui/tile.ui @@ -1,16 +1,45 @@ <ui version="4.0" > - <class>panelTile</class> - <widget class="QWidget" name="panelTile" > + <class>formTile</class> + <widget class="QWidget" name="formTile" > <property name="geometry" > <rect> <x>0</x> <y>0</y> <width>226</width> - <height>874</height> + <height>949</height> </rect> </property> <layout class="QVBoxLayout" > <item> + <widget class="QGroupBox" name="boxButtons" > + <property name="title" > + <string/> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KPushButton" name="buttonApply" > + <property name="text" > + <string>&Apply</string> + </property> + <property name="shortcut" > + <string>Ctrl+Return</string> + </property> + </widget> + </item> + <item> + <widget class="KPushButton" name="buttonDiscard" > + <property name="text" > + <string>&Discard</string> + </property> + <property name="shortcut" > + <string>Esc</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> <widget class="QGroupBox" name="boxName" > <property name="title" > <string>Name</string> @@ -18,6 +47,9 @@ <layout class="QHBoxLayout" > <item> <widget class="KLineEdit" name="varName" > + <property name="toolTip" > + <string>Name of the tile</string> + </property> <property name="text" > <string/> </property> @@ -43,6 +75,9 @@ <height>64</height> </size> </property> + <property name="toolTip" > + <string>Image of the tile</string> + </property> </widget> </item> </layout> @@ -62,6 +97,9 @@ <height>75</height> </size> </property> + <property name="toolTip" > + <string>Directions into the tile</string> + </property> <property name="dragEnabled" > <bool>true</bool> </property> @@ -81,6 +119,9 @@ <layout class="QVBoxLayout" > <item> <widget class="KLineEdit" name="varWildChance" > + <property name="toolTip" > + <string>Chacne of having a wild encounter on the tile</string> + </property> <property name="readOnly" > <bool>true</bool> </property> @@ -122,7 +163,17 @@ </property> <layout class="QHBoxLayout" > <item> - <widget class="KComboBox" name="varHMType" /> + <widget class="KComboBox" name="varHMType" > + <property name="toolTip" > + <string>HM required to access the tile</string> + </property> + <property name="insertPolicy" > + <enum>QComboBox::NoInsert</enum> + </property> + <property name="sizeAdjustPolicy" > + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> </item> </layout> </widget> @@ -134,7 +185,17 @@ </property> <layout class="QHBoxLayout" > <item> - <widget class="KComboBox" name="varHMUnder" /> + <widget class="KComboBox" name="varHMUnder" > + <property name="toolTip" > + <string>Tile that replaces when HM is used</string> + </property> + <property name="insertPolicy" > + <enum>QComboBox::NoInsert</enum> + </property> + <property name="sizeAdjustPolicy" > + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> </item> </layout> </widget> @@ -155,7 +216,17 @@ </property> <layout class="QHBoxLayout" > <item> - <widget class="KComboBox" name="varForce" /> + <widget class="KComboBox" name="varForce" > + <property name="toolTip" > + <string>Force the tile exerts on the player</string> + </property> + <property name="insertPolicy" > + <enum>QComboBox::NoInsert</enum> + </property> + <property name="sizeAdjustPolicy" > + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> </item> </layout> </widget> @@ -167,7 +238,17 @@ </property> <layout class="QHBoxLayout" > <item> - <widget class="KComboBox" name="varDirection" /> + <widget class="KComboBox" name="varDirection" > + <property name="toolTip" > + <string>Direction the force is exerted in</string> + </property> + <property name="insertPolicy" > + <enum>QComboBox::NoInsert</enum> + </property> + <property name="sizeAdjustPolicy" > + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> </item> </layout> </widget> @@ -206,6 +287,11 @@ <extends>QLineEdit</extends> <header>klineedit.h</header> </customwidget> + <customwidget> + <class>KPushButton</class> + <extends>QPushButton</extends> + <header>kpushbutton.h</header> + </customwidget> </customwidgets> <resources/> <connections/> diff --git a/pokemodr/gui/time.ui b/pokemodr/gui/time.ui index e1477257..9d6f0db3 100644 --- a/pokemodr/gui/time.ui +++ b/pokemodr/gui/time.ui @@ -1,16 +1,45 @@ <ui version="4.0" > - <class>panelTime</class> - <widget class="QWidget" name="panelTime" > + <class>formTime</class> + <widget class="QWidget" name="formTime" > <property name="geometry" > <rect> <x>0</x> <y>0</y> <width>226</width> - <height>241</height> + <height>316</height> </rect> </property> <layout class="QVBoxLayout" > <item> + <widget class="QGroupBox" name="boxButtons" > + <property name="title" > + <string/> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KPushButton" name="buttonApply" > + <property name="text" > + <string>&Apply</string> + </property> + <property name="shortcut" > + <string>Ctrl+Return</string> + </property> + </widget> + </item> + <item> + <widget class="KPushButton" name="buttonDiscard" > + <property name="text" > + <string>&Discard</string> + </property> + <property name="shortcut" > + <string>Esc</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> <widget class="QGroupBox" name="boxName" > <property name="title" > <string>Name</string> @@ -18,6 +47,9 @@ <layout class="QHBoxLayout" > <item> <widget class="KLineEdit" name="varName" > + <property name="toolTip" > + <string>Name of the time period</string> + </property> <property name="showClearButton" stdset="0" > <bool>true</bool> </property> @@ -34,6 +66,9 @@ <layout class="QVBoxLayout" > <item> <widget class="KIntNumInput" name="varHour" > + <property name="toolTip" > + <string>Hour the time period starts</string> + </property> <property name="label" > <string>Hour</string> </property> @@ -47,6 +82,9 @@ </item> <item> <widget class="KIntNumInput" name="varMinute" > + <property name="toolTip" > + <string>Minute the time period starts</string> + </property> <property name="label" > <string>Minute</string> </property> @@ -87,6 +125,11 @@ <extends>QLineEdit</extends> <header>klineedit.h</header> </customwidget> + <customwidget> + <class>KPushButton</class> + <extends>QPushButton</extends> + <header>kpushbutton.h</header> + </customwidget> </customwidgets> <resources/> <connections/> diff --git a/pokemodr/gui/type.ui b/pokemodr/gui/type.ui index 18e55e31..2c1270b0 100644 --- a/pokemodr/gui/type.ui +++ b/pokemodr/gui/type.ui @@ -1,16 +1,45 @@ <ui version="4.0" > - <class>panelType</class> - <widget class="QWidget" name="panelType" > + <class>formType</class> + <widget class="QWidget" name="formType" > <property name="geometry" > <rect> <x>0</x> <y>0</y> - <width>134</width> - <height>228</height> + <width>226</width> + <height>349</height> </rect> </property> <layout class="QVBoxLayout" > <item> + <widget class="QGroupBox" name="boxButtons" > + <property name="title" > + <string/> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KPushButton" name="buttonApply" > + <property name="text" > + <string>&Apply</string> + </property> + <property name="shortcut" > + <string>Ctrl+Return</string> + </property> + </widget> + </item> + <item> + <widget class="KPushButton" name="buttonDiscard" > + <property name="text" > + <string>&Discard</string> + </property> + <property name="shortcut" > + <string>Esc</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> <widget class="QGroupBox" name="boxName" > <property name="title" > <string>Name</string> @@ -18,6 +47,9 @@ <layout class="QHBoxLayout" > <item> <widget class="KLineEdit" name="varName" > + <property name="toolTip" > + <string>The name of the type</string> + </property> <property name="showClearButton" stdset="0" > <bool>true</bool> </property> @@ -33,14 +65,20 @@ </property> <layout class="QVBoxLayout" > <item> - <widget class="KLineEdit" name="klineedit" > + <widget class="KLineEdit" name="varSTAB" > + <property name="toolTip" > + <string>Multiplier for STAB (Same Type Attack Bonus)</string> + </property> <property name="readOnly" > <bool>true</bool> </property> </widget> </item> <item> - <widget class="KIntNumInput" name="kintnuminput_2" > + <widget class="KIntNumInput" name="varSTABNum" > + <property name="toolTip" > + <string/> + </property> <property name="label" > <string>Numerator</string> </property> @@ -50,7 +88,10 @@ </widget> </item> <item> - <widget class="KIntNumInput" name="kintnuminput" > + <widget class="KIntNumInput" name="varSTABDenom" > + <property name="toolTip" > + <string/> + </property> <property name="label" > <string>Denominator</string> </property> @@ -88,6 +129,11 @@ <extends>QLineEdit</extends> <header>klineedit.h</header> </customwidget> + <customwidget> + <class>KPushButton</class> + <extends>QPushButton</extends> + <header>kpushbutton.h</header> + </customwidget> </customwidgets> <resources/> <connections/> diff --git a/pokemodr/gui/typechart.ui b/pokemodr/gui/typechart.ui index e02734cc..912c3ad2 100644 --- a/pokemodr/gui/typechart.ui +++ b/pokemodr/gui/typechart.ui @@ -1,67 +1,87 @@ <ui version="4.0" > - <class>panelTypeChart</class> - <widget class="QWidget" name="panelTypeChart" > + <class>formTypeEffectiveness</class> + <widget class="QDialog" name="formTypeEffectiveness" > <property name="geometry" > <rect> <x>0</x> <y>0</y> - <width>109</width> - <height>207</height> + <width>226</width> + <height>226</height> </rect> </property> + <property name="windowTitle" > + <string>Type Effectiveness</string> + </property> <layout class="QVBoxLayout" > <item> - <widget class="QGroupBox" name="boxAttacker" > + <widget class="QGroupBox" name="boxEffectiveness" > <property name="title" > - <string>Attacker</string> + <string>Effectiveness</string> </property> - <layout class="QHBoxLayout" > + <layout class="QVBoxLayout" > <item> - <widget class="KComboBox" name="varAttacker" /> + <widget class="KLineEdit" name="varEffectiveness" > + <property name="toolTip" > + <string>Multiplier for attacks between the two types</string> + </property> + <property name="text" > + <string/> + </property> + <property name="readOnly" > + <bool>true</bool> + </property> + </widget> </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="boxDefender" > - <property name="title" > - <string>Defender</string> - </property> - <layout class="QHBoxLayout" > <item> - <widget class="KComboBox" name="varDefender" /> + <widget class="KIntNumInput" name="varEffectivenessNum" > + <property name="label" > + <string>Numerator</string> + </property> + <property name="minimum" > + <number>0</number> + </property> + </widget> + </item> + <item> + <widget class="KIntNumInput" name="varEffectivenessDenom" > + <property name="label" > + <string>Denominator</string> + </property> + <property name="minimum" > + <number>1</number> + </property> + </widget> </item> </layout> </widget> </item> <item> - <widget class="QGroupBox" name="boxEffectiveness" > - <property name="title" > - <string>Effectiveness</string> - </property> - <layout class="QHBoxLayout" /> - </widget> - </item> - <item> - <spacer> - <property name="orientation" > - <enum>Qt::Vertical</enum> + <widget class="KDialogButtonBox" name="buttons" > + <property name="standardButtons" > + <set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set> </property> - <property name="sizeHint" > - <size> - <width>20</width> - <height>40</height> - </size> + <property name="centerButtons" > + <bool>true</bool> </property> - </spacer> + </widget> </item> </layout> </widget> <customwidgets> <customwidget> - <class>KComboBox</class> - <extends>QComboBox</extends> - <header>kcombobox.h</header> + <class>KDialogButtonBox</class> + <extends>QDialogButtonBox</extends> + <header>kdialogbuttonbox.h</header> + </customwidget> + <customwidget> + <class>KIntNumInput</class> + <extends>QWidget</extends> + <header>knuminput.h</header> + </customwidget> + <customwidget> + <class>KLineEdit</class> + <extends>QLineEdit</extends> + <header>klineedit.h</header> </customwidget> </customwidgets> <resources/> diff --git a/pokemodr/pokemodr.pro b/pokemodr/pokemodr.pro index e8fbd2fd..d1ffe65e 100644 --- a/pokemodr/pokemodr.pro +++ b/pokemodr/pokemodr.pro @@ -3,7 +3,9 @@ DESTDIR = ../../bin TEMPLATE = app LIBS += -L../../lib -lgeneral -lpokemod -laudio -CONFIG += qt gui warn_on dll -SOURCES += *.cpp -HEADERS += *.h +CONFIG += qt gui warn_on dll + +FORMS += gui/*.ui +SOURCES += *.cpp +HEADERS += *.h |