diff options
author | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2011-04-30 16:57:31 +0200 |
---|---|---|
committer | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2011-04-30 16:57:31 +0200 |
commit | 908dceb882723460cde35ec8ef22927b702ab874 (patch) | |
tree | 0598a9cb5d720c66c619fd350d64453490b35143 /src/gui | |
parent | 8a67e721880959b431d220e2d1fd5b60a4f11ad7 (diff) | |
parent | 0b1c6eb3c4941dc2d47ad3207bab4509ae1014cc (diff) | |
download | mana-client-908dceb882723460cde35ec8ef22927b702ab874.tar.gz mana-client-908dceb882723460cde35ec8ef22927b702ab874.tar.bz2 mana-client-908dceb882723460cde35ec8ef22927b702ab874.tar.xz mana-client-908dceb882723460cde35ec8ef22927b702ab874.zip |
Merge branch '0.5'
Conflicts:
CMakeLists.txt
po/fi.po
po/fr.po
src/gui/skilldialog.cpp
src/localplayer.cpp
src/net/manaserv/generalhandler.cpp
src/net/tmwa/buysellhandler.cpp
src/net/tmwa/generalhandler.cpp
src/net/tmwa/playerhandler.cpp
src/net/tmwa/specialhandler.cpp
src/winver.h
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/buy.cpp | 6 | ||||
-rw-r--r-- | src/gui/skilldialog.cpp | 17 | ||||
-rw-r--r-- | src/gui/skilldialog.h | 4 |
3 files changed, 14 insertions, 13 deletions
diff --git a/src/gui/buy.cpp b/src/gui/buy.cpp index 4a8dae17..8e9f13e8 100644 --- a/src/gui/buy.cpp +++ b/src/gui/buy.cpp @@ -208,11 +208,7 @@ void BuyDialog::action(const gcn::ActionEvent &event) if (price < 0) price = 0; setMoney(mMoney - mAmountItems * price); - - // Reset selection - mAmountItems = 1; - mSlider->setValue(1); - mSlider->gcn::Slider::setScale(1, mMaxItems); + valueChanged(gcn::SelectionEvent(mShopItemList)); } } diff --git a/src/gui/skilldialog.cpp b/src/gui/skilldialog.cpp index c7976caa..19bd06d6 100644 --- a/src/gui/skilldialog.cpp +++ b/src/gui/skilldialog.cpp @@ -56,6 +56,8 @@ #include <set> #include <string> +#define SKILLS_FILE "skills.xml" + class SkillModel; class SkillEntry; @@ -235,8 +237,7 @@ SkillDialog::SkillDialog(): SkillDialog::~SkillDialog() { - // Clear gui - loadSkills(""); + clearSkills(); } void SkillDialog::action(const gcn::ActionEvent &event) @@ -291,7 +292,7 @@ void SkillDialog::event(Event::Channel channel, const Event &event) } } -void SkillDialog::loadSkills(const std::string &file) +void SkillDialog::clearSkills() { // Fixes issues with removing tabs if (mTabs->getSelectedTabIndex() != -1) @@ -308,11 +309,13 @@ void SkillDialog::loadSkills(const std::string &file) delete_all(mSkills); mSkills.clear(); +} - if (file.length() == 0) - return; +void SkillDialog::loadSkills() +{ + clearSkills(); - XML::Document doc(file); + XML::Document doc(SKILLS_FILE); xmlNodePtr root = doc.rootNode(); int setCount = 0; @@ -323,7 +326,7 @@ void SkillDialog::loadSkills(const std::string &file) if (!root || !xmlStrEqual(root->name, BAD_CAST "skills")) { - logger->log("Error loading skills file: %s", file.c_str()); + logger->log("Error loading skills file: %s", SKILLS_FILE); if (Net::getNetworkType() == ServerInfo::TMWATHENA) { diff --git a/src/gui/skilldialog.h b/src/gui/skilldialog.h index a49c537b..ba908697 100644 --- a/src/gui/skilldialog.h +++ b/src/gui/skilldialog.h @@ -66,7 +66,9 @@ class SkillDialog : public Window, public gcn::ActionListener, public EventListe */ void update(); - void loadSkills(const std::string &file); + void loadSkills(); + + void clearSkills(); void setModifiable(int id, bool modifiable); |