CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     David White <[EMAIL PROTECTED]> 05/02/05 04:09:07

Modified files:
        src            : game.cpp 

Log message:
        made the Wesnoth client respect the 'title' option for campaigns from 
the campaign server

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/game.cpp.diff?tr1=1.186&tr2=1.187&r1=text&r2=text

Patches:
Index: wesnoth/src/game.cpp
diff -u wesnoth/src/game.cpp:1.186 wesnoth/src/game.cpp:1.187
--- wesnoth/src/game.cpp:1.186  Sat Jan 29 17:25:19 2005
+++ wesnoth/src/game.cpp        Sat Feb  5 04:09:07 2005
@@ -1,4 +1,4 @@
-/* $Id: game.cpp,v 1.186 2005/01/29 17:25:19 Sirp Exp $ */
+/* $Id: game.cpp,v 1.187 2005/02/05 04:09:07 Sirp Exp $ */
 /*
    Copyright (C) 2003 by David White <[EMAIL PROTECTED]>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -1102,18 +1102,22 @@
 
                std::vector<std::string> delete_options;
 
-               for(config::child_list::const_iterator i = cmps.begin(); i != 
cmps.end(); ++i) {
-                       campaigns.push_back((**i)["name"]);
+               for(config::child_list::const_iterator i = cmps.begin(); i != 
cmps.end(); ++i) {
+                       const std::string& name = (**i)["name"];
+                       campaigns.push_back(name);
                        
-                       std::string name = (**i)["name"];
-
                        
if(std::count(publish_options.begin(),publish_options.end(),name) != 0) {
                                delete_options.push_back(name);
                        }
-
-                       std::replace(name.begin(),name.end(),'_',' ');
+
+                       std::string title = (**i)["title"];
+                       if(title == "") {
+                               title = name;
+                               std::replace(title.begin(),title.end(),'_',' ');
+                       }
+                       
                        options.push_back(IMAGE_PREFIX + (**i)["icon"] + 
COLUMN_SEPARATOR +
-                                         name + COLUMN_SEPARATOR +
+                                         title + COLUMN_SEPARATOR +
                                          (**i)["version"] + COLUMN_SEPARATOR +
                                          (**i)["author"] + COLUMN_SEPARATOR +
                                          (**i)["downloads"] + COLUMN_SEPARATOR 
+


Reply via email to