15 #define GETTEXT_DOMAIN "wesnoth-lib" 42 , last_real_advancement_(real)
48 listbox& list = find_widget<listbox>(&
window,
"advance_choice",
false);
52 window.keyboard_capture(&list);
55 find_widget<button>(&window,
"show_help",
false),
64 std::string image_string, name = sample.
type_name();
71 if(back.has_attribute(
"image")) {
72 image_string = back[
"image"].str();
75 name = back[
"description"].str();
78 if(image_string.empty()) {
82 column[
"label"] = image_string;
83 row_data.emplace(
"advancement_image", column);
85 column[
"label"] = name;
86 row_data.emplace(
"advancement_name", column);
94 window.set_escape_disabled(
true);
99 const int selected_row
100 = find_widget<listbox>(
get_window(),
"advance_choice",
false).get_selected_row();
102 if(selected_row == -1) {
106 find_widget<unit_preview_pane>(
get_window(),
"advancement_details",
false)
107 .set_displayed_unit(*
previews_[selected_row]);
window(const builder_window::window_resolution &definition)
< Needs to be initialized in show.
#define REGISTER_DIALOG(window_id)
Wrapper for REGISTER_DIALOG2.
void show_help(const std::string &show_topic, int xloc, int yloc)
Open the help browser, show topic with id show_topic.
This class represents a single unit of a specific type.
void connect_signal_mouse_left_click(dispatcher &dispatcher, const signal &signal)
Connects a signal handler for a left mouse button click.
virtual void post_show(window &window) override
Actions to be taken after the window has been shown.
child_itors child_range(config_key_type key)
grid & add_row(const widget_item &item, const int index=-1)
When an item in the list is selected by the user we need to update the state.
const unit_type & type() const
This unit's type, accounting for gender and variation.
std::shared_ptr< const unit > unit_const_ptr
std::map< std::string, t_string > widget_item
This file contains the settings handling of the widget library.
std::size_t last_real_advancement_
const t_string & type_name() const
Gets the translatable name of this unit's type.
window * get_window()
Returns a pointer to the dialog's window.
std::size_t selected_index_
const std::string & image() const
int get_retval() const
Returns the cached window exit code.
Abstract base class for all modal dialogs.
std::map< std::string, widget_item > widget_data
Dialog was closed with the OK button.
config & get_modifications()
Get the raw modifications.
base class of top level items, the only item which needs to store the final canvases to draw on...
const std::vector< unit_const_ptr > & previews_
std::string image_mods() const
Gets an IPF string containing all IPF image mods.
void connect_signal_notify_modified(dispatcher &dispatcher, const signal_notification &signal)
Connects a signal handler for getting a notification upon modification.
virtual void pre_show(window &window) override
Actions to be taken before showing the window.