From fc3046a7e917458e024d76fd37ec531ce7efe217 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sun, 24 Feb 2008 02:38:08 +0000 Subject: [FIX] Include cleanup [FIX] Consolidate skins into Pokemod UI forms [FIX] Now using KMainWindow [FIX] Some code for the tree set up git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@79 6ecfd1a5-f3ed-3746-8530-beee90d26b22 --- Changelog | 10 + pokemod/MapEffect.cpp | 4 +- pokemod/MapTrainer.cpp | 8 +- pokemod/MapTrainer.h | 2 - pokemod/Object.h | 2 +- pokemodr/AbilityUI.h | 2 +- pokemodr/AuthorUI.h | 2 +- pokemodr/BadgeUI.h | 2 - pokemodr/CoinListObjectUI.h | 2 - pokemodr/CoinListUI.h | 2 - pokemodr/EggGroupUI.h | 2 - pokemodr/ItemTypeUI.h | 5 - pokemodr/ItemUI.h | 2 - pokemodr/MapTrainerTeamMemberUI.h | 2 - pokemodr/MapUI.h | 2 - pokemodr/MapWarpUI.h | 2 - pokemodr/MapWildListEncounterUI.h | 2 - pokemodr/MapWildListUI.h | 2 - pokemodr/MoveUI.h | 2 - pokemodr/NatureUI.h | 2 - pokemodr/ObjectUI.h | 35 ++ pokemodr/PokeModTreeItem.h | 20 +- pokemodr/PokeModrUI.cpp | 99 +++++- pokemodr/PokeModrUI.h | 4 +- pokemodr/PokemodUI.cpp | 146 +++++++++ pokemodr/PokemodUI.h | 8 +- pokemodr/RulesUI.h | 2 - pokemodr/SpeciesAbilityUI.h | 2 - pokemodr/SpeciesItemUI.h | 2 - pokemodr/SpeciesMoveUI.h | 2 - pokemodr/SpeciesUI.h | 2 - pokemodr/StoreUI.h | 2 - pokemodr/TODO | 3 +- pokemodr/TileUI.h | 2 - pokemodr/TimeUI.h | 2 - pokemodr/TypeUI.h | 2 - pokemodr/gui/pokemod.ui | 674 ++++++++++++++++++++++++++++++-------- pokemodr/gui/pokemodr.ui | 12 +- pokemodr/images/overlays.qrc | 14 +- pokemodr/pokemodr.pro | 12 +- 40 files changed, 864 insertions(+), 240 deletions(-) diff --git a/Changelog b/Changelog index 1eafde85..3e20848f 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,13 @@ +----------------- +Rev: 79 +Date: 23 February 2008 +User: MathStuf +----------------- +[FIX] Include cleanup +[FIX] Consolidate skins into Pokemod UI forms +[FIX] Now using KMainWindow +[FIX] Some code for the tree set up + ----------------- Rev: 78 Date: 23 February 2008 diff --git a/pokemod/MapEffect.cpp b/pokemod/MapEffect.cpp index c7c2c1c1..5ca7f96f 100644 --- a/pokemod/MapEffect.cpp +++ b/pokemod/MapEffect.cpp @@ -69,7 +69,7 @@ bool MapEffect::validate() const pokemod->validationMsg("Invalid existence flag status"); valid = false; } - if (!QFile::exists(QString("%1/image/skin/%2.png").arg(pokemod->getPath()).arg(skin))) + if (!QFile::exists(getSkin())) { pokemod->validationMsg(QString("Skin not found")); valid = false; @@ -286,7 +286,7 @@ Flag MapEffect::getExistFlag() const QString MapEffect::getSkin() const { - return skin; + return QString("%1/image/skin/%2.png").arg(pokemod->getPath()).arg(skin); } int MapEffect::getEffect() const diff --git a/pokemod/MapTrainer.cpp b/pokemod/MapTrainer.cpp index 306b50ec..cd6b4c98 100644 --- a/pokemod/MapTrainer.cpp +++ b/pokemod/MapTrainer.cpp @@ -69,7 +69,7 @@ bool MapTrainer::validate() const pokemod->validationMsg("Name is not defined"); valid = false; } - if (!QFile::exists(QString("%1/image/skin/%2.png").arg(pokemod->getPath()).arg(skin))) + if (!QFile::exists(getSkin())) { pokemod->validationMsg("Skin could't be found"); valid = false; @@ -84,7 +84,7 @@ bool MapTrainer::validate() const pokemod->validationMsg("Invalid number of Pokémon for a fight"); valid = false; } - if (!QFile::exists(QString("%1/ai/%2.pai").arg(pokemod->getPath()).arg(ai))) + if (!QFile::exists(getAI())) { pokemod->validationMsg("AI file couldn\'t be found"); valid = false; @@ -314,7 +314,7 @@ Point MapTrainer::getCoordinate() const QString MapTrainer::getSkin() const { - return skin; + return QString("%1/image/skin/%2.png").arg(pokemod->getPath()).arg(skin); } int MapTrainer::getSight() const @@ -334,7 +334,7 @@ int MapTrainer::getNumFight() const QString MapTrainer::getAI() const { - return ai; + return QString("%1/ai/%2.pai").arg(pokemod->getPath()).arg(ai); } Flag MapTrainer::getAppearFlag() const diff --git a/pokemod/MapTrainer.h b/pokemod/MapTrainer.h index 467b3ac9..168c1053 100644 --- a/pokemod/MapTrainer.h +++ b/pokemod/MapTrainer.h @@ -65,11 +65,9 @@ class MapTrainer : public Object QString getName() const; Point getCoordinate() const; QString getSkin() const; - bool getSkinExists() const; int getSight() const; int getDirection() const; int getNumFight() const; - bool getAIExists() const; QString getAI() const; Flag getAppearFlag() const; int getOverworldDialog() const; diff --git a/pokemod/Object.h b/pokemod/Object.h index 6105d121..a0c774ef 100644 --- a/pokemod/Object.h +++ b/pokemod/Object.h @@ -62,7 +62,7 @@ class Object return (0 <= id); } - const QString& getClassName() const + QString getClassName() const { return className; } diff --git a/pokemodr/AbilityUI.h b/pokemodr/AbilityUI.h index 52ddb22d..a93253ea 100644 --- a/pokemodr/AbilityUI.h +++ b/pokemodr/AbilityUI.h @@ -23,12 +23,12 @@ #ifndef __POKEMODR_ABILITYUI__ #define __POKEMODR_ABILITYUI__ -#include #include #include #include "ObjectUI.h" + #include "ui_ability.h" class AbilityUI : public ObjectUI, private Ui::formAbility diff --git a/pokemodr/AuthorUI.h b/pokemodr/AuthorUI.h index d94b1f54..296a3d6e 100644 --- a/pokemodr/AuthorUI.h +++ b/pokemodr/AuthorUI.h @@ -23,12 +23,12 @@ #ifndef __POKEMODR_AUTHORUI__ #define __POKEMODR_AUTHORUI__ -#include #include #include #include "ObjectUI.h" + #include "ui_author.h" class AuthorUI : public ObjectUI, private Ui::formAuthor diff --git a/pokemodr/BadgeUI.h b/pokemodr/BadgeUI.h index 0f93152a..fec60b79 100644 --- a/pokemodr/BadgeUI.h +++ b/pokemodr/BadgeUI.h @@ -23,8 +23,6 @@ #ifndef __POKEMODR_BADGEUI__ #define __POKEMODR_BADGEUI__ -#include - #include #include diff --git a/pokemodr/CoinListObjectUI.h b/pokemodr/CoinListObjectUI.h index fbd7da60..53dae3aa 100644 --- a/pokemodr/CoinListObjectUI.h +++ b/pokemodr/CoinListObjectUI.h @@ -23,8 +23,6 @@ #ifndef __POKEMODR_COINLISTOBJECTUI__ #define __POKEMODR_COINLISTOBJECTUI__ -#include - #include #include "ObjectUI.h" diff --git a/pokemodr/CoinListUI.h b/pokemodr/CoinListUI.h index 6b32c534..d6b166a6 100644 --- a/pokemodr/CoinListUI.h +++ b/pokemodr/CoinListUI.h @@ -23,8 +23,6 @@ #ifndef __POKEMODR_COINLISTUI__ #define __POKEMODR_COINLISTUI__ -#include - #include #include diff --git a/pokemodr/EggGroupUI.h b/pokemodr/EggGroupUI.h index dcd89357..d5f8bd75 100644 --- a/pokemodr/EggGroupUI.h +++ b/pokemodr/EggGroupUI.h @@ -23,8 +23,6 @@ #ifndef __POKEMODR_EGGGROUPUI__ #define __POKEMODR_EGGGROUPUI__ -#include - #include #include diff --git a/pokemodr/ItemTypeUI.h b/pokemodr/ItemTypeUI.h index 32c98df3..923de180 100644 --- a/pokemodr/ItemTypeUI.h +++ b/pokemodr/ItemTypeUI.h @@ -23,11 +23,6 @@ #ifndef __POKEMODR_ITEMTYPEUI__ #define __POKEMODR_ITEMTYPEUI__ -#include - -#include -#include - #include #include "ObjectUI.h" diff --git a/pokemodr/ItemUI.h b/pokemodr/ItemUI.h index 1047f881..587e1481 100644 --- a/pokemodr/ItemUI.h +++ b/pokemodr/ItemUI.h @@ -23,8 +23,6 @@ #ifndef __POKEMODR_ITEMUI__ #define __POKEMODR_ITEMUI__ -#include - #include #include diff --git a/pokemodr/MapTrainerTeamMemberUI.h b/pokemodr/MapTrainerTeamMemberUI.h index c7082a19..42146d6f 100644 --- a/pokemodr/MapTrainerTeamMemberUI.h +++ b/pokemodr/MapTrainerTeamMemberUI.h @@ -23,8 +23,6 @@ #ifndef __POKEMODR_MAPTRAINERTEAMMEMBERUI__ #define __POKEMODR_MAPTRAINERTEAMMEMBERUI__ -#include - #include #include "ObjectUI.h" diff --git a/pokemodr/MapUI.h b/pokemodr/MapUI.h index 2fdd4de1..fdf7ef1f 100644 --- a/pokemodr/MapUI.h +++ b/pokemodr/MapUI.h @@ -23,8 +23,6 @@ #ifndef __POKEMODR_MAPUI__ #define __POKEMODR_MAPUI__ -#include - #include #include diff --git a/pokemodr/MapWarpUI.h b/pokemodr/MapWarpUI.h index 3d73ca5e..0201a400 100644 --- a/pokemodr/MapWarpUI.h +++ b/pokemodr/MapWarpUI.h @@ -23,8 +23,6 @@ #ifndef __POKEMODR_MAPWARPUI__ #define __POKEMODR_MAPWARPUI__ -#include - #include #include diff --git a/pokemodr/MapWildListEncounterUI.h b/pokemodr/MapWildListEncounterUI.h index e65e927b..cfbe3ef2 100644 --- a/pokemodr/MapWildListEncounterUI.h +++ b/pokemodr/MapWildListEncounterUI.h @@ -23,8 +23,6 @@ #ifndef __POKEMODR_MAPWILDLISTENCOUNTERUI__ #define __POKEMODR_MAPWILDLISTENCOUNTERUI__ -#include - #include #include "ObjectUI.h" diff --git a/pokemodr/MapWildListUI.h b/pokemodr/MapWildListUI.h index 5aa5d8bb..a37eec8a 100644 --- a/pokemodr/MapWildListUI.h +++ b/pokemodr/MapWildListUI.h @@ -23,8 +23,6 @@ #ifndef __POKEMODR_MAPWILDLISTUI__ #define __POKEMODR_MAPWILDLISTUI__ -#include - #include #include "ObjectUI.h" diff --git a/pokemodr/MoveUI.h b/pokemodr/MoveUI.h index a2ec8439..1248c491 100644 --- a/pokemodr/MoveUI.h +++ b/pokemodr/MoveUI.h @@ -23,8 +23,6 @@ #ifndef __POKEMODR_MOVEUI__ #define __POKEMODR_MOVEUI__ -#include - #include #include diff --git a/pokemodr/NatureUI.h b/pokemodr/NatureUI.h index 4b6f9e56..c7130fee 100644 --- a/pokemodr/NatureUI.h +++ b/pokemodr/NatureUI.h @@ -23,8 +23,6 @@ #ifndef __POKEMODR_NATUREUI__ #define __POKEMODR_NATUREUI__ -#include - #include #include diff --git a/pokemodr/ObjectUI.h b/pokemodr/ObjectUI.h index 691fcb1a..1901c1de 100644 --- a/pokemodr/ObjectUI.h +++ b/pokemodr/ObjectUI.h @@ -23,8 +23,11 @@ #ifndef __POKEMODR_OBJECTUI__ #define __POKEMODR_OBJECTUI__ +#include #include +#include +#include #include #include @@ -39,17 +42,40 @@ class ObjectUI : public QWidget public: ObjectUI(QWidget* parent) : QWidget(parent), + m_changed(false), obj(NULL), obj_mod(NULL) { connect(this, SIGNAL(changed(bool)), parent->parent()->parent()->parent(), SLOT(setChangedTitle(bool))); + connect(this, SIGNAL(changed(bool)), SLOT(setChanged(bool))); } virtual ~ObjectUI() { } + void closeEvent (QCloseEvent* event) + { + KDialog* dialog = new KDialog(this, Qt::Dialog); + dialog->setModal(true); + dialog->setCaption("My title"); + dialog->setButtons(KDialog::Yes | KDialog::No | KDialog::Cancel); + QLabel* label = new QLabel("You have unsaved changes, would you like to save them?", dialog); + dialog->setMainWidget(label); + connect(dialog, SIGNAL(yesClicked()), this, SLOT(on_buttonApply_clicked())); + connect(dialog, SIGNAL(noClicked()), this, SLOT(on_buttonDiscard_clicked())); + if (dialog->exec() == QDialog::Rejected) + event->ignore(); + else + event->accept(); + } + // virtual KToolBar getToolbar(QWidget* parent) = 0; + bool isChanged() const + { + return m_changed; + } + const Object* getOriginal() const { return obj; @@ -68,6 +94,13 @@ class ObjectUI : public QWidget } signals: void changed(bool); + public slots: + void setChanged(const bool c) + { + m_changed = c; + } + virtual void on_buttonApply_clicked() = 0; + virtual void on_buttonDiscard_clicked() = 0; protected: void setObjects(Object* orig, Object* mod) { @@ -77,6 +110,8 @@ class ObjectUI : public QWidget virtual void setGui() = 0; + bool m_changed; + Object* obj; Object* obj_mod; }; diff --git a/pokemodr/PokeModTreeItem.h b/pokemodr/PokeModTreeItem.h index c94886b0..0469d333 100644 --- a/pokemodr/PokeModTreeItem.h +++ b/pokemodr/PokeModTreeItem.h @@ -1,7 +1,7 @@ ///////////////////////////////////////////////////////////////////////////// // Name: pokegen/PokeModTreeItem.h -// Purpose: Subclass of QTreeItem that allows information to be tacked on -// as well +// Purpose: Subclass of QTreeWidgetItem that allows information to be +// tacked on as well // Author: Ben Boeckel // Modified by: Ben Boeckel // Created: Tue Jan 22 19:12:17 2008 @@ -34,16 +34,24 @@ class PokeModTreeItem : public QObject, public QTreeWidgetItem Q_OBJECT public: - PokeModTreeItem(Object& o, QTreeWidget* parent) : + PokeModTreeItem(Object* o, QTreeWidget* parent) : QTreeWidgetItem(parent, QTreeWidgetItem::UserType), - obj(&o) + obj(o) { + if (obj) + updateName(); } - Object& getObject() + const Object* getObject() const { - return *obj; + return obj; } + Object* getObject() + { + return obj; + } + public slots: + void updateName(); private: Object* obj; }; diff --git a/pokemodr/PokeModrUI.cpp b/pokemodr/PokeModrUI.cpp index 19e86090..a8490551 100644 --- a/pokemodr/PokeModrUI.cpp +++ b/pokemodr/PokeModrUI.cpp @@ -30,8 +30,8 @@ #include #include "PokeModrUI.h" +#include "PokeModTreeItem.h" -// Debugging includes #include "AbilityUI.h" #include "AuthorUI.h" #include "BadgeUI.h" @@ -41,7 +41,10 @@ #include "ItemUI.h" #include "ItemTypeUI.h" #include "MapUI.h" +#include "MapTrainerTeamMemberUI.h" #include "MapWarpUI.h" +#include "MapWildListUI.h" +#include "MapWildListEncounterUI.h" #include "MoveUI.h" #include "NatureUI.h" #include "PokemodUI.h" @@ -57,16 +60,16 @@ #include "TypeUI.h" PokeModrUI::PokeModrUI(KConfigGroup cfg, KConfigGroup history, QWidget* parent) : - QMainWindow(parent), + KMainWindow(parent), config(cfg), recent("&Recent Files...", NULL) { setupUi(this); QMetaObject::connectSlotsByName(this); -// recent.loadEntries(history); -// menuBar()->addMenu(helpMenu("", false)); -// restoreWindowSize(cfg); -// cfg.readEntry("splitterPos", 100); + recent.loadEntries(history); + menuBar()->addMenu(customHelpMenu(false)); + restoreWindowSize(cfg); + cfg.readEntry("splitterPos", 100); // if (cfg.readEntry("reloadOnStart", false).toBool()) // open(recent.urls().at(0)); @@ -115,6 +118,7 @@ void PokeModrUI::PokeModrUI::on_actionNew_triggered() void PokeModrUI::on_actionOpen_triggered() { + } void PokeModrUI::on_actionSave_triggered() @@ -149,6 +153,83 @@ void PokeModrUI::on_splitter_splitterMoved(const int pos) { } -// void PokeModrUI::on_treePokemod_itemChanged(QTreeWidgetItem* item) -// { -// } +void PokeModrUI::on_treePokemod_itemSelectionChanged() +{ + QTreeWidgetItem* cur = treePokemod->currentItem(); + PokeModTreeItem* selected = static_cast(treePokemod->selectedItems()[0]); + if (selected->getObject() || static_cast(formPanel->widget())->close()) + { + Object* o = selected->getObject(); + QString name(o->getClassName()); + ObjectUI* widget = NULL; + if (name == "Ability") + widget = new AbilityUI(static_cast(o), formPanel); +// else if (name == "AbilityEffect") +// widget = new AbilityEffectUI(static_cast(o), formPanel); + else if (name == "Author") + widget = new AuthorUI(static_cast(o), formPanel); + else if (name == "Badge") + widget = new BadgeUI(static_cast(o), formPanel); + else if (name == "CoinList") + widget = new CoinListUI(static_cast(o), formPanel); + else if (name == "CoinListObject") + widget = new CoinListObjectUI(static_cast(o), formPanel); +// else if (name == "Dialog") +// widget = new DialogUI(static_cast(o), formPanel); + else if (name == "EggGroup") + widget = new EggGroupUI(static_cast(o), formPanel); + else if (name == "Item") + widget = new ItemUI(static_cast(o), formPanel); +// else if (name == "ItemEffect") +// widget = new ItemEffectUI(static_cast(o), formPanel); + else if (name == "ItemType") + widget = new ItemTypeUI(static_cast(o), formPanel); + else if (name == "Map") + widget = new MapUI(static_cast(o), formPanel); +// else if (name == "MapEffect") +// widget = new MapEffectUI(static_cast(o), formPanel); +// else if (name == "MapTrainer") +// widget = new MapTrainerUI(static_cast(o), formPanel); + else if (name == "MapTrainerTeamMember") + widget = new MapTrainerTeamMemberUI(static_cast(o), formPanel); + else if (name == "MapWarp") + widget = new MapWarpUI(static_cast(o), formPanel); + else if (name == "MapWildList") + widget = new MapWildListUI(static_cast(o), formPanel); + else if (name == "MapWildListEncounter") + widget = new MapWildListEncounterUI(static_cast(o), formPanel); + else if (name == "Move") + widget = new MoveUI(static_cast(o), formPanel); +// else if (name == "MoveEffect") +// widget = new MoveEffectUI(static_cast(o), formPanel); + else if (name == "Nature") + widget = new NatureUI(static_cast(o), formPanel); + else if (name == "Pokemod") + widget = new PokemodUI(static_cast(o), formPanel); + else if (name == "Rules") + widget = new RulesUI(static_cast(o), formPanel); + else if (name == "Species") + widget = new SpeciesUI(static_cast(o), formPanel); + else if (name == "SpeciesAbility") + widget = new SpeciesAbilityUI(static_cast(o), formPanel); + else if (name == "SpeciesEvolution") + widget = new SpeciesEvolutionUI(static_cast(o), formPanel); + else if (name == "SpeciesItem") + widget = new SpeciesItemUI(static_cast(o), formPanel); + else if (name == "SpeciesMove") + widget = new SpeciesMoveUI(static_cast(o), formPanel); + else if (name == "Store") + widget = new StoreUI(static_cast(o), formPanel); + else if (name == "Tile") + widget = new TileUI(static_cast(o), formPanel); + else if (name == "Time") + widget = new TimeUI(static_cast(o), formPanel); + else if (name == "Type") + widget = new TypeUI(static_cast(o), formPanel); + formPanel->setWidget(widget); + connect(widget, SIGNAL(changed(bool)), selected, SLOT(updateName())); + formPanel->show(); + } + else + treePokemod->setCurrentItem(cur); +} diff --git a/pokemodr/PokeModrUI.h b/pokemodr/PokeModrUI.h index 89bc85ad..137c2c21 100644 --- a/pokemodr/PokeModrUI.h +++ b/pokemodr/PokeModrUI.h @@ -35,7 +35,7 @@ #include "ui_pokemodr.h" -class PokeModrUI : public QMainWindow, private Ui::formPokeModr +class PokeModrUI : public KMainWindow, private Ui::formPokeModr { Q_OBJECT @@ -55,7 +55,7 @@ class PokeModrUI : public QMainWindow, private Ui::formPokeModr void on_actionPaste_triggered(); void on_actionPreferences_triggered(); void on_splitter_splitterMoved(const int pos); -// void on_treePokemod_itemChanged(QTreeWidgetItem* item); + void on_treePokemod_itemSelectionChanged(); private: KConfigGroup config; KRecentFilesAction recent; diff --git a/pokemodr/PokemodUI.cpp b/pokemodr/PokemodUI.cpp index bb06b359..e6bb3f91 100644 --- a/pokemodr/PokemodUI.cpp +++ b/pokemodr/PokemodUI.cpp @@ -24,7 +24,9 @@ #include #include +#include +#include "ImageDialog.h" #include "PokemodUI.h" PokemodUI::PokemodUI(Pokemod* p, QWidget* parent) : @@ -80,6 +82,54 @@ void PokemodUI::setGui() varWarp->setCurrentIndex(varWarp->findData(pokemod_mod->getStartWarp())); varSuperPCUsername->setText(pokemod_mod->getSuperPCUname()); varSuperPCPassword->setText(pokemod_mod->getSuperPCPasswd()); + try + { + varWalkSkin->setIcon(ImageCache::open(pokemod->getWalkSkin())); + } + catch (OpenException& e) + { + BugCatcher::report(e); + } + try + { + varBikeSkin->setIcon(ImageCache::open(pokemod->getBikeSkin())); + } + catch (OpenException& e) + { + BugCatcher::report(e); + } + try + { + varFlySkin->setIcon(ImageCache::open(pokemod->getFlySkin())); + } + catch (OpenException& e) + { + BugCatcher::report(e); + } + try + { + varSurfSkin->setIcon(ImageCache::open(pokemod->getSurfSkin())); + } + catch (OpenException& e) + { + BugCatcher::report(e); + } + try + { + varFishSkin->setIcon(ImageCache::open(pokemod->getFishSkin())); + } + catch (OpenException& e) + { + BugCatcher::report(e); + } + try + { + varSurfFishSkin->setIcon(ImageCache::open(pokemod->getSurfFishSkin())); + } + catch (OpenException& e) + { + BugCatcher::report(e); + } } void PokemodUI::on_buttonApply_clicked() @@ -152,3 +202,99 @@ void PokemodUI::on_varSuperPCPassword_textChanged(const QString& p) pokemod_mod->setSuperPCPasswd(p); emit(changed(true)); } + +void PokemodUI::on_varWalkSkin_pressed() +{ + if (ImageDialog::exec()) + { + try + { + pokemod->setWalkSkin(ImageDialog::selectedUrl()); + } + catch (SaveException& e) + { + BugCatcher::report(e); + } + setGui(); + } +} + +void PokemodUI::on_varBikeSkin_pressed() +{ + if (ImageDialog::exec()) + { + try + { + pokemod->setBikeSkin(ImageDialog::selectedUrl()); + } + catch (SaveException& e) + { + BugCatcher::report(e); + } + setGui(); + } +} + +void PokemodUI::on_varFlySkin_pressed() +{ + if (ImageDialog::exec()) + { + try + { + pokemod->setFlySkin(ImageDialog::selectedUrl()); + } + catch (SaveException& e) + { + BugCatcher::report(e); + } + setGui(); + } +} + +void PokemodUI::on_varSurfSkin_pressed() +{ + if (ImageDialog::exec()) + { + try + { + pokemod->setSurfSkin(ImageDialog::selectedUrl()); + } + catch (SaveException& e) + { + BugCatcher::report(e); + } + setGui(); + } +} + +void PokemodUI::on_varFishSkin_pressed() +{ + if (ImageDialog::exec()) + { + try + { + pokemod->setFishSkin(ImageDialog::selectedUrl()); + } + catch (SaveException& e) + { + BugCatcher::report(e); + } + setGui(); + } +} + +void PokemodUI::on_varSurfFishSkin_pressed() +{ + if (ImageDialog::exec()) + { + try + { + pokemod->setSurfFishSkin(ImageDialog::selectedUrl()); + } + catch (SaveException& e) + { + BugCatcher::report(e); + } + setGui(); + } +} diff --git a/pokemodr/PokemodUI.h b/pokemodr/PokemodUI.h index 64f2275d..837500d0 100644 --- a/pokemodr/PokemodUI.h +++ b/pokemodr/PokemodUI.h @@ -23,8 +23,6 @@ #ifndef __POKEMODR_POKEMODUI__ #define __POKEMODR_POKEMODUI__ -#include - #include #include @@ -55,6 +53,12 @@ class PokemodUI : public ObjectUI, private Ui::formPokemod void on_varWarp_currentIndexChanged(const int s); void on_varSuperPCUsername_textChanged(const QString& u); void on_varSuperPCPassword_textChanged(const QString& p); + void on_varWalkSkin_pressed(); + void on_varBikeSkin_pressed(); + void on_varFlySkin_pressed(); + void on_varSurfSkin_pressed(); + void on_varFishSkin_pressed(); + void on_varSurfFishSkin_pressed(); private: void setGui(); diff --git a/pokemodr/RulesUI.h b/pokemodr/RulesUI.h index bf2c043b..061e69ca 100644 --- a/pokemodr/RulesUI.h +++ b/pokemodr/RulesUI.h @@ -23,8 +23,6 @@ #ifndef __POKEMODR_RULESUI__ #define __POKEMODR_RULESUI__ -#include - #include #include "ObjectUI.h" diff --git a/pokemodr/SpeciesAbilityUI.h b/pokemodr/SpeciesAbilityUI.h index cc31ac54..8f85daa3 100644 --- a/pokemodr/SpeciesAbilityUI.h +++ b/pokemodr/SpeciesAbilityUI.h @@ -23,8 +23,6 @@ #ifndef __POKEMODR_SPECIESABILITYUI__ #define __POKEMODR_SPECIESABILITYUI__ -#include - #include #include "ObjectUI.h" diff --git a/pokemodr/SpeciesItemUI.h b/pokemodr/SpeciesItemUI.h index 2e9c19b7..7538184d 100644 --- a/pokemodr/SpeciesItemUI.h +++ b/pokemodr/SpeciesItemUI.h @@ -23,8 +23,6 @@ #ifndef __POKEMODR_SPECIESITEMUI__ #define __POKEMODR_SPECIESITEMUI__ -#include - #include #include "ObjectUI.h" diff --git a/pokemodr/SpeciesMoveUI.h b/pokemodr/SpeciesMoveUI.h index 7e3c6f93..ed6f5647 100644 --- a/pokemodr/SpeciesMoveUI.h +++ b/pokemodr/SpeciesMoveUI.h @@ -23,8 +23,6 @@ #ifndef __POKEMODR_SPECIESMOVEUI__ #define __POKEMODR_SPECIESMOVEUI__ -#include - #include #include "ObjectUI.h" diff --git a/pokemodr/SpeciesUI.h b/pokemodr/SpeciesUI.h index 82536c48..bdfdfcf6 100644 --- a/pokemodr/SpeciesUI.h +++ b/pokemodr/SpeciesUI.h @@ -23,8 +23,6 @@ #ifndef __POKEMODR_SPECIESUI__ #define __POKEMODR_SPECIESUI__ -#include - #include #include diff --git a/pokemodr/StoreUI.h b/pokemodr/StoreUI.h index bb11f5a5..a3ebaa59 100644 --- a/pokemodr/StoreUI.h +++ b/pokemodr/StoreUI.h @@ -23,8 +23,6 @@ #ifndef __POKEMODR_STOREUI__ #define __POKEMODR_STOREUI__ -#include - #include #include diff --git a/pokemodr/TODO b/pokemodr/TODO index cff537df..b38e904f 100644 --- a/pokemodr/TODO +++ b/pokemodr/TODO @@ -1,5 +1,5 @@ AbilityEffect -Dialog +Dialog (with command dialogs) ItemEffect MapEffect MapTrainer @@ -11,4 +11,3 @@ Tree Handling Toolbar loading Menu stuff Help Menu -QMainWindow->KMainWindow diff --git a/pokemodr/TileUI.h b/pokemodr/TileUI.h index eb758b54..ef93b675 100644 --- a/pokemodr/TileUI.h +++ b/pokemodr/TileUI.h @@ -23,8 +23,6 @@ #ifndef __POKEMODR_TILEUI__ #define __POKEMODR_TILEUI__ -#include - #include #include diff --git a/pokemodr/TimeUI.h b/pokemodr/TimeUI.h index 404519e8..63e02840 100644 --- a/pokemodr/TimeUI.h +++ b/pokemodr/TimeUI.h @@ -23,8 +23,6 @@ #ifndef __POKEMODR_TIMEUI__ #define __POKEMODR_TIMEUI__ -#include - #include #include diff --git a/pokemodr/TypeUI.h b/pokemodr/TypeUI.h index d77f6cb7..57ec1482 100644 --- a/pokemodr/TypeUI.h +++ b/pokemodr/TypeUI.h @@ -23,8 +23,6 @@ #ifndef __POKEMODR_TYPEUI__ #define __POKEMODR_TYPEUI__ -#include - #include #include diff --git a/pokemodr/gui/pokemod.ui b/pokemodr/gui/pokemod.ui index 317cada0..a8eee900 100644 --- a/pokemodr/gui/pokemod.ui +++ b/pokemodr/gui/pokemod.ui @@ -5,8 +5,8 @@ 0 0 - 244 - 689 + 460 + 748 @@ -43,148 +43,522 @@ - - - Title - - - - - - The title of the PokéMod - - - true - - - - - - - - - - Version - - - - - - PokéMod version - - - true - - - - - - - - - - Description - - - - - - Description of the PokéMod - - - - - - - - - - Start Map + + + 0 - - - - - Map the player starts on - - - QComboBox::NoInsert - - - QComboBox::AdjustToContents - - - - - - - Warp - - - - - - Warp the player starts on - - - QComboBox::NoInsert - - - QComboBox::AdjustToContents - - - - - - - - - - - - - Super PC - - - - - - Username - - - - - - Username to access the Super PC - - - true - - - - - - - - - - Password - - - - - - Password to access the Super PC - - - true - - - - - - - + + + General + + + + + + Title + + + + + + The title of the PokéMod + + + true + + + + + + + + + + Version + + + + + + PokéMod version + + + true + + + + + + + + + + Description + + + + + + Description of the PokéMod + + + + + + + + + + Start Map + + + + + + Map the player starts on + + + QComboBox::NoInsert + + + QComboBox::AdjustToContents + + + + + + + Warp + + + + + + Warp the player starts on + + + QComboBox::NoInsert + + + QComboBox::AdjustToContents + + + + + + + + + + + + + Super PC + + + + + + Username + + + + + + Username to access the Super PC + + + true + + + + + + + + + + Password + + + + + + Password to access the Super PC + + + true + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Skins + + + + + + Walking + + + + 4 + + + 4 + + + 4 + + + 4 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 192 + 128 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + Biking + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 192 + 128 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + Flying + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 192 + 128 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + Surfing + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 192 + 128 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + Fishing + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 192 + 128 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + Surf Fishing + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 192 + 128 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + Qt::Vertical + + + + 424 + 16 + + + + + + + + + Typechart + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + @@ -194,8 +568,8 @@ - 20 - 40 + 452 + 16 @@ -208,6 +582,16 @@ QComboBox
kcombobox.h
+ + KIconButton + QPushButton +
kicondialog.h
+
+ + KIntNumInput + QWidget +
knuminput.h
+
KLineEdit QLineEdit diff --git a/pokemodr/gui/pokemodr.ui b/pokemodr/gui/pokemodr.ui index 21c52cd8..5ef9c1c2 100644 --- a/pokemodr/gui/pokemodr.ui +++ b/pokemodr/gui/pokemodr.ui @@ -1,6 +1,6 @@ formPokeModr - + 0 @@ -19,7 +19,7 @@ Qt::Horizontal - + PokéMod Elements @@ -44,7 +44,7 @@ 0 0 817 - 25 + 29 @@ -196,6 +196,12 @@
QScrollArea
1
+ + KMainWindow + QMainWindow +
kmainwindow.h
+ 1 +
diff --git a/pokemodr/images/overlays.qrc b/pokemodr/images/overlays.qrc index 0db7ffa1..98be3f31 100644 --- a/pokemodr/images/overlays.qrc +++ b/pokemodr/images/overlays.qrc @@ -1,11 +1,11 @@ - images/overlays/effect.png - images/overlays/no-walk.png - images/overlays/trainer.png - images/overlays/walk.png - images/overlays/warp.png - images/overlays/water.png - images/overlays/wilds.png + overlays/effect.png + overlays/no-walk.png + overlays/trainer.png + overlays/walk.png + overlays/warp.png + overlays/water.png + overlays/wilds.png diff --git a/pokemodr/pokemodr.pro b/pokemodr/pokemodr.pro index 6a5087a5..7177c977 100644 --- a/pokemodr/pokemodr.pro +++ b/pokemodr/pokemodr.pro @@ -68,7 +68,6 @@ SOURCES += AbilityUI.cpp \ PokeModr.cpp \ PokeModrUI.cpp \ RulesUI.cpp \ - SkinsUI.cpp \ SpeciesUI.cpp \ SpeciesAbilityUI.cpp \ SpeciesEvolutionUI.cpp \ @@ -83,7 +82,8 @@ SOURCES += AbilityUI.cpp \ MapWarpUI.cpp \ MapWildListEncounterUI.cpp \ MapTrainerTeamMemberUI.cpp \ - MapWildListUI.cpp + MapWildListUI.cpp \ + PokeModTreeItem.cpp HEADERS += AbilityUI.h \ AuthorUI.h \ @@ -103,7 +103,6 @@ HEADERS += AbilityUI.h \ PokeModrUI.h \ PokeModTreeItem.h \ RulesUI.h \ - SkinsUI.h \ SpeciesUI.h \ SpeciesAbilityUI.h \ SpeciesEvolutionUI.h \ @@ -144,7 +143,6 @@ FORMS += gui/ability.ui \ gui/pokemod.ui \ gui/pokemodr.ui \ gui/rules.ui \ - gui/skins.ui \ gui/species.ui \ gui/speciesability.ui \ gui/speciesevolution.ui \ @@ -153,5 +151,7 @@ FORMS += gui/ability.ui \ gui/store.ui \ gui/tile.ui \ gui/time.ui \ - gui/type.ui \ - gui/typechart.ui + gui/type.ui + +RESOURCES += images/overlays.qrc + -- cgit