From 520ad3869427eab2c1091cbb082cb96e1b797f0f Mon Sep 17 00:00:00 2001 From: TuxSH Date: Sun, 13 Sep 2015 18:43:33 +0200 Subject: [PATCH] The maximum number for items has been raised to 999 --- CHANGELOG.md | 8 ++ CMakeLists.txt | 5 +- PkmGCSaveEditor/CMakeLists.txt | 1 - PkmGCSaveEditor/src/Core/ItemPocketEditor.cpp | 7 +- PkmGCSaveEditor/src/MainWindow.cpp | 23 ++- PkmGCSaveEditor/src/MainWindow.h | 3 +- .../translations/PkmGCSaveEditor_en.ts | 131 +++++++++--------- .../translations/PkmGCSaveEditor_fr.ts | 131 +++++++++--------- 8 files changed, 169 insertions(+), 140 deletions(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..a62b5f7 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,8 @@ +###PkmGCTools v1.1: +* GBA Pokémon are now **fully** supported. +* As a consequence onversion between Colosseum, XD and GBA Pokémon is now **fully** supported. + * It is done (almost) exactly like it is in Colosseum/XD during a GC<->GBA trade (meaning, for example, that the data specific to shadow Pokémon is lost). + * Please note that A-Save discards all party-related information (e.g status alteration). The Devil is in the detail... +* The maximum number for items has been raised to 999. +* Some bug fixes (Strategy Memo edition now working properly etc...). +* PkmGCSaveEditor now has an icon! \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index f63d2bf..90fd7b4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,6 +8,7 @@ set(CMAKE_INSTALL_PREFIX installdir) set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP ON) include(InstallRequiredSystemLibraries) install(FILES ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} DESTINATION bin COMPONENT Runtime) +install(FILES "CHANGELOG.md" DESTINATION bin COMPONENT Runtime) add_subdirectory(LibPkmGC) add_definitions(${LIBPKMGC_DEFINITIONS}) @@ -17,8 +18,8 @@ if(BUILD_PKMGCSAVEEDITOR) install(FILES ${LIBPKMGC_RUNTIME} DESTINATION bin COMPONENT Runtime) if(WIN32) - install(CODE "message(\"Running windeployqt\")" COMPONENT RUNTIME) - install(CODE "execute_process(COMMAND ${QT5_BINARY_DIR}/windeployqt.exe ${CMAKE_INSTALL_PREFIX}/bin/PkmGCSaveEditor.exe)") + install(CODE "if(EXISTS ${CMAKE_INSTALL_PREFIX}/bin/PkmGCSaveEditor.exe)\n message(\"Running windeployqt\")\nexecute_process(COMMAND ${QT5_BINARY_DIR}/windeployqt.exe ${CMAKE_INSTALL_PREFIX}/bin/PkmGCSaveEditor.exe)\nelse()\n message(\"Please rerun INSTALL once to install the required Qt libraries\")\n endif()" + COMPONENT RUNTIME) endif(WIN32) endif() diff --git a/PkmGCSaveEditor/CMakeLists.txt b/PkmGCSaveEditor/CMakeLists.txt index 49edac8..02ed504 100644 --- a/PkmGCSaveEditor/CMakeLists.txt +++ b/PkmGCSaveEditor/CMakeLists.txt @@ -20,7 +20,6 @@ set(PKMGCSAVEEDITOR_SUPPORTED_LANGUAGES en fr CACHE INTERNAL "PkmGCSaveEditor's get_target_property(QT5_QMAKE_EXECUTABLE Qt5::qmake IMPORTED_LOCATION) execute_process(COMMAND ${QT5_QMAKE_EXECUTABLE} -query QT_INSTALL_BINS OUTPUT_VARIABLE QT5_BINARY_DIR OUTPUT_STRIP_TRAILING_WHITESPACE) -message(${QT5_BINARY_DIR}) set(QT5_BINARY_DIR ${QT5_BINARY_DIR} CACHE INTERNAL "Qt5 bin dir" FORCE) if(Qt5LinguistTools_FOUND) diff --git a/PkmGCSaveEditor/src/Core/ItemPocketEditor.cpp b/PkmGCSaveEditor/src/Core/ItemPocketEditor.cpp index 0afbad3..39de932 100644 --- a/PkmGCSaveEditor/src/Core/ItemPocketEditor.cpp +++ b/PkmGCSaveEditor/src/Core/ItemPocketEditor.cpp @@ -91,12 +91,11 @@ void ItemPocketEditor::setEditedItem(LibPkmGC::Item const & val){ } void ItemPocketEditor::updateMaxQuantity(void) { - const int maxqty[] = { 0, 99, 99, 99, 99, 1, 99, 1 }; - const int maxqtyPC[] = { 0, 999, 999, 999, 999, 1, 999, 1 }; + const int maxqty[] = { 0, 999, 999, 999, 999, 1, 999, 1 }; ItemCategoryIndex ctgy = getItemCategory(itemNameFld->currentItemIndex(), isXD); - quantityFld->setRange(0, (flags == GIVABLE_ITEMS_ALLOWED) ? maxqtyPC[(size_t)ctgy] : maxqty[(size_t)ctgy]); - quantityFld->setDisabled(maxqty[(size_t)ctgy] == 0); + quantityFld->setRange(0, maxqty[ctgy]); + quantityFld->setDisabled(maxqty[ctgy] == 0); } void ItemPocketEditor::displayItem(void) { QTableWidgetItem *it = tbl->currentItem(); diff --git a/PkmGCSaveEditor/src/MainWindow.cpp b/PkmGCSaveEditor/src/MainWindow.cpp index 5e697fc..de3826f 100644 --- a/PkmGCSaveEditor/src/MainWindow.cpp +++ b/PkmGCSaveEditor/src/MainWindow.cpp @@ -102,16 +102,16 @@ MainWindow::MainWindow() : QMainWindow(), centralWidget(new MWCentralWidget) { optionsMenu = menuBar()->addMenu(tr("&Options")); interfaceLangSubMenu = optionsMenu->addMenu(tr("&Interface language")); dumpedNamesLangSubMenu = optionsMenu->addMenu(tr("&Dumped names language")); - + ignoreDataCorruptionAction = new QAction(this); + ignoreDataCorruptionAction->setCheckable(true); + optionsMenu->addAction(ignoreDataCorruptionAction); setCentralWidget(centralWidget); - connect(openFileAction, SIGNAL(triggered()), this, SLOT(openSaveFile())); - connect(saveFileAction, SIGNAL(triggered()), this, SLOT(saveSaveFile())); - connect(saveFileAsAction, SIGNAL(triggered()), this, SLOT(saveSaveFileAs())); - connect(exitAction, SIGNAL(triggered()), this, SLOT(close())); + loadSettings(); + ignoreDataCorruptionAction->setChecked(ignoreDataCorruption); createInterfaceLanguageMenu(); createDumpedNamesLanguageMenu(); interfaceLanguageChanged(interfaceLangGroup->checkedAction()); @@ -121,6 +121,12 @@ MainWindow::MainWindow() : QMainWindow(), centralWidget(new MWCentralWidget) { saveFileAction->setDisabled(true); saveFileAsAction->setDisabled(true); + + connect(openFileAction, SIGNAL(triggered()), this, SLOT(openSaveFile())); + connect(saveFileAction, SIGNAL(triggered()), this, SLOT(saveSaveFile())); + connect(saveFileAsAction, SIGNAL(triggered()), this, SLOT(saveSaveFileAs())); + connect(exitAction, SIGNAL(triggered()), this, SLOT(close())); + connect(ignoreDataCorruptionAction, SIGNAL(triggered()), this, SLOT(changeIgnoreDataCorruptionStatus())); } void MainWindow::createDumpedNamesLanguageMenu(void) { @@ -209,6 +215,8 @@ void MainWindow::updateText(void) { for (QList::iterator it = actions2.begin() + 1; it != actions2.end(); ++it) (*it)->setText(VersionInfoLayout::languageNames()[(*it)->data().toInt()]); + + ignoreDataCorruptionAction->setText(tr("Ignore data corruption")); } @@ -243,7 +251,6 @@ QString MainWindow::loadInterfaceLanguage(QString const& language) { switchTranslator(translator, fileName); switchTranslator(translatorQt, langPath + QString("qt_%1.qm").arg(lg)); // Note that qt_en.qm does not exist, which is normal :) - switchTranslator(translatorQt, langPath + QString("qtbase_%1.qm").arg(lg)); // For Qt > 5.3 updateText(); @@ -258,6 +265,10 @@ void MainWindow::dumpedNamesLanguageChanged(QAction* action) { if (action != NULL) dumpedNamesLanguage = (LanguageIndex)action->data().toInt(); } +void MainWindow::changeIgnoreDataCorruptionStatus(void) { + ignoreDataCorruption = ignoreDataCorruptionAction->isChecked(); +} + void MainWindow::changeEvent(QEvent* ev) { if (ev == NULL) return; switch (ev->type()) { diff --git a/PkmGCSaveEditor/src/MainWindow.h b/PkmGCSaveEditor/src/MainWindow.h index f7fc74b..81c3008 100644 --- a/PkmGCSaveEditor/src/MainWindow.h +++ b/PkmGCSaveEditor/src/MainWindow.h @@ -73,6 +73,7 @@ public slots: void interfaceLanguageChanged(QAction* action); void dumpedNamesLanguageChanged(QAction* action); + void changeIgnoreDataCorruptionStatus(void); protected: @@ -92,11 +93,11 @@ private: QAction *openFileAction, *saveFileAction, *saveFileAsAction, *exitAction; QMenu *optionsMenu; - QAction* ignoreDataCorruptionAction; QMenu* interfaceLangSubMenu; QActionGroup *interfaceLangGroup; QMenu* dumpedNamesLangSubMenu; QActionGroup *dumpedNamesLangGroup; + QAction* ignoreDataCorruptionAction; QSettings *settings; QTranslator translator, translatorQt; diff --git a/PkmGCSaveEditor/translations/PkmGCSaveEditor_en.ts b/PkmGCSaveEditor/translations/PkmGCSaveEditor_en.ts index cde6611..ae9a24d 100644 --- a/PkmGCSaveEditor/translations/PkmGCSaveEditor_en.ts +++ b/PkmGCSaveEditor/translations/PkmGCSaveEditor_en.ts @@ -757,49 +757,49 @@ Ribbons - + Genderless Genderless - + Unown form: Unown form: - + will evolve into: will evolve into: - - + + Invalid version info Invalid version info - - + + "Invalid Pokémon" flag set "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. @@ -894,32 +894,32 @@ MWCentralWidget - + Game configuration Game configuration - + Trainer info, Party and Bag Trainer info, Party and Bag - + PC PC - + Daycare Daycare - + Strategy memo Strategy memo - + Purifier Purifier @@ -927,142 +927,147 @@ MainWindow - - + + &File &File - - + + &Options &Options - - + + &Interface language &Interface language - - + + &Dumped names language &Dumped names language - + &Open... &Open... - + &Save &Save - + Save &as... Save &as... - + &Exit &Exit - - + + Select &automatically Select &automatically - - - + + Ignore data corruption + Ignore data corruption + + + + + GCI save files (*.gci) GCI save files (*.gci) - - - + + + Raw save files (*.bin) Raw save files (*.bin) - + The save file has been modified. The save file has been modified. - + Do you want to save your changes? Do you want to save your changes? - + Could not open file. Could not open file. - + An error occured while reading the specified save file. An error occured while reading the specified save file. - + Open save file Open save file - + All Files (*) All Files (*) - - - - - - + + + + + + Error Error - + Invalid file size. Invalid file size. - - + + Warning Warning - + The backup save slot was loaded because the most recent save slot is corrupt. The backup save slot was loaded because the most recent save slot is corrupt. - + The second backup save slot was loaded because the other ones are corrupt. The second backup save slot was loaded because the other ones are corrupt. - + All save slots are corrupt. All save slots are corrupt. - + No save file loaded No save file loaded - + %1, %n save(s) %1, %n save @@ -1070,32 +1075,32 @@ - + Colosseum Colosseum - + XD XD - + Could not write to file. Could not write to file. - + An error occured while writing to the specified save file. An error occured while writing to the specified save file. - + All files (*) All files (*) - + Save save file Save save file diff --git a/PkmGCSaveEditor/translations/PkmGCSaveEditor_fr.ts b/PkmGCSaveEditor/translations/PkmGCSaveEditor_fr.ts index 844f71e..894249b 100644 --- a/PkmGCSaveEditor/translations/PkmGCSaveEditor_fr.ts +++ b/PkmGCSaveEditor/translations/PkmGCSaveEditor_fr.ts @@ -757,49 +757,49 @@ Rubans - + Genderless Asexué - + Unown form: Forme Zarbi : - + will evolve into: évoluera en : - - + + Invalid version info Infos de version invalides - - + + "Invalid Pokémon" flag set 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. @@ -894,32 +894,32 @@ MWCentralWidget - + Game configuration Configuration du jeu - + Trainer info, Party and Bag Infos dresseur, Equipe et Sac - + PC PC - + Daycare Pension - + Strategy memo Mémo - + Purifier Purificateur @@ -927,142 +927,147 @@ MainWindow - - + + &File &Fichier - - + + &Options &Options - - + + &Interface language Langue de l'&interface - - + + &Dumped names language Langue des noms &extraits - + &Open... &Ouvrir... - + &Save &Enregistrer - + Save &as... Enregistrer &sous... - + &Exit &Quitter - - + + Select &automatically Sélectionner &automatiquement - - - + + Ignore data corruption + Ignorer la corruption des données + + + + + GCI save files (*.gci) Fichiers de sauvegarde GCI (*.gci) - - - + + + Raw save files (*.bin) Fichiers de sauvegarde bruts (*.bin) - + The save file has been modified. Le fichier de sauvegarde a été modifié. - + Do you want to save your changes? Voulez-vous enregistrer vos modifications ? - + Could not open file. Impossible d'ouvrir le fichier. - + An error occured while reading the specified save file. Une erreur s'est produite durant la lecture du fichier de sauvegarde. - + Open save file Ouvrir fichier de sauvegarde - + All Files (*) Tous les fichiers (*) - - - - - - + + + + + + Error Erreur - + Invalid file size. Taille de fichier invalide - - + + Warning Avertissement - + The backup save slot was loaded because the most recent save slot is corrupt. L'emplacement de sauvegarde de secours a été chargé car l'emplacement le plus récent est corrompu - + The second backup save slot was loaded because the other ones are corrupt. Le deuxième emplacement de sauvegarde de secours a été chargé car l'emplacement le plus récent est corrompu - + All save slots are corrupt. Tous les emplacements de sauvegarde sont corrompus. - + No save file loaded Aucune sauvegarde chargée - + %1, %n save(s) %1, %n sauvegarde @@ -1070,32 +1075,32 @@ - + Colosseum Colosseum - + XD XD - + Could not write to file. Impossible d'écrire dans le fichier. - + An error occured while writing to the specified save file. Une erreur s'est produite pendant l'écriture des données sur le fichier de sauvegarde. - + All files (*) Tous les fichiers (*) - + Save save file Sauvegarder fichier de sauvegarde