[Widelands-cvs] SF.net SVN: widelands: [3177] trunk/src
Status: Beta
Brought to you by:
sirver
From: <si...@us...> - 2008-04-12 19:28:50
|
Revision: 3177 http://widelands.svn.sourceforge.net/widelands/?rev=3177&view=rev Author: sigra Date: 2008-04-12 12:28:45 -0700 (Sat, 12 Apr 2008) Log Message: ----------- Make automatic roadbuilding mode after creation of non-connected flag optional. Requested by Mazze. Modified Paths: -------------- trunk/src/interactive_base.cc trunk/src/interactive_base.h trunk/src/ui/ui_fs_menus/fullscreen_menu_options.cc trunk/src/ui/ui_fs_menus/fullscreen_menu_options.h Modified: trunk/src/interactive_base.cc =================================================================== --- trunk/src/interactive_base.cc 2008-04-11 10:24:22 UTC (rev 3176) +++ trunk/src/interactive_base.cc 2008-04-12 19:28:45 UTC (rev 3177) @@ -91,6 +91,7 @@ (get_xres(), get_yres(), s.get_int("depth", 16), s.get_bool("fullscreen", false)); + m_auto_roadbuild_mode = s.get_bool("auto_roadbuild_mode", true); m_show_workarea_preview = s.get_bool("workareapreview", false); } @@ -285,7 +286,8 @@ Widelands::Field & field = egbase().map()[m_flag_to_connect]; if (upcast(Widelands::Flag const, flag, field.get_immovable())) { if (not flag->has_road() and not m_buildroad) - start_build_road(m_flag_to_connect, field.get_owned_by()); + if (m_auto_roadbuild_mode) + start_build_road(m_flag_to_connect, field.get_owned_by()); m_flag_to_connect = Coords::Null(); } } Modified: trunk/src/interactive_base.h =================================================================== --- trunk/src/interactive_base.h 2008-04-11 10:24:22 UTC (rev 3176) +++ trunk/src/interactive_base.h 2008-04-12 19:28:45 UTC (rev 3177) @@ -60,6 +60,7 @@ static int32_t get_xres(); static int32_t get_yres(); + bool m_auto_roadbuild_mode; bool m_show_workarea_preview; // point of view for drawing Modified: trunk/src/ui/ui_fs_menus/fullscreen_menu_options.cc =================================================================== --- trunk/src/ui/ui_fs_menus/fullscreen_menu_options.cc 2008-04-11 10:24:22 UTC (rev 3176) +++ trunk/src/ui/ui_fs_menus/fullscreen_menu_options.cc 2008-04-12 19:28:45 UTC (rev 3177) @@ -49,24 +49,27 @@ 2, &Fullscreen_Menu_Options::end_modal, this, om_ok, _("Apply")), -m_title(this, MENU_XRES / 2, 30, _("General Options"), Align_HCenter), -m_fullscreen(this, 300, 110), -m_label_fullscreen(this, 325, 120, _("Fullscreen"), Align_VCenter), +m_title(this, MENU_XRES / 2, 0, _("General Options"), Align_HCenter), +m_fullscreen(this, 300, 80), +m_label_fullscreen(this, 325, 90, _("Fullscreen"), Align_VCenter), m_inputgrab(this, 300, 140), -m_label_inputgrab(this, 325, 150, _("Grab Input"), Align_VCenter), -m_music(this, 300, 170), -m_label_music(this, 325, 180, _("Enable Music"), Align_VCenter), -m_fx(this, 300, 200), -m_label_fx(this, 325, 210, _("Enable Sound"), Align_VCenter), -m_reslist(this, 80, 110, 190, 150, Align_Left, true), -m_label_resolution(this, 85, 95, _("In-game resolution"), Align_VCenter), -m_label_language(this, MENU_XRES / 2 + 85, 95, _("Language"), Align_VCenter), -m_language_list(this, MENU_XRES / 2 + 75, 110, 210, 150, Align_Left, true), +m_label_inputgrab(this, 325, 120, _("Grab Input"), Align_VCenter), +m_music(this, 300, 140), +m_label_music(this, 325, 150, _("Enable Music"), Align_VCenter), +m_fx(this, 300, 170), +m_label_fx(this, 325, 180, _("Enable Sound"), Align_VCenter), +m_reslist(this, 80, 80, 190, 150, Align_Left, true), +m_label_resolution(this, 85, 65, _("In-game resolution"), Align_VCenter), +m_label_language(this, MENU_XRES / 2 + 85, 65, _("Language"), Align_VCenter), +m_language_list(this, MENU_XRES / 2 + 75, 80, 210, 150, Align_Left, true), m_label_game_options - (this, MENU_XRES / 2, 300, _("In-game Options"), Align_HCenter), -m_single_watchwin(this, 85, 355), + (this, MENU_XRES / 2, 270, _("In-game Options"), Align_HCenter), +m_single_watchwin(this, 85, 325), m_label_single_watchwin - (this, 110, 365, _("Use single Watchwindow Mode"), Align_VCenter), + (this, 110, 335, _("Use single Watchwindow Mode"), Align_VCenter), +m_auto_roadbuild_mode(this, 85, 355), +m_label_auto_roadbuild_mode + (this, 110, 365, _("Start roadbuilding after placing flag"), Align_VCenter), m_show_workarea_preview(this, 85, 385), m_label_show_workarea_preview (this, 110, 395, _("Show buildings area preview"), Align_VCenter), @@ -88,6 +91,7 @@ m_fx .set_state(opt.fx); m_fx .set_enabled(not g_sound_handler.m_lock_audio_disabling); m_single_watchwin .set_state(opt.single_watchwin); + m_auto_roadbuild_mode .set_state(opt.auto_roadbuild_mode); m_show_workarea_preview .set_state(opt.show_warea); m_snap_windows_only_when_overlapping.set_state (opt.snap_windows_only_when_overlapping); @@ -171,6 +175,7 @@ m_inputgrab .get_state (), m_fullscreen .get_state (), m_single_watchwin .get_state (), + m_auto_roadbuild_mode .get_state (), m_show_workarea_preview .get_state (), m_snap_windows_only_when_overlapping.get_state (), m_dock_windows_to_edges .get_state (), @@ -207,6 +212,7 @@ opt.inputgrab = s->get_bool("inputgrab", false); opt.fullscreen = s->get_bool("fullscreen", false); opt.single_watchwin = s->get_bool("single_watchwin", false); + opt.auto_roadbuild_mode = s->get_bool("auto_roadbuild_mode", true); opt.show_warea = s->get_bool("workareapreview", false); opt.snap_windows_only_when_overlapping = s->get_bool("snap_windows_only_when_overlapping", false); @@ -225,6 +231,7 @@ m_opt_section->set_bool("fullscreen", opt.fullscreen); m_opt_section->set_bool("inputgrab", opt.inputgrab); m_opt_section->set_bool("single_watchwin", opt.single_watchwin); + m_opt_section->set_bool("auto_roadbuild_mode", opt.auto_roadbuild_mode); m_opt_section->set_bool("workareapreview", opt.show_warea); m_opt_section->set_bool ("snap_windows_only_when_overlapping", Modified: trunk/src/ui/ui_fs_menus/fullscreen_menu_options.h =================================================================== --- trunk/src/ui/ui_fs_menus/fullscreen_menu_options.h 2008-04-11 10:24:22 UTC (rev 3176) +++ trunk/src/ui/ui_fs_menus/fullscreen_menu_options.h 2008-04-12 19:28:45 UTC (rev 3177) @@ -44,6 +44,7 @@ bool inputgrab; bool fullscreen; bool single_watchwin; + bool auto_roadbuild_mode; bool show_warea; bool snap_windows_only_when_overlapping; bool dock_windows_to_edges; @@ -92,6 +93,8 @@ UI::Textarea m_label_game_options; UI::Checkbox m_single_watchwin; UI::Textarea m_label_single_watchwin; + UI::Checkbox m_auto_roadbuild_mode; + UI::Textarea m_label_auto_roadbuild_mode; UI::Checkbox m_show_workarea_preview; UI::Textarea m_label_show_workarea_preview; UI::Checkbox m_snap_windows_only_when_overlapping; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |