36 chosen_topic_(nullptr),
37 selected_item_(&toplevel,
"", 0)
53 if (sec.
id !=
"toplevel" &&
expanded_.insert(&sec).second) {
80 for (
const auto &
t : sec.
topics) {
89 std::stringstream to_show;
90 for (
unsigned i = 1;
i <
level; ++
i) {
100 std::stringstream to_show;
103 return to_show.str();
108 std::stringstream to_show;
111 return to_show.str();
116 topic_list::const_iterator tit =
118 if (tit != sec.
topics.end()) {
121 if (
t.id.size()<2 ||
t.id[0] !=
'.' ||
t.id[1] !=
'.')
142 for (std::vector<visible_item>::const_iterator it =
visible_items_.begin();
164 if (sec !=
nullptr) {
170 int x = mousex - menu::location().x;
178 if (menu::double_clicked() ||
x < text_start) {
184 }
else if (
x >= text_start){
205 std::vector<std::string> menu_items;
206 for(std::vector<visible_item>::const_iterator items_it =
visible_items_.begin(),
208 std::string to_show = items_it->visible_string;
210 to_show = std::string(
"*") + to_show;
211 menu_items.push_back(to_show);
217 t(nullptr), sec(_sec), visible_string(vis_string),
level(lev) {}
220 t(_t), sec(nullptr), visible_string(vis_string),
level(lev) {}
224 return sec !=
nullptr && *sec == _sec;
229 return t !=
nullptr && *
t == _t;
234 return t == vis_item.
t && sec == vis_item.
sec;
const std::string menu_expand
const std::string menu_contract
const std::string open_section_img
bool is_visible_id(const std::string &id)
const std::string closed_section_img
const std::string topic_img
std::vector< std::string > empty_string_vector
help::section default_toplevel
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 section contains topics and sections along with title and ID.
A topic contains a title, an id and some text.
static map_location::DIRECTION s
char const IMG_TEXT_SEPARATOR