Mana
Loading...
Searching...
No Matches
charselectdialog.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
26#include "net/charhandler.h"
27
28#include <guichan/actionlistener.hpp>
29#include <guichan/keylistener.hpp>
30
32class LocalPlayer;
33class LoginData;
34class PlayerBox;
35
36namespace Net {
37class CharHandler;
38}
39
45class CharSelectDialog : public Window, public gcn::ActionListener,
46 public gcn::KeyListener
47{
48 public:
49 friend class CharDeleteConfirm;
50 friend class Net::CharHandler;
51
53
55
56 void action(const gcn::ActionEvent &event) override;
57
58 void keyPressed(gcn::KeyEvent &keyEvent) override;
59
64
73 bool selectByName(const std::string &name,
75
76 private:
77 void attemptCharacterDelete(int index);
78 void attemptCharacterSelect(int index);
79
80 void setCharacters(const Net::Characters &characters);
81
82 void lock();
83 void unlock();
84 void setLocked(bool locked);
85
86 bool mLocked = false;
87
88 gcn::Label *mAccountNameLabel;
89
90 gcn::Button *mSwitchLoginButton;
92 gcn::Button *mUnregisterButton = nullptr;
93 gcn::Button *mChangeEmailButton = nullptr;
94
96 std::vector<CharacterDisplay*> mCharacterEntries;
97
99
101};
Listener for confirming character deletion.
Character selection dialog.
std::vector< CharacterDisplay * > mCharacterEntries
The player boxes.
void keyPressed(gcn::KeyEvent &keyEvent) override
void attemptCharacterSelect(int index)
Communicate character selection to the server.
void setLocked(bool locked)
gcn::Button * mChangeEmailButton
gcn::Button * mUnregisterButton
Net::CharHandler * mCharHandler
void attemptCharacterDelete(int index)
Communicate character deletion to the server.
~CharSelectDialog() override
LoginData * mLoginData
void setCharacters(const Net::Characters &characters)
gcn::Button * mChangePasswordButton
void action(const gcn::ActionEvent &event) override
gcn::Label * mAccountNameLabel
bool selectByName(const std::string &name, SelectAction action=Focus)
Attempt to select the character with the given name.
gcn::Button * mSwitchLoginButton
The local player character.
Definition localplayer.h:75
A box showing a player character.
Definition playerbox.h:34
A window.
Definition window.h:59
LoginData loginData
Definition client.cpp:95
The network communication layer.
std::list< Character * > Characters
Definition charhandler.h:49