The Battle for Wesnoth  1.17.0-dev
mp_change_control.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2011 - 2021
3  by Lukasz Dobrogowski <lukasz.dobrogowski@gmail.com>
4  Part of the Battle for Wesnoth Project https://www.wesnoth.org/
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY.
12 
13  See the COPYING file for more details.
14 */
15 
16 #pragma once
17 
19 
20 #include <vector>
21 
22 namespace events
23 {
24  class menu_handler;
25 }
26 
27 namespace gui2::dialogs
28 {
29 
30 /**
31  * @ingroup GUIWindowDefinitionWML
32  *
33  * This shows the multiplayer change control dialog.
34  * Key |Type |Mandatory|Description
35  * ------------------|--------------|---------|-----------
36  * sides_list | @ref listbox |yes |List of sides participating in the MP game.
37  * nicks_list | @ref listbox |yes |List of nicks of all clients playing or observing the MP game.
38  */
40 {
41 public:
43 
45 
46 private:
47  virtual const std::string& window_id() const override;
48 
49  virtual void pre_show(window& window) override;
50 
51  virtual void post_show(window& window) override;
52 
53  void handle_sides_list_item_clicked();
54  void handle_nicks_list_item_clicked();
55 
56  void highlight_side_nick();
57 
59 
60  unsigned int selected_side_;
61  unsigned int selected_nick_;
62 
63  // Contains the mapping from listbox labels to actual sides
64  std::vector<int> sides_;
65 
66  // Contains the mapping from listbox labels to actual nicks
67  std::vector<std::string> nicks_;
68 };
69 
70 } // namespace dialogs
This shows the multiplayer change control dialog.
events::menu_handler & menu_handler_
std::vector< std::string > nicks_
Handling of system events.
Definition: manager.hpp:43
Abstract base class for all modal dialogs.
base class of top level items, the only item which needs to store the final canvases to draw on...
Definition: window.hpp:65