diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2007-05-03 23:12:56 +0000 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2007-05-03 23:12:56 +0000 |
| commit | 21cb50c82f18b3a2ee1e77a7de11413ce45e6587 (patch) | |
| tree | 33d1c600c9e26756580c92ea6b331041699510eb | |
| parent | 621d0f09fafba69aa650bc1555927f41e9c8e60e (diff) | |
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@7 6ecfd1a5-f3ed-3746-8530-beee90d26b22
| -rw-r--r-- | Changelog | 8 | ||||
| -rw-r--r-- | pokegen.cbp | 486 | ||||
| -rw-r--r-- | pokegen.layout | 31 | ||||
| -rw-r--r-- | pokemod/Ability.cpp | 40 | ||||
| -rw-r--r-- | pokemod/Ability.h | 5 | ||||
| -rw-r--r-- | pokemod/Author.cpp | 40 | ||||
| -rw-r--r-- | pokemod/Author.h | 5 | ||||
| -rw-r--r-- | pokemod/Badge.cpp | 44 | ||||
| -rw-r--r-- | pokemod/Badge.h | 5 | ||||
| -rw-r--r-- | pokemod/Debug.cpp | 28 | ||||
| -rw-r--r-- | pokemod/Debug.h | 63 | ||||
| -rw-r--r-- | pokemod/Nature.cpp | 36 | ||||
| -rw-r--r-- | pokemod/Nature.h | 5 | ||||
| -rw-r--r-- | pokemod/Object.cpp | 2 | ||||
| -rw-r--r-- | pokemod/Object.h | 9 | ||||
| -rw-r--r-- | pokemodr/PokeModr.cpp | 7 | ||||
| -rw-r--r-- | pokemodr/PokeModrDebug.h | 57 |
17 files changed, 247 insertions, 624 deletions
@@ -1,4 +1,12 @@ -----------------
+Rev: 7
+Date: 3 May 2007
+User: MathStuf
+-----------------
+[FIX] Allowed more general logging for PokeMod
+[FIX] Fixed errors in PokeMod logging functions
+
+-----------------
Rev: 6
Date: 3 May 2007
User: MathStuf
diff --git a/pokegen.cbp b/pokegen.cbp index 1b82ad5e..3c7c1e28 100644 --- a/pokegen.cbp +++ b/pokegen.cbp @@ -58,492 +58,6 @@ <Unit filename="pokemodr\PokeModrDebug.h"> <Option target="pokemodr" /> </Unit> - <Unit filename="pokemodr\gui\PokeModrGUI.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\PokeModrGUI.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\abilityeffectpanel.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\abilityeffectpanel.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\abilitypanel.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\abilitypanel.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\app_resources.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\app_resources.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\authorpanel.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\authorpanel.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\badgepanel.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\badgepanel.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\coinitempanel.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\coinitempanel.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\coinpanel.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\coinpanel.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\debugWindow.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\debugWindow.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dialogpanel.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dialogpanel.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgBattleTrainer.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgBattleTrainer.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgCheckDirection.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgCheckDirection.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgCheckHeldItems.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgCheckHeldItems.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgCheckItem.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgCheckItem.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgCheckLevels.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgCheckLevels.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgCheckMoney.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgCheckMoney.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgCheckRoster.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgCheckRoster.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgCheckSpecies.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgCheckSpecies.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgCoinList.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgCoinList.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgDaycare.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgDaycare.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgDeleteMove.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgDeleteMove.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgDialog.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgDialog.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgDisplayName.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgDisplayName.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgFlagFlip.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgFlagFlip.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgFlagRandomize.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgFlagRandomize.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgFlagSet.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgFlagSet.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgFlagTest.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgFlagTest.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgFlagUnset.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgFlagUnset.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgGiveItem.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgGiveItem.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgGiveMoney.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgGiveMoney.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgGivePokemon.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgGivePokemon.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgItemShop.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgItemShop.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgMenu.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgMenu.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgMoveEffect.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgMoveEffect.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgMusic.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgMusic.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgShowPokemon.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgShowPokemon.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgSoundEffect.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgSoundEffect.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgTakeItem.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgTakeItem.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgTakeMoney.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgTakeMoney.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgTakePokemon.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgTakePokemon.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgTeachMove.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgTeachMove.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgTimer.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgTimer.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgTrade.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgTrade.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgTurnEffect.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgTurnEffect.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgViewPokemon.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgViewPokemon.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgWarp.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgWarp.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgYesNo.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\dlgYesNo.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\editimage.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\editimage.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\givebadge.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\givebadge.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\itemeffectpanel.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\itemeffectpanel.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\itempanel.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\itempanel.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\itemstoragepanel.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\itemstoragepanel.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\mainWindow.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\mainWindow.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\mapeffectpanel.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\mapeffectpanel.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\mappanel.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\mappanel.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\maptrainerpanel.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\maptrainerpanel.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\maptrainerteampanel.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\maptrainerteampanel.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\mapwarppanel.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\mapwarppanel.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\mapwildlistpanel.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\mapwildlistpanel.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\mapwildpanel.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\mapwildpanel.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\menuEntry.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\menuEntry.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\moveeffectpanel.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\moveeffectpanel.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\movepanel.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\movepanel.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\natureeffectpanel.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\natureeffectpanel.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\naturepanel.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\naturepanel.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\pokemonabilitypanel.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\pokemonabilitypanel.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\pokemonevolutionpanel.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\pokemonevolutionpanel.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\pokemonitempanel.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\pokemonitempanel.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\pokemonmovepanel.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\pokemonmovepanel.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\pokemonnaturepanel.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\pokemonnaturepanel.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\pokemonpanel.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\pokemonpanel.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\prefs.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\prefs.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\statuseffectpanel.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\statuseffectpanel.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\statuspanel.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\statuspanel.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\storeitempanel.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\storeitempanel.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\storepanel.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\storepanel.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\tilepanel.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\tilepanel.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\timepanel.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\timepanel.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\typemultiplier.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\typemultiplier.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\typepanel.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\typepanel.h"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\validation.cpp"> - <Option target="pokemodr" /> - </Unit> - <Unit filename="pokemodr\gui\validation.h"> - <Option target="pokemodr" /> - </Unit> <Extensions> <code_completion /> </Extensions> diff --git a/pokegen.layout b/pokegen.layout index 152b590b..e6dad18c 100644 --- a/pokegen.layout +++ b/pokegen.layout @@ -1,32 +1,32 @@ <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <CodeBlocks_layout_file> <ActiveTarget name="pokemodr" /> - <File name="Changelog" open="0" top="0" tabpos="1"> - <Cursor position="355" topLine="0" /> + <File name="Changelog" open="1" top="1" tabpos="1"> + <Cursor position="204" topLine="0" /> </File> <File name="pokemod\Ability.cpp" open="0" top="0" tabpos="0"> - <Cursor position="5246" topLine="140" /> + <Cursor position="2545" topLine="57" /> </File> <File name="pokemod\Ability.h" open="0" top="0" tabpos="0"> - <Cursor position="2259" topLine="35" /> + <Cursor position="2189" topLine="33" /> </File> <File name="pokemod\Author.cpp" open="0" top="0" tabpos="0"> - <Cursor position="4688" topLine="135" /> + <Cursor position="2205" topLine="46" /> </File> <File name="pokemod\Author.h" open="0" top="0" tabpos="0"> - <Cursor position="1910" topLine="39" /> + <Cursor position="1963" topLine="33" /> </File> <File name="pokemod\Badge.cpp" open="0" top="0" tabpos="0"> - <Cursor position="8587" topLine="244" /> + <Cursor position="2587" topLine="74" /> </File> <File name="pokemod\Badge.h" open="0" top="0" tabpos="0"> - <Cursor position="2527" topLine="46" /> + <Cursor position="2457" topLine="44" /> </File> <File name="pokemod\Debug.cpp" open="0" top="0" tabpos="0"> - <Cursor position="2949" topLine="47" /> + <Cursor position="2162" topLine="30" /> </File> <File name="pokemod\Debug.h" open="0" top="0" tabpos="0"> - <Cursor position="14582" topLine="13" /> + <Cursor position="1646" topLine="15" /> </File> <File name="pokemod\Flag.cpp" open="0" top="0" tabpos="0"> <Cursor position="3104" topLine="58" /> @@ -47,16 +47,16 @@ <Cursor position="2452" topLine="32" /> </File> <File name="pokemod\Nature.cpp" open="0" top="0" tabpos="0"> - <Cursor position="4852" topLine="134" /> + <Cursor position="2240" topLine="67" /> </File> <File name="pokemod\Nature.h" open="0" top="0" tabpos="0"> - <Cursor position="2172" topLine="34" /> + <Cursor position="2072" topLine="34" /> </File> <File name="pokemod\Object.cpp" open="0" top="0" tabpos="0"> - <Cursor position="1428" topLine="4" /> + <Cursor position="1428" topLine="11" /> </File> <File name="pokemod\Object.h" open="0" top="0" tabpos="0"> - <Cursor position="1677" topLine="27" /> + <Cursor position="1637" topLine="24" /> </File> <File name="pokemod\Path.cpp" open="0" top="0" tabpos="0"> <Cursor position="2216" topLine="39" /> @@ -88,4 +88,7 @@ <File name="pokemod\Xml.h" open="0" top="0" tabpos="0"> <Cursor position="3343" topLine="26" /> </File> + <File name="pokemodr\PokeModrDebug.h" open="0" top="0" tabpos="0"> + <Cursor position="1675" topLine="0" /> + </File> </CodeBlocks_layout_file> diff --git a/pokemod/Ability.cpp b/pokemod/Ability.cpp index 1974f487..1ca90255 100644 --- a/pokemod/Ability.cpp +++ b/pokemod/Ability.cpp @@ -45,11 +45,7 @@ PokeGen::PokeMod::Ability::~Ability() LogDtor("Ability", id, name));
}
-#ifdef POKEMODR
-void PokeGen::PokeMod::Ability::Validate(wxListBox &output)
-#else
void PokeGen::PokeMod::Ability::Validate()
-#endif
{
isValid = true;
LogValidateStart("Ability", id, name);
@@ -57,9 +53,38 @@ void PokeGen::PokeMod::Ability::Validate() if (name == "")
{
LogVarNotSet("Ability", "Name", id, name);
-# ifdef POKEMODR
+ isValid = false;
+ }
+ // Check if there are any effects defined
+ if (GetAbilityEffectCount())
+ {
+ // Validate each effect
+ for (std::vector<AbilityEffect>::iterator i = effects.begin(); i != effects.end(); ++i)
+ {
+ LogSubmoduleIterate("Ability", "effect", i->GetId(), id, name);
+ // If an effect isn't valid, neither is the ability
+ if (!i->IsValid())
+ isValid = false;
+ }
+ }
+ else
+ {
+ LogSubmoduleEmpty("Ability", "effect", id, name);
+ isValid = false;
+ }
+ LogValidationOver("Ability", isValid, id, name);
+}
+
+#ifdef PG_DEBUG_WINDOW
+void PokeGen::PokeMod::Ability::Validate(wxListBox &output)
+{
+ isValid = true;
+ LogValidateStart("Ability", id, name);
+ // Make sure the name is set to something
+ if (name == "")
+ {
+ LogVarNotSet("Ability", "Name", id, name);
output.Append(ConsoleLogVarNotSet("Ability", "Name", id, name));
-# endif
isValid = false;
}
// Check if there are any effects defined
@@ -77,13 +102,12 @@ void PokeGen::PokeMod::Ability::Validate() else
{
LogSubmoduleEmpty("Ability", "effect", id, name);
-# ifdef POKEMODR
output.Append(ConsoleLogSubmoduleEmpty("Ability", "effect", id, name));
-# endif
isValid = false;
}
LogValidationOver("Ability", isValid, id, name);
}
+#endif
void PokeGen::PokeMod::Ability::ImportXml(XmlElement &xml, unsigned _id)
{
diff --git a/pokemod/Ability.h b/pokemod/Ability.h index 53ee18cd..9d8dfded 100644 --- a/pokemod/Ability.h +++ b/pokemod/Ability.h @@ -54,10 +54,9 @@ namespace PokeGen void NewAbilityEffect(XmlElement *xml = NULL);
void DeleteAbilityEffect(unsigned _id);
private:
-# ifdef POKEMODR
- void Validate(wxListBox &output);
-# else
void Validate();
+# ifdef PG_DEBUG_WINDOW
+ void Validate(wxListBox &output);
# endif
String name;
diff --git a/pokemod/Author.cpp b/pokemod/Author.cpp index 20801e01..d01ae45e 100644 --- a/pokemod/Author.cpp +++ b/pokemod/Author.cpp @@ -46,47 +46,63 @@ PokeGen::PokeMod::Author::~Author() LogDtor("Author", id, name);
}
-#ifdef POKEMODR
-void PokeGen::PokeMod::Author::Validate(wxListBox &output)
-#else
void PokeGen::PokeMod::Author::Validate()
-#endif
{
isValid = true;
LogValidateStart("Author", id, name);
if (name == "")
{
LogVarNotSet("Author", "name", id);
-# ifdef POKEMODR
+ isValid = false;
+ }
+ if (email == "")
+ {
+ LogVarNotSet("Author", "email", id, name);
+ }
+ else if (!IsValidEmail())
+ {
+ LogVarNotValid("Author", "email", id, name);
+ isValid = false;
+ }
+ if (role == "")
+ {
+ LogValNotSet("Author", "role", id, name);
+ isValid = false;
+ }
+ LogValidateOver("Author", isValid, id, name);
+}
+
+#ifdef PG_DEBUG_WINDOW
+void PokeGen::PokeMod::Author::Validate(wxListBox &output)
+{
+ isValid = true;
+ LogValidateStart("Author", id, name);
+ if (name == "")
+ {
+ LogVarNotSet("Author", "name", id);
output.Append(ConsoleLogVarNotSet("Author", "name", id)));
-# endif
isValid = false;
}
if (email == "")
{
LogVarNotSet("Author", "email", id, name);
-# ifdef POKEMODR
output.Append(ConsoleLogVarNotSetW("Author", "email", id)));
-# endif
}
else if (!IsValidEmail())
{
LogVarNotValid("Author", "email", id, name);
-# ifdef POKEMODR
output.Append(ConsoleLogVarNotValid("Author", "email", id, name));
-# endif
isValid = false;
}
if (role == "")
{
LogValNotSet("Author", "role", id, name);
-# ifdef POKEMODR
output.Append(ConsoleLogValNotSet("Author", "role", id, name)));
-# endif
isValid = false;
}
LogValidateOver("Author", isValid, id, name);
}
+#endif
void PokeGen::PokeMod::Author::ImportXml(XmlElement &xml, unsigned _id)
{
diff --git a/pokemod/Author.h b/pokemod/Author.h index b4758d88..01bb8418 100644 --- a/pokemod/Author.h +++ b/pokemod/Author.h @@ -49,10 +49,9 @@ namespace PokeGen String GetEmail();
String GetRole();
private:
-# ifdef POKEMODR
- void Validate(wxListBox &output);
-# else
void Validate();
+# ifdef PG_DEBUG_WINDOW
+ void Validate(wxListBox &output);
# endif
enum EmailCheck
diff --git a/pokemod/Badge.cpp b/pokemod/Badge.cpp index a66279aa..56e988ae 100644 --- a/pokemod/Badge.cpp +++ b/pokemod/Badge.cpp @@ -53,20 +53,43 @@ PokeGen::PokeMod::Badge::~Badge() LogDtor("Badge", id, name);
}
-#ifdef POKEMODR
-void PokeGen::PokeMod::Badge::Validate(wxListBox &output)
-#else
void PokeGen::PokeMod::Badge::Validate()
-#endif
{
isValid = true;
LogValidateStart("Badge", id, name);
if (name == "")
{
LogVarNotSet("Badge", "name", id);
-# ifdef POKEMODR
+ isValid = false;
+ }
+ if (!face.DoesExist())
+ {
+ if (face == "")
+ LogVarNotSet("Badge", "face sprite", id, name);
+ else
+ LogVarNotValid("Badge", "face sprite", id, name);
+ isValid = false;
+ }
+ if (!badge.DoesExist())
+ {
+ if (badge == "")
+ LogVarNotSet("Badge", "badge sprite", id, name);
+ else
+ LogVarNotValid("Badge", "badge sprite", id, name);
+ isValid = false;
+ }
+ LogValidationOver("Badge", isValid, is, name);
+}
+
+#ifdef PG_DEBUG_WINDOW
+void PokeGen::PokeMod::Badge::Validate(wxListBox &output)
+{
+ isValid = true;
+ LogValidateStart("Badge", id, name);
+ if (name == "")
+ {
+ LogVarNotSet("Badge", "name", id);
output.Append(ConsoleLogVarNotSet("Badge", "name", id));
-# endif
isValid = false;
}
if (!face.DoesExist())
@@ -74,16 +97,12 @@ void PokeGen::PokeMod::Badge::Validate() if (face == "")
{
LogVarNotSet("Badge", "face sprite", id, name);
-# ifdef POKEMODR
output.Append(ConsoleLogVarNotSet("Badge", "face sprite", id, name));
-# endif
}
else
{
LogVarNotValid("Badge", "face sprite", id, name);
-# ifdef POKEMODR
output.Append(ConsoleLogVarNotValid("Badge", "face sprite", id, name));
-# endif
}
isValid = false;
}
@@ -92,21 +111,18 @@ void PokeGen::PokeMod::Badge::Validate() if (badge == "")
{
LogVarNotSet("Badge", "badge sprite", id, name);
-# ifdef POKEMODR
output.Append(ConsoleLogVarNotSet("Badge", "badge sprite", id, name));
-# endif
}
else
{
LogVarNotValid("Badge", "badge sprite", id, name);
-# ifdef POKEMODR
output.Append(ConsoleLogVarNotValid("Badge", "badge sprite", id, name));
-# endif
}
isValid = false;
}
LogValidationOver("Badge", isValid, is, name);
}
+#endif
void PokeGen::PokeMod::Badge::ImportXml(XmlElement &xml, unsigned _id)
{
diff --git a/pokemod/Badge.h b/pokemod/Badge.h index b8b7b67f..8e3e46c5 100644 --- a/pokemod/Badge.h +++ b/pokemod/Badge.h @@ -62,10 +62,9 @@ namespace PokeGen Frac GetStat(unsigned s);
bool GetHm(unsigned h);
private:
-# ifdef POKEMODR
- void Validate(wxListBox &output);
-# else
void Validate();
+# ifdef PG_DEBUG_WINDOW
+ void Validate(wxListBox &output);
# endif
String name;
diff --git a/pokemod/Debug.cpp b/pokemod/Debug.cpp index d160fd2b..4875bd4d 100644 --- a/pokemod/Debug.cpp +++ b/pokemod/Debug.cpp @@ -25,12 +25,11 @@ #ifdef PM_DEBUG
-// Declare an instance of the debug window
-#ifdef PM_DEBUG_OUTPUT_DEBUG
-debugWindow debug = new debugWindow();
+#ifdef PG_DEBUG_WINDOW
+extern debugWindow PokeModDebugWindow;
#endif
-extern int PMdebugLevel;
+int PokModDebugLevel;
void PokeGen::PokeMod::Log(const char *msg, int level)
{
@@ -40,23 +39,26 @@ void PokeGen::PokeMod::Log(const char *msg, int level) if (level <= PMdebugLevel)
{
// Get the current time
- time_t curTimeSec = time(NULL);
- PMString curTime = asctime(localtime(&curTimeSec));
- curTime.erase(curTime.find('\n'));
+ char path[21];
+ char time[9];
+ time_t rawTime = std::time(NULL);
+ tm *curTime = std::localtime(&rawTime);
+ strftime(path, 21, "%y/%m-%b/%d-%a", curTime);
+ strftime(time, 9, "%X", curTime);
// Get the actual output message
- PMString output("%s (%s): %s", PokeModDebugStr[level], curTime.c_str(), msg);
+ String output("%s (%s): %s", PokeModDebugStr[level], time, msg);
// Output to the command window
# ifdef PM_DEBUG_OUTPUT_CONSOLE
std::cout << output << std::endl;
# endif
// Output to the debugging console
# ifdef PM_DEBUG_OUTPUT_DEBUG
- if (debug.m_Show[level].IsChecked())
- debug.m_Debug.Append(output);
+ if (PokeModDebugWindow.m_Show[level].IsChecked())
+ PokeModDebugWindow.m_Debug.Append(output);
# endif
// Output to the debugging log
# ifdef PM_DEBUG_OUTPUT_FILE
- std::ofstream flog("PokeMod.log", std::ios::app);
+ std::ofstream flog(String("/log/pokemod/%s.log", path), std::ios::app);
// Output erros if the file fails
if (!flog)
{
@@ -64,7 +66,7 @@ void PokeGen::PokeMod::Log(const char *msg, int level) std::cout << "Alert (" << curTime << "): Unable to open log file!\n";
# endif
# ifdef PM_DEBUG_OUTPUT_DEBUG
- debug.m_Debug.Append(String("Alert (%s): Unable to open log file!", curTime));
+ PokeModDebugWindow.m_Debug.Append(String("Alert (%s): Unable to open log file!", curTime));
# endif
}
else
@@ -79,7 +81,7 @@ void PokeGen::PokeMod::Log(const char *msg, int level) #else
// Empty function if debugging isn't wanted
-void PokeGen::PokeMod::Log(const PokeGen::PokeMod::String &msg, int level)
+void PokeGen::PokeMod::Log(const String &msg, int level)
{
return;
}
diff --git a/pokemod/Debug.h b/pokemod/Debug.h index 56956244..be22a407 100644 --- a/pokemod/Debug.h +++ b/pokemod/Debug.h @@ -26,24 +26,29 @@ // TODO (Ben#1#): Comment logging functions
+#define PM_DEBUG
+
#ifdef PM_DEBUG
+# define PM_DEBUG_OUTPUT_FILE
+# define PM_DEBUG_OUTPUT_CONSOLE
+
# include <ctime>
+
# ifdef PM_DEBUG_OUTPUT_FILE
# include <fstream>
# endif
+
# ifdef PM_DEBUG_OUTPUT_CONSOLE
# include <cstdio>
# endif
-# ifdef PM_DEBUG_OUTPUT_DEBUG
-# include "../gui/debugWindow.h"
-# endif
-# if !defined(PM_DEBUG_OUTPUT_FILE) && !defined(PM_DEBUG_OUTPUT_CONSOLE) && !defined(PM_DEBUG_OUTPUT_DEBUG)
+# if !defined(PM_DEBUG_OUTPUT_FILE) && !defined(PM_DEBUG_OUTPUT_CONSOLE) && !defined(PG_DEBUG_WINDOW)
# error "Debugging turned on, but no output specified!"
-# endif
+# endif
#include "String.h"
+#include "Frac.h"
namespace PokeGen
{
@@ -95,6 +100,7 @@ namespace PokeGen Log(String("%s Validation: %s of %u%s isn\'t set", module, var, id, name ? String(" (%s)", name).c_str() : ""), PM_DEBUG_ALERT);
}
+# ifdef PG_DEBUG_WINDOW
inline String ConsoleLogVarNotSet(const char *module, const char *var, unsigned id, const char *name = NULL)
{
return String("Error (%s): %s of %u%s isn\'t set", module, var, id, name ? String(" (%s)", name).c_str() : "");
@@ -104,16 +110,19 @@ namespace PokeGen {
return String("Warning (%s): %s of %u%s isn\'t set", module, var, id, name ? String(" (%s)", name).c_str() : "");
}
+# endif
inline void LogVarNotValid(const char *module, const char *var, unsigned id, const char *name = NULL)
{
Log(String("%s Validation: %s of %u%s isn\'t valid", module, var, id, name ? String(" (%s)", name).c_str() : ""), PM_DEBUG_ALERT);
}
+# ifdef PG_DEBUG_WINDOW
inline String ConsoleLogVarNotValid(const char *module, const char *var, unsigned id, const char *name = NULL)
{
return String("Error (%s): %s of %u%s isn\'t valid", module, var, id, name ? String(" (%s)", name).c_str() : "");
}
+# endif
inline void LogSubmoduleIterate(const char *module, const char *subName, unsigned subId, unsigned id, const char *name = NULL)
{
@@ -125,10 +134,12 @@ namespace PokeGen Log(String("%s Validation: No %s of %u%s defined", module, subName, id, name ? String(" (%s)", name).c_str() : ""), PM_DEBUG_ALERT);
}
+# ifdef PG_DEBUG_WINDOW
inline String ConsoleLogSubmoduleEmpty(const char *module, const char *subName, unsigned id, const char *name = NULL)
{
return String("Error (%s): No %s of %u%s defined", module, subName, id, name ? String(" (%s)", name).c_str() : "");
}
+# endif
inline void LogValidationOver(const char *module, bool valid, unsigned id, const char *name = NULL)
{
@@ -170,104 +181,104 @@ namespace PokeGen // Setting Variable Values
inline void LogSetVar(const char *module, const char *var, unsigned id, int valInt = INT_MIN, const char *valStr = NULL, const char *name = NULL)
{
- Log(String("%s: Setting %s of %u%s to %s", module, var, id, name ? String(" (%s)", name).c_str() : "", (valInt == INT_MIN) ? String("%d%s", valInt, valStr ? String(" (%s)", valStr).c_str()).c_str() : (valStr ? valStr : String("%d", valInt).c_str())), PM_DEBUG_DEBUG);
+ Log(String("%s: Setting %s of %u%s to %s", module, var, id, name ? String(" (%s)", name).c_str() : "", (valInt == INT_MIN) ? String("%d%s", valInt, valStr ? String(" (%s)", valStr).c_str() : "").c_str() : (valStr ? valStr : String("%d", valInt).c_str())), PM_DEBUG_DEBUG);
}
inline void LogSetVar(const char *module, const char *var, unsigned id, unsigned valInt = UINT_MAX, const char *valStr = NULL, const char *name = NULL)
{
- Log(String("%s: Setting %s of %u%s to %s", module, var, id, name ? String(" (%s)", name).c_str() : "", (valInt == INT_MIN) ? String("%u%s", valInt, valStr ? String(" (%s)", valStr).c_str()).c_str() : (valStr ? valStr : String("%u", valInt).c_str())), PM_DEBUG_DEBUG);
+ Log(String("%s: Setting %s of %u%s to %s", module, var, id, name ? String(" (%s)", name).c_str() : "", (valInt == UINT_MAX) ? String("%u%s", valInt, valStr ? String(" (%s)", valStr).c_str() : "").c_str() : (valStr ? valStr : String("%u", valInt).c_str())), PM_DEBUG_DEBUG);
}
- inline void LogSetVar(const char *module, const char *var, const Frac &val, unsigned id, const char *name = NULL)
+ inline void LogSetVar(const char *module, const char *var, Frac &val, unsigned id, const char *name = NULL)
{
- Log(String("%s: Setting %s of %u%s to %u/%u", module, var, id, name ? String(" (%s)", name).c_str() : "", val.GetNum(), val.GetDenom()), PM_DEBUG_);
+ Log(String("%s: Setting %f of %u%s to %u/%u", module, var, id, name ? String(" (%s)", name).c_str() : "", val.GetNum(), val.GetDenom()), PM_DEBUG_DEBUG);
}
inline void LogSetVar(const char *module, const char *var, unsigned n, unsigned d, unsigned id, const char *name = NULL)
{
- Log(String("%s: Setting %s of %u%s to %u/%u", module, var, id, name ? String(" (%s)", name).c_str() : "", n, d), PM_DEBUG_);
+ Log(String("%s: Setting %s of %u%s to %u/%u", module, var, id, name ? String(" (%s)", name).c_str() : "", n, d), PM_DEBUG_DEBUG);
}
inline void LogSetVar(const char *module, const char *var, unsigned n, bool isNum, unsigned id, const char *name = NULL)
{
- Log(String("%s: Setting %s of %s of %u%s to %u", module, isNum ? "numerator" : "denominator", var, id, name ? String(" (%s)", name).c_str() : "", n), PM_DEBUG_);
+ Log(String("%s: Setting %s of %s of %u%s to %u", module, isNum ? "numerator" : "denominator", var, id, name ? String(" (%s)", name).c_str() : "", n), PM_DEBUG_DEBUG);
}
inline void LogOutOfRange(const char *module, const char *var, int valInt, const char *regVal, unsigned id, const char *name = NULL)
{
- Log(String("%s: Attempting to set %s to %d of %u%s out-of-range (%s)", module, var, valInt, id, name ? String(" (%s)", name).c_str() : "", regVal), PM_DEBUG_);
+ Log(String("%s: Attempting to set %s to %d of %u%s out-of-range (%s)", module, var, valInt, id, name ? String(" (%s)", name).c_str() : "", regVal), PM_DEBUG_DEBUG);
}
inline void LogNotSet(const char *module, const char *var, const char *reg, unsigned id, int valInt = INT_MIN, const char *valStr = NULL, const char *name = NULL)
{
- Log(String("%s: Attempting to set %s to %s of %u%s without %s being set", module, var, (valInt == INT_MIN) ? String("%d%s", valInt, valStr ? String(" (%s)", valStr).c_str()).c_str() : (valStr ? valStr : String("%d", valInt).c_str()), id, name ? String(" (%s)", name).c_str() : "", reg), PM_DEBUG_);
+ Log(String("%s: Attempting to set %s to %s of %u%s without %s being set", module, var, (valInt == INT_MIN) ? String("%d%s", valInt, valStr ? String(" (%s)", valStr).c_str() : "").c_str() : (valStr ? valStr : String("%d", valInt).c_str()), id, name ? String(" (%s)", name).c_str() : "", reg), PM_DEBUG_ERROR);
}
inline void LogNotSet(const char *module, const char *var, const char *reg, unsigned id, unsigned valInt = UINT_MAX, const char *valStr = NULL, const char *name = NULL)
{
- Log(String("%s: Attempting to set %s to %s of %u%s without %s being set", module, var, (valInt == UINT_MAX) ? String("%u%s", valInt, valStr ? String(" (%s)", valStr).c_str()).c_str() : (valStr ? valStr : String("%u", valInt).c_str()), id, name ? String(" (%s)", name).c_str() : "", reg), PM_DEBUG_);
+ Log(String("%s: Attempting to set %s to %s of %u%s without %s being set", module, var, (valInt == UINT_MAX) ? String("%u%s", valInt, valStr ? String(" (%s)", valStr).c_str() : "").c_str() : (valStr ? valStr : String("%u", valInt).c_str()), id, name ? String(" (%s)", name).c_str() : "", reg), PM_DEBUG_ERROR);
}
inline void LogNoUse(const char *module, const char *var, const char *reg, const char *regVal, unsigned id, int valInt = INT_MIN, const char *valStr = NULL, const char *name = NULL)
{
- Log(String("%s: Attempting to set %s to %s of %u%s without %s needing it (%s)", module, var, (valInt == INT_MIN) ? String("%d%s", valInt, valStr ? String(" (%s)", valStr).c_str()).c_str() : (valStr ? valStr : String("%d", valInt).c_str()), id, name ? String(" (%s)", name).c_str() : "", reg, regVal), PM_DEBUG_);
+ Log(String("%s: Attempting to set %s to %s of %u%s without %s needing it (%s)", module, var, (valInt == INT_MIN) ? String("%d%s", valInt, valStr ? String(" (%s)", valStr).c_str() : "").c_str() : (valStr ? valStr : String("%d", valInt).c_str()), id, name ? String(" (%s)", name).c_str() : "", reg, regVal), PM_DEBUG_ERROR);
}
inline void LogNoUse(const char *module, const char *var, const char *reg, const char *regVal, unsigned id, unsigned valInt = UINT_MAX, const char *valStr = NULL, const char *name = NULL)
{
- Log(String("%s: Attempting to set %s to %s of %u%s without %s needing it (%s)", module, var, (valInt == UINT_MAX) ? String("%u%s", valInt, valStr ? String(" (%s)", valStr).c_str()).c_str() : (valStr ? valStr : String("%u", valInt).c_str()), id, name ? String(" (%s)", name).c_str() : "", reg, regVal), PM_DEBUG_);
+ Log(String("%s: Attempting to set %s to %s of %u%s without %s needing it (%s)", module, var, (valInt == UINT_MAX) ? String("%u%s", valInt, valStr ? String(" (%s)", valStr).c_str() : "").c_str() : (valStr ? valStr : String("%u", valInt).c_str()), id, name ? String(" (%s)", name).c_str() : "", reg, regVal), PM_DEBUG_ERROR);
}
// Fetching variable values
inline void LogFetchVar(const char *module, const char *var, int valInt, const char *regVal, unsigned id, const char *name = NULL)
{
- Log(String("%s: Fetching %s from %u%s (%d%s)", module, var, id, name ? String(" (%s)", name).c_str() : "", valInt, regVal ? String(", %s", regVal).c_str() : ""), PM_DEBUG_);
+ Log(String("%s: Fetching %s from %u%s (%d%s)", module, var, id, name ? String(" (%s)", name).c_str() : "", valInt, regVal ? String(", %s", regVal).c_str() : ""), PM_DEBUG_DEBUG);
}
inline void LogFetchVar(const char *module, const char *var, const char *valStr, const char *regVal, unsigned id, const char *name = NULL)
{
- Log(String("%s: Fetching %s from %u%s (%s%s)", module, var, id, name ? String(" (%s)", name).c_str() : "", valStr, regVal ? String(", %s", regVal).c_str() : ""), PM_DEBUG_);
+ Log(String("%s: Fetching %s from %u%s (%s%s)", module, var, id, name ? String(" (%s)", name).c_str() : "", valStr, regVal ? String(", %s", regVal).c_str() : ""), PM_DEBUG_DEBUG);
}
// Submodule logging
inline void LogSubmoduleFetch(const char *module, const char *subName, unsigned subId, unsigned id, const char *name = NULL)
{
- Log(String("%s: Fetching %s %u from %u%s", module, subName, subId, id, name ? String(" (%s)", name).c_str() : ""), PM_DEBUG_);
+ Log(String("%s: Fetching %s %u from %u%s", module, subName, subId, id, name ? String(" (%s)", name).c_str() : ""), PM_DEBUG_DEBUG);
}
inline void LogSubmoduleFetch(const char *module, const char *subName, const char *subStr, unsigned id, const char *name = NULL)
{
- Log(String("%s: Fetching %s %s from %u%s", module, subName, subStr, id, name ? String(" (%s)", name).c_str() : ""), PM_DEBUG_);
+ Log(String("%s: Fetching %s %s from %u%s", module, subName, subStr, id, name ? String(" (%s)", name).c_str() : ""), PM_DEBUG_DEBUG);
}
inline void LogSubmoduleFetchFail(const char *module, const char *subName, unsigned subId, unsigned id, const char *name = NULL)
{
- Log(String("%s: Fetching %s %u from %u%s", module, subName, subId, id, name ? String(" (%s)", name).c_str() : ""), PM_DEBUG_);
+ Log(String("%s: Fetching %s %u from %u%s", module, subName, subId, id, name ? String(" (%s)", name).c_str() : ""), PM_DEBUG_ERROR);
}
inline void LogSubmoduleCount(const char *module, const char *subName, unsigned id, const char *name = NULL)
{
- Log(String("%s: Fetching %s count of %u%s", module, subName, id, name ? String(" (%s)", name).c_str() : ""), PM_DEBUG_);
+ Log(String("%s: Fetching %s count of %u%s", module, subName, id, name ? String(" (%s)", name).c_str() : ""), PM_DEBUG_DEBUG);
}
inline void LogSubmoduleNew(const char *module, const char *subName, unsigned subId, unsigned id, const char *name = NULL)
{
- Log(String("%s: Creating a new %s (%u) in %u%s", module, subName, subId, id, name ? String(" (%s)", name).c_str() : ""), PM_DEBUG_);
+ Log(String("%s: Creating a new %s (%u) in %u%s", module, subName, subId, id, name ? String(" (%s)", name).c_str() : ""), PM_DEBUG_DEBUG);
}
inline void LogSubmoduleRemoveStart(const char *module, const char *subName, unsigned subId, unsigned id, const char *name = NULL)
{
- Log(String("%s: Attempting to remove %s %u from %u%s", module, subName, subId, id, name ? String(" (%s)", name).c_str() : ""), PM_DEBUG_);
+ Log(String("%s: Attempting to remove %s %u from %u%s", module, subName, subId, id, name ? String(" (%s)", name).c_str() : ""), PM_DEBUG_DEBUG);
}
inline void LogSubmoduleRemoved(const char *module, const char *subName, unsigned subId, unsigned id, const char *name = NULL)
{
- Log(String("%s: Removed %s %u from %u%s", module, subName, subId, id, name ? String(" (%s)", name).c_str() : ""), PM_DEBUG_);
+ Log(String("%s: Removed %s %u from %u%s", module, subName, subId, id, name ? String(" (%s)", name).c_str() : ""), PM_DEBUG_DEBUG);
}
inline void LogSubmoduleRemoveFail(const char *module, const char *subName, unsigned subId, unsigned id, const char *name = NULL)
{
- Log(String("%s: Failed to remove %s %u from %u%s", module, subName, subId, id, name ? String(" (%s)", name).c_str() : ""), PM_DEBUG_);
+ Log(String("%s: Failed to remove %s %u from %u%s", module, subName, subId, id, name ? String(" (%s)", name).c_str() : ""), PM_DEBUG_ERROR);
}
/* inline void Log(const char *module, unsigned id, const char *name = NULL)
diff --git a/pokemod/Nature.cpp b/pokemod/Nature.cpp index 128651ce..ed4aa73a 100644 --- a/pokemod/Nature.cpp +++ b/pokemod/Nature.cpp @@ -44,20 +44,41 @@ PokeGen::PokeMod::Nature::~Nature() LogDtor("Nature", id, name);
}
-#ifdef POKEMODR
-void PokeGen::PokeMod::Nature::Validate(wxListBox &output)
-#else
void PokeGen::PokeMod::Nature::Validate()
-#endif
{
isValid = true;
LogValidateStart("Nature", id, name);
if (name == "")
{
LogVarNotSet("Nature", "name", id);
-# ifdef POKEMODR
+ isValid = false;
+ }
+ if (GetNatureEffectCount())
+ {
+ for (unsigned i = 0; i < GetNatureEffectCount(); ++i)
+ {
+ LogSubmoduleIterate("Nature", "effect", i, id, name);
+ if (!effects[i].IsValid())
+ isValid = false;
+ }
+ }
+ else
+ {
+ LogSubmoduleEmpty("Nature", "effects", id, name);
+ isValid = false;
+ }
+ LogValidationOver("Nature", isValid, id, name);
+}
+
+#ifdef PG_DEBUG_WINDOW
+void PokeGen::PokeMod::Nature::Validate(wxListBox &output)
+{
+ isValid = true;
+ LogValidateStart("Nature", id, name);
+ if (name == "")
+ {
+ LogVarNotSet("Nature", "name", id);
output.Append(ConsoleLogVarNotSet("Nature", "name", id);
-# endif
isValid = false;
}
if (GetNatureEffectCount())
@@ -72,13 +93,12 @@ void PokeGen::PokeMod::Nature::Validate() else
{
LogSubmoduleEmpty("Nature", "effects", id, name);
-# ifdef POKEMODR
output.Append(ConsoleLogSubmoduleEmpty("Nature", "effects", id, name));
-# endif
isValid = false;
}
LogValidationOver("Nature", isValid, id, name);
}
+#endif
void PokeGen::PokeMod::Nature::ImportXml(XmlElement &xml, unsigned _id)
{
diff --git a/pokemod/Nature.h b/pokemod/Nature.h index 440c6a8a..e95ff484 100644 --- a/pokemod/Nature.h +++ b/pokemod/Nature.h @@ -53,11 +53,10 @@ namespace PokeGen void NewNatureEffect(XmlElement *xml = NULL);
void DeleteNatureEffect(unsigned _id);
private:
-# ifdef POKEMODR
+# ifdef PG_DEBUG_WINDOW
void Validate(wxListBox &output);
-# else
- void Validate();
# endif
+ void Validate();
String name;
diff --git a/pokemod/Object.cpp b/pokemod/Object.cpp index 152c9a82..72968631 100644 --- a/pokemod/Object.cpp +++ b/pokemod/Object.cpp @@ -35,7 +35,7 @@ bool PokeGen::PokeMod::Object::IsValid() return isValid;
}
-#ifdef POKEMODR
+#ifdef PG_DEBUG_WINDOW
bool PokeGen::PokeMod::Object::IsValid(const wxListBox &output)
{
// Validate with debugging console output
diff --git a/pokemod/Object.h b/pokemod/Object.h index ba879952..4632ca97 100644 --- a/pokemod/Object.h +++ b/pokemod/Object.h @@ -24,7 +24,7 @@ #ifndef __POKEMOD_OBJECT__
#define __POKEMOD_OBJECT__
-#ifdef POKEMODR
+#ifdef PM_DEBUG_OUTPUT_DEBUG
# include <wx/listbox.h>
#endif
@@ -43,14 +43,13 @@ namespace PokeGen unsigned GetId();
bool IsValid();
-# ifdef POKEMODR
+# ifdef PG_DEBUG_WINDOW
bool IsValid(wxListBox &output);
# endif
protected:
-# ifdef POKEMODR
- virtual void Validate(wxListBox &output = NULL);
-# else
virtual void Validate();
+# ifdef PG_DEBUG_WINDOW
+ virtual void Validate(wxListBox &output);
# endif
bool isValid;
diff --git a/pokemodr/PokeModr.cpp b/pokemodr/PokeModr.cpp index 38b9524f..15a10bb8 100644 --- a/pokemodr/PokeModr.cpp +++ b/pokemodr/PokeModr.cpp @@ -31,16 +31,15 @@ #include "../pokemod/pokemod_inc.h"
using namespace std;
-using namespace PokeMod;
+using namespace PokeGen;
#define PKMR_VERSION "0.0.0.1a"
#define PKMR_DATE "Thursday, February 8, 2007"
#define PKMR_WEBSITE "http:/""/nerdyproductions.sobertillnoon.com"
-PMPokemod curPokeMod;
+PokeMod::Pokemod curPokeMod;
-int debugLevel;
-int PMdebugLevel;
+int PokeModrDebugLevel;
int main(int argc, char *argv[])
{
diff --git a/pokemodr/PokeModrDebug.h b/pokemodr/PokeModrDebug.h index fd891d6b..ba87de22 100644 --- a/pokemodr/PokeModrDebug.h +++ b/pokemodr/PokeModrDebug.h @@ -1,10 +1,10 @@ /////////////////////////////////////////////////////////////////////////////
// Name: debug.h
-// Purpose: Define debugging stuff for PokéModr
+// Purpose: Define debugging stuff for PokéModr
// Author: Ben Boeckel
// Modified by: Ben Boeckel
// Created: Thu Feb 15 12:30:45 2007
-// Copyright: ©2007 Ben Boeckel and Nerdy Productions
+// Copyright: ©2007 Ben Boeckel and Nerdy Productions
// Licence:
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -24,30 +24,45 @@ #ifndef __PKMR_DEBUG__
#define __PKMR_DEBUG__
-#define __WXDEBUG__
+#define PKMR_DEBUG
-#define PM_DEBUG
-#ifdef PM_DEBUG
+#ifdef PKMR_DEBUG
-#define PM_DEBUG_OUTPUT_FILE
-#define PM_DEBUG_OUTPUT_CONSOLE
-#define PM_DEBUG_OUTPUT_DEBUG
+# define PKMR_DEBUG_OUTPUT_FILE
+# define PKMR_DEBUG_OUTPUT_CONSOLE
-#endif
+# include <ctime>
-#define PKMR_DEBUG
-#ifdef PKMR_DEBUG
-enum PokeModrDebug
+# ifdef PKMR_DEBUG_OUTPUT_FILE
+# include <fstream>
+# endif
+
+# ifdef PKMR_DEBUG_OUTPUT_CONSOLE
+# include <cstdio>
+# endif
+
+# if !defined(PKMR_DEBUG_OUTPUT_FILE) && !defined(PKMR_DEBUG_OUTPUT_CONSOLE) && !defined(PG_DEBUG_WINDOW)
+# error "Debugging turned on, but no output specified!"
+# endif
+
+namespace PokeGen
{
- PKMR_DEBUG_EMERGENCY = 0,
- PKMR_DEBUG_ALERT = 1,
- PKMR_DEBUG_CRITICAL_ERROR = 2,
- PKMR_DEBUG_ERROR = 3,
- PKMR_DEBUG_WARNING = 4,
- PKMR_DEBUG_NOTICE = 5,
- PKMR_DEBUG_INFO = 6,
- PKMR_DEBUG_DEBUG = 7
-};
+ namespace PokeModr
+ {
+ enum PokeModrDebug
+ {
+ PKMR_DEBUG_EMERGENCY = 0,
+ PKMR_DEBUG_ALERT = 1,
+ PKMR_DEBUG_CRITICAL_ERROR = 2,
+ PKMR_DEBUG_ERROR = 3,
+ PKMR_DEBUG_WARNING = 4,
+ PKMR_DEBUG_NOTICE = 5,
+ PKMR_DEBUG_INFO = 6,
+ PKMR_DEBUG_DEBUG = 7
+ };
+ }
+}
+
#endif
#endif
|
