diff options
author | Ben Boeckel <MathStuf@gmail.com> | 2008-02-23 09:06:05 +0000 |
---|---|---|
committer | Ben Boeckel <MathStuf@gmail.com> | 2008-02-23 09:06:05 +0000 |
commit | aa1b8ec37833c1b538666f3fab1d426dd18f2907 (patch) | |
tree | 608beccfc4b262301db710a1d6d4f4cb3c92d078 | |
parent | 82bf5001730ebd1b2c8448138e2ebaff2332dea2 (diff) | |
download | sigen-aa1b8ec37833c1b538666f3fab1d426dd18f2907.tar.gz sigen-aa1b8ec37833c1b538666f3fab1d426dd18f2907.tar.xz sigen-aa1b8ec37833c1b538666f3fab1d426dd18f2907.zip |
[FIX] Warp states can now leave states untouched
[FIX] Map/Warp dependencies in UI forms
[ADD] MapWarpUI.{h, cpp}
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@75 6ecfd1a5-f3ed-3746-8530-beee90d26b22
-rw-r--r-- | Changelog | 9 | ||||
-rw-r--r-- | pokemod/MapWarp.cpp | 24 | ||||
-rw-r--r-- | pokemod/MapWarp.h | 18 | ||||
-rw-r--r-- | pokemod/Object.h | 1 | ||||
-rw-r--r-- | pokemod/Pokemod.cpp | 11 | ||||
-rw-r--r-- | pokemodr/CoinListObjectUI.cpp | 2 | ||||
-rw-r--r-- | pokemodr/PokeModrUI.cpp | 2 | ||||
-rw-r--r-- | pokemodr/PokemodUI.cpp | 2 | ||||
-rw-r--r-- | pokemodr/SpeciesEvolutionUI.cpp | 2 | ||||
-rw-r--r-- | pokemodr/TODO | 2 | ||||
-rw-r--r-- | pokemodr/gui/mapwarp.ui | 6 | ||||
-rw-r--r-- | pokemodr/pokemodr.pro | 6 |
12 files changed, 53 insertions, 32 deletions
@@ -1,4 +1,13 @@ ----------------- +Rev: 75 +Date: 23 February 2008 +User: MathStuf +----------------- +[FIX] Warp states can now leave states untouched +[FIX] Map/Warp dependencies in UI forms +[ADD] MapWarpUI.{h, cpp} + +----------------- Rev: 74 Date: 23 February 2008 User: MathStuf diff --git a/pokemod/MapWarp.cpp b/pokemod/MapWarp.cpp index d5e00542..1cc17994 100644 --- a/pokemod/MapWarp.cpp +++ b/pokemod/MapWarp.cpp @@ -33,9 +33,9 @@ MapWarp::MapWarp(const Pokemod* par, const int _id) : coordinate(0, 0), directionOut(-1), warpType(-1), - isBiking(false), - isFlash(false), - isFoggy(false), + isBiking(Flag::Ignore), + isFlash(Flag::Ignore), + isFoggy(Flag::Ignore), toMap(-1), toWarp(-1), workingFlag(0, 0), @@ -196,18 +196,24 @@ void MapWarp::setWarpType(const int w) throw(BoundsException) warpType = w; } -void MapWarp::setIsBiking(const bool i) +void MapWarp::setIsBiking(const int i) throw(BoundsException) { + if (Flag::End <= i) + throw(BoundsException(className, "isBiking")); isBiking = i; } -void MapWarp::setIsFlash(const bool i) +void MapWarp::setIsFlash(const int i) throw(BoundsException) { + if (Flag::End <= i) + throw(BoundsException(className, "isFlash")); isFlash = i; } -void MapWarp::setIsFoggy(const bool i) +void MapWarp::setIsFoggy(const int i) throw(BoundsException) { + if (Flag::End <= i) + throw(BoundsException(className, "isFoggy")); isFoggy = i; } @@ -276,17 +282,17 @@ int MapWarp::getWarpType() const return warpType; } -bool MapWarp::getIsBiking() const +int MapWarp::getIsBiking() const { return isBiking; } -bool MapWarp::getIsFlash() const +int MapWarp::getIsFlash() const { return isFlash; } -bool MapWarp::getIsFoggy() const +int MapWarp::getIsFoggy() const { return isFoggy; } diff --git a/pokemod/MapWarp.h b/pokemod/MapWarp.h index fae0f138..a852b3d2 100644 --- a/pokemod/MapWarp.h +++ b/pokemod/MapWarp.h @@ -61,9 +61,9 @@ class MapWarp : public Object void setFrom(const int d, const bool f) throw(BoundsException); void setDirectionOut(const int d) throw(BoundsException); void setWarpType(const int w) throw(BoundsException); - void setIsBiking(const bool i); - void setIsFlash(const bool i); - void setIsFoggy(const bool i); + void setIsBiking(const int i) throw(BoundsException); + void setIsFlash(const int i) throw(BoundsException); + void setIsFoggy(const int i) throw(BoundsException); void setToMap(const int t) throw(BoundsException); void setToWarp(const int t) throw(BoundsException); void setWorkingFlag(const int f, const int s); @@ -76,9 +76,9 @@ class MapWarp : public Object bool getFrom(const int d) const throw(BoundsException); int getDirectionOut() const; int getWarpType() const; - bool getIsBiking() const; - bool getIsFlash() const; - bool getIsFoggy() const; + int getIsBiking() const; + int getIsFlash() const; + int getIsFoggy() const; int getToMap() const; int getToWarp() const; Flag getWorkingFlag() const; @@ -93,9 +93,9 @@ class MapWarp : public Object bool from[D_End]; int directionOut; int warpType; - bool isBiking; - bool isFlash; - bool isFoggy; + int isBiking; + int isFlash; + int isFoggy; int toMap; int toWarp; Flag workingFlag; diff --git a/pokemod/Object.h b/pokemod/Object.h index 580a8081..6105d121 100644 --- a/pokemod/Object.h +++ b/pokemod/Object.h @@ -24,6 +24,7 @@ #define __POKEMOD_OBJECT__ #include <Exception.h> +#include <Ini.h> class Pokemod; diff --git a/pokemod/Pokemod.cpp b/pokemod/Pokemod.cpp index 9272cb5a..71d77375 100644 --- a/pokemod/Pokemod.cpp +++ b/pokemod/Pokemod.cpp @@ -754,7 +754,8 @@ int Pokemod::getNewTypeId() const void Pokemod::load(const QString& fname, const int) throw(Exception) { Ini ini(fname); - QStringList fpath = fname.split('\\', QString::SkipEmptyParts).join("/").split('\\', QString::SkipEmptyParts); + QStringList fpath = fname.split('\\', QString::SkipEmptyParts).join("/").split("/", QString::SkipEmptyParts); + fpath.removeLast(); fpath.removeLast(); path = fpath.join("/"); ini.getValue("title", title); @@ -764,9 +765,9 @@ void Pokemod::load(const QString& fname, const int) throw(Exception) ini.getValue("startWarp", startWarp); ini.getValue("superPCUname", superPCUname); ini.getValue("superPCPasswd", superPCPasswd); - QDir fdir(path); - if (QFile::exists(QString("%1/rules.pini").arg(path))) - rules.load(QString("%1/rules.pini").arg(path)); + QDir fdir(getPath()); + if (QFile::exists(QString("%1/rules.pini").arg(getPath()))) + rules.load(QString("%1/rules.pini").arg(getPath())); abilities.clear(); if (fdir.cd("ability")) { @@ -947,7 +948,7 @@ void Pokemod::save() const throw(Exception) QString Pokemod::getPath() const { - return path; + return QString("%1/%2").arg(path).arg(title); } int Pokemod::maxCompatability(const Pokemod& p) const diff --git a/pokemodr/CoinListObjectUI.cpp b/pokemodr/CoinListObjectUI.cpp index da333fe0..c7a7338e 100644 --- a/pokemodr/CoinListObjectUI.cpp +++ b/pokemodr/CoinListObjectUI.cpp @@ -55,6 +55,7 @@ void CoinListObjectUI::setGui() { bool resetObjects = (coinListObject_mod->getType() != lastType); varType->setCurrentIndex(coinListObject_mod->getType()); + lastType = coinListObject_mod->getType(); if (resetObjects) { varObject->clear(); @@ -76,7 +77,6 @@ void CoinListObjectUI::setGui() varObject->setItemData(i, s->getId()); } } - lastType = coinListObject_mod->getType(); } varObject->setCurrentIndex(varObject->findData(coinListObject_mod->getObject())); varAmount->setValue(coinListObject_mod->getAmount()); diff --git a/pokemodr/PokeModrUI.cpp b/pokemodr/PokeModrUI.cpp index e1575a88..19e86090 100644 --- a/pokemodr/PokeModrUI.cpp +++ b/pokemodr/PokeModrUI.cpp @@ -41,6 +41,7 @@ #include "ItemUI.h" #include "ItemTypeUI.h" #include "MapUI.h" +#include "MapWarpUI.h" #include "MoveUI.h" #include "NatureUI.h" #include "PokemodUI.h" @@ -84,6 +85,7 @@ PokeModrUI::PokeModrUI(KConfigGroup cfg, KConfigGroup history, QWidget* parent) // formPanel->setWidget(new ItemUI(pokemod->newItem(), formPanel)); // formPanel->setWidget(new ItemTypeUI(pokemod->newItemType(), formPanel)); formPanel->setWidget(new MapUI(pokemod->newMap(), formPanel)); +// formPanel->setWidget(new MapWarpUI(pokemod->newMap()->newWarp(), formPanel)); // formPanel->setWidget(new MoveUI(pokemod->newMove(), formPanel)); // formPanel->setWidget(new NatureUI(pokemod->newNature(), formPanel)); // formPanel->setWidget(new SpeciesUI(pokemod->newSpecies(), formPanel)); diff --git a/pokemodr/PokemodUI.cpp b/pokemodr/PokemodUI.cpp index 0366d663..bb06b359 100644 --- a/pokemodr/PokemodUI.cpp +++ b/pokemodr/PokemodUI.cpp @@ -58,8 +58,10 @@ void PokemodUI::setGui() varVersion->setText(pokemod_mod->getVersion()); varDescription->setText(pokemod_mod->getDescription()); varMap->setCurrentIndex(varMap->findData(pokemod_mod->getStartMap())); + lastMap = pokemod_mod->getStartMap(); if (resetWarps) { + varWarp->clear(); try { const Map* m = pokemod->getMapByID(pokemod_mod->getStartMap()); diff --git a/pokemodr/SpeciesEvolutionUI.cpp b/pokemodr/SpeciesEvolutionUI.cpp index e82c98ff..377dd59e 100644 --- a/pokemodr/SpeciesEvolutionUI.cpp +++ b/pokemodr/SpeciesEvolutionUI.cpp @@ -63,6 +63,7 @@ void SpeciesEvolutionUI::setGui() const bool styleChanged = (speciesEvolution_mod->getStyle() != lastStyle); varSpecies->setCurrentIndex(varSpecies->findData(speciesEvolution_mod->getSpecies())); varStyle->setCurrentIndex(speciesEvolution_mod->getStyle()); + lastStyle = speciesEvolution_mod->getStyle(); if (styleChanged) { varVal1->clear(); @@ -117,7 +118,6 @@ void SpeciesEvolutionUI::setGui() varVal3->setEnabled(true); break; } - lastStyle = speciesEvolution_mod->getStyle(); } if ((speciesEvolution_mod->getStyle() == SpeciesEvolution::S_Item) ||(speciesEvolution_mod->getStyle() == SpeciesEvolution::S_TradeItem)) varVal1->setCurrentIndex(varVal1->findData(speciesEvolution_mod->getVal1())); diff --git a/pokemodr/TODO b/pokemodr/TODO index 2cfecd33..491442dc 100644 --- a/pokemodr/TODO +++ b/pokemodr/TODO @@ -1,11 +1,9 @@ AbilityEffect Dialog ItemEffect -Map (tilemap Model-View-Delegate) MapEffect MapTrainer MapTrainerTeamMember -MapWarp MapWildList MapWildListEncounter MoveEffect diff --git a/pokemodr/gui/mapwarp.ui b/pokemodr/gui/mapwarp.ui index 7af45ba9..6492579f 100644 --- a/pokemodr/gui/mapwarp.ui +++ b/pokemodr/gui/mapwarp.ui @@ -5,8 +5,8 @@ <rect> <x>0</x> <y>0</y> - <width>290</width> - <height>1010</height> + <width>300</width> + <height>1030</height> </rect> </property> <property name="windowTitle" > @@ -309,7 +309,7 @@ </property> <property name="sizeHint" > <size> - <width>20</width> + <width>282</width> <height>16</height> </size> </property> diff --git a/pokemodr/pokemodr.pro b/pokemodr/pokemodr.pro index 77545915..6e1c1b82 100644 --- a/pokemodr/pokemodr.pro +++ b/pokemodr/pokemodr.pro @@ -79,7 +79,8 @@ SOURCES += AbilityUI.cpp \ TilemapModel.cpp \ TileUI.cpp \ TimeUI.cpp \ - TypeUI.cpp + TypeUI.cpp \ + MapWarpUI.cpp HEADERS += AbilityUI.h \ AuthorUI.h \ @@ -110,7 +111,8 @@ HEADERS += AbilityUI.h \ TilemapModel.h \ TileUI.h \ TimeUI.h \ - TypeUI.h + TypeUI.h \ + MapWarpUI.h FORMS += gui/ability.ui \ gui/abilityeffect.ui \ |