summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMateusz Kaduk <mateusz.kaduk@gmail.com>2004-12-28 12:21:58 +0000
committerMateusz Kaduk <mateusz.kaduk@gmail.com>2004-12-28 12:21:58 +0000
commit5420f80ca8ceb37cbdd7f2f5c4a23f82f928df2e (patch)
tree97f48fcbfc02cf986c426117d4fbb1f37ca68d85
parent51777892f80d950757a27591dca861cc41f7a8fa (diff)
downloadmana-5420f80ca8ceb37cbdd7f2f5c4a23f82f928df2e.tar.gz
mana-5420f80ca8ceb37cbdd7f2f5c4a23f82f928df2e.tar.bz2
mana-5420f80ca8ceb37cbdd7f2f5c4a23f82f928df2e.tar.xz
mana-5420f80ca8ceb37cbdd7f2f5c4a23f82f928df2e.zip
Fixed incluing stats_window.h instead of stats.h
Using stringstream for labels
-rw-r--r--src/gui/stats.cpp18
-rw-r--r--src/gui/stats.h6
2 files changed, 13 insertions, 11 deletions
diff --git a/src/gui/stats.cpp b/src/gui/stats.cpp
index 3a1a206f..33a3f8a9 100644
--- a/src/gui/stats.cpp
+++ b/src/gui/stats.cpp
@@ -1,4 +1,4 @@
-#include "stats_window.h"
+#include "stats.h"
/*
* Constructor
@@ -6,16 +6,16 @@
StatsWindow::StatsWindow(gcn::Container *parent)
: Window(parent, "Stats")
{
- stats_str[0] << "Strenght: " << char_info->STR;
- stats_str[1] << "Agility: " << char_info->AGI;
- stats_str[2] << "Vitality: " << char_info->VIT;
- stats_str[3] << "Inteligence: " << char_info->INT;
- stats_str[4] << "Dexternity: " << char_info->DEX;
- stats_str[5] << "Luck: " << char_info->LUK;
+ statsStr[0] << "Strenght: " << char_info->STR;
+ statsStr[1] << "Agility: " << char_info->AGI;
+ statsStr[2] << "Vitality: " << char_info->VIT;
+ statsStr[3] << "Inteligence: " << char_info->INT;
+ statsStr[4] << "Dexternity: " << char_info->DEX;
+ statsStr[5] << "Luck: " << char_info->LUK;
/* New labels */
- for(int i=0; i<5;i++)
- statsLabel[i] = new gcn::Label(stats_str[i]);
+ for(i=0; i<5;i++)
+ statsLabel[i] = new gcn::Label(statsStr[i].str());
/* New buttons */
for(i=0; i<5;i++)
diff --git a/src/gui/stats.h b/src/gui/stats.h
index 9f716ef4..b7f32f99 100644
--- a/src/gui/stats.h
+++ b/src/gui/stats.h
@@ -4,6 +4,7 @@
#include "button.h"
#include "window.h"
#include "main.h"
+#include <sstream>
class StatsWindow : public Window, public gcn::ActionListener {
public:
@@ -18,8 +19,9 @@ class StatsWindow : public Window, public gcn::ActionListener {
void action(const std::string& eventId);
private:
+ int i;
/* Stats values */
- std::string statsStr[5];
+ std::stringstream statsStr[5];
/* Stats captions */
gcn::Label *statsLabel[5];
@@ -38,7 +40,7 @@ class StatsWindow : public Window, public gcn::ActionListener {
/*
* Destructor.
*/
- virtual ~StatsWindow();
+ ~StatsWindow();
};
#endif /* _STATS_Window_H */