The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
edit_side.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2010 - 2016 by Fabian Müller <[email protected]>
3  Part of the Battle for Wesnoth Project http://www.wesnoth.org/
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY.
11 
12  See the COPYING file for more details.
13 */
14 
15 #ifndef GUI_DIALOGS_EDITOR_EDIT_SIDE_HPP_INCLUDED
16 #define GUI_DIALOGS_EDITOR_EDIT_SIDE_HPP_INCLUDED
17 
18 #include "gui/dialogs/dialog.hpp"
19 #include "gui/widgets/group.hpp"
20 #include "team.hpp"
21 
22 namespace gui2
23 {
24 
25 class ttoggle_button;
26 
27 class teditor_edit_side : public tdialog
28 {
29 public:
30  teditor_edit_side(int side,
31  std::string& team_name,
32  std::string& user_team_name,
33  int& gold,
34  int& income,
35  int& village_income,
36  int& village_support,
37  bool& fog,
38  bool& shroud,
39  team::SHARE_VISION& share_vision,
40  team::CONTROLLER& controller,
41  bool& no_leader,
42  bool& hidden);
43 
44  /** The execute function see @ref tdialog for more information. */
45  static bool execute(int side,
46  std::string& team_name,
47  std::string& user_team_name,
48  int& gold,
49  int& income,
50  int& village_income,
51  int& village_support,
52  bool& fog,
53  bool& shroud,
54  team::SHARE_VISION& share_vision,
55  team::CONTROLLER& controller,
56  bool& no_leader,
57  bool& hidden,
58  CVideo& video)
59  {
60  return teditor_edit_side(side,
61  team_name,
62  user_team_name,
63  gold,
64  income,
65  village_income,
66  village_support,
67  fog,
68  shroud,
69  share_vision,
70  controller,
71  no_leader,
72  hidden).show(video);
73  }
74 
75 private:
76  void pre_show(twindow& window);
77  void post_show(twindow& window);
78 
79  template <typename T>
80  void register_radio_toggle(const std::string& toggle_id, tgroup<T>& group, const T& enum_value, T& current_value, twindow& window);
81 
82  team::CONTROLLER& controller_;
84 
85  team::SHARE_VISION& share_vision_;
87 
88  /** Inherited from tdialog, implemented by REGISTER_DIALOG. */
89  virtual const std::string& window_id() const;
90 };
91 }
92 
93 #endif /* ! GUI_DIALOGS_EDIT_LABEL_INCLUDED */
virtual const std::string & window_id() const
Inherited from tdialog, implemented by REGISTER_DIALOG.
tgroup< team::SHARE_VISION > vision_group
Definition: edit_side.hpp:86
int village_support
Definition: game_config.cpp:39
Definition: video.hpp:58
void post_show(twindow &window)
Actions to be taken after the window has been shown.
Definition: edit_side.cpp:110
teditor_edit_side(int side, std::string &team_name, std::string &user_team_name, int &gold, int &income, int &village_income, int &village_support, bool &fog, bool &shroud, team::SHARE_VISION &share_vision, team::CONTROLLER &controller, bool &no_leader, bool &hidden)
Definition: edit_side.cpp:53
-file sdl_utils.hpp
tgroup< team::CONTROLLER > controller_group
Definition: edit_side.hpp:83
base class of top level items, the only item which needs to store the final canvases to draw on ...
Definition: window.hpp:62
A class inherited from ttext_box that displays its input as stars.
Definition: field-fwd.hpp:23
Abstract base class for all dialogs.
Definition: dialog.hpp:121
void pre_show(twindow &window)
Actions to be taken before showing the window.
Definition: edit_side.cpp:89
int village_income
Definition: game_config.cpp:38
team::CONTROLLER & controller_
Definition: edit_side.hpp:82
GLboolean GLuint group
Definition: glew.h:2589
void register_radio_toggle(const std::string &toggle_id, tgroup< T > &group, const T &enum_value, T &current_value, twindow &window)
Definition: edit_side.cpp:101
team::SHARE_VISION & share_vision_
Definition: edit_side.hpp:85
static bool execute(int side, std::string &team_name, std::string &user_team_name, int &gold, int &income, int &village_income, int &village_support, bool &fog, bool &shroud, team::SHARE_VISION &share_vision, team::CONTROLLER &controller, bool &no_leader, bool &hidden, CVideo &video)
The execute function see tdialog for more information.
Definition: edit_side.hpp:45
GLsizei const GLcharARB ** string
Definition: glew.h:4503