summaryrefslogtreecommitdiff
path: root/src/gui/skill.cpp
diff options
context:
space:
mode:
authorBjörn Steinbrink <B.Steinbrink@gmx.de>2006-01-22 13:31:13 +0000
committerBjörn Steinbrink <B.Steinbrink@gmx.de>2006-01-22 13:31:13 +0000
commitbd56bf8afdab16383ed8ad08412a8c807f84af85 (patch)
tree0e963ada63bcbe3c50dd77986aaa15b9ba49816a /src/gui/skill.cpp
parent5359640b6f271af31f6423df9d661433eff89a3e (diff)
downloadmana-bd56bf8afdab16383ed8ad08412a8c807f84af85.tar.gz
mana-bd56bf8afdab16383ed8ad08412a8c807f84af85.tar.bz2
mana-bd56bf8afdab16383ed8ad08412a8c807f84af85.tar.xz
mana-bd56bf8afdab16383ed8ad08412a8c807f84af85.zip
Merged NETWORK branch (includes BEING_OVERHAUL).
Diffstat (limited to 'src/gui/skill.cpp')
-rw-r--r--src/gui/skill.cpp24
1 files changed, 8 insertions, 16 deletions
diff --git a/src/gui/skill.cpp b/src/gui/skill.cpp
index 8a073bdd..ba117b67 100644
--- a/src/gui/skill.cpp
+++ b/src/gui/skill.cpp
@@ -29,10 +29,7 @@
#include "listbox.h"
#include "scrollarea.h"
-#include "../playerinfo.h"
-
-#include "../net/messageout.h"
-#include "../net/protocol.h"
+#include "../localplayer.h"
#include "../graphics.h"
extern Graphics *graphics;
@@ -64,8 +61,7 @@ const char *skill_db[] = {
SkillDialog::SkillDialog():
- Window("Skills"),
- skillPoints(0)
+ Window("Skills")
{
setWindowName("Skills");
setDefaultSize(graphics->getWidth() - 255, 25, 240, 240);
@@ -119,18 +115,16 @@ void SkillDialog::action(const std::string& eventId)
{
// Increment skill
int selectedSkill = skillListBox->getSelected();
- if (player_info->skillPoint > 0 && selectedSkill >= 0)
+ if (selectedSkill >= 0)
{
- MessageOut outMsg;
- outMsg.writeInt16(CMSG_SKILL_LEVELUP_REQUEST);
- outMsg.writeInt16(skillList[selectedSkill]->id);
+ player_node->raiseSkill(skillList[selectedSkill]->id);
}
}
else if (eventId == "skill")
{
incButton->setEnabled(
skillListBox->getSelected() > -1 &&
- skillPoints > 0);
+ player_node->skillPoint > 0);
}
else if (eventId == "close")
{
@@ -138,17 +132,15 @@ void SkillDialog::action(const std::string& eventId)
}
}
-void SkillDialog::setPoints(int i)
+void SkillDialog::update()
{
- skillPoints = i;
-
if (pointsLabel != NULL) {
char tmp[128];
- sprintf(tmp, "Skill points: %i", skillPoints);
+ sprintf(tmp, "Skill points: %i", player_node->skillPoint);
pointsLabel->setCaption(tmp);
}
- incButton->setEnabled(skillListBox->getSelected() > -1 && skillPoints > 0);
+ incButton->setEnabled(skillListBox->getSelected() > -1 && player_node->skillPoint > 0);
}
int SkillDialog::getNumberOfElements()