summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEugenio Favalli <elvenprogrammer@gmail.com>2005-08-21 18:40:50 +0000
committerEugenio Favalli <elvenprogrammer@gmail.com>2005-08-21 18:40:50 +0000
commit52e80454ecefaf9be262169db3a366f623c5d7c7 (patch)
tree0ba2f62ea79fc469e90a81146e01879f284215a2 /src
parent3a8cd47ab1bcb1bd3b97160b8ca59c30a2077f05 (diff)
downloadmana-52e80454ecefaf9be262169db3a366f623c5d7c7.tar.gz
mana-52e80454ecefaf9be262169db3a366f623c5d7c7.tar.bz2
mana-52e80454ecefaf9be262169db3a366f623c5d7c7.tar.xz
mana-52e80454ecefaf9be262169db3a366f623c5d7c7.zip
Some updates and cleanups
Diffstat (limited to 'src')
-rw-r--r--src/gui/skill.cpp23
-rw-r--r--src/gui/skill.h1
-rw-r--r--src/gui/status.cpp2
3 files changed, 24 insertions, 2 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();
+ }
+}
diff --git a/src/gui/skill.h b/src/gui/skill.h
index a9111528..b4c2522f 100644
--- a/src/gui/skill.h
+++ b/src/gui/skill.h
@@ -78,6 +78,7 @@ class SkillDialog : public Window, public gcn::ActionListener,
bool hasSkill(int id);
void addSkill(int id, int lv, int sp);
void setSkill(int id, int lv, int sp);
+ void cleanList();
};
extern SkillDialog *skillDialog;
diff --git a/src/gui/status.cpp b/src/gui/status.cpp
index eb20dcd5..c903261c 100644
--- a/src/gui/status.cpp
+++ b/src/gui/status.cpp
@@ -43,7 +43,7 @@ StatusWindow::StatusWindow():
Window("%s Lvl: % 2i Job: % 2i GP: % 2i")
{
hp = new gcn::Label("HP");
- sp = new gcn::Label("SP");
+ sp = new gcn::Label("MP");
hpValue = new gcn::Label();
spValue = new gcn::Label();
expLabel = new gcn::Label("Exp");