The Battle for Wesnoth 1.21.0-dev
 
Loading...
Searching...
No Matches
campaign_selection.cpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2009 - 2025
3 by Mark de Wever <koraq@xs4all.nl>
4 Part of the Battle for Wesnoth Project https://www.wesnoth.org/
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY.
12
13 See the COPYING file for more details.
14*/
15
16#define GETTEXT_DOMAIN "wesnoth-lib"
17
19
20#include "filesystem.hpp"
34
35#include <functional>
36
37namespace gui2::dialogs
38{
39
40namespace
41{
42 // These arbitary strings are used instead of a campaign id for the special pages
43 // which can appear in the right-hand pane. The data for those pages is loaded
44 // from the tree_view's WML via ids hardcoded in pre_show().
45 const std::string PAGE_ID_GET_ADDONS = "////addons////";
46 const std::string PAGE_ID_LANDING_PAGE = "////landing-page////";
47 const std::string PAGE_ID_MISSING_CAMPAIGNS = "////missing-campaign////";
48
49 // The campaign_rng_mode preference stores a string mirroring the savefile's random_mode RNG.
50 const std::vector<std::string> rng_mode_prefs{"default", "deterministic", "biased"};
51};
52
53REGISTER_DIALOG(campaign_selection)
54
56 : modal_dialog(window_id())
57 , engine_(eng)
58 , choice_(-1)
59 , rng_mode_(RNG_DEFAULT)
60 , mod_states_()
61 , page_ids_()
62 , current_difficulty_()
63 , current_sorting_(RANK)
64 , currently_sorted_asc_(true)
65 , mod_ids_()
66{
67 set_show_even_without_video(true);
68 set_allow_plugin_skip(false);
69}
70
72{
73 tree_view& tree = find_widget<tree_view>("campaign_tree");
74 const std::string& campaign_id = tree.selected_item() ? tree.selected_item()->id() : PAGE_ID_LANDING_PAGE;
75 if(campaign_id.empty()) {
76 return;
77 }
78
79 const bool can_proceed = campaign_id != PAGE_ID_MISSING_CAMPAIGNS && campaign_id != PAGE_ID_LANDING_PAGE;
80 const bool actual_campaign = can_proceed && campaign_id != PAGE_ID_GET_ADDONS;
81
82 button& ok_button = find_widget<button>("ok");
83 ok_button.set_active(can_proceed);
84 ok_button.set_label((campaign_id == PAGE_ID_GET_ADDONS) ? _("game^Get Add-ons") : _("game^Play"));
85
86 auto iter = std::find(page_ids_.begin(), page_ids_.end(), campaign_id);
87 if(iter == page_ids_.end()) {
88 return;
89 }
90 const int choice = std::distance(page_ids_.begin(), iter);
91
92 multi_page& pages = find_widget<multi_page>("campaign_details");
93 pages.select_page(choice);
94
95 // The engine bounds-checks this and silently selects the first campaign if choice points to one
96 // of the non-campaign pages.
98
99 styled_widget& background = find_widget<styled_widget>("campaign_background");
100 background.set_label(engine_.current_level().data()["background"].str());
101
102 // Rebuild difficulty menu
103 auto& diff_menu = find_widget<menu_button>("difficulty_menu");
104
105 // Attempt to set the difficulty list. If doing so fails (because the campaign has no difficulties), disable the difficulty menu.
106 if(!actual_campaign || !set_difficulty_list(diff_menu, engine_.current_level().data())) {
107 // Cosmetic bug: this leaves the difficulties of a previously-selected campaign visible
108 diff_menu.set_active(false);
109 return;
110 }
111
112 diff_menu.set_active(true);
113}
114
115bool campaign_selection::set_difficulty_list(menu_button& diff_menu, const config& campaign, const std::string& selected)
116{
117 auto diff_config_range = campaign.child_range("difficulty");
118 const std::size_t difficulty_count = diff_config_range.size();
119
120 if(diff_config_range.empty()) {
121 return false;
122 }
123
124 std::vector<config> entry_list;
125 std::size_t n = 0, selection = 0;
126
127 for(const auto& cfg : diff_config_range) {
128 config entry;
129
130 // FIXME: description may have markup that will display weird on the menu_button proper
131 entry["label"] = cfg["label"].str() + " (" + cfg["description"].str() + ")";
132 entry["image"] = cfg["image"].str("misc/blank-hex.png");
133
134 if(prefs::get().is_campaign_completed(campaign["id"], cfg["define"])) {
135 std::string laurel;
136
137 if(n + 1 >= difficulty_count) {
139 } else if(n == 0) {
141 } else {
143 }
144
145 entry["image"] = laurel + "~BLIT(" + entry["image"].str() + ")";
146 }
147
148 if(!cfg["description"].empty()) {
149 std::string desc;
150 if(cfg["auto_markup"].to_bool(true) == false) {
151 desc = cfg["description"].str();
152 } else {
153 desc = markup::span_color(font::GRAY_COLOR, "(", cfg["description"].str(), ")");
154 }
155
156 // Icons get displayed instead of the labels on the dropdown menu itself,
157 // so we want to prepend each label to its description here
158 desc = cfg["label"].str() + "\n" + desc;
159
160 entry["details"] = std::move(desc);
161 }
162
163 entry["define"] = cfg["define"].str();
164 entry_list.emplace_back(std::move(entry));
165
166 if(selected.empty() ? cfg["default"].to_bool(false) : cfg["define"].str() == selected) {
167 selection = n;
168 }
169
170 ++n;
171 }
172
173 diff_menu.set_values(entry_list);
174 diff_menu.set_selected(selection);
175 return true;
176}
177
178void campaign_selection::select_rng_option(menu_button& rng_menu, const std::string& random_mode)
179{
180 auto rng_it = std::find(rng_mode_prefs.begin(), rng_mode_prefs.end(), random_mode);
181 rng_menu.set_selected(rng_it != rng_mode_prefs.end()
182 ? static_cast<unsigned>(std::distance(rng_mode_prefs.begin(), rng_it))
183 : static_cast<unsigned>(RNG_DEFAULT));
184}
185
187{
188 const unsigned mode = std::clamp<unsigned>(rng_menu.get_value(), RNG_DEFAULT, RNG_BIASED);
189 return mode == RNG_DEFAULT ? "" : rng_mode_prefs[mode];
190}
191
193{
194 current_difficulty_ = find_widget<menu_button>("difficulty_menu").get_value_config()["define"].str();
195}
196
198{
199 using level_ptr = ng::create_engine::level_ptr;
200
201 auto levels = engine_.get_levels_by_type_unfiltered(level_type::type::sp_campaign);
202
203 switch(order) {
204 case RANK: // Already sorted by rank
205 // This'll actually never happen, but who knows if that'll ever change...
206 if(!ascending) {
207 std::reverse(levels.begin(), levels.end());
208 }
209
210 break;
211
212 case DATE:
213 std::sort(levels.begin(), levels.end(), [ascending](const level_ptr& a, const level_ptr& b) {
214 auto cpn_a = std::dynamic_pointer_cast<ng::campaign>(a);
215 auto cpn_b = std::dynamic_pointer_cast<ng::campaign>(b);
216
217 if(cpn_b == nullptr) {
218 return cpn_a != nullptr;
219 }
220
221 if(cpn_a == nullptr) {
222 return false;
223 }
224
225 return ascending
226 ? cpn_a->dates().first < cpn_b->dates().first
227 : cpn_a->dates().first > cpn_b->dates().first;
228 });
229
230 break;
231
232 case NAME:
233 std::sort(levels.begin(), levels.end(), [ascending](const level_ptr& a, const level_ptr& b) {
234 const int cmp = translation::icompare(a->name(), b->name());
235 return ascending ? cmp < 0 : cmp > 0;
236 });
237
238 break;
239 }
240
241 tree_view& tree = find_widget<tree_view>("campaign_tree");
242
243 // Remember which campaign was selected...
244 std::string was_selected;
245 if(tree.selected_item()) {
246 was_selected = tree.selected_item()->id();
247 }
248 tree.clear();
249
250 boost::dynamic_bitset<> show_items;
251 show_items.resize(levels.size(), true);
252
253 if(!last_search_words_.empty()) {
254 for(unsigned i = 0; i < levels.size(); ++i) {
255 bool found = false;
256 for(const auto& word : last_search_words_) {
257 found = translation::ci_search(levels[i]->name(), word) ||
258 translation::ci_search(levels[i]->data()["name"].t_str().base_str(), word) ||
259 translation::ci_search(levels[i]->description(), word) ||
260 translation::ci_search(levels[i]->data()["description"].t_str().base_str(), word) ||
261 translation::ci_search(levels[i]->data()["abbrev"], word) ||
262 translation::ci_search(levels[i]->data()["abbrev"].t_str().base_str(), word);
263
264 if(!found) {
265 break;
266 }
267 }
268
269 show_items[i] = found;
270 }
271 }
272
273 // List of which options has been selected in the completion filter multimenu_button
274 boost::dynamic_bitset<> filter_comp_options = find_widget<multimenu_button>("filter_completion").get_toggle_states();
275
276 bool exists_in_filtered_result = false;
277 for(unsigned i = 0; i < levels.size(); ++i) {
278 bool completed = prefs::get().is_campaign_completed(levels[i]->data()["id"]);
279 config::const_child_itors difficulties = levels[i]->data().child_range("difficulty");
280 auto did_complete_at = [](const config& c) { return c["completed_at"].to_bool(); };
281
282 // Check for non-completion on every difficulty save the first.
283 const bool only_first_completed = difficulties.size() > 1 &&
284 std::none_of(difficulties.begin() + 1, difficulties.end(), did_complete_at);
285 const bool completed_easy = only_first_completed && did_complete_at(difficulties.front());
286 const bool completed_hardest = !difficulties.empty() && did_complete_at(difficulties.back());
287 const bool completed_mid = completed && !completed_hardest && !completed_easy;
288
289 if( show_items[i] && (
290 ( (!completed) && filter_comp_options[0] ) // Selects all campaigns not finished by player
291 || ( completed && filter_comp_options[4] ) // Selects all campaigns finished by player
292 || ( completed_hardest && filter_comp_options[3] ) // Selects campaigns completed in hardest difficulty
293 || ( completed_easy && filter_comp_options[1] ) // Selects campaigns completed in easiest difficulty
294 || ( completed_mid && filter_comp_options[2]) // Selects campaigns completed in any other difficulty
295 )) {
296 add_campaign_to_tree(levels[i]->data());
297 if (!exists_in_filtered_result) {
298 exists_in_filtered_result = levels[i]->id() == was_selected;
299 }
300 }
301 }
302
303 if(!was_selected.empty() && exists_in_filtered_result) {
304 find_widget<tree_view_node>(was_selected).select_node();
305 } else {
306 campaign_selected();
307 }
308}
309
311{
312 static bool force = false;
313 if(force) {
314 return;
315 }
316
317 if(current_sorting_ == order) {
319 currently_sorted_asc_ = false;
320 } else {
323 }
324 } else if(current_sorting_ == RANK) {
326 current_sorting_ = order;
327 } else {
329 current_sorting_ = order;
330
331 force = true;
332
333 if(order == NAME) {
334 find_widget<toggle_button>("sort_time").set_value(0);
335 } else if(order == DATE) {
336 find_widget<toggle_button>("sort_name").set_value(0);
337 }
338
339 force = false;
340 }
341
343}
344
345void campaign_selection::filter_text_changed(const std::string& text)
346{
347 const std::vector<std::string> words = utils::split(text, ' ');
348
349 if(words == last_search_words_) {
350 return;
351 }
352
353 last_search_words_ = words;
355}
356
358{
359 text_box* filter = find_widget<text_box>("filter_box", false, true);
360 filter->on_modified([this](const auto& box) { filter_text_changed(box.text()); });
361
362 /***** Setup campaign tree. *****/
363 tree_view& tree = find_widget<tree_view>("campaign_tree");
364
365 connect_signal_notify_modified(tree,
366 std::bind(&campaign_selection::campaign_selected, this));
367
368 toggle_button& sort_name = find_widget<toggle_button>("sort_name");
369 toggle_button& sort_time = find_widget<toggle_button>("sort_time");
370
371 connect_signal_notify_modified(sort_name,
373
374 connect_signal_notify_modified(sort_time,
376
377#ifdef __IPHONEOS__
378 // On iOS, opening the campaign browser should not immediately summon the
379 // software keyboard just because the optional filter field exists.
380 keyboard_capture(&tree);
381#else
382 keyboard_capture(filter);
383#endif
385
386 /***** Setup campaign details. *****/
387 multi_page& pages = find_widget<multi_page>("campaign_details");
388
389 // Setup completion filter
390 multimenu_button& filter_comp = find_widget<multimenu_button>("filter_completion");
391 connect_signal_notify_modified(filter_comp,
392 std::bind(&campaign_selection::sort_campaigns, this, RANK, 1));
393 for (unsigned j = 0; j < filter_comp.num_options(); j++) {
394 filter_comp.select_option(j);
395 }
396
397 // Add campaigns to the list
398 for(const auto& level : engine_.get_levels_by_type_unfiltered(level_type::type::sp_campaign)) {
399 const config& campaign = level->data();
400
401 /*** Add tree item ***/
402 add_campaign_to_tree(campaign);
403
404 /*** Add detail item ***/
405 pages.add_page({
406 {"description", {
407 {"label", campaign["description"].t_str()},
408 {"text_alignment", campaign["description_alignment"].str("left")},
409 {"use_markup", "true"}
410 }},
411 {"image", {
412 {"label", campaign["image"].str()}
413 }}
414 });
415 page_ids_.push_back(campaign["id"]);
416 }
417
418 //
419 // Special-purpose pages that appear as if they were campaigns.
420 //
421
422 // The intro page is shown if nothing is selected in the tree_view, it isn't in the tree itself
423 pages.add_page("no_campaign_selected", -1, widget_data{});
424 page_ids_.push_back(PAGE_ID_LANDING_PAGE);
425
426 // Addon Manager link
427 config addons;
428 addons["icon"] = "icons/icon-game.png~BLIT(icons/icon-addon-publish.png)";
429 addons["name"] = _("More campaigns...");
430 addons["completed"] = false;
431 addons["id"] = PAGE_ID_GET_ADDONS;
432
433 add_campaign_to_tree(addons);
434
435 pages.add_page("go_download_more_stuff", -1, widget_data{});
436 page_ids_.push_back(PAGE_ID_GET_ADDONS);
437
438 // The data directory has few (or none) of the mainline campaigns
439 std::vector<std::string> dirs;
440 filesystem::get_files_in_dir(game_config::path + "/data/campaigns", nullptr, &dirs);
441 if(dirs.size() <= 15) {
442 config missing;
443 missing["icon"] = "units/unknown-unit.png";
444 missing["name"] = _("Missing Campaigns");
445 missing["completed"] = false;
446 missing["id"] = PAGE_ID_MISSING_CAMPAIGNS;
447
448 add_campaign_to_tree(missing);
449
450 pages.add_page("missing_campaign_warning", -1, widget_data{});
451 page_ids_.push_back(PAGE_ID_MISSING_CAMPAIGNS);
452 }
453
454 //
455 // Set up Mods selection dropdown
456 //
457 multimenu_button& mods_menu = find_widget<multimenu_button>("mods_menu");
458
460 std::vector<config> mod_menu_values;
461 std::vector<std::string> enabled = engine_.active_mods();
462
464 const bool active = std::find(enabled.begin(), enabled.end(), mod->id) != enabled.end();
465
466 mod_menu_values.emplace_back("label", mod->name, "tooltip", mod->description, "checkbox", active);
467
468 mod_states_.push_back(active);
469 mod_ids_.emplace_back(mod->id);
470 }
471
472 mods_menu.set_values(mod_menu_values);
473 mods_menu.select_options(mod_states_);
474
475 connect_signal_notify_modified(mods_menu, std::bind(&campaign_selection::mod_toggled, this));
476 } else {
477 mods_menu.set_active(false);
478 mods_menu.set_label(_("active_modifications^None"));
479 }
480
481 //
482 // Set up RNG mode dropdown
483 //
484 // New installs default to "Reduced RNG"; existing installs restore the last selection.
485 select_rng_option(find_widget<menu_button>("rng_menu"), prefs::get().campaign_rng_mode());
486
487 //
488 // Set up Difficulty dropdown
489 //
490 menu_button& diff_menu = find_widget<menu_button>("difficulty_menu");
491
492 diff_menu.set_use_markup(true);
493 connect_signal_notify_modified(diff_menu, std::bind(&campaign_selection::difficulty_selected, this));
494
496
497 plugins_context_.reset(new plugins_context("Campaign Selection"));
498 plugins_context_->set_callback("create", [this](const config&) { set_retval(retval::OK); }, false);
499 plugins_context_->set_callback("quit", [this](const config&) { set_retval(retval::CANCEL); }, false);
500
501 plugins_context_->set_accessor("find_level", [this](const config& cfg) {
502 const std::string id = cfg["id"].str();
503 auto result = engine_.find_level_by_id(id);
504 return config {
505 "index", result.second,
506 "type", level_type::get_string(result.first),
507 };
508 });
509
510 plugins_context_->set_accessor_int("find_mod", [this](const config& cfg) {
512 });
513
514 plugins_context_->set_callback("select_level", [this](const config& cfg) {
515 choice_ = cfg["index"].to_int();
517 }, true);
518}
519
521{
522 // We completed the campaign! Calculate the appropriate victory laurel.
523 const auto get_laurel = [&campaign] {
524 if(!campaign["completed"].to_bool()) {
525 return std::string{};
526 }
527
528 config::const_child_itors difficulties = campaign.child_range("difficulty");
529 auto did_complete_at = [](const config& c) { return c["completed_at"].to_bool(); };
530
531 // Check for non-completion on every difficulty save the first.
532 const bool only_first_completed = difficulties.size() > 1 &&
533 std::none_of(difficulties.begin() + 1, difficulties.end(), did_complete_at);
534
535 /*
536 * Criteria:
537 *
538 * - Use the gold laurel (hardest) for campaigns with only one difficulty OR
539 * if out of two or more difficulties, the last one has been completed.
540 *
541 * - Use the bronze laurel (easiest) only if the first difficulty out of two
542 * or more has been completed.
543 *
544 * - Use the silver laurel otherwise.
545 */
546 if(!difficulties.empty() && did_complete_at(difficulties.back())) {
548 } else if(only_first_completed && did_complete_at(difficulties.front())) {
550 } else {
552 }
553 };
554
555 auto& node = find_widget<tree_view>("campaign_tree")
556 .add_node("campaign", {
557 {"icon", {
558 {"label", campaign["icon"].str()}
559 }},
560 {"name", {
561 {"label", campaign["name"].t_str()}
562 }},
563 {"victory", {
564 {"label", get_laurel()}
565 }}
566 });
567
568 node.set_id(campaign["id"]);
569}
570
572{
573 if(get_retval() != retval::OK) {
574 return;
575 }
576
577 tree_view& tree = find_widget<tree_view>("campaign_tree");
578 if(tree.empty() || !tree.selected_item()) {
579 return;
580 }
581
582 const std::string& campaign_id = tree.selected_item()->id();
583 if(!campaign_id.empty()) {
584 if (campaign_id == PAGE_ID_GET_ADDONS) {
586 } else {
587 auto iter = std::find(page_ids_.begin(), page_ids_.end(), campaign_id);
588 if(iter != page_ids_.end()) {
589 choice_ = std::distance(page_ids_.begin(), iter);
590 }
592 }
593 }
594
595 rng_mode_ = RNG_MODE(std::clamp<unsigned>(find_widget<menu_button>("rng_menu").get_value(), RNG_DEFAULT, RNG_BIASED));
596 prefs::get().set_campaign_rng_mode(rng_mode_prefs[rng_mode_]);
598}
599
601{
602 boost::dynamic_bitset<> new_mod_states =
603 find_widget<multimenu_button>("mods_menu").get_toggle_states();
604
605 // Get a mask of any mods that were toggled, regardless of new state
606 mod_states_ = mod_states_ ^ new_mod_states;
607
608 for(unsigned i = 0; i < mod_states_.size(); i++) {
609 if(mod_states_[i]) {
611 }
612 }
613
614 // Save the full toggle states for next time
615 mod_states_ = new_mod_states;
616}
617
618} // namespace dialogs
A config object defines a single node in a WML file, with access to child nodes.
Definition config.hpp:157
child_itors child_range(std::string_view key)
Definition config.cpp:260
boost::iterator_range< const_child_iterator > const_child_itors
Definition config.hpp:281
Simple push button.
Definition button.hpp:36
virtual void set_active(const bool active) override
See styled_widget::set_active.
Definition button.cpp:64
void toggle_sorting_selection(CAMPAIGN_ORDER order)
RNG_MODE rng_mode_
whether the player checked the "Deterministic" checkbox.
void difficulty_selected()
Called when the difficulty selection changes.
static std::string get_selected_rng_option(const menu_button &rng_menu)
Returns the random_mode for the given RNG menu's selected option.
static void select_rng_option(menu_button &rng_menu, const std::string &random_mode)
Selects the given RNG menu's option for the given random_mode.
std::vector< std::string > mod_ids_
virtual void pre_show() override
Actions to be taken before showing the window.
void sort_campaigns(CAMPAIGN_ORDER order, bool ascending)
static bool set_difficulty_list(menu_button &diff_menu, const config &campaign, const std::string &selected="")
Fills the given difficulty menu with options from the given campaign.
virtual void post_show() override
Actions to be taken after the window has been shown.
void add_campaign_to_tree(const config &campaign)
void filter_text_changed(const std::string &text)
void campaign_selected()
Called when an item in the left-hand pane (the tree view) is selected.
std::vector< std::string > last_search_words_
std::vector< std::string > page_ids_
Abstract base class for all modal dialogs.
std::unique_ptr< plugins_context > plugins_context_
void set_selected(unsigned selected, bool fire_event=true)
void set_values(const std::vector<::config > &values, unsigned selected=0)
virtual unsigned get_value() const override
Inherited from selectable_item.
grid & add_page(const widget_item &item)
Adds single page to the grid.
void select_page(const unsigned page, const bool select=true)
Selects a page.
void select_options(const boost::dynamic_bitset<> &states)
Set the options selected in the menu.
void set_values(const std::vector<::config > &values)
Set the available menu options.
unsigned num_options()
Get the number of options available in the menu.
virtual void set_active(const bool active) override
See styled_widget::set_active.
void select_option(const unsigned option, const bool selected=true)
Select an option in the menu.
virtual void set_label(const t_string &text)
virtual void set_use_markup(bool use_markup)
A widget that allows the user to input text in single line.
Definition text_box.hpp:125
tree_view_node * selected_item()
bool empty() const
Definition tree_view.cpp:99
const std::string & id() const
Definition widget.cpp:110
void set_retval(const int retval, const bool close_window=true)
Sets there return value of the window.
Definition window.hpp:387
show_mode mode() const
Returns the dialog mode for this window.
Definition window.hpp:669
void keyboard_capture(widget *widget)
Definition window.cpp:1205
void add_to_keyboard_chain(widget *widget)
Adds the widget to the keyboard chain.
Definition window.cpp:1219
int get_retval()
Definition window.hpp:394
int find_extra_by_id(const MP_EXTRA extra_type, const std::string &id) const
bool toggle_mod(const std::string &id, bool force=false)
std::vector< std::string > & active_mods()
const std::vector< extras_metadata_ptr > & get_const_extras_by_type(const MP_EXTRA extra_type) const
std::shared_ptr< level > level_ptr
std::pair< level_type::type, int > find_level_by_id(const std::string &id) const
std::vector< level_ptr > get_levels_by_type_unfiltered(level_type::type type) const
void set_current_level(const std::size_t index)
level & current_level() const
const config & data() const
static prefs & get()
bool is_campaign_completed(const std::string &campaign_id)
void set_modifications(const std::vector< std::string > &value, bool mp=true)
const config * cfg
Declarations for File-IO.
static std::string _(const char *str)
Definition gettext.hpp:100
This file contains the window object, this object is a top level container which has the event manage...
#define REGISTER_DIALOG(window_id)
Wrapper for REGISTER_DIALOG2.
void get_files_in_dir(const std::string &dir, std::vector< std::string > *files, std::vector< std::string > *dirs=nullptr, name_mode mode=name_mode::FILE_NAME_ONLY, filter_mode filter=filter_mode::NO_FILTER, reorder_mode reorder=reorder_mode::DONT_REORDER, file_tree_checksum *checksum=nullptr)
Get a list of all files and/or directories in a given directory.
const color_t GRAY_COLOR
std::string victory_laurel_hardest
std::string victory_laurel
std::string victory_laurel_easy
std::string path
std::map< std::string, widget_item > widget_data
Definition widget.hpp:36
@ OK
Dialog was closed with the OK button.
Definition retval.hpp:35
@ CANCEL
Dialog was closed with the CANCEL button.
Definition retval.hpp:38
std::string span_color(const color_t &color, Args &&... data)
Applies Pango markup to the input specifying its display color.
Definition markup.hpp:110
bool ci_search(const std::string &s1, const std::string &s2)
Case-insensitive search.
Definition gettext.cpp:559
std::vector< std::string > split(const config_attribute_value &val)
std::string_view data
Definition picture.cpp:188
static std::string get_string(enum_type key)
Converts a enum to its string equivalent.
Definition enum_base.hpp:46
static map_location::direction n
#define i
#define c
#define b