40 chosen_topic_(nullptr),
41 selected_item_(&toplevel,
"", 0)
57 if (sec.
id !=
"toplevel" &&
expanded_.insert(&sec).second) {
84 for (
const auto &
t : sec.
topics) {
93 std::stringstream to_show;
94 for (
unsigned i = 1;
i <
level; ++
i) {
104 std::stringstream to_show;
107 return to_show.str();
112 std::stringstream to_show;
115 return to_show.str();
120 topic_list::const_iterator tit =
122 if (tit != sec.
topics.end()) {
125 if (t.
id.size()<2 || t.
id[0] !=
'.' || t.
id[1] !=
'.')
146 for (std::vector<visible_item>::const_iterator it =
visible_items_.begin();
168 if (sec !=
nullptr) {
174 int x = mousex - menu::location().x;
182 if (menu::double_clicked() || x < text_start) {
188 }
else if (x >= text_start){
209 std::vector<std::string> menu_items;
210 for(std::vector<visible_item>::const_iterator items_it =
visible_items_.begin(),
212 std::string to_show = items_it->visible_string;
214 to_show = std::string(
"*") + to_show;
215 menu_items.push_back(to_show);
221 t(nullptr), sec(_sec), visible_string(vis_string),
level(lev) {}
228 return sec !=
nullptr && *
sec == _sec;
233 return t !=
nullptr && *
t == _t;
238 return t == vis_item.
t &&
sec == vis_item.
sec;
char const IMG_TEXT_SEPARATOR
const std::string open_section_img
const std::string topic_img
const std::string closed_section_img
A section contains topics and sections along with title and ID.
const std::string menu_expand
std::vector< std::string > empty_string_vector
bool is_visible_id(const std::string &id)
static map_location::DIRECTION s
const std::string menu_contract
const topic * find_topic(const section &sec, const std::string &id)
Search for the topic with the specified identifier in the section and its subsections.
uint32_t get_mouse_state(int *x, int *y)
A wrapper for SDL_GetMouseState that gives coordinates in draw space.
void play_UI_sound(const std::string &files)
A topic contains a title, an id and some text.
help::section default_toplevel