summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYohann Ferreira <bertram@cegetel.net>2005-01-13 17:58:55 +0000
committerYohann Ferreira <bertram@cegetel.net>2005-01-13 17:58:55 +0000
commit37a40bd2592f2d0df4003bc403b44efb19b22f0c (patch)
tree95baa767014000d91065c9f922c40855f301e2fb
parent2c89e2b61990f69150f2c7216817014b503369aa (diff)
downloadmana-37a40bd2592f2d0df4003bc403b44efb19b22f0c.tar.gz
mana-37a40bd2592f2d0df4003bc403b44efb19b22f0c.tar.bz2
mana-37a40bd2592f2d0df4003bc403b44efb19b22f0c.tar.xz
mana-37a40bd2592f2d0df4003bc403b44efb19b22f0c.zip
*** empty log message ***
-rw-r--r--src/gui/stats.cpp34
-rw-r--r--src/gui/stats.h2
2 files changed, 27 insertions, 9 deletions
diff --git a/src/gui/stats.cpp b/src/gui/stats.cpp
index bb095130..2b8b4faa 100644
--- a/src/gui/stats.cpp
+++ b/src/gui/stats.cpp
@@ -31,7 +31,10 @@ StatsWindow::StatsWindow():
// New labels
for (i = 0; i < 6; i++) {
statsLabel[i] = new gcn::Label();
+ statsDisplayLabel[i] = new gcn::Label();
}
+ remainingStatsPointsLabel = new gcn::Label();
+
update();
// New buttons
@@ -50,35 +53,50 @@ StatsWindow::StatsWindow():
// Set position
for (i = 0; i < 6; i++) {
statsLabel[i]->setPosition(10,(i*23)+10);
+ statsDisplayLabel[i]->setPosition(120,(i*23)+10);
statsButton[i]->setPosition(170,(i*23)+10);
}
+ remainingStatsPointsLabel->setPosition(10, 156);
// Assemble
for(i = 0; i < 6; i++) {
add(statsLabel[i]);
+ add(statsDisplayLabel[i]);
add(statsButton[i]);
statsButton[i]->addActionListener(this);
}
+ add(remainingStatsPointsLabel);
- setSize(200, 150);
+ setSize(200, 180);
setLocationRelativeTo(getParent());
}
void StatsWindow::update(){
std::stringstream statsStr[6];
+ std::stringstream figureStr[6];
- statsStr[0] << "Strength: " << (int)char_info->STR;
- statsStr[1] << "Agility: " << (int)char_info->AGI;
- statsStr[2] << "Vitality: " << (int)char_info->VIT;
- statsStr[3] << "Intelligence: " << (int)char_info->INT;
- statsStr[4] << "Dexterity: " << (int)char_info->DEX;
- statsStr[5] << "Luck: " << (int)char_info->LUK;
+ statsStr[0] << "Strength:";
+ figureStr[0] << (int)char_info->STR;
+ statsStr[1] << "Agility:";
+ figureStr[1] << (int)char_info->AGI;
+ statsStr[2] << "Vitality:";
+ figureStr[2] << (int)char_info->VIT;
+ statsStr[3] << "Intelligence:";
+ figureStr[3] << (int)char_info->INT;
+ statsStr[4] << "Dexterity:";
+ figureStr[4] << (int)char_info->DEX;
+ statsStr[5] << "Luck:";
+ figureStr[5] << (int)char_info->LUK;
// Update labels
for (i = 0; i < 6; i++) {
statsLabel[i]->setCaption(statsStr[i].str());
statsLabel[i]->adjustSize();
+ statsDisplayLabel[i]->setCaption(figureStr[i].str());
+ statsDisplayLabel[i]->adjustSize();
}
+ remainingStatsPointsLabel->setCaption("Remaing Status Points : ??");
+ remainingStatsPointsLabel->adjustSize();
}
StatsWindow::~StatsWindow() {
@@ -122,6 +140,4 @@ void StatsWindow::action(const std::string& eventId) {
}
flush();
update();
- WFIFOW(4) = net_b_value(1);
- WFIFOSET(5);
}
diff --git a/src/gui/stats.h b/src/gui/stats.h
index 95ee235e..b730aefb 100644
--- a/src/gui/stats.h
+++ b/src/gui/stats.h
@@ -55,6 +55,8 @@ class StatsWindow : public Window, public gcn::ActionListener {
* Stats captions.
*/
gcn::Label *statsLabel[6];
+ gcn::Label *statsDisplayLabel[6];
+ gcn::Label *remainingStatsPointsLabel;
/**
* Stats buttons.