CVSROOT: /cvsroot/wesnoth
Module name: wesnoth
Branch:
Changes by: Kristoffer Erlandsson <[EMAIL PROTECTED]> 04/08/29
17:05:30
Modified files:
src : help.cpp
Log message:
The help system should open much faster after the first try now.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/help.cpp.diff?tr1=1.28&tr2=1.29&r1=text&r2=text
Patches:
Index: wesnoth/src/help.cpp
diff -u wesnoth/src/help.cpp:1.28 wesnoth/src/help.cpp:1.29
--- wesnoth/src/help.cpp:1.28 Sun Aug 29 16:48:01 2004
+++ wesnoth/src/help.cpp Sun Aug 29 17:05:29 2004
@@ -43,6 +43,9 @@
help::section toplevel;
// All sections and topics not referenced from the default toplevel.
help::section hidden_sections;
+
+ int last_num_encountered_units = -1;
+ int last_num_encountered_terrains = -1;
config dummy_cfg;
std::vector<std::string> empty_string_vector;
@@ -2369,7 +2372,13 @@
gui::draw_dialog(xloc, yloc, width, height, disp, _("The Battle for
Wesnoth Help"),
NULL, &buttons_ptr, &restorer);
- generate_contents();
+ if (preferences::encountered_units().size() !=
last_num_encountered_units
+ || preferences::encountered_terrains().size() !=
last_num_encountered_terrains) {
+ // More units or terrains encountered, update the contents.
+ last_num_encountered_units =
preferences::encountered_units().size();
+ last_num_encountered_terrains =
preferences::encountered_terrains().size();
+ generate_contents();
+ }
try {
help_browser hb(disp, toplevel_sec);
hb.set_location(xloc + left_padding, yloc + top_padding);