diff --git a/CHANGELOG.md b/CHANGELOG.md index ea4f231..5111a42 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +###PkmGCTools v1.2.3: +Fixing a problem with japanese characters. + ###PkmGCTools v1.2.2: Few changes this week: * The PID of a Pokémon can now be displayed either in hexadecimal or in decimal (default: hexadecimal). diff --git a/LibPkmGC/include/LibPkmGC/Base/Pokemon.h b/LibPkmGC/include/LibPkmGC/Base/Pokemon.h index fe3c74c..0bf81bc 100644 --- a/LibPkmGC/include/LibPkmGC/Base/Pokemon.h +++ b/LibPkmGC/include/LibPkmGC/Base/Pokemon.h @@ -49,6 +49,8 @@ public: virtual Pokemon* clone(void) const = 0; virtual Pokemon* create(void) const = 0; + void updateNamesLanguage(void); + static u16 calculateStat(size_t statIndex, PokemonSpeciesIndex species, PokemonNatureIndex natureIndex, u8 level, u8 IV, u8 EV); static void calculateStats(PokemonSpeciesIndex species, PokemonNatureIndex natureIndex, u8 level, const u8 IVs[6], const u8 EVs[6], u16 outStats[6]); static u8 calculateLevelFromExp(PokemonSpeciesIndex species, u32 experience); diff --git a/LibPkmGC/include/LibPkmGC/Core/Config.h b/LibPkmGC/include/LibPkmGC/Core/Config.h index be64292..ba28850 100644 --- a/LibPkmGC/include/LibPkmGC/Core/Config.h +++ b/LibPkmGC/include/LibPkmGC/Core/Config.h @@ -22,7 +22,7 @@ #include #include -#define LIBPKMGC_VERSION 1002002 +#define LIBPKMGC_VERSION 1002003 #define LIBPKMGC_VERSION_MAJOR ((LIBPKMGC_VERSION / 1000000) % 1000) #define LIBPKMGC_VERSION_MINOR ((LIBPKMGC_VERSION / 1000) % 1000) #define LIBPKMGC_VERSION_BUILD (LIBPKMGC_VERSION % 1000) diff --git a/LibPkmGC/src/LibPkmGC/Base/Pokemon.cpp b/LibPkmGC/src/LibPkmGC/Base/Pokemon.cpp index a85355e..6101aed 100644 --- a/LibPkmGC/src/LibPkmGC/Base/Pokemon.cpp +++ b/LibPkmGC/src/LibPkmGC/Base/Pokemon.cpp @@ -24,6 +24,11 @@ namespace LibPkmGC { namespace Base { +void Pokemon::updateNamesLanguage(void) { + OTName->setCharset(version.language == Japanese); + name->setCharset(version.language == Japanese); +} + u16 Pokemon::calculateStat(size_t statIndex, PokemonSpeciesIndex species, PokemonNatureIndex natureIndex, u8 level, u8 IV, u8 EV){ static const u16 n[3] = { 110, 100, 90 }; @@ -251,6 +256,10 @@ void Pokemon::swap(Pokemon& other) { SW(ballCaughtWith); SW(levelMet); SW(OTGender); + + SW(version); + updateNamesLanguage(); + other.updateNamesLanguage(); if (OTName->isGBA() == other.OTName->isGBA()) SW(OTName); else { @@ -275,7 +284,7 @@ void Pokemon::swap(Pokemon& other) { SW(PID); SW(GCUnk); - SW(version); + SW(partyData); @@ -301,6 +310,8 @@ void Pokemon::swap(Pokemon& other) { bool i1 = isMarkedAsInvalid(), i2 = other.isMarkedAsInvalid(); setInvalidPokemonFlag(i2); setInvalidPokemonFlag(i1); + + } void Pokemon::copyNonVirtual(Pokemon const& other) { @@ -345,6 +356,7 @@ Pokemon & Pokemon::operator=(Pokemon const & other){ if (this != &other) { Base::DataStruct::operator=(other); copyNonVirtual(other); + updateNamesLanguage(); *OTName = *(other.OTName); *name = *(other.name); setEggFlag(other.isEgg()); diff --git a/LibPkmGC/src/LibPkmGC/Colosseum/Common/Pokemon.cpp b/LibPkmGC/src/LibPkmGC/Colosseum/Common/Pokemon.cpp index d0a22f9..1524cdf 100644 --- a/LibPkmGC/src/LibPkmGC/Colosseum/Common/Pokemon.cpp +++ b/LibPkmGC/src/LibPkmGC/Colosseum/Common/Pokemon.cpp @@ -112,6 +112,8 @@ void Pokemon::loadFields(void) { normalizepokerus(); normalizeStatus(); + updateNamesLanguage(); + } void Pokemon::save(void) { @@ -130,9 +132,13 @@ void Pokemon::save(void) { SV_FIELD_E_MAX(u8, OTGender, 0x10, Gender, Female); SV_FIELD(u16, SID, 0x14); SV_FIELD(u16, TID, 0x16); + + updateNamesLanguage(); + OTName->save(data + 0x18, 10); name->save(data + 0x2e, 10); name->save(data + 0x44, 10); + SV_FIELD_MAX(u32, experience, 0x5c, getSpeciesExpTable(species)[100]); if (partyData.level > 100) partyData.level = 100; diff --git a/LibPkmGC/src/LibPkmGC/GBA/Detail/GBACharTables.cpp b/LibPkmGC/src/LibPkmGC/GBA/Detail/GBACharTables.cpp index c9e57ba..4dfe3ec 100644 --- a/LibPkmGC/src/LibPkmGC/GBA/Detail/GBACharTables.cpp +++ b/LibPkmGC/src/LibPkmGC/GBA/Detail/GBACharTables.cpp @@ -393,7 +393,7 @@ inline chartable_t initJapCharTable(void) { tbl.insert(charset_t(0xAB, 0xFF01)); tbl.insert(charset_t(0xAC, 0xFF1F)); tbl.insert(charset_t(0xAD, 0x3002)); - tbl.insert(charset_t(0xAE, 0xFF0D)); + tbl.insert(charset_t(0xAE, 0x30FC)); tbl.insert(charset_t(0xAF, 0x30FB)); tbl.insert(charset_t(0xB0, 0x2025)); tbl.insert(charset_t(0xB1, 0x300E)); diff --git a/LibPkmGC/src/LibPkmGC/GBA/Pokemon.cpp b/LibPkmGC/src/LibPkmGC/GBA/Pokemon.cpp index f0d88f2..c7f5537 100644 --- a/LibPkmGC/src/LibPkmGC/GBA/Pokemon.cpp +++ b/LibPkmGC/src/LibPkmGC/GBA/Pokemon.cpp @@ -53,6 +53,7 @@ Pokemon::Pokemon(Pokemon const& other) : Base::Pokemon(other) { setEggFlag(other.isEgg()); setSecondAbilityFlag(other.hasSecondAbility()); setInvalidPokemonFlag(other.isMarkedAsInvalid()); + updateNamesLanguage(); } void Pokemon::swap(Pokemon& other) { Base::Pokemon::swap(other); @@ -294,6 +295,9 @@ void Pokemon::loadFields(void) { normalizeStatus(); if (!checkChecksum(false)) setInvalidPokemonFlag(true); + + updateNamesLanguage(); + } @@ -318,6 +322,7 @@ void Pokemon::save(void) { version.save(lg, gm); normalizepokerus(); + updateNamesLanguage(); name->save(data + 8, 10); OTName->save(data + 20, 7); diff --git a/LibPkmGC/src/LibPkmGC/XD/Common/Pokemon.cpp b/LibPkmGC/src/LibPkmGC/XD/Common/Pokemon.cpp index 5497024..a795a24 100644 --- a/LibPkmGC/src/LibPkmGC/XD/Common/Pokemon.cpp +++ b/LibPkmGC/src/LibPkmGC/XD/Common/Pokemon.cpp @@ -124,6 +124,7 @@ void Pokemon::loadFields(void) { pkmFlags[LIBPKMGC_GC_SECOND_ABILITY_FLAG] = isSecondAbilityDefined() && pkmFlags[LIBPKMGC_GC_SECOND_ABILITY_FLAG]; normalizepokerus(); normalizeStatus(); + updateNamesLanguage(); } @@ -171,6 +172,10 @@ void Pokemon::save(void) { SV_FIELD(u32, st, 0x2c); SV_FIELD_B(u8, obedient, 0x30); SV_FIELD(u8, encounterType, 0x33); + + version.save(data + 0x34); + updateNamesLanguage(); + OTName->save(data + 0x38, 10); name->save(data + 0x4e, 10); name->save(data + 0x64, 10); @@ -191,7 +196,6 @@ void Pokemon::save(void) { SV_FIELD(u16, shadowPkmID, 0xba); - version.save(data + 0x34); for (size_t i = 0; i < 4; ++i) moves[i].save(data + 0x80 + 4 * i); diff --git a/PkmGCSaveEditor/src/Core/Globals.h b/PkmGCSaveEditor/src/Core/Globals.h index f43705c..5912aee 100644 --- a/PkmGCSaveEditor/src/Core/Globals.h +++ b/PkmGCSaveEditor/src/Core/Globals.h @@ -19,7 +19,7 @@ #ifndef _PKMGCSAVEEDITOR_GLOBALS_H #define _PKMGCSAVEEDITOR_GLOBALS_H -#define PKMGCSAVEEDITOR_VERSION 1002002 +#define PKMGCSAVEEDITOR_VERSION 1002003 #define PKMGCSAVEEDITOR_VERSION_MAJOR ((PKMGCSAVEEDITOR_VERSION / 1000000) % 1000) #define PKMGCSAVEEDITOR_VERSION_MINOR ((PKMGCSAVEEDITOR_VERSION / 1000) % 1000) #define PKMGCSAVEEDITOR_VERSION_BUILD (PKMGCSAVEEDITOR_VERSION % 1000) diff --git a/PkmGCSaveEditor/src/GCUIs/PokemonUI.cpp b/PkmGCSaveEditor/src/GCUIs/PokemonUI.cpp index 2b735b6..8ac2fb0 100644 --- a/PkmGCSaveEditor/src/GCUIs/PokemonUI.cpp +++ b/PkmGCSaveEditor/src/GCUIs/PokemonUI.cpp @@ -643,12 +643,14 @@ void PokemonUI::saveChanges(void){ pkm->ballCaughtWith = ballCaughtWithFld->currentItemIndex(); pkm->obedient = obedientFld->isChecked(); + pkm->version = versionFld->info(); + pkm->updateNamesLanguage(); + OTField->trainerName(pkm->OTName); pkm->TID = OTField->TID(); pkm->SID = OTField->SID(); pkm->OTGender = OTField->trainerGender(); - pkm->version = versionFld->info(); pkm->partyData.currentHP = currentHPFld->unsignedValue(); for (size_t i = 0; i < 6; ++i) { diff --git a/PkmGCSaveEditor/translations/PkmGCSaveEditor_de.ts b/PkmGCSaveEditor/translations/PkmGCSaveEditor_de.ts index 9efe73f..8f26daa 100644 --- a/PkmGCSaveEditor/translations/PkmGCSaveEditor_de.ts +++ b/PkmGCSaveEditor/translations/PkmGCSaveEditor_de.ts @@ -888,17 +888,17 @@ Pokémon caught in XD always have this field checked Bänder - + Genderless Geschlechtslos - + Unown form: Icognito-Form: - + will evolve into: entwickelt sich zu: @@ -913,22 +913,22 @@ Pokémon caught in XD always have this field checked Als „ungültiges Pokémon“ markiert - + Location caught (see <a href='http://bulbapedia.bulbagarden.net/wiki/List_of_locations_by_index_number_(Generation_III)'>here</a>) Fangort (Details <a href='http://bulbapedia.bulbagarden.net/wiki/List_of_locations_by_index_number_(Generation_III)'>hier</a>) - + Location caught (see <a href='http://bulbapedia.bulbagarden.net/wiki/List_of_locations_by_index_number_(GCN)'>here</a>) Fangort (Details <a href='http://bulbapedia.bulbagarden.net/wiki/List_of_locations_by_index_number_(GCN)'>hier</a>) - + Warning Warnung - + The version info you specified is invalid. The game will therefore consider this Pokémon invalid. Die angegebene Spielversion ist nicht gültig. Das Spiel wird dieses Pokémon daher für ungültig halten. diff --git a/PkmGCSaveEditor/translations/PkmGCSaveEditor_en.ts b/PkmGCSaveEditor/translations/PkmGCSaveEditor_en.ts index 1207c97..bc92914 100644 --- a/PkmGCSaveEditor/translations/PkmGCSaveEditor_en.ts +++ b/PkmGCSaveEditor/translations/PkmGCSaveEditor_en.ts @@ -883,17 +883,17 @@ Pokémon caught in XD always have this field checked Ribbons - + Genderless Genderless - + Unown form: Unown form: - + will evolve into: will evolve into: @@ -908,22 +908,22 @@ Pokémon caught in XD always have this field checked "Invalid Pokémon" flag set - + Location caught (see <a href='http://bulbapedia.bulbagarden.net/wiki/List_of_locations_by_index_number_(Generation_III)'>here</a>) Location caught (see <a href='http://bulbapedia.bulbagarden.net/wiki/List_of_locations_by_index_number_(Generation_III)'>here</a>) - + Location caught (see <a href='http://bulbapedia.bulbagarden.net/wiki/List_of_locations_by_index_number_(GCN)'>here</a>) Location caught (see <a href='http://bulbapedia.bulbagarden.net/wiki/List_of_locations_by_index_number_(GCN)'>here</a>) - + Warning Warning - + The version info you specified is invalid. The game will therefore consider this Pokémon invalid. The version info you specified is invalid. The game will therefore consider this Pokémon invalid. diff --git a/PkmGCSaveEditor/translations/PkmGCSaveEditor_fr.ts b/PkmGCSaveEditor/translations/PkmGCSaveEditor_fr.ts index 9130380..6d08cf2 100644 --- a/PkmGCSaveEditor/translations/PkmGCSaveEditor_fr.ts +++ b/PkmGCSaveEditor/translations/PkmGCSaveEditor_fr.ts @@ -883,17 +883,17 @@ Les Pokémon attrapés dans XD ont toujours cette case cochée Rubans - + Genderless Asexué - + Unown form: Forme Zarbi : - + will evolve into: évoluera en : @@ -908,22 +908,22 @@ Les Pokémon attrapés dans XD ont toujours cette case cochée Drapeau "Pokémon invalide" activé - + Location caught (see <a href='http://bulbapedia.bulbagarden.net/wiki/List_of_locations_by_index_number_(Generation_III)'>here</a>) Lieu de capture (cf. <a href='http://bulbapedia.bulbagarden.net/wiki/List_of_locations_by_index_number_(Generation_III)'>Bulbapedia</a>) - + Location caught (see <a href='http://bulbapedia.bulbagarden.net/wiki/List_of_locations_by_index_number_(GCN)'>here</a>) Lieu de capture (cf. <a href='http://bulbapedia.bulbagarden.net/wiki/List_of_locations_by_index_number_(GCN)'>Bulbapedia</a>) - + Warning Avertissement - + The version info you specified is invalid. The game will therefore consider this Pokémon invalid. Les informations sur la version du jeu que vous avez entrées sont invalides. Le jeu considérera de ce fait ce Pokémon invalide.