Mana
Loading...
Searching...
No Matches
skilldialog.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 "gui/widgets/window.h"
25#include "eventlistener.h"
26
27#include <guichan/actionlistener.hpp>
28
29#include <map>
30#include <memory>
31#include <vector>
32
33class Button;
34class Label;
35class ScrollArea;
36class SkillModel;
37class Tab;
38class TabbedArea;
39
40struct SkillInfo;
41
47class SkillDialog : public Window, public gcn::ActionListener, public EventListener
48{
49 public:
51 ~SkillDialog() override;
52
53 void event(Event::Channel channel, const Event &event) override;
54
58 void action(const gcn::ActionEvent &event) override;
59
63 std::string update(int id);
64
68 void update();
69
70 void loadSkills();
71
72 void clearSkills();
73
74 void setModifiable(int id, bool modifiable);
75
76 bool hasSkills() { return !mSkills.empty(); }
77
78 private:
79 std::vector<std::unique_ptr<SkillModel>> mSkillModels;
80 std::vector<std::unique_ptr<Tab>> mTabs;
81 std::vector<std::unique_ptr<gcn::Widget>> mTabWidgets;
82 std::map<int, SkillInfo*> mSkills;
86};
87
Button widget.
Definition button.h:38
Definition event.h:42
Channel
Definition event.h:45
Label widget.
Definition label.h:34
A scroll area.
Definition scrollarea.h:38
The skill dialog.
Definition skilldialog.h:48
std::vector< std::unique_ptr< SkillModel > > mSkillModels
Definition skilldialog.h:79
std::map< int, SkillInfo * > mSkills
Definition skilldialog.h:82
~SkillDialog() override
std::vector< std::unique_ptr< gcn::Widget > > mTabWidgets
Definition skilldialog.h:81
void event(Event::Channel channel, const Event &event) override
void clearSkills()
void setModifiable(int id, bool modifiable)
Label * mPointsLabel
Definition skilldialog.h:84
bool hasSkills()
Definition skilldialog.h:76
void action(const gcn::ActionEvent &event) override
Called when receiving actions from widget.
TabbedArea * mTabbedArea
Definition skilldialog.h:83
void update()
Update other parts of the display.
std::vector< std::unique_ptr< Tab > > mTabs
Definition skilldialog.h:80
void loadSkills()
Button * mIncreaseButton
Definition skilldialog.h:85
A tab, the same as the Guichan tab in 0.8, but extended to allow transparency.
Definition tab.h:33
A tabbed area, the same as the guichan tabbed area in 0.8, but extended.
Definition tabbedarea.h:40
A window.
Definition window.h:59
SkillDialog * skillDialog
Definition game.cpp:97