summaryrefslogtreecommitdiffstats
path: root/pokemod/Dialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'pokemod/Dialog.cpp')
-rw-r--r--pokemod/Dialog.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/pokemod/Dialog.cpp b/pokemod/Dialog.cpp
index 5ea0e44d..829a53f7 100644
--- a/pokemod/Dialog.cpp
+++ b/pokemod/Dialog.cpp
@@ -31,29 +31,29 @@
#include "Species.h"
#include "Dialog.h"
-const QStringList PokeMod::Dialog::CommandStr = QStringList() << "Flip Flag" << "Set Flag" << "Unset Flag" << "Randomize Flag" << "Test Flag" << "Dialog" << "Yes/No" << "Item Shop" << "Give Item" << "Take Item" << "Check Item" << "Coin List" << "Teach Move" << "Delete Move" << "Give Pokemon" << "Take Pokemon" << "Show Pokemon" << "View Pokemon" << "Give Money" << "Take Money" << "Move Effect" << "Turn Effect" << "Check Direction" << "Check Roster" << "Check Levels" << "Check Species" << "Check Held Items" << "Check Money" << "Trade" << "Daycare" << "Battle" << "Badge" << "Warp" << "Name" << "Music" << "Sound Effect" << "Timer" << "Map Sign" << "Wild Scope" << "Safari" << "Heal Party" << "Refresh" << "Clear" << "Pause" << "New Line" << "Exit" << "Menu";
-const QStringList PokeMod::Dialog::CommandAbbrStr = QStringList() << "FF" << "SF" << "UF" << "RF" << "TF" << "D" << "YN" << "ItS" << "GIt" << "TIt" << "CIt" << "CL" << "TMv" << "DMv" << "GPk" << "TPk" << "SPk" << "VPk" << "G$" << "T$" << "MvEf" << "TEf" << "CD" << "CR" << "CLv" << "CS" << "CHIt" << "C$" << "T" << "Dc" << "Bat" << "Bdg" << "W" << "N" << "Ms" << "SFX" << "Tmr" << "MS" << "WS" << "S" << "HP" << "R" << "C" << "P" << "NL" << "X" << "M";
-const QList<unsigned> PokeMod::Dialog::CommandNumArgs = QList<unsigned>() << 1 << 1 << 1 << 1 << 3 << 2 << 2 << 1 << 4 << 4 << 4 << 1 << 5 << 3 << 7 << 4 << 1 << 4 << 1 << 4 << 6 << 3 << 6 << 5 << 5 << 4 << 4 << 5 << 6 << 1 << 2 << 1 << 2 << 1 << 2 << 1 << 3 << 1 << 1 << 3 << 0 << 0 << 0 << 0 << 0 << 0;
+const QStringList Dialog::CommandStr = QStringList() << "Flip Flag" << "Set Flag" << "Unset Flag" << "Randomize Flag" << "Test Flag" << "Dialog" << "Yes/No" << "Item Shop" << "Give Item" << "Take Item" << "Check Item" << "Coin List" << "Teach Move" << "Delete Move" << "Give Pokemon" << "Take Pokemon" << "Show Pokemon" << "View Pokemon" << "Give Money" << "Take Money" << "Move Effect" << "Turn Effect" << "Check Direction" << "Check Roster" << "Check Levels" << "Check Species" << "Check Held Items" << "Check Money" << "Trade" << "Daycare" << "Battle" << "Badge" << "Warp" << "Name" << "Music" << "Sound Effect" << "Timer" << "Map Sign" << "Wild Scope" << "Safari" << "Heal Party" << "Refresh" << "Clear" << "Pause" << "New Line" << "Exit" << "Menu";
+const QStringList Dialog::CommandAbbrStr = QStringList() << "FF" << "SF" << "UF" << "RF" << "TF" << "D" << "YN" << "ItS" << "GIt" << "TIt" << "CIt" << "CL" << "TMv" << "DMv" << "GPk" << "TPk" << "SPk" << "VPk" << "G$" << "T$" << "MvEf" << "TEf" << "CD" << "CR" << "CLv" << "CS" << "CHIt" << "C$" << "T" << "Dc" << "Bat" << "Bdg" << "W" << "N" << "Ms" << "SFX" << "Tmr" << "MS" << "WS" << "S" << "HP" << "R" << "C" << "P" << "NL" << "X" << "M";
+const QList<unsigned> Dialog::CommandNumArgs = QList<unsigned>() << 1 << 1 << 1 << 1 << 3 << 2 << 2 << 1 << 4 << 4 << 4 << 1 << 5 << 3 << 7 << 4 << 1 << 4 << 1 << 4 << 6 << 3 << 6 << 5 << 5 << 4 << 4 << 5 << 6 << 1 << 2 << 1 << 2 << 1 << 2 << 1 << 3 << 1 << 1 << 3 << 0 << 0 << 0 << 0 << 0 << 0;
-PokeMod::Dialog::Dialog(const Pokemod& par, const unsigned _id) :
+Dialog::Dialog(const Pokemod& par, const unsigned _id) :
Object(par, _id),
dialog("")
{
}
-PokeMod::Dialog::Dialog(const Pokemod& par, const Dialog& d, const unsigned _id) :
+Dialog::Dialog(const Pokemod& par, const Dialog& d, const unsigned _id) :
Object(par, _id)
{
*this = d;
}
-PokeMod::Dialog::Dialog(const Pokemod& par, const QString& fname, const unsigned _id) :
+Dialog::Dialog(const Pokemod& par, const QString& fname, const unsigned _id) :
Object(par, _id)
{
load(fname, _id);
}
-bool PokeMod::Dialog::validate() const
+bool Dialog::validate() const
{
bool valid = true;
pokemod.validationMsg(QString("---Dialog with id %1---").arg(id), Pokemod::V_Msg);
@@ -120,7 +120,7 @@ bool PokeMod::Dialog::validate() const
unsigned tempU = arg.toUInt(&okU);
unsigned long tempUL = arg.toULong(&okUL);
unsigned invError = 0;
- const Map* map = NULL;
+ const Map* map;
++numArgs;
switch (curCmd)
{
@@ -376,7 +376,7 @@ bool PokeMod::Dialog::validate() const
if (!okU || (pokemod.getMapIndex(tempU) == UINT_MAX))
invError = 2;
else
- map = &pokemod.getMap(pokemod.getMapIndex(tempU));
+ map = &pokemod.getMapByID(tempU);
break;
case 3:
if (map)
@@ -405,7 +405,7 @@ bool PokeMod::Dialog::validate() const
if (!okU || (pokemod.getMapIndex(tempU) == UINT_MAX))
invError = 1;
else
- map = &pokemod.getMap(pokemod.getMapIndex(tempU));
+ map = &pokemod.getMapByID(tempU);
break;
case 2:
if (map)
@@ -504,7 +504,7 @@ bool PokeMod::Dialog::validate() const
if (!okU || (pokemod.getMapIndex(tempU) == UINT_MAX))
invError = 1;
else
- map = &pokemod.getMap(pokemod.getMapIndex(tempU));
+ map = &pokemod.getMapByID(tempU);
}
else if (numArgs == 2)
{
@@ -531,7 +531,7 @@ bool PokeMod::Dialog::validate() const
if (!okU || (pokemod.getMapIndex(tempU) == UINT_MAX))
invError = 1;
else
- map = &pokemod.getMap(pokemod.getMapIndex(tempU));
+ map = &pokemod.getMapByID(tempU);
}
else if (numArgs == 2)
{
@@ -602,7 +602,7 @@ bool PokeMod::Dialog::validate() const
case 1:
if (okU && (pokemod.getItemIndex(tempU) != UINT_MAX))
{
- const Item& item = pokemod.getItem(pokemod.getItemIndex(tempU));
+ const Item& item = pokemod.getItemByID(tempU);
bool temp = false;
for (unsigned i = 0; (i < item.getEffectCount()) || !temp; ++i)
{
@@ -661,7 +661,7 @@ bool PokeMod::Dialog::validate() const
return valid;
}
-void PokeMod::Dialog::load(const QString& fname, const unsigned _id) throw(Exception)
+void Dialog::load(const QString& fname, const unsigned _id) throw(Exception)
{
Ini ini(fname);
if (_id == UINT_MAX)
@@ -671,7 +671,7 @@ void PokeMod::Dialog::load(const QString& fname, const unsigned _id) throw(Excep
ini.getValue("dialog", dialog);
}
-void PokeMod::Dialog::save() const throw(Exception)
+void Dialog::save() const throw(Exception)
{
Ini ini;
ini.addField("id", id);
@@ -679,24 +679,24 @@ void PokeMod::Dialog::save() const throw(Exception)
ini.save(QString("%1/dialog/%2.pini").arg(pokemod.getPath()).arg(id));
}
-void PokeMod::Dialog::setDialog(const QString& d)
+void Dialog::setDialog(const QString& d)
{
dialog = d;
}
-QString PokeMod::Dialog::getDialog() const
+QString Dialog::getDialog() const
{
return dialog;
}
-void PokeMod::Dialog::insertDialogCommand(const QString& cmd, const long pos) throw(BoundsException)
+void Dialog::insertDialogCommand(const QString& cmd, const long pos) throw(BoundsException)
{
if (dialog.length() < pos)
throw(BoundsException("Dialog" , "command"));
dialog.insert(pos, cmd);
}
-PokeMod::Dialog& PokeMod::Dialog::operator=(const Dialog& rhs)
+Dialog& Dialog::operator=(const Dialog& rhs)
{
if (this == &rhs)
return *this;