[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Wesnoth-cvs-commits] wesnoth/src help.cpp
From: |
Guillaume Melquiond |
Subject: |
[Wesnoth-cvs-commits] wesnoth/src help.cpp |
Date: |
Fri, 03 Dec 2004 13:03:51 -0500 |
CVSROOT: /cvsroot/wesnoth
Module name: wesnoth
Branch:
Changes by: Guillaume Melquiond <address@hidden> 04/12/03 17:57:36
Modified files:
src : help.cpp
Log message:
Remove two useless parameters. And fix bug #11110 as a corollary.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/help.cpp.diff?tr1=1.59&tr2=1.60&r1=text&r2=text
Patches:
Index: wesnoth/src/help.cpp
diff -u wesnoth/src/help.cpp:1.59 wesnoth/src/help.cpp:1.60
--- wesnoth/src/help.cpp:1.59 Thu Dec 2 22:21:45 2004
+++ wesnoth/src/help.cpp Fri Dec 3 17:57:35 2004
@@ -286,11 +286,9 @@
const int x_, y_;
};
- /// Update the vector with items, creating surfaces for everything
- /// and putting things where they belong. parsed_items should be a
- /// vector with parsed strings, such as parse_text returns.
- void set_items(const std::vector<std::string> &parsed_items,
- const std::string &title);
+ /// Update the vector with the items of the shown topic, creating
+ /// surfaces for everything and putting things where they belong.
+ void set_items();
// Create appropriate items from configs. Items will be added to the
// internal vector. These methods check that the necessary
@@ -1615,11 +1613,13 @@
void help_text_area::set_inner_location(SDL_Rect const &rect) {
bg_register(rect);
+ if (shown_topic_)
+ set_items();
}
void help_text_area::show_topic(const topic &t) {
shown_topic_ = &t;
- set_items(t.text, t.title);
+ set_items();
set_dirty(true);
}
@@ -1644,8 +1644,7 @@
rect.h = box ? surface->h + box_width * 2 : surface->h;
}
-void help_text_area::set_items(const std::vector<std::string> &parsed_items,
- const std::string
&title) {
+void help_text_area::set_items() {
last_row_.clear();
items_.clear();
curr_loc_.first = 0;
@@ -1663,6 +1662,7 @@
down_one_line();
}
// Parse and add the text.
+ std::vector<std::string> const &parsed_items = shown_topic_->text;
std::vector<std::string>::const_iterator it;
for (it = parsed_items.begin(); it != parsed_items.end(); it++) {
if (*it != "" && (*it)[0] == '[') {
- [Wesnoth-cvs-commits] wesnoth/src help.cpp,
Guillaume Melquiond <=