Mana
Loading...
Searching...
No Matches
statuswindow.h
Go to the documentation of this file.
1/*
2 * The Mana Client
3 * Copyright (C) 2004-2009 The Mana World Development Team
4 * Copyright (C) 2009-2012 The Mana Developers
5 *
6 * This file is part of The Mana Client.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21
22#pragma once
23
24#include "eventlistener.h"
25
26#include "gui/widgets/window.h"
27
28#include <guichan/actionlistener.hpp>
29
30#include <map>
31
32class AttrDisplay;
33class ProgressBar;
34class ScrollArea;
35class VertContainer;
36
42class StatusWindow : public Window, public EventListener
43{
44 public:
46
47 void event(Event::Channel channel, const Event &event) override;
48
49 void updateAttrs();
50
51 void setPointsNeeded(int id, int needed);
52
53 void addAttribute(int id, const std::string &name, bool modifiable,
54 const std::string &description);
55
56 static void updateHPBar(ProgressBar *bar, bool showMax = false);
57 static void updateMPBar(ProgressBar *bar, bool showMax = false);
58 static void updateXPBar(ProgressBar *bar, bool percent = true);
59 static void updateProgressBar(ProgressBar *bar, int value, int max,
60 bool percent);
61 void updateProgressBar(ProgressBar *bar, int id,
62 bool percent = true);
63
64 private:
68 gcn::Label *mLvlLabel, *mMoneyLabel;
69 gcn::Label *mHpLabel, *mMpLabel, *mXpLabel;
71
72 gcn::Label *mJobLvlLabel, *mJobLabel;
74
79
82
83 std::map<int, AttrDisplay *> mAttrs;
84};
85
Definition event.h:42
Channel
Definition event.h:45
A progress bar.
Definition progressbar.h:34
A scroll area.
Definition scrollarea.h:38
The player status dialog.
static void updateMPBar(ProgressBar *bar, bool showMax=false)
void event(Event::Channel channel, const Event &event) override
std::map< int, AttrDisplay * > mAttrs
gcn::Label * mCorrectionPointsLabel
ScrollArea * mAttrScroll
gcn::Label * mMoneyLabel
void setPointsNeeded(int id, int needed)
gcn::Label * mMpLabel
static void updateHPBar(ProgressBar *bar, bool showMax=false)
gcn::Label * mCharacterPointsLabel
gcn::Label * mXpLabel
static void updateProgressBar(ProgressBar *bar, int value, int max, bool percent)
gcn::Label * mJobLvlLabel
gcn::Label * mLvlLabel
Status Part.
ScrollArea * mDAttrScroll
gcn::Label * mJobLabel
ProgressBar * mMpBar
VertContainer * mAttrCont
gcn::Label * mHpLabel
ProgressBar * mJobBar
ProgressBar * mXpBar
VertContainer * mDAttrCont
ProgressBar * mHpBar
void addAttribute(int id, const std::string &name, bool modifiable, const std::string &description)
static void updateXPBar(ProgressBar *bar, bool percent=true)
A widget container.
A window.
Definition window.h:59
StatusWindow * statusWindow
Definition game.cpp:94