summaryrefslogtreecommitdiffstats
path: root/pokemod/Pokemon.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2007-06-28 15:25:39 +0000
committerBen Boeckel <MathStuf@gmail.com>2007-06-28 15:25:39 +0000
commit9102febc37475af113681eaaee02ecc2ea04b4da (patch)
treead08b65668913258d28022f79b202ceaeddfb7c8 /pokemod/Pokemon.cpp
parent5c3ca621f75587173bab3d946aee81dd2d36f495 (diff)
downloadsigen-9102febc37475af113681eaaee02ecc2ea04b4da.tar.gz
sigen-9102febc37475af113681eaaee02ecc2ea04b4da.tar.xz
sigen-9102febc37475af113681eaaee02ecc2ea04b4da.zip
Minor various fixes, Dialog validation started, GUI fixes, String methods added
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@21 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemod/Pokemon.cpp')
-rw-r--r--pokemod/Pokemon.cpp184
1 files changed, 93 insertions, 91 deletions
diff --git a/pokemod/Pokemon.cpp b/pokemod/Pokemon.cpp
index 31b7ccd3..b699e540 100644
--- a/pokemod/Pokemon.cpp
+++ b/pokemod/Pokemon.cpp
@@ -102,25 +102,25 @@ void PokeGen::PokeMod::Pokemon::Validate()
LogVarNotValid("Pokemon", id, "frontMaleSprite", name);
isValid = false;
}
- if (!Path(pokemod->GetPath() + "images/pokemon/back/" + (pokemod->IsGenderAllowed() ? "male/" : "") + name + ".png").DoesExist())
+ if (!Path(pokemod->GetPath() + "images/pokemon/back/" + (pokemod->IsGenderAllowed() ? "male/" : "") + name + ".png").DoesExist())
{
LogVarNotSet("Pokemon", id, "backMaleSprite", name);
isValid = false;
- }
- if (pokemod->IsGenderAllowed())
- {
- if (!Path(pokemod->GetPath() + "images/pokemon/front/female/" + name + ".png").DoesExist())
- {
- LogVarNotValid("Pokemon", id, "frontFemaleSprite", name);
- isValid = false;
- }
- if (!Path(pokemod->GetPath() + "images/pokemon/back/female/" + name + ".png").DoesExist())
- {
- LogVarNotSet("Pokemon", id, "backFemaleSprite", name);
- isValid = false;
- }
- }
- if (!Path(pokemod->GetPath() + "images/pokemon/list/" + name + ".png").DoesExist())
+ }
+ if (pokemod->IsGenderAllowed())
+ {
+ if (!Path(pokemod->GetPath() + "images/pokemon/front/female/" + name + ".png").DoesExist())
+ {
+ LogVarNotValid("Pokemon", id, "frontFemaleSprite", name);
+ isValid = false;
+ }
+ if (!Path(pokemod->GetPath() + "images/pokemon/back/female/" + name + ".png").DoesExist())
+ {
+ LogVarNotSet("Pokemon", id, "backFemaleSprite", name);
+ isValid = false;
+ }
+ }
+ if (!Path(pokemod->GetPath() + "images/pokemon/list/" + name + ".png").DoesExist())
{
LogVarNotValid("Pokemon", id, "listSprite", name);
isValid = false;
@@ -361,36 +361,36 @@ void PokeGen::PokeMod::Pokemon::Validate(const wxListBox &output)
output.Append(ConsoleLogVarNotValid("Pokemon", id, "heightInches", name));
isValid = false;
}
- if (!Path(pokemod->GetPath() + "images/pokemon/front/male/" + name + ".png").DoesExist())
+ if (!Path(pokemod->GetPath() + "images/pokemon/front/male/" + name + ".png").DoesExist())
{
LogVarNotValid("Pokemon", id, "frontMaleSprite", name);
output.Append(ConsoleLogVarNotValid("Pokemon", id, "frontMaleSprite", name));
isValid = false;
}
- if (!Path(pokemod->GetPath() + "images/pokemon/back/male/" + name + ".png").DoesExist())
- {
- LogVarNotValid("Pokemon", id, "backMaleSprite", name);
- output.Append(ConsoleLogVarNotValid("Pokemon", id, "backMaleSprite", name));
- isValid = false;
- }
- if (!Path(pokemod->GetPath() + "images/pokemon/front/female/" + name + ".png").DoesExist())
- {
- LogVarNotValid("Pokemon", id, "frontFemaleSprite", name);
- output.Append(ConsoleLogVarNotValid("Pokemon", id, "frontFemaleSprite", name));
- isValid = false;
- }
- if (!Path(pokemod->GetPath() + "images/pokemon/back/female/" + name + ".png").DoesExist())
- {
- LogVarNotValid("Pokemon", id, "backFemaleSprite", name);
- output.Append(ConsoleLogVarNotValid("Pokemon", id, "backFemrontMaleSprite", name));
- isValid = false;
- }
- if (!Path(pokemod->GetPath() + "images/pokemon/list/" + name + ".png").DoesExist())
- {
- LogVarNotValid("Pokemon", id, "listSprite", name);
- output.Append(ConsoleLogVarNotValid("Pokemon", id, "listSprite", name));
- isValid = false;
- }
+ if (!Path(pokemod->GetPath() + "images/pokemon/back/male/" + name + ".png").DoesExist())
+ {
+ LogVarNotValid("Pokemon", id, "backMaleSprite", name);
+ output.Append(ConsoleLogVarNotValid("Pokemon", id, "backMaleSprite", name));
+ isValid = false;
+ }
+ if (!Path(pokemod->GetPath() + "images/pokemon/front/female/" + name + ".png").DoesExist())
+ {
+ LogVarNotValid("Pokemon", id, "frontFemaleSprite", name);
+ output.Append(ConsoleLogVarNotValid("Pokemon", id, "frontFemaleSprite", name));
+ isValid = false;
+ }
+ if (!Path(pokemod->GetPath() + "images/pokemon/back/female/" + name + ".png").DoesExist())
+ {
+ LogVarNotValid("Pokemon", id, "backFemaleSprite", name);
+ output.Append(ConsoleLogVarNotValid("Pokemon", id, "backFemrontMaleSprite", name));
+ isValid = false;
+ }
+ if (!Path(pokemod->GetPath() + "images/pokemon/list/" + name + ".png").DoesExist())
+ {
+ LogVarNotValid("Pokemon", id, "listSprite", name);
+ output.Append(ConsoleLogVarNotValid("Pokemon", id, "listSprite", name));
+ isValid = false;
+ }
if (!pokemod->GetPokemon(eggSpecies))
{
LogVarNotValid("Pokemon", id, "eggSpecies", name);
@@ -835,40 +835,40 @@ void PokeGen::PokeMod::Pokemon::SetPokedexEntry(const String &p)
pokedexEntry = p;
}
-void PokeGen::PokeMod::Pokemon::SetFrontMaleSprite(const Path &f)
+void PokeGen::PokeMod::Pokemon::SetFrontMaleSprite(Path &f)
{
LogSetVar("Pokemon", id, "frontMaleSprite", f, name);
f.CopyTo(pokemod->GetPath() + "pokemon/front/" + (pokemod->IsGenderAllowed() ? "male/" : "") + name + ".png");
}
-void PokeGen::PokeMod::Pokemon::SetBackMaleSprite(const Path &b)
+void PokeGen::PokeMod::Pokemon::SetBackMaleSprite(Path &b)
{
LogSetVar("Pokemon", id, "backMaleSprite", b, name);
- b.CopyTo(pokemod->GetPath() + "pokemon/back/" + (pokemod->IsGenderAllowed() ? "male/" : "") + name + ".png");
-}
-
-void PokeGen::PokeMod::Pokemon::SetFrontFemaleSprite(const Path &f)
-{
- if (pokemod->IsGenderAllowed())
- {
- LogSetVar("Pokemon", id, "frontFemaleSprite", f, name);
- f.CopyTo(pokemod->GetPath() + "pokemon/front/female/" + name + ".png");
- }
-}
-
-void PokeGen::PokeMod::Pokemon::SetBackFemaleSprite(const Path &b)
-{
- if (pokemod->IsGenderAllowed())
- {
- LogSetVar("Pokemon", id, "backFemaleSprite", b, name);
- b.CopyTo(pokemod->GetPath() + "pokemon/back/female/" + name + ".png");
- }
-}
-
-void PokeGen::PokeMod::Pokemon::SetListSprite(const Path &l)
+ b.CopyTo(pokemod->GetPath() + "pokemon/back/" + (pokemod->IsGenderAllowed() ? "male/" : "") + name + ".png");
+}
+
+void PokeGen::PokeMod::Pokemon::SetFrontFemaleSprite(Path &f)
+{
+ if (pokemod->IsGenderAllowed())
+ {
+ LogSetVar("Pokemon", id, "frontFemaleSprite", f, name);
+ f.CopyTo(pokemod->GetPath() + "pokemon/front/female/" + name + ".png");
+ }
+}
+
+void PokeGen::PokeMod::Pokemon::SetBackFemaleSprite(Path &b)
+{
+ if (pokemod->IsGenderAllowed())
+ {
+ LogSetVar("Pokemon", id, "backFemaleSprite", b, name);
+ b.CopyTo(pokemod->GetPath() + "pokemon/back/female/" + name + ".png");
+ }
+}
+
+void PokeGen::PokeMod::Pokemon::SetListSprite(Path &l)
{
LogSetVar("Pokemon", id, "listSprite", l, name);
- l.CopyTo(pokemod->GetPath() + "pokemon/list/" + name + ".png");
+ l.CopyTo(pokemod->GetPath() + "pokemon/list/" + name + ".png");
}
void PokeGen::PokeMod::Pokemon::SetGenderFactor(const Frac &g)
@@ -1044,37 +1044,39 @@ PokeGen::PokeMod::String PokeGen::PokeMod::Pokemon::GetPokedexEntry() const
bool PokeGen::PokeMod::Pokemon::GetFrontMaleSprite() const
{
LogFetchVar("Pokemon", id, "frontMaleSprite", -1, name);
- return Path(pokemod->GetPath() + "pokemon/front/" + (pokemod->IsGenderAllowed() ? "male/" : "") + name + ".png").DoesExist();
+ return Path(pokemod->GetPath() + "pokemon/front/" + (pokemod->IsGenderAllowed() ? "male/" : "") + name + ".png").DoesExist();
}
bool PokeGen::PokeMod::Pokemon::GetBackMaleSprite() const
{
- LogFetchVar("Pokemon", id, "backMaleSprite", -1, name);
- return Path(pokemod->GetPath() + "pokemon/back/" + (pokemod->IsGenderAllowed() ? "male/" : "") + name + ".png").DoesExist();
-}
-
-bool PokeGen::PokeMod::Pokemon::GetFrontFemaleSprite() const
-{
- if (pokemod->IsGenderAllowed())
- {
- LogFetchVar("Pokemon", id, "frontFemaleSprite", -1, name);
- return Path(pokemod->GetPath() + "pokemon/front/female/" + name + ".png").DoesExist();
- }
-}
-
-bool PokeGen::PokeMod::Pokemon::GetBackFemaleSprite() const
-{
- if (pokemod->IsGenderAllowed())
- {
- LogFetchVar("Pokemon", id, "backFemaleSprite", -1, name);
- return Path(pokemod->GetPath() + "pokemon/back/female/" + name + ".png").DoesExist();
- }
-}
-
+ LogFetchVar("Pokemon", id, "backMaleSprite", -1, name);
+ return Path(pokemod->GetPath() + "pokemon/back/" + (pokemod->IsGenderAllowed() ? "male/" : "") + name + ".png").DoesExist();
+}
+
+bool PokeGen::PokeMod::Pokemon::GetFrontFemaleSprite() const
+{
+ if (pokemod->IsGenderAllowed())
+ {
+ LogFetchVar("Pokemon", id, "frontFemaleSprite", -1, name);
+ return Path(pokemod->GetPath() + "pokemon/front/female/" + name + ".png").DoesExist();
+ }
+ return false;
+}
+
+bool PokeGen::PokeMod::Pokemon::GetBackFemaleSprite() const
+{
+ if (pokemod->IsGenderAllowed())
+ {
+ LogFetchVar("Pokemon", id, "backFemaleSprite", -1, name);
+ return Path(pokemod->GetPath() + "pokemon/back/female/" + name + ".png").DoesExist();
+ }
+ return false;
+}
+
bool PokeGen::PokeMod::Pokemon::GetListSprite() const
{
- LogFetchVar("Pokemon", id, "listSprite", -1, name);
- return Path(pokemod->GetPath() + "pokemon/list/" + name + ".png").DoesExist();
+ LogFetchVar("Pokemon", id, "listSprite", -1, name);
+ return Path(pokemod->GetPath() + "pokemon/list/" + name + ".png").DoesExist();
}
PokeGen::PokeMod::Frac PokeGen::PokeMod::Pokemon::GetGenderFactor() const