/
multiplayer_configure.hpp
128 lines (105 loc) · 3.43 KB
/
multiplayer_configure.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
/*
Copyright (C) 2013 - 2015 Boldizsár Lipka <lipkab@zoho.com>
Part of the Battle for Wesnoth Project http://www.wesnoth.org
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY.
See the COPYING file for more details.
*/
#ifndef MULTIPLAYER_CONFIGURE_HPP_INCLUDED
#define MULTIPLAYER_CONFIGURE_HPP_INCLUDED
#include "depcheck.hpp"
#include "mp_game_settings.hpp"
#include "multiplayer_ui.hpp"
#include "widgets/slider.hpp"
#include "widgets/scrollpane.hpp"
#include "widgets/combo.hpp"
#include "tooltips.hpp"
#include "mp_options.hpp"
#include "configure_engine.hpp"
#include <boost/scoped_ptr.hpp>
class saved_game;
namespace mp {
class configure : public mp::ui
{
public:
///gives the user the option to adjust the passed saved_game
///Call get_parameters to finalize;
configure(game_display& dist, const config& game_config, chat& c, config& gamelist, saved_game& game, bool local_players_only);
~configure();
void get_parameters();
protected:
virtual void layout_children(const SDL_Rect& rect);
virtual void process_event();
virtual void hide_children(bool hide=true);
private:
//Settings that can be changed unledd wml forbids it
struct nolock_settings
{
nolock_settings(game_display& disp);
gui::slider turns_slider_;
gui::label turns_label_;
gui::slider village_gold_slider_;
gui::label village_gold_label_;
gui::slider village_support_slider_;
gui::label village_support_label_;
gui::slider xp_modifier_slider_;
gui::label xp_modifier_label_;
gui::label generic_label_;
gui::button use_map_settings_;
gui::button random_start_time_;
gui::button fog_game_;
gui::button shroud_game_;
};
bool local_players_only_;
tooltips::manager tooltip_manager_;
int mp_countdown_init_time_;
int mp_countdown_reservoir_time_;
gui::button countdown_game_;
gui::slider countdown_init_time_slider_;
gui::label countdown_init_time_label_;
gui::slider countdown_reservoir_time_slider_;
gui::label countdown_reservoir_time_label_;
gui::label countdown_turn_bonus_label_;
gui::slider countdown_turn_bonus_slider_;
gui::label countdown_action_bonus_label_;
gui::slider countdown_action_bonus_slider_;
gui::label name_entry_label_;
gui::button observers_game_;
gui::button oos_debug_;
gui::button shuffle_sides_;
gui::label random_faction_mode_label_;
gui::combo random_faction_mode_;
gui::button cancel_game_;
gui::button launch_game_;
gui::button password_button_;
gui::textbox name_entry_;
gui::label entry_points_label_;
gui::combo entry_points_combo_;
gui::scrollpane options_pane_left_;
gui::scrollpane options_pane_right_;
std::vector<config const*> entry_points_;
bool show_entry_points_;
bool force_use_map_settings_check_;
saved_game& state_;
mp_game_settings& parameters_;
ng::configure_engine engine_;
options::manager options_manager_;
boost::scoped_ptr<nolock_settings> nolock_settings_;
struct process_event_data {
bool launch, quit;
process_event_data()
: launch(false), quit(false)
{}
process_event_data(bool l, bool q)
: launch(l), quit(q)
{}
};
void process_event_impl(const process_event_data &);
bool plugin_event_helper(const process_event_data &);
};
} // end namespace mp
#endif