Author: shadowmaster
Date: Fri May  2 03:16:17 2008
New Revision: 26298

URL: http://svn.gna.org/viewcvs/wesnoth?rev=26298&view=rev
Log:
* New, less-confusing fallback text when a saved game contains a null campaign 
field or the relevant campaign cannot be located.
* Output a campaign's internal id from saved game when debug mode is enabled

Modified:
    trunk/src/dialogs.cpp

Modified: trunk/src/dialogs.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/dialogs.cpp?rev=26298&r1=26297&r2=26298&view=diff
==============================================================================
--- trunk/src/dialogs.cpp (original)
+++ trunk/src/dialogs.cpp Fri May  2 03:16:17 2008
@@ -554,15 +554,20 @@
                str << "\n";
 
                if(campaign_type == "scenario") {
-                       const config* campaign = 
game_config_->find_child("campaign","id",summary["campaign"]);
+                       const std::string campaign_id = summary["campaign"];
+                       const config* campaign = campaign_id.empty() ? NULL : 
game_config_->find_child("campaign", "id", campaign_id);
+                       utils::string_map symbols;
                        if (campaign != NULL) {
-                               utils::string_map symbols;
                                symbols["campaign_name"] = (*campaign)["name"];
-                               //[EMAIL PROTECTED] FIXME: this is a 
superfluous manner of making the string, however, I'll keep it
-                               //! for the sake of not messing with the human 
side of i18n
-                               str << vgettext("Campaign: $campaign_name", 
symbols);   // FIXME: isn't this superfluous?
                        } else {
-                               str << _("#(unknown campaign)");
+                               // Fallback to nontranslatable campaign id.
+                               symbols["campaign_name"] = "(" + campaign_id + 
")";
+                       }
+                       str << vgettext("Campaign: $campaign_name", symbols);
+
+                       // Display internal id for debug purposes if we didn't 
above
+                       if (game_config::debug && (campaign != NULL)) {
+                               str << '\n' << "(" << campaign_id << ")";
                        }
                } else if(campaign_type == "multiplayer") {
                        str << _("Multiplayer");


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to