diff options
author | Ira Rice <irarice@gmail.com> | 2009-03-11 18:06:30 -0600 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2009-03-11 18:06:30 -0600 |
commit | c2ae6d9cea9fc3d861e73d4cf7eca5284519758e (patch) | |
tree | e52abe836ff96446ec3109cf7c273dd7ee35c1e8 /src/gui/ministatus.cpp | |
parent | 6b538196a799525d8ad4bf5cb5affe87745d4242 (diff) | |
download | mana-c2ae6d9cea9fc3d861e73d4cf7eca5284519758e.tar.gz mana-c2ae6d9cea9fc3d861e73d4cf7eca5284519758e.tar.bz2 mana-c2ae6d9cea9fc3d861e73d4cf7eca5284519758e.tar.xz mana-c2ae6d9cea9fc3d861e73d4cf7eca5284519758e.zip |
Added a new Popup class, which overall is functionally similar to the
Window class, but stripped down to the bare essential functionality to
just draw and position them. This means no resizing, no close buttons,
no ability to move them, etc. This should help reduce the overhead in
drawing speech bubbles, as well as other popup type dialogs, but is also
not a drop in replacement for the Window class as well.
Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src/gui/ministatus.cpp')
-rw-r--r-- | src/gui/ministatus.cpp | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/src/gui/ministatus.cpp b/src/gui/ministatus.cpp index 6537b48e..18b9d714 100644 --- a/src/gui/ministatus.cpp +++ b/src/gui/ministatus.cpp @@ -31,13 +31,8 @@ #include "../utils/stringutils.h" MiniStatusWindow::MiniStatusWindow(): - Window("") + Popup("MiniStatus") { - setWindowName("MiniStatus"); - setResizable(false); - setMovable(false); - setTitleBarHeight(0); - mHpBar = new ProgressBar(1.0f, 100, 20, 0, 171, 34); mMpBar = new ProgressBar(1.0f, 100, 20, 26, 102, 230); mXpBar = new ProgressBar(1.0f, 100, 20, 143, 192, 211); @@ -52,25 +47,17 @@ MiniStatusWindow::MiniStatusWindow(): setContentSize(mXpBar->getX() + mXpBar->getWidth(), mXpBar->getY() + mXpBar->getHeight()); - setDefaultSize(0, 0, getWidth(), getHeight()); - loadWindowState(); } void MiniStatusWindow::update() { // HP Bar coloration if (player_node->mHp < int(player_node->mMaxHp / 3)) - { mHpBar->setColor(223, 32, 32); // Red - } else if (player_node->mHp < int((player_node->mMaxHp / 3) * 2)) - { mHpBar->setColor(230, 171, 34); // Orange - } else - { mHpBar->setColor(0, 171, 34); // Green - } float xp = (float) player_node->getXp() / player_node->mXpForNextLevel; |