summaryrefslogtreecommitdiffstats
path: root/pokemodr/PokemodUI.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'pokemodr/PokemodUI.cpp')
-rw-r--r--pokemodr/PokemodUI.cpp146
1 files changed, 146 insertions, 0 deletions
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 <BugCatcher.h>
#include <Exception.h>
+#include <ImageCache.h>
+#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();
+ }
+}