Skip to content

Commit

Permalink
Merge branch 'master' of git://github.com/wesnoth/wesnoth
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeck88 committed Jun 25, 2014
2 parents 6ec86c9 + e13775f commit 0982d9d
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 31 deletions.
36 changes: 35 additions & 1 deletion src/gui/dialogs/game_cache_options.cpp
Expand Up @@ -35,7 +35,41 @@
namespace gui2
{

// TODO: wikidoc!
/*WIKI
* @page = GUIWindowDefinitionWML
* @order = 2_game_cache_options
*
* == Game cache options ==
*
* A Preferences subdialog including a report on the location and size of the
* game's WML cache, buttons to copy its path to clipboard or browse to it,
* and the possibility of clearing stale files from the cache or purging it
* entirely.
*
* @begin{table}{dialog_widgets}
*
* path & & text_box & m &
* Cache dir path. $
*
* copy & & button & m &
* Copies the cache path to clipboard. $
*
* browse & & button & m &
* Browses to the cache path using the platform's file management
* application. $
*
* size & & label & m &
* Current total size of the cache dir's contents. $
*
* clean & & button & m &
* Cleans the cache, erasing stale files not used by the Wesnoth
* version presently running the dialog. $
*
* purge & & button & m &
* Purges the cache in its entirety. $
*
* @end{table}
*/

REGISTER_DIALOG(game_cache_options)

Expand Down
8 changes: 1 addition & 7 deletions src/mp_game_settings.cpp
Expand Up @@ -48,8 +48,6 @@ mp_game_settings::mp_game_settings() :
shroud_game(false),
allow_observers(false),
shuffle_sides(false),
share_view(false),
share_maps(false),
saved_game(false),
options()

Expand Down Expand Up @@ -82,8 +80,6 @@ mp_game_settings::mp_game_settings(const config& cfg) :
shroud_game(false),
allow_observers(false),
shuffle_sides(false),
share_view(false),
share_maps(false),
saved_game(false),
options()
{
Expand Down Expand Up @@ -117,8 +113,6 @@ mp_game_settings::mp_game_settings(const mp_game_settings& settings)
, shroud_game(settings.shroud_game)
, allow_observers(settings.allow_observers)
, shuffle_sides(settings.shuffle_sides)
, share_view(settings.share_view)
, share_maps(settings.share_maps)
, saved_game(settings.saved_game)
, options(settings.options)
{
Expand Down Expand Up @@ -179,7 +173,7 @@ void mp_game_settings::reset()
mp_countdown_turn_bonus=0;
mp_countdown_action_bonus=0;
mp_countdown=false;
use_map_settings = random_start_time = fog_game = shroud_game = allow_observers = shuffle_sides = share_view = share_maps = false;
use_map_settings = random_start_time = fog_game = shroud_game = allow_observers = shuffle_sides = false;
options.clear();
}

Expand Down
2 changes: 0 additions & 2 deletions src/mp_game_settings.hpp
Expand Up @@ -59,8 +59,6 @@ struct mp_game_settings : public savegame::savegame_config
bool shroud_game;
bool allow_observers;
bool shuffle_sides;
bool share_view;
bool share_maps;

bool saved_game;

Expand Down
3 changes: 0 additions & 3 deletions src/multiplayer.cpp
Expand Up @@ -782,9 +782,6 @@ void start_local_game_commandline(game_display& disp, const config& game_config,
parameters.use_map_settings = true;
}

// We also want the following in order to be consistent with MP lobby mode:
parameters.share_view = true;

// None of the other parameters need to be set, as their creation values above are good enough for CL mode.
// In particular, we do not want to use the preferences values.

Expand Down
14 changes: 2 additions & 12 deletions src/multiplayer_configure.cpp
Expand Up @@ -82,7 +82,6 @@ configure::configure(game_display& disp, const config &cfg, chat& c, config& gam
cancel_game_(disp.video(), _("Back")),
launch_game_(disp.video(), _("OK")),
password_button_(disp.video(), _("Set Password...")),
vision_combo_(disp, std::vector<std::string>()),
name_entry_(disp.video(), 32),
entry_points_label_(disp.video(), _("Select an entry point:"), font::SIZE_SMALL, font::LOBBY_COLOR),
entry_points_combo_(disp, std::vector<std::string>()),
Expand Down Expand Up @@ -171,14 +170,13 @@ configure::configure(game_display& disp, const config &cfg, chat& c, config& gam
shuffle_sides_.set_check(preferences::shuffle_sides());
shuffle_sides_.set_help_string(_("Assign sides to players at random"));

#if 0
// The possible vision settings
std::vector<std::string> vision_types;
vision_types.push_back(_("Share View"));
vision_types.push_back(_("Share Maps"));
vision_types.push_back(_("Share None"));
vision_combo_.set_items(vision_types);
vision_combo_.set_selected(0);

#endif
// The starting points for campaign.
std::vector<std::string> entry_point_titles;

Expand Down Expand Up @@ -288,8 +286,6 @@ const mp_game_settings& configure::get_parameters()
parameters_.shroud_game = shroud_game_.checked();
parameters_.allow_observers = observers_game_.checked();
parameters_.shuffle_sides = shuffle_sides_.checked();
parameters_.share_view = vision_combo_.selected() == 0;
parameters_.share_maps = vision_combo_.selected() == 1;

parameters_.options = options_manager_.get_values();

Expand Down Expand Up @@ -506,7 +502,6 @@ void configure::hide_children(bool hide)
launch_game_.hide(hide);

password_button_.hide(hide);
vision_combo_.hide(hide);
name_entry_.hide(hide);

entry_points_label_.hide(hide);
Expand Down Expand Up @@ -554,11 +549,6 @@ void configure::layout_children(const SDL_Rect& rect)

int slider_width = options_pane_left_.width() - 40;

#ifdef MP_VISION_OPTIONAL
vision_combo_.set_location(xpos, ypos);
ypos += vision_combo_.height() + border_size;
#endif

int xpos_left = 0;
int ypos_left = 0;

Expand Down
1 change: 0 additions & 1 deletion src/multiplayer_configure.hpp
Expand Up @@ -82,7 +82,6 @@ class configure : public mp::ui
gui::button launch_game_;
gui::button password_button_;

gui::combo vision_combo_;
gui::textbox name_entry_;

gui::label entry_points_label_;
Expand Down
5 changes: 2 additions & 3 deletions src/multiplayer_connect_engine.cpp
Expand Up @@ -1047,9 +1047,8 @@ config side_engine::new_config() const
(res["shroud"] != "yes" && res["shroud"] != "no")) {
res["shroud"] = parent_.params_.shroud_game;
}

res["share_maps"] = parent_.params_.share_maps;
res["share_view"] = parent_.params_.share_view;
//share view default to true here to restore the previous behaviour.
res["share_view"] = res["share_view"].to_bool(true);

if (!parent_.params_.use_map_settings || res["village_gold"].empty()) {
res["village_gold"] = parent_.params_.village_gold;
Expand Down
7 changes: 5 additions & 2 deletions src/play_controller.cpp
Expand Up @@ -242,6 +242,9 @@ void play_controller::init(CVideo& video){
browse_ = true;

init_managers();
#if 0
// [era] and [modification] childs don't exist anymore in level_
// the events are now added in saved_game::expand_mp_events
// add era & mod events for MP game
if (const config &era_cfg = level_.child("era")) {
game_events::add_events(era_cfg.child_range("event"), "era_events");
Expand All @@ -256,6 +259,7 @@ void play_controller::init(CVideo& video){
}
}
}
#endif
loadscreen::global_loadscreen->start_stage("start game");
loadscreen_manager->reset();
}
Expand Down Expand Up @@ -648,9 +652,8 @@ config play_controller::to_config() const
sound::write_music_play_list(cfg);
}

//TODO: move id_manager handling to play_controller
cfg["next_underlying_unit_id"] = str_cast(n_unit::id_manager::instance().get_save_id());

//TODO: i am not sure whether the next line is needed.
cfg.merge_attributes(saved_game_.classification().to_config());
return cfg;
}
Expand Down

0 comments on commit 0982d9d

Please sign in to comment.