diff options
author | Eugenio Favalli <elvenprogrammer@gmail.com> | 2005-08-21 18:40:50 +0000 |
---|---|---|
committer | Eugenio Favalli <elvenprogrammer@gmail.com> | 2005-08-21 18:40:50 +0000 |
commit | 52e80454ecefaf9be262169db3a366f623c5d7c7 (patch) | |
tree | 0ba2f62ea79fc469e90a81146e01879f284215a2 /src/gui/skill.cpp | |
parent | 3a8cd47ab1bcb1bd3b97160b8ca59c30a2077f05 (diff) | |
download | mana-52e80454ecefaf9be262169db3a366f623c5d7c7.tar.gz mana-52e80454ecefaf9be262169db3a366f623c5d7c7.tar.bz2 mana-52e80454ecefaf9be262169db3a366f623c5d7c7.tar.xz mana-52e80454ecefaf9be262169db3a366f623c5d7c7.zip |
Some updates and cleanups
Diffstat (limited to 'src/gui/skill.cpp')
-rw-r--r-- | src/gui/skill.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/gui/skill.cpp b/src/gui/skill.cpp index 064354cd..fc791cd5 100644 --- a/src/gui/skill.cpp +++ b/src/gui/skill.cpp @@ -80,7 +80,7 @@ SkillDialog::SkillDialog(): skillScrollArea->setDimension(gcn::Rectangle(5, 5, 230, 180)); pointsLabel->setDimension(gcn::Rectangle(8, 190, 200, 16)); incButton->setPosition(skillScrollArea->getX(), 210); - useButton->setPosition(incButton->getX() + incButton->getWidth() + 10, + useButton->setPosition(incButton->getX() + incButton->getWidth() + 5, 210); closeButton->setPosition( skillScrollArea->getX() + skillScrollArea->getWidth() - closeButton->getWidth(), @@ -129,6 +129,18 @@ void SkillDialog::action(const std::string& eventId) WFIFOSET(4); } } + else if (eventId == "use") + { + // Use skill + int selectedSkill = skillListBox->getSelected(); + if (selectedSkill >= 0) + { + WFIFOW(0) = net_w_value(0x0113); + WFIFOW(2) = 0; + WFIFOW(4) = net_w_value(skillList[selectedSkill]->id); + WFIFOL(6) = net_l_value(0); + } + } else if (eventId == "skill") { incButton->setEnabled( @@ -202,3 +214,12 @@ void SkillDialog::setSkill(int id, int lv, int sp) } } } + +void SkillDialog::cleanList() +{ + for (int i = skillList.size() - 1; i >= 0; i--) + { + delete skillList[i]; + skillList.pop_back(); + } +} |