mail[Wesnoth-commits] r40139 - /branches/fendrin_gui_stuff/src/menu_events.cpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by fabianmueller5 on December 06, 2009 - 11:00:
Author: fendrin
Date: Sun Dec  6 11:00:42 2009
New Revision: 40139

URL: http://svn.gna.org/viewcvs/wesnoth?rev=40139&view=rev
Log:
Disabled the gui2 debug create unit dialog and enabled the gui1 one for 
testing purposes.

Modified:
    branches/fendrin_gui_stuff/src/menu_events.cpp

Modified: branches/fendrin_gui_stuff/src/menu_events.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/fendrin_gui_stuff/src/menu_events.cpp?rev=40139&r1=40138&r2=40139&view=diff
==============================================================================
--- branches/fendrin_gui_stuff/src/menu_events.cpp (original)
+++ branches/fendrin_gui_stuff/src/menu_events.cpp Sun Dec  6 11:00:42 2009
@@ -1314,65 +1314,65 @@
        }
 }
 
-void menu_handler::create_unit_2(mouse_handler& mousehandler)
-{
-       assert(gui_ != NULL);
-       //
-       // The unit creation dialog makes sure unit types
-       // are properly cached.
-       //
-       gui2::tunit_create create_dlg;
-       create_dlg.show(gui_->video());
-
-       if(create_dlg.no_choice()) {
-               return;
-       }
-
-       const std::string& ut_id = create_dlg.choice();
-       unit_type_data::unit_type_map::const_iterator i =
-       unit_type_data::types().find_unit_type(ut_id);
-       if(i == unit_type_data::types().end()) {
-               ERR_NG << "create unit dialog returned inexistent or unusable 
unit_type id '" << ut_id << "'\n";
-               return;
-       }
-
-       const unit_type& ut = i->second;
-
-       unit_race::GENDER gender = create_dlg.gender();
-       const bool generate_name = create_dlg.generate_name();
-
-       // Do not try to set bad genders, may mess up l10n
-       // FIXME: is this actually necessary?
-       if(ut.genders().end() == std::find(ut.genders().begin(), 
ut.genders().end(), gender)) {
-               gender = ut.genders().front();
-       }
-
-       unit chosen(&units_, &ut, 1, true, gender, "");
-       chosen.new_turn();
-
-       //FIXME: the generate name option seems useless now, remove it
-       if(!generate_name)
-       chosen.set_name("");
-
-       const map_location& loc = mousehandler.get_last_hex();
-       units_.replace(loc, chosen);
-
-       if(map_.is_village(loc)) {
-               get_village(loc, chosen.side());
-       }
-
-       gui_->invalidate(loc);
-       gui_->invalidate_unit();
-}
+//void menu_handler::create_unit_2(mouse_handler& mousehandler)
+//{
+//     assert(gui_ != NULL);
+//     //
+//     // The unit creation dialog makes sure unit types
+//     // are properly cached.
+//     //
+//     gui2::tunit_create create_dlg;
+//     create_dlg.show(gui_->video());
+//
+//     if(create_dlg.no_choice()) {
+//             return;
+//     }
+//
+//     const std::string& ut_id = create_dlg.choice();
+//     unit_type_data::unit_type_map::const_iterator i =
+//     unit_type_data::types().find_unit_type(ut_id);
+//     if(i == unit_type_data::types().end()) {
+//             ERR_NG << "create unit dialog returned inexistent or unusable 
unit_type id '" << ut_id << "'\n";
+//             return;
+//     }
+//
+//     const unit_type& ut = i->second;
+//
+//     unit_race::GENDER gender = create_dlg.gender();
+//     const bool generate_name = create_dlg.generate_name();
+//
+//     // Do not try to set bad genders, may mess up l10n
+//     // FIXME: is this actually necessary?
+//     if(ut.genders().end() == std::find(ut.genders().begin(), 
ut.genders().end(), gender)) {
+//             gender = ut.genders().front();
+//     }
+//
+//     unit chosen(&units_, &ut, 1, true, gender, "");
+//     chosen.new_turn();
+//
+//     //FIXME: the generate name option seems useless now, remove it
+//     if(!generate_name)
+//     chosen.set_name("");
+//
+//     const map_location& loc = mousehandler.get_last_hex();
+//     units_.replace(loc, chosen);
+//
+//     if(map_.is_village(loc)) {
+//             get_village(loc, chosen.side());
+//     }
+//
+//     gui_->invalidate(loc);
+//     gui_->invalidate_unit();
+//}
 
 void menu_handler::create_unit(mouse_handler& mousehandler)
 {
        /** @todo: reenable after releasing 1.7.4; as-is causes memory 
corruption */
        //      if(gui2::new_widgets) {
-       if(true) {
-               create_unit_2(mousehandler);
-               return;
-       }
+//     if(true) {
+//             create_unit_2(mousehandler);
+//             return;
+//     }
 
        std::vector<std::string> options;
        static int last_selection = -1;




Related Messages


Powered by MHonArc, Updated Sun Dec 06 12:00:07 2009