wesnoth-cvs-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Wesnoth-cvs-commits] wesnoth/src game_events.cpp team.cpp team.hpp


From: Philippe Plantier
Subject: [Wesnoth-cvs-commits] wesnoth/src game_events.cpp team.cpp team.hpp
Date: Sat, 19 Mar 2005 16:26:30 -0500

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     Philippe Plantier <address@hidden>      05/03/19 21:26:30

Modified files:
        src            : game_events.cpp team.cpp team.hpp 

Log message:
        * Added the silent= option in the [objectives] tag, which allows 
objectives to
        be silently changed.
        * When there are no objectives in a category (win / lose), this 
category is now
        not displayed at all.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/game_events.cpp.diff?tr1=1.131&tr2=1.132&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/team.cpp.diff?tr1=1.82&tr2=1.83&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/team.hpp.diff?tr1=1.54&tr2=1.55&r1=text&r2=text

Patches:
Index: wesnoth/src/game_events.cpp
diff -u wesnoth/src/game_events.cpp:1.131 wesnoth/src/game_events.cpp:1.132
--- wesnoth/src/game_events.cpp:1.131   Sat Mar 19 18:25:21 2005
+++ wesnoth/src/game_events.cpp Sat Mar 19 21:26:30 2005
@@ -1,4 +1,4 @@
-/* $Id: game_events.cpp,v 1.131 2005/03/19 18:25:21 gruikya Exp $ */
+/* $Id: game_events.cpp,v 1.132 2005/03/19 21:26:30 gruikya Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -531,10 +531,10 @@
        else if(cmd == "objectives") {
                const std::string win_str = "@";
                const std::string lose_str = "#";
-               const std::string none_str = _("None specified");
 
                const std::string& summary = cfg["summary"];
                const size_t side = lexical_cast_default<size_t>(cfg["side"], 
0);
+               bool silent = cfg["silent"] == "yes";
 
                if(side != 0 && (side - 1) >= teams->size()) {
                        ERR_NG << "Invalid side: " << cfg["side"] << " in 
objectives event\n";
@@ -574,16 +574,12 @@
                std::stringstream objs;
                if(!summary.empty())
                        objs << "*" << summary << "\n";
-               objs << win_string << "\n";
-               if(win_objectives.empty()) {
-                       objs << none_str << "\n";
-               } else {
+               if(!win_objectives.empty()) {
+                       objs << win_string << "\n";
                        objs << win_objectives << "\n";
                }
-               objs << lose_string << "\n";
-               if(lose_objectives.empty()) {
-                       objs << none_str << "\n";
-               } else {
+               if(!lose_objectives.empty()) {
+                       objs << lose_string << "\n";
                        objs << lose_objectives << "\n";
                }
 
@@ -591,10 +587,10 @@
                        for(std::vector<team>::iterator itor = teams->begin();
                                        itor != teams->end(); ++itor) {
 
-                               itor->set_objectives(objs.str());
+                               itor->set_objectives(objs.str(), silent);
                        }
                } else {
-                       (*teams)[side - 1].set_objectives(objs.str());
+                       (*teams)[side - 1].set_objectives(objs.str(), silent);
                }
        }
 
Index: wesnoth/src/team.cpp
diff -u wesnoth/src/team.cpp:1.82 wesnoth/src/team.cpp:1.83
--- wesnoth/src/team.cpp:1.82   Sat Mar 19 13:02:34 2005
+++ wesnoth/src/team.cpp        Sat Mar 19 21:26:30 2005
@@ -1,4 +1,4 @@
-/* $Id: team.cpp,v 1.82 2005/03/19 13:02:34 gruikya Exp $ */
+/* $Id: team.cpp,v 1.83 2005/03/19 21:26:30 gruikya Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -526,10 +526,11 @@
        return info_.save_id;
 }
 
-void team::set_objectives(const std::string& new_objectives)
+void team::set_objectives(const std::string& new_objectives, bool silently)
 {
        info_.objectives = new_objectives;
-       info_.objectives_changed = true;
+       if(!silently)
+               info_.objectives_changed = true;
 }
 
 void team::reset_objectives_changed() 
Index: wesnoth/src/team.hpp
diff -u wesnoth/src/team.hpp:1.54 wesnoth/src/team.hpp:1.55
--- wesnoth/src/team.hpp:1.54   Sat Mar 19 13:02:34 2005
+++ wesnoth/src/team.hpp        Sat Mar 19 21:26:30 2005
@@ -1,4 +1,4 @@
-/* $Id: team.hpp,v 1.54 2005/03/19 13:02:34 gruikya Exp $ */
+/* $Id: team.hpp,v 1.55 2005/03/19 21:26:30 gruikya Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -125,7 +125,7 @@
        const std::string& name() const;
        const std::string& save_id() const;
 
-       void set_objectives(const std::string& new_objectives);
+       void set_objectives(const std::string& new_objectives, bool 
silently=false);
        void reset_objectives_changed();
 
        const std::string& objectives() const;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]