summaryrefslogtreecommitdiffstats
path: root/pokemod/Dialog.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2007-10-26 20:01:48 +0000
committerBen Boeckel <MathStuf@gmail.com>2007-10-26 20:01:48 +0000
commit1f08afc80c73087bf9bde639754670548b89fc9f (patch)
tree70a80d7998d9279a75509fed14238b3ba493e9eb /pokemod/Dialog.cpp
parent5b55d13ead7e352ee1feaae72009e8abf5bd071a (diff)
[ADD] DISCLAIMER
[FIX] PokemonEvolution styles [ADD] Relative enumeration [DEL] pokemod/Status.{h, cpp} [DEL] pokemod/StatusEffect.{h, cpp} [FIX] Status effects will be added as needed instead of customized [FIX] Completed ItemEffects [FIX] Factored out Natures to be global [DEL] pokemod/PokemonNature.{h, cpp} [DEL] ai/Net.{h, cpp} [DEL] ai/Layer/{h, cpp} [ADD] battle/Arena.{h, cpp} [ADD] battle/Team.{h, cpp} [ADD] battle/Human.{h, cpp} [ADD] battle/Bot.{h, cpp} [ADD] battle/GhostBot.{h, cpp} [ADD] battle/Pokemon.{h, cpp} [ADD] battle/Ghost.{h, cpp} [FIX] Fixed some scope errors in pokemod [ADD] audio/audio.pro [ADD] audio/Audio.{h, cpp} [ADD] audio/AudioLibrary.{h, cpp} [ADD] audio/AudioSystem.{h, cpp} [ADD] audio/Music.{h, cpp} [ADD] audio/SoundEffect.{h, cpp} [DEL] old audio system (was in C) [FIX] Optimized some routines in pokemod [FIX] Moved global classes (Ini, Frac, Matrix, FracMatrix, Point, Flag) to general git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@25 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemod/Dialog.cpp')
-rw-r--r--pokemod/Dialog.cpp23
1 files changed, 19 insertions, 4 deletions
diff --git a/pokemod/Dialog.cpp b/pokemod/Dialog.cpp
index 4d13515f..3c146d06 100644
--- a/pokemod/Dialog.cpp
+++ b/pokemod/Dialog.cpp
@@ -22,6 +22,10 @@
#include "Dialog.h"
+const char* PokeGen::PokeMod::Dialog::CommandStr[PokeGen::PokeMod::Dialog::End] = {"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 char* PokeGen::PokeMod::Dialog::CommandAbbrStr[PokeGen::PokeMod::Dialog::End] = {"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 unsigned PokeGen::PokeMod::Dialog::CommandNumArgs[PokeGen::PokeMod::Dialog::Menu] = {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};
+
PokeGen::PokeMod::Dialog::Dialog(const Pokemod* par, const unsigned _id) :
Object(_id, par),
dialog("")
@@ -242,7 +246,7 @@ bool PokeGen::PokeMod::Dialog::Validate()
invError = 1;
break;
case 2:
- if (!okU || (pokemod->GetPokemonByID(tempU) ==UINT_MAX))
+ if (!okU || (pokemod->GetSpeciesByID(tempU) ==UINT_MAX))
invError = 2;
break;
case 3:
@@ -281,7 +285,7 @@ bool PokeGen::PokeMod::Dialog::Validate()
invError = 1;
break;
case 2:
- if (!okU || (pokemod->GetPokemonByID(tempU) == UINT_MAX))
+ if (!okU || (pokemod->GetSpeciesByID(tempU) == UINT_MAX))
invError = 2;
break;
case 3:
@@ -293,7 +297,7 @@ bool PokeGen::PokeMod::Dialog::Validate()
case ShowPokemon:
if (numArgs == 1)
{
- if (!okU || (pokemod->GetPokemonByID(tempU) == UINT_MAX))
+ if (!okU || (pokemod->GetSpeciesByID(tempU) == UINT_MAX))
invError = 1;
}
break;
@@ -443,7 +447,7 @@ bool PokeGen::PokeMod::Dialog::Validate()
break;
case 2:
case 3:
- if (!okU || (pokemod->GetPokemonByID(tempU) == UINT_MAX))
+ if (!okU || (pokemod->GetSpeciesByID(tempU) == UINT_MAX))
invError = numArgs;
case 4:
if (!okUL)
@@ -512,12 +516,23 @@ bool PokeGen::PokeMod::Dialog::Validate()
}
break;
case Music:
+ if (numArgs == 1)
+ {
+ if (!QFile(pokemod->GetPath() + "music/" + arg).exists())
+ invError = 1;
+ }
+ break;
case SoundEffect:
if (numArgs == 1)
{
if (!QFile(pokemod->GetPath() + "sound/" + arg).exists())
invError = 1;
}
+ else if (numArgs == 2)
+ {
+ if (!okU)
+ invError = 2;
+ }
break;
case Timer:
switch (numArgs)