41 #define ERR_CF LOG_STREAM(err, log_config)
44 #define DBG_MP LOG_STREAM(debug, log_mp_configure)
49 : turns_slider_(video)
51 , village_gold_slider_(video)
53 , village_support_slider_(video)
55 , xp_modifier_slider_(video)
58 , use_map_settings_(video,
_(
"Use map settings"),
gui::button::TYPE_CHECK)
59 , random_start_time_(video,
_(
"Random start time"),
gui::button::TYPE_CHECK)
60 , fog_game_(video,
_(
"Fog of war"),
gui::button::TYPE_CHECK)
61 , shroud_game_(video,
_(
"Shroud"),
gui::button::TYPE_CHECK)
66 ui(video, wesnothd_connection,
_(
"Configure Game"), cfg, c, gamelist),
108 DBG_MP <<
"constructing multiplayer configure dialog" << std::endl;
154 std::vector<std::string> translated_modes;
156 std::string mode_str = mp_game_settings::RANDOM_FACTION_MODE::from_int(
i).to_string();
161 random_faction_mode_.
set_help_string(
_(
"Independent: Random factions assigned independently\nNo Mirror: No two players will get the same faction\nNo Ally Mirror: No two allied players will get the same faction"));
166 nolock_settings_->use_map_settings_.set_help_string(
_(
"Use scenario specific settings"));
172 nolock_settings_->turns_slider_.set_help_string(
_(
"The maximum number of turns the game can last"));
178 nolock_settings_->village_gold_slider_.set_help_string(
_(
"The amount of income each village yields per turn"));
184 nolock_settings_->village_support_slider_.set_help_string(
_(
"The number of unit levels each village can support"));
191 nolock_settings_->xp_modifier_slider_.set_help_string(
_(
"The amount of experience a unit needs to advance"));
195 nolock_settings_->random_start_time_.set_help_string(
_(
"Randomize time of day in begin"));
199 nolock_settings_->fog_game_.set_help_string(
_(
"Enemy units cannot be seen unless they are in range of your units"));
203 nolock_settings_->shroud_game_.set_help_string(
_(
"The map is unknown until your units explore it"));
208 std::vector<std::string> vision_types;
209 vision_types.push_back(
_(
"Share View"));
210 vision_types.push_back(
_(
"Share Maps"));
211 vision_types.push_back(
_(
"Share None"));
253 DBG_MP <<
"destructing multiplayer configure dialog - aborted game creation" << std::endl;
256 DBG_MP <<
"destructing multiplayer configure dialog - a game will be configured" << std::endl;
259 DBG_MP <<
"storing parameter values in preferences" << std::endl;
292 DBG_MP <<
"getting parameter values from widgets" << std::endl;
302 if(mp_countdown_reservoir_time_val > 0 && mp_countdown_init_time_val > mp_countdown_reservoir_time_val)
303 mp_countdown_init_time_val = mp_countdown_reservoir_time_val;
347 SDL_GetMouseState(&mousex,&mousey);
384 std::stringstream
buf;
389 if(cur_turns < 100) {
390 buf <<
_(
"Turns: ") << cur_turns;
392 buf <<
_(
"Unlimited turns");
412 buf <<
_(
"Experience modifier: ") << xpmod <<
"%";
471 buf <<
_(
"Turn bonus: ") << mp_countdown_turn_bonus_val;
480 buf <<
_(
"Action bonus: ") << mp_countdown_action_bonus_val;
488 DBG_MP << (hide ?
"hiding" :
"showing" ) <<
" children widgets" << std::endl;
543 DBG_MP <<
"laying out the children" << std::endl;
547 const int border_size = 6;
548 const int column_border_size = 10;
553 const int column_width = (ca.w - ca.x) / 2 - column_border_size;
565 int ypos_columntop = ypos;
567 const int right_pane_height =
580 ypos_left += 2 * border_size;
641 xpos += column_width + column_border_size;
642 ypos = ypos_columntop;
680 ypos_right +=
nolock_settings_->village_support_label_.height() + border_size;
683 ypos_right +=
nolock_settings_->village_support_slider_.height() + border_size;
690 ypos_right +=
nolock_settings_->village_gold_slider_.height() + 3 * border_size;
700 #ifdef OK_BUTTON_ON_RIGHT
706 ca.y + ca.h - right_button->
height());
void set_village_support(int value)
const int turns_max
maximum number of turns
const std::string & set_text(const std::string &text)
void set_countdown_action_bonus(int value)
void set_countdown_turn_bonus(int value)
void set_shroud(bool value)
void set_countdown_init_time(int value)
const mp_game_settings * mp_settings
void set_value(int value)
Add a special kind of assert to validate whether the input from WML doesn't contain any problems that...
boost::scoped_ptr< plugins_context > plugins_context_
void set_options(const config &values)
void hide_children(bool hide=true)
void set_scenario(const std::string &id)
Sets the selected scenario.
virtual void layout_children(const SDL_Rect &rect)
Lays the children out.
result get_result()
Returns the result of the current widget.
void set_increment(int increment)
void set_text(const std::string &text, const SDL_Color &color=font::NORMAL_COLOR)
void set_random_faction_mode(const std::string &value)
void show_transient_message(CVideo &video, const std::string &title, const std::string &message, const std::string &image, const bool message_use_markup, const bool title_use_markup, const bool restore_background)
Shows a transient message to the user.
GLint GLint GLint GLint GLint GLint y
void set_modifications(const std::vector< std::string > &ids)
Sets the activated modifications.
const std::string text() const
GLint GLenum GLsizei GLint GLsizei const GLvoid * data
void set_countdown(bool value)
const int turns_step
slider step size for turns
const SDL_Color NORMAL_COLOR
void set_registered_users_only(bool value)
virtual void hide_children(bool hide=true)
Hides or shows all gui::widget children of this widget.
This module controls the multiplayer lobby.
std::vector< std::string > active_mods
static UNUSEDNOWARN std::string _(const char *str)
A class that represents a TCP/IP connection to the wesnothd server.
result set_result(result res)
Sets the result of this dialog, to be checked by get_result().
General settings and defaults for scenarios.
static bool execute(std::string &password, CVideo &video)
The excute function see tdialog for more information.
const gui::label & title() const
void set_era(const std::string &id)
Sets the selected era.
void set_random_start_time(bool value)
virtual void enable(bool new_val=true)
GLenum GLuint GLsizei const char * buf
std::string campaign
the campaign being played
static UNUSEDNOWARN std::string gettext(const char *str)
GLuint GLuint GLsizei count
void set_allow_observers(bool value)
SDL_Rect client_area() const
void set_selected(int val)
const SDL_Color LOBBY_COLOR
config & gamelist()
Returns the current gamelist.
std::string get_scenario_id()
GLint GLint GLint GLint GLint x
void set_items(const std::vector< std::string > &items)
Declarations for File-IO.
const int turns_min
minimum number of turns
void set_turns(int value)
game_classification & classification()
void swap(game_board &one, game_board &other)
void set_campaign(const std::string &id)
Sets the selected campaign.
Standard logging facilities (interface).
const std::function< std::string(const config &, const std::string &) > get_str
void set_shuffle_sides(bool value)
this class memorizes a chat session.
const config & get_values()
Returns the the values for each option.
A config object defines a single node in a WML file, with access to child nodes.
void set_countdown_reservoir_time(int value)
void set_xp_modifier(int value)
GLsizei const GLcharARB ** string
void layout_widgets(int startx, int starty, int w)
void set_village_gold(int value)
void set_use_map_settings(bool value)
a base class for the different multiplayer base dialogs: game list, create game, wait game...
virtual void gamelist_updated(bool silent=true)
Called each time the gamelist_ variable is updated.