From 43971c1e7934712f6ded380fba0552f71142100f Mon Sep 17 00:00:00 2001 From: Bart Cools Date: Fri, 30 May 2014 00:55:58 +0200 Subject: [PATCH] Fix for the changing ProgressBar.. The only thing now needed for properties GUI is making it fancy, and change the way it's placed with multiple players --- src/guiengine/widgets/skill_level_widget.cpp | 5 ++--- src/guiengine/widgets/skill_level_widget.hpp | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/guiengine/widgets/skill_level_widget.cpp b/src/guiengine/widgets/skill_level_widget.cpp index edd19fd42..3f0ca300c 100644 --- a/src/guiengine/widgets/skill_level_widget.cpp +++ b/src/guiengine/widgets/skill_level_widget.cpp @@ -40,7 +40,6 @@ using namespace irr; SkillLevelWidget::SkillLevelWidget(core::recti area, const int player_id, const int value, const stringw& label) : Widget(WTYPE_DIV) { - m_bar_value = value; m_player_id = player_id; setSize(area.UpperLeftCorner.X, area.UpperLeftCorner.Y, @@ -95,7 +94,6 @@ void SkillLevelWidget::move(int x, int y, int w, int h) m_bar_y, m_bar_w, m_bar_h ); - m_bar->setValue(m_bar_value); } if (m_label != NULL) { @@ -140,7 +138,8 @@ void SkillLevelWidget::setSize(const int x, const int y, const int w, const int void SkillLevelWidget::setValue(int value) { - m_bar_value = value; + m_bar->setValue(value); + } // ----------------------------------------------------------------------------- diff --git a/src/guiengine/widgets/skill_level_widget.hpp b/src/guiengine/widgets/skill_level_widget.hpp index 84a1fd547..bdd1e4b3f 100644 --- a/src/guiengine/widgets/skill_level_widget.hpp +++ b/src/guiengine/widgets/skill_level_widget.hpp @@ -51,7 +51,6 @@ class SkillLevelWidget : public Widget int m_bar_x, m_bar_y, m_bar_h, m_bar_w; int m_label_x, m_label_y, m_label_h, m_label_w; - int m_bar_value; std::string m_label_name; int m_player_id; @@ -85,7 +84,7 @@ class SkillLevelWidget : public Widget void setValue(int value); /** Get the current values of the widget. */ - int getValue() {return m_bar_value; }; + int getValue() {return m_bar->getValue(); }; }; }