15 #define GETTEXT_DOMAIN "wesnoth-lib"
42 , last_real_advancement_(real)
48 listbox& list = find_widget<listbox>(&
window,
"advance_choice",
false);
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);
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]);
child_itors child_range(config_key_type key)
Abstract base class for all modal dialogs.
int get_retval() const
Returns the cached window exit code.
window * get_window()
Returns a pointer to the dialog's window.
std::size_t last_real_advancement_
const std::vector< unit_const_ptr > & previews_
virtual void pre_show(window &window) override
Actions to be taken before showing the window.
virtual void post_show(window &window) override
Actions to be taken after the window has been shown.
std::size_t selected_index_
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.
base class of top level items, the only item which needs to store the final canvases to draw on.
void keyboard_capture(widget *widget)
void set_escape_disabled(const bool escape_disabled)
Disable the escape key.
const std::string & image() const
This class represents a single unit of a specific type.
const t_string & type_name() const
Gets the translatable name of this unit's type.
const unit_type & type() const
This unit's type, accounting for gender and variation.
std::string image_mods() const
Gets an IPF string containing all IPF image mods.
config & get_modifications()
Get the raw modifications.
#define REGISTER_DIALOG(window_id)
Wrapper for REGISTER_DIALOG2.
void connect_signal_notify_modified(dispatcher &dispatcher, const signal_notification &signal)
Connects a signal handler for getting a notification upon modification.
void connect_signal_mouse_left_click(dispatcher &dispatcher, const signal &signal)
Connects a signal handler for a left mouse button click.
std::map< std::string, widget_item > widget_data
std::map< std::string, t_string > widget_item
@ OK
Dialog was closed with the OK button.
void show_help(const std::string &show_topic, int xloc, int yloc)
Open the help browser, show topic with id show_topic.
std::shared_ptr< const unit > unit_const_ptr
This file contains the settings handling of the widget library.