summaryrefslogtreecommitdiffstats
path: root/pokemod/Dialog.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2008-05-21 03:10:12 +0000
committerBen Boeckel <MathStuf@gmail.com>2008-05-21 03:10:12 +0000
commit820bc54980b906042c0b5231147caea2059af7c9 (patch)
treeb7f6da88e1e879ab65f7172b04a17f63f61538bf /pokemod/Dialog.cpp
parentd910d8ec38e0c33eeb32b7ceaaea9b40632cbd17 (diff)
[FIX] Added a command widget
[FIX] More unneeded code in widget ctors removed [FIX] Changed command delimiter to @ from % [FIX] Request to save factored out of ObjectUI git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@158 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemod/Dialog.cpp')
-rw-r--r--pokemod/Dialog.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/pokemod/Dialog.cpp b/pokemod/Dialog.cpp
index a755fbf2..edb08924 100644
--- a/pokemod/Dialog.cpp
+++ b/pokemod/Dialog.cpp
@@ -62,7 +62,7 @@ void Dialog::validate()
{
if (m_dialog.isEmpty())
emit(error("Dialog is empty"));
- if (m_dialog.count('%') & 1)
+ if (m_dialog.count('@') & 1)
emit(error("Command delimiter mismatch"));
else
{
@@ -72,12 +72,12 @@ void Dialog::validate()
{
switch (m_dialog.at(i).toAscii())
{
- case '%':
+ case '@':
switch (curCmd)
{
case FlipFlag ... Exit:
if (numArgs != CommandNumArgs[curCmd])
- emit(error(QString("Invalid number of arguments for \"%1\". %2 given when %3 needed")));
+ emit(error(QString("Invalid number of arguments for \"%1\". %2 given when %3 needed").arg(CommandStr[curCmd], numArgs, CommandNumArgs[curCmd])));
break;
case Menu:
if (!(numArgs & 1))
@@ -85,7 +85,7 @@ void Dialog::validate()
break;
case End:
QString curCmdStr;
- for (; (m_dialog.at(i) != '%') && (m_dialog.at(i) != '#'); ++i)
+ for (; (m_dialog.at(i) != '@') && (m_dialog.at(i) != '#'); ++i)
curCmdStr += m_dialog.at(i);
if (((curCmd = CommandAbbrStr.indexOf(curCmdStr))) == INT_MAX)
{
@@ -101,7 +101,7 @@ void Dialog::validate()
if (curCmd != End)
{
QString arg;
- for (; (m_dialog.at(i) != '%') && (m_dialog.at(i) != '#'); ++i)
+ for (; (m_dialog.at(i) != '@') && (m_dialog.at(i) != '#'); ++i)
arg += m_dialog.at(i);
bool ok;
int temp = arg.toInt(&ok);
@@ -411,7 +411,7 @@ void Dialog::validate()
if (ok)
{
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)
- emit(error(QString("More %1 than can be carried in \"%2\"").arg((curCmd == CheckRoster) ? "party members" : ((curCmd == CheckLevels) ? "level" : "money")).arg(CommandStr[curCmd])));
+ emit(error(QString("More %1 than can be carried in \"%2\"").arg((curCmd == CheckRoster) ? "party members" : ((curCmd == CheckLevels) ? "level" : "money"), CommandStr[curCmd])));
}
else
invError = 3;