The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
multiplayer_create.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2007 - 2016 by David White <[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 /** @file */
16 
17 #ifndef MULTIPLAYER_CREATE_HPP_INCLUDED
18 #define MULTIPLAYER_CREATE_HPP_INCLUDED
19 
20 #include "depcheck.hpp"
21 #include "create_engine.hpp"
22 #include "multiplayer_ui.hpp"
23 #include "widgets/slider.hpp"
24 #include "widgets/combo.hpp"
25 #include "widgets/multimenu.hpp"
26 #include "tooltips.hpp"
27 
28 namespace mp {
29 
30 class create : public mp::ui
31 {
32 public:
33  create(CVideo& v, twesnothd_connection* wesnothd_connection, const config& game_config, saved_game& state,
34  chat& c, config& gamelist);
35  ~create();
36 
38 
39 protected:
40  virtual void layout_children(const SDL_Rect& rect);
41  virtual void process_event();
42  virtual void hide_children(bool hide=true);
43 
44 private:
45  void init_level_type_changed(size_t index);
46  void init_level_changed(size_t index);
47 
49 
50  void draw_level_image();
51 
52  void set_description(const std::string& description);
53 
54  void update_mod_menu();
55 
57 
62 
66 
76 
82 
84 
86 
89 
91  SDL_Rect image_rect_;
92 
93  std::vector<ng::level::TYPE> available_level_types_;
94 
96 
98  bool create, load, quit;
99  boost::optional<std::string> filename;
100 
102  : create(false), load(false), quit(false), filename()
103  {}
104  process_event_data(bool c, bool l, bool q)
105  : create(c), load(l), quit(q), filename()
106  {}
108  : create(false), load(true), quit(false), filename(fname)
109  {}
110  };
111 
112  void process_event_impl(const process_event_data &);
113  bool plugin_event_helper(const process_event_data &);
114 
115  void select_level_type_helper(const std::string & str);
116 };
117 
118 } // end namespace mp
119 
120 #endif
121 
tooltips::manager tooltip_manager_
gui::textbox filter_name_
gui::menu eras_menu_
gui::button cancel_game_
gui::multimenu mods_menu_
A widget that additionally to the normal menu contents also displays a checkbox in each row...
Definition: multimenu.hpp:27
const GLfloat * c
Definition: glew.h:12741
const mp_game_settings & get_parameters()
boost::optional< std::string > filename
gui::label era_label_
Definition: video.hpp:58
process_event_data(const std::string &fname)
SDL_Rect image_rect_
gui::label map_generator_label_
gui::button regenerate_map_
GLdouble l
Definition: glew.h:6966
void init_level_type_changed(size_t index)
GLdouble GLdouble GLdouble GLdouble q
Definition: glew.h:1382
This module controls the multiplayer lobby.
virtual void layout_children(const SDL_Rect &rect)
Lays the children out.
A class that represents a TCP/IP connection to the wesnothd server.
gui::slider filter_num_players_slider_
void synchronize_selections()
gui::button generator_settings_
virtual void hide(bool value=true)
Definition: widget.cpp:162
gui::button load_game_
const GLdouble * v
Definition: glew.h:1359
gui::label num_players_label_
gui::label mod_label_
ng::create_engine engine_
void init_level_changed(size_t index)
bool plugin_event_helper(const process_event_data &)
gui::label filter_num_players_label_
process_event_data(bool c, bool l, bool q)
gui::label map_size_label_
gui::label filter_name_label_
void set_description(const std::string &description)
gui::label level_type_label_
gui::combo level_type_combo_
Game configuration data as global variables.
Definition: build_info.cpp:38
GLuint index
Definition: glew.h:1782
config & gamelist()
Returns the current gamelist.
std::vector< ng::level::TYPE > available_level_types_
gui::label no_era_label_
create(CVideo &v, twesnothd_connection *wesnothd_connection, const config &game_config, saved_game &state, chat &c, config &gamelist)
void select_level_type_helper(const std::string &str)
gui::textbox description_
gui::menu levels_menu_
virtual void process_event()
std::string select_campaign_difficulty()
this class memorizes a chat session.
virtual void hide_children(bool hide=true)
Hides or shows all gui::widget children of this widget.
gui::button launch_game_
A config object defines a single node in a WML file, with access to child nodes.
Definition: config.hpp:83
void process_event_impl(const process_event_data &)
GLsizei const GLcharARB ** string
Definition: glew.h:4503
util::scoped_ptr< surface_restorer > image_restorer_
a base class for the different multiplayer base dialogs: game list, create game, wait game...