diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2008-05-02 08:42:08 +0000 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2008-05-02 08:42:08 +0000 |
| commit | 822b5fcaa34b78b9668a58680f9e0d89aa3fd7bd (patch) | |
| tree | 40dc605213eff20f62b16e5f54e5e5e03d744d63 /pokemod/Dialog.cpp | |
| parent | 696414f1dc8bc419427efb6c1abe1bbae0a68a56 (diff) | |
| download | sigen-822b5fcaa34b78b9668a58680f9e0d89aa3fd7bd.tar.gz sigen-822b5fcaa34b78b9668a58680f9e0d89aa3fd7bd.tar.xz sigen-822b5fcaa34b78b9668a58680f9e0d89aa3fd7bd.zip | |
[FIX] Exceptions no longer used in pokemod
[DEL] Exception and BugCatcher are no longer needed
[ADD] Object.cpp added
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@119 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemod/Dialog.cpp')
| -rw-r--r-- | pokemod/Dialog.cpp | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/pokemod/Dialog.cpp b/pokemod/Dialog.cpp index 8ec1ee1a..5c0ea887 100644 --- a/pokemod/Dialog.cpp +++ b/pokemod/Dialog.cpp @@ -57,7 +57,7 @@ Dialog::Dialog(const QDomElement& xml, const Object* parent, const int id) : load(xml, id); } -bool Dialog::validate() const +void Dialog::validate(QTextStream& stream) { // TODO: validate // bool valid = true; @@ -65,12 +65,12 @@ bool Dialog::validate() const // if (m_dialog == "") // { // static_cast<const Pokemod*>(pokemod())->validationMsg("Dialog is empty"); -// valid = false; +// setValid(false); // } // if (m_dialog.count('%') & 1) // { // static_cast<const Pokemod*>(pokemod())->validationMsg("Command delimiter mismatch"); -// valid = false; +// setValid(false); // } // else // { @@ -87,14 +87,14 @@ bool Dialog::validate() const // if (numArgs != CommandNumArgs[curCmd]) // { // static_cast<const Pokemod*>(pokemod())->validationMsg(QString("Invalid number of arguments for \"%1\". %2 given when %3 needed").arg(CommandStr[curCmd]).arg(numArgs).arg(CommandNumArgs[curCmd])); -// valid = false; +// setValid(false); // } // break; // case Menu: // if (!(numArgs & 1)) // { // static_cast<const Pokemod*>(pokemod())->validationMsg("Invalid number of arguments for Menu"); -// valid = false; +// setValid(false); // } // break; // case End: @@ -106,7 +106,7 @@ bool Dialog::validate() const // if (curCmdStr != "") // { // static_cast<const Pokemod*>(pokemod())->validationMsg(QString("Invalid command \"%1\"").arg(curCmdStr)); -// valid = false; +// setValid(false); // } // curCmd = End; // } @@ -136,7 +136,7 @@ bool Dialog::validate() const // if (!ok) // { // static_cast<const Pokemod*>(pokemod())->validationMsg(QString("Bad flag in \"%1\"").arg(CommandStr[curCmd])); -// valid = false; +// setValid(false); // } // } // break; @@ -151,7 +151,7 @@ bool Dialog::validate() const // if (!ok) // { // static_cast<const Pokemod*>(pokemod())->validationMsg("Bad flag in \"Test Flag\""); -// valid = false; +// setValid(false); // } // break; // case 3: @@ -282,7 +282,7 @@ bool Dialog::validate() const // if (static_cast<const Pokemod*>(pokemod())->rules()->maxLevel() < temp) // { // static_cast<const Pokemod*>(pokemod())->validationMsg("Higher level than allowed in \"Give Pokémon\""); -// valid = false; +// setValid(false); // } // } // else @@ -334,7 +334,7 @@ bool Dialog::validate() const // if (static_cast<const Pokemod*>(pokemod())->rules()->maxMoney() < temp) // { // static_cast<const Pokemod*>(pokemod())->validationMsg("More money given than can be held in \"Give Money\"", Pokemod::V_Warn); -// valid = false; +// setValid(false); // } // } // else @@ -354,7 +354,7 @@ bool Dialog::validate() const // if (static_cast<const Pokemod*>(pokemod())->rules()->maxMoney() < temp) // { // static_cast<const Pokemod*>(pokemod())->validationMsg("More money taken than can be held in \"Take Money\""); -// valid = false; +// setValid(false); // } // } // else @@ -445,7 +445,7 @@ bool Dialog::validate() const // if (((curCmd == CheckRoster) ? static_cast<const Pokemod*>(pokemod())->rules()->maxParty() : ((curCmd == CheckLevels) ? static_cast<const Pokemod*>(pokemod())->rules()->maxLevel() : static_cast<const Pokemod*>(pokemod())->rules()->maxMoney())) < temp) // { // static_cast<const Pokemod*>(pokemod())->validationMsg(QString("More %1 than can be carried in \"%2\"").arg((curCmd == CheckRoster) ? "party members" : ((curCmd == CheckLevels) ? "level" : "money")).arg(CommandStr[curCmd])); -// valid = false; +// setValid(false); // } // } // else @@ -617,7 +617,7 @@ bool Dialog::validate() const // if (!temp) // { // static_cast<const Pokemod*>(pokemod())->validationMsg("Item in argument #1 in \"Safari\" isn\'t a PokéBall"); -// valid = false; +// setValid(false); // } // } // else @@ -656,7 +656,7 @@ bool Dialog::validate() const // if (invError) // { // static_cast<const Pokemod*>(pokemod())->validationMsg(QString("Invalid argument #%1 in \"%2\"").arg(invError).arg(CommandStr[curCmd])); -// valid = false; +// setValid(false); // } // } // break; @@ -689,10 +689,13 @@ QString Dialog::dialog() const return m_dialog; } -void Dialog::insertCommand(const int position, const QString& command) throw(BoundsException) +void Dialog::insertCommand(const int position, const QString& command) { if (m_dialog.length() < position) - error<BoundsException>("command"); + { + boundsError("command"); + return; + } m_dialog.insert(position, command); } |
