diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2008-04-10 22:03:57 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2008-04-10 22:03:57 +0000 |
commit | f97ddedaa9672c78147fc13282bd14a5be46eb19 (patch) | |
tree | b433e4f9fe285ab6b48fb0e98a8c010e8a9b73e2 /src/gui | |
parent | 720f716ba8d98a85266b8e81a534737c6fcdcf5f (diff) | |
download | mana-f97ddedaa9672c78147fc13282bd14a5be46eb19.tar.gz mana-f97ddedaa9672c78147fc13282bd14a5be46eb19.tar.bz2 mana-f97ddedaa9672c78147fc13282bd14a5be46eb19.tar.xz mana-f97ddedaa9672c78147fc13282bd14a5be46eb19.zip |
Fixed some compiler warnings and don't try to load particle effects when no
file is set.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/skill.cpp | 46 | ||||
-rw-r--r-- | src/gui/trade.h | 2 | ||||
-rw-r--r-- | src/gui/widgets/layout.h | 2 |
3 files changed, 26 insertions, 24 deletions
diff --git a/src/gui/skill.cpp b/src/gui/skill.cpp index 09e7a10d..48d64202 100644 --- a/src/gui/skill.cpp +++ b/src/gui/skill.cpp @@ -103,26 +103,27 @@ void SkillDialog::update() Skill_Tab::Skill_Tab(std::string type): type(type) { - int skillnum; + int skillNum = 0; + if (type == "Weapon") { - skillnum = CHAR_SKILL_WEAPON_NB; + skillNum = CHAR_SKILL_WEAPON_NB; } else if (type == "Magic") { - skillnum = CHAR_SKILL_MAGIC_NB; + skillNum = CHAR_SKILL_MAGIC_NB; } else if (type == "Craft") { - skillnum = CHAR_SKILL_CRAFT_NB; + skillNum = CHAR_SKILL_CRAFT_NB; } - mSkillNameLabels.resize(skillnum); - mSkillLevelLabels.resize(skillnum); - mSkillExpLabels.resize(skillnum); - mSkillProgress.resize(skillnum); + mSkillNameLabels.resize(skillNum); + mSkillLevelLabels.resize(skillNum); + mSkillExpLabels.resize(skillNum); + mSkillProgress.resize(skillNum); - for (int a=0; a < skillnum; a++) + for (int a=0; a < skillNum; a++) { mSkillNameLabels.at(a) = new gcn::Label(""); mSkillNameLabels.at(a)->setPosition(1, a*32 ); @@ -148,28 +149,29 @@ Skill_Tab::Skill_Tab(std::string type): type(type) void Skill_Tab::update() { setOpaque(false); - int skillnum; - int skillbegin; + int skillNum = 0; + int skillBegin; + if (type == "Weapon") { - skillnum = CHAR_SKILL_WEAPON_NB; - skillbegin = CHAR_SKILL_WEAPON_BEGIN - CHAR_SKILL_BEGIN; + skillNum = CHAR_SKILL_WEAPON_NB; + skillBegin = CHAR_SKILL_WEAPON_BEGIN - CHAR_SKILL_BEGIN; } else if (type == "Magic") { - skillnum = CHAR_SKILL_MAGIC_NB; - skillbegin = CHAR_SKILL_MAGIC_BEGIN - CHAR_SKILL_BEGIN; + skillNum = CHAR_SKILL_MAGIC_NB; + skillBegin = CHAR_SKILL_MAGIC_BEGIN - CHAR_SKILL_BEGIN; } else if (type == "Craft") { - skillnum = CHAR_SKILL_CRAFT_NB; - skillbegin = CHAR_SKILL_CRAFT_BEGIN - CHAR_SKILL_BEGIN; + skillNum = CHAR_SKILL_CRAFT_NB; + skillBegin = CHAR_SKILL_CRAFT_BEGIN - CHAR_SKILL_BEGIN; } - for (int a = 0; a < skillnum; a++) + for (int a = 0; a < skillNum; a++) { - int baseLevel = player_node->getAttributeBase(a + skillbegin + CHAR_SKILL_BEGIN); - int effLevel = player_node->getAttributeEffective(a + skillbegin + CHAR_SKILL_BEGIN); + int baseLevel = player_node->getAttributeBase(a + skillBegin + CHAR_SKILL_BEGIN); + int effLevel = player_node->getAttributeEffective(a + skillBegin + CHAR_SKILL_BEGIN); std::string skillLevel("Lvl: " + toString(baseLevel)); if (effLevel < baseLevel) @@ -182,11 +184,11 @@ void Skill_Tab::update() } mSkillLevelLabels.at(a)->setCaption(skillLevel); - std::pair<int, int> exp = player_node->getExperience(a + skillbegin); + std::pair<int, int> exp = player_node->getExperience(a + skillBegin); std::string sExp (toString(exp.first) + " / " + toString(exp.second)); - mSkillNameLabels.at(a)->setCaption(LocalPlayer::getSkillName(a + skillbegin)); + mSkillNameLabels.at(a)->setCaption(LocalPlayer::getSkillName(a + skillBegin)); mSkillNameLabels.at(a)->adjustSize(); mSkillLevelLabels.at(a)->adjustSize(); mSkillExpLabels.at(a)->setCaption(sExp); diff --git a/src/gui/trade.h b/src/gui/trade.h index cd943a41..449de573 100644 --- a/src/gui/trade.h +++ b/src/gui/trade.h @@ -96,7 +96,7 @@ class TradeWindow : public Window, gcn::ActionListener, SelectionListener { PREPARING, /**< Players are adding items. */ PROPOSING, /**< Local player is proposing a trade. */ - ACCEPTING, /**< Distant player is proposing a trade. */ + ACCEPTING /**< Distant player is proposing a trade. */ }; /** diff --git a/src/gui/widgets/layout.h b/src/gui/widgets/layout.h index 2d81ad81..5914b5c1 100644 --- a/src/gui/widgets/layout.h +++ b/src/gui/widgets/layout.h @@ -311,7 +311,7 @@ class Layout: public LayoutCell { AUTO_DEF = -42, /**< Default value, behaves like AUTO_ADD. */ AUTO_SET = -43, /**< Uses the share as the new size. */ - AUTO_ADD = -44, /**< Adds the share to the current size. */ + AUTO_ADD = -44 /**< Adds the share to the current size. */ }; private: |