Author: alink
Date: Sat Jul 12 22:43:01 2008
New Revision: 27951

URL: http://svn.gna.org/viewcvs/wesnoth?rev=27951&view=rev
Log:
Fix "unit descrition" action for unit with hide_help=yes
Was broken by r25212 (unit lazy loading avoiding an old topic lazy loading)

Modified:
    trunk/src/help.cpp

Modified: trunk/src/help.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/help.cpp?rev=27951&r1=27950&r2=27951&view=diff
==============================================================================
--- trunk/src/help.cpp (original)
+++ trunk/src/help.cpp Sat Jul 12 22:43:01 2008
@@ -1193,6 +1193,9 @@
 public:
        unit_topic_generator(const unit_type &t): type_(t) {}
        virtual std::string operator()() const {
+               // this will force the lazy loading to build this unit
+               unit_type_data::types().find(type_.id(), 
unit_type::WITHOUT_ANIMATIONS);
+               
                std::stringstream ss;
                std::string clear_stringstream;
                const std::string detailed_description = 
type_.unit_description();
@@ -1574,7 +1577,7 @@
                const std::string type_name = type.type_name();
                const std::string ref_id = hidden_symbol(type.hide_help()) + 
unit_prefix +  type.id();
                topic unit_topic(type_name, ref_id, "");
-               //unit_topic.text = new unit_topic_generator(type);
+               unit_topic.text = new unit_topic_generator(type);
                topics.push_back(unit_topic);
 
                if (!type.hide_help()) {
@@ -2710,15 +2713,6 @@
                }
        }
 
-    //if this is a unit help, check if all needed information is available
-    if (t.text.parsed_text().size() == 0){
-        if (t.id.find(unit_prefix) == 0){
-            std::string unit_id = t.id.substr(unit_prefix.length(), 
t.id.length() - unit_prefix.length());
-            const unit_type& type = unit_type_data::types().find(unit_id, 
unit_type::WITHOUT_ANIMATIONS)->second;
-            t.text = new unit_topic_generator(type);
-        }
-    }
-
        shown_topic_ = &t;
        text_area_.show_topic(t);
        menu_.select_topic(t);


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

Reply via email to