diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2007-06-22 17:46:50 +0000 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2007-06-22 17:46:50 +0000 |
| commit | 5c3ca621f75587173bab3d946aee81dd2d36f495 (patch) | |
| tree | 2d64b74bbe323a582cdc17f0a442c5ff1b48038e /pokemod/Dialog.cpp | |
| parent | 3595239f08f2bc1df32ef22ed6de9bde10ca3384 (diff) | |
| download | sigen-5c3ca621f75587173bab3d946aee81dd2d36f495.tar.gz sigen-5c3ca621f75587173bab3d946aee81dd2d36f495.tar.xz sigen-5c3ca621f75587173bab3d946aee81dd2d36f495.zip | |
Pokemod validation, paths made to default
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@20 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemod/Dialog.cpp')
| -rw-r--r-- | pokemod/Dialog.cpp | 67 |
1 files changed, 11 insertions, 56 deletions
diff --git a/pokemod/Dialog.cpp b/pokemod/Dialog.cpp index 23f09e1b..0ff37cef 100644 --- a/pokemod/Dialog.cpp +++ b/pokemod/Dialog.cpp @@ -23,18 +23,18 @@ #include "Dialog.h"
-extern PokeGen::PokeMod::Pokemod curPokeMod;
-
-PokeGen::PokeMod::Dialog::Dialog(const unsigned _id) :
+PokeGen::PokeMod::Dialog::Dialog(const Pokemod *par, const unsigned _id) :
dialog("")
{
LogCtor("Dialog", _id);
id = _id;
+ pokemod = par;
}
-PokeGen::PokeMod::Dialog::Dialog(Ini &ini, const unsigned _id)
+PokeGen::PokeMod::Dialog::Dialog(const Pokemod *par, Ini &ini, const unsigned _id)
{
LogCtorIni("Dialog", _id);
+ pokemod = par;
ImportIni(ini, _id);
if (id == UINT_MAX)
LogIdError("Dialog");
@@ -94,58 +94,13 @@ PokeGen::PokeMod::String PokeGen::PokeMod::Dialog::GetDialog() const return dialog;
}
-void PokeGen::PokeMod::Dialog::InsertDialogCommand(const unsigned cmd, const unsigned pos)
-{
- /*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
- Timer
- Map Sign
- Wild Scope
- Safari
- Heal Party
- Refresh
- Clear
- Pause
- New Line
- Exit
- Menu*/
- // TODO (Ben#1#): Dialog commands
-}
-
void PokeGen::PokeMod::Dialog::InsertDialogCommand(const String &cmd, const unsigned pos)
{
- InsertDialogCommand(FindIn(DC_END, cmd, DialogCommandStr), pos);
+ Log(String("Dialog: Inserting dialog command %s into %u at %u", cmd.c_str(), id, pos), PM_DEBUG_INFO);
+ if (dialog.length() < pos)
+ {
+ Log(String("Dialog: Position out-of-range in %u", id), PM_DEBUG_ERROR);
+ return;
+ }
+ dialog.insert();
}
|
