mail[Wesnoth-commits] r20765 - in /trunk: data/ data/core/ src/


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

Header


Content

Posted by benoit . timbert on September 28, 2007 - 23:35:
Author: noyga
Date: Fri Sep 28 23:34:32 2007
New Revision: 20765

URL: http://svn.gna.org/viewcvs/wesnoth?rev=20765&view=rev
Log:
apply patch #812 from Shadow master:
Adds an option to set the default gender of leader in Multiplayer mode.
This gender will be used for leaders whose unit that have both genders.

For the moment this option is very basic.
Misc improvements planned later:
- add a third "random" choice, which imho should be the default
- allow gender selection direction in the leader choice GUI, with 4 options :
 "male", "female", "random" or "default". "Default" should use the above 
option.

Modified:
    trunk/data/_main.cfg
    trunk/data/core/about.cfg
    trunk/src/game_preferences.cpp
    trunk/src/game_preferences.hpp
    trunk/src/multiplayer_connect.cpp
    trunk/src/multiplayer_create.cpp

Modified: trunk/data/_main.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/_main.cfg?rev=20765&r1=20764&r2=20765&view=diff
==============================================================================
--- trunk/data/_main.cfg (original)
+++ trunk/data/_main.cfg Fri Sep 28 23:34:32 2007
@@ -30,6 +30,13 @@
 [binary_path]
     path=data/core
 [/binary_path]
+
+[advanced_preference]
+    field=mp_female_leaders
+    name=_"Female leaders on MP (if available)"
+    type=boolean
+    default=no
+[/advanced_preference]
 
 [advanced_preference]
     field=compress_saves

Modified: trunk/data/core/about.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/core/about.cfg?rev=20765&r1=20764&r2=20765&view=diff
==============================================================================
--- trunk/data/core/about.cfg (original)
+++ trunk/data/core/about.cfg Fri Sep 28 23:34:32 2007
@@ -574,6 +574,10 @@
         name = "Hans-Joachim Gurt (HaJo)"
     [/entry]
     [entry]
+        name = "Ignacio Riquelme Morelle (Shadow Master)"
+        comment = "Test implementation of female leaders in multiplayer 
games"
+    [/entry]
+    [entry]
         name = "J.R. Blain (Cowboy)"
     [/entry]
     [entry]

Modified: trunk/src/game_preferences.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/game_preferences.cpp?rev=20765&r1=20764&r2=20765&view=diff
==============================================================================
--- trunk/src/game_preferences.cpp (original)
+++ trunk/src/game_preferences.cpp Fri Sep 28 23:34:32 2007
@@ -555,6 +555,11 @@
        return utils::string_bool(preferences::get("compress_saves"), true);
 }
 
+bool mp_female_leaders_flag()
+{
+       return utils::string_bool(preferences::get("mp_female_leaders"), 
false);
+}
+
 bool chat_timestamp()
 {
        return utils::string_bool(preferences::get("chat_timestamp"), false);

Modified: trunk/src/game_preferences.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/game_preferences.hpp?rev=20765&r1=20764&r2=20765&view=diff
==============================================================================
--- trunk/src/game_preferences.hpp (original)
+++ trunk/src/game_preferences.hpp Fri Sep 28 23:34:32 2007
@@ -161,6 +161,7 @@
        void set_chat_lines(int lines);
 
        bool compress_saves();
+       bool mp_female_leaders_flag();
 
        std::set<std::string> &encountered_units();
        std::set<t_translation::t_letter> &encountered_terrains();

Modified: trunk/src/multiplayer_connect.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/multiplayer_connect.cpp?rev=20765&r1=20764&r2=20765&view=diff
==============================================================================
--- trunk/src/multiplayer_connect.cpp (original)
+++ trunk/src/multiplayer_connect.cpp Fri Sep 28 23:34:32 2007
@@ -528,6 +528,7 @@
        }
 
        if(enabled_) {
+               if ( preferences::mp_female_leaders_flag() && controller_ == 
CNTR_LOCAL || controller_ == CNTR_COMPUTER ) res["gender"] = "female";
                if (leader_.empty()) {
                        res["type"] = llm_.get_leader();
                } else {

Modified: trunk/src/multiplayer_create.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/multiplayer_create.cpp?rev=20765&r1=20764&r2=20765&view=diff
==============================================================================
--- trunk/src/multiplayer_create.cpp (original)
+++ trunk/src/multiplayer_create.cpp Fri Sep 28 23:34:32 2007
@@ -480,6 +480,7 @@
                        side["side"] = lexical_cast<std::string>(pos+1);
                        side["team_name"] = lexical_cast<std::string>(pos+1);
                        side["canrecruit"] = "1";
+                       if ( preferences::mp_female_leaders_flag() ) 
side["gender"] = "female";
                        side["controller"] = "human";
                }
 




Related Messages


Powered by MHonArc, Updated Sat Sep 29 00:00:55 2007