14 #define GETTEXT_DOMAIN "wesnoth-lib" 39 : players_(register_integer("players", true, data.nplayers))
40 , width_(register_integer("width", true, data.width))
41 , height_(register_integer("height", true, data.height))
42 , update_width_label_()
43 , update_height_label_()
45 register_integer(
"hills_num",
true, data.iterations);
46 register_integer(
"hills_size",
true, data.hill_size);
47 register_integer(
"villages",
true, data.nvillages);
48 register_integer(
"castle_size",
true, data.castle_size);
49 register_integer(
"landform",
true, data.island_size);
51 register_bool(
"connect_castles",
true, data.link_castles);
52 register_bool(
"show_labels",
true, data.show_labels);
62 gui2::bind_status_label<slider>(&window,
"players");
71 gui2::bind_status_label<slider>(&window,
"villages", [](
slider&
s)->std::string {
return formatter() <<
s.get_value() <<
_(
"/1000 tiles"); });
72 gui2::bind_status_label<slider>(&window,
"castle_size");
73 gui2::bind_status_label<slider>(&window,
"landform", [](
slider&
s)->std::string {
74 return s.get_value() == 0 ?
_(
"Inland") : (
s.get_value() < max_coastal ?
_(
"Coastal") :
_(
"Island")); });
86 update_dimension_slider(
width_);
87 update_dimension_slider(
height_);
#define REGISTER_DIALOG(window_id)
Wrapper for REGISTER_DIALOG2.
window * get_window() const
Returns a pointer to the dialog's window.
T get_widget_value(window &window)
Gets the value of the field.
Implements some helper classes to ease adding fields to a dialog and hide the synchronization needed...
field_integer * players_
We need to own these fields to access the underlying widget.
static std::string _(const char *str)
virtual void pre_show(window &window) override
The execute function.
static int extra_size_per_player
void set_value_range(int min_value, int max_value)
virtual int get_maximum_value() const override
Inherited from integer_selector.
void connect_signal_notify_modified(dispatcher &dispatcher, const signal_notification_function &signal)
Connects a signal handler for getting a notification upon modification.
This file contains the settings handling of the widget library.
static void field(LexState *ls, struct ConsControl *cc)
std::function< void()> update_width_label_
std::function< void()> update_height_label_
Various uncategorised dialogs.
styled_widget * get_widget()
static map_location::DIRECTION s
A slider is a control that can select a value by moving a grip on a groove.
base class of top level items, the only item which needs to store the final canvases to draw on...
Template class to implement the generic field implementation.
void adjust_minimum_size_by_players()