Author: sapient
Date: Mon Apr 16 02:14:55 2007
New Revision: 16857

URL: http://svn.gna.org/viewcvs/wesnoth?rev=16857&view=rev
Log:
syntax change to portrait effect and add unit_description also

Modified:
    trunk/changelog
    trunk/src/unit.cpp

Modified: trunk/changelog
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/changelog?rev=16857&r1=16856&r2=16857&view=diff
==============================================================================
--- trunk/changelog (original)
+++ trunk/changelog Mon Apr 16 02:14:55 2007
@@ -76,7 +76,7 @@
    * use complex variable substitution almost everywhere
    * new key for [set_variable], literal=, to avoid variable substitution
    * [effect] can now toggle the zoc
-   * [effect] can now apply new portrait images
+   * [effect] can now apply new portrait images and unit type descriptions
    * new key for [variable], boolean_equals=, to test boolean equality
    * remove some old backward compatibility support
    * set_name in attack modification [effect] no longer change the weapon's

Modified: trunk/src/unit.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit.cpp?rev=16857&r1=16856&r2=16857&view=diff
==============================================================================
--- trunk/src/unit.cpp (original)
+++ trunk/src/unit.cpp Mon Apr 16 02:14:55 2007
@@ -2403,8 +2403,12 @@
                        wassert(gamedata_ != NULL);
                        const game_data::unit_type_map::const_iterator var = 
gamedata_->unit_types.find(id());
                        advance_to(&var->second.get_variation(variation_));
-               } else if(apply_to == "portrait") {
-                       cfg_["profile"] = (**i.first)["image"];
+               } else if(apply_to == "profile") {
+                       const std::string& portrait = (**i.first)["portrait"];
+                       const std::string& description = 
(**i.first)["description"];
+                       if(!portrait.empty()) cfg_["profile"] = portrait;
+                       if(!description.empty()) cfg_["unit_description"] = 
description;
+                       //help::unit_topic_generator(*this, 
(**i.first)["help_topic"]);
                } else if(apply_to == "new_attack") {
                        
attacks_.push_back(attack_type(**i.first,id(),image_fighting((**i.first)["range"]=="ranged"
 ? attack_type::LONG_RANGE : attack_type::SHORT_RANGE)));
                } else if(apply_to == "remove_attacks") {


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

Reply via email to