Some cleanup/fixups on 7c663bc0a9
This commit is contained in:
parent
7c663bc0a9
commit
4d7df69428
4 changed files with 3 additions and 8 deletions
|
@ -547,7 +547,6 @@ set(wesnoth-gui_widget_SRC
|
|||
gui/widgets/settings.cpp
|
||||
gui/widgets/slider.cpp
|
||||
gui/widgets/spacer.cpp
|
||||
gui/widgets/status_label_helper.cpp
|
||||
gui/widgets/stacked_widget.cpp
|
||||
gui/widgets/text.cpp
|
||||
gui/widgets/text_box.cpp
|
||||
|
|
|
@ -460,7 +460,6 @@ wesnoth_sources = Split("""
|
|||
gui/widgets/settings.cpp
|
||||
gui/widgets/slider.cpp
|
||||
gui/widgets/spacer.cpp
|
||||
gui/widgets/status_label_helper.cpp
|
||||
gui/widgets/stacked_widget.cpp
|
||||
gui/widgets/text_box.cpp
|
||||
gui/widgets/text.cpp
|
||||
|
|
|
@ -33,10 +33,6 @@ static int min_size = 20;
|
|||
|
||||
REGISTER_DIALOG(generator_settings)
|
||||
|
||||
static const auto landform_label = [](tslider& s)->std::string {
|
||||
return s.get_value() == 0 ? _("Inland") : (s.get_value() < max_coastal ? _("Coastal") : _("Island"));
|
||||
};
|
||||
|
||||
tgenerator_settings::tgenerator_settings(generator_data& data)
|
||||
: players_(register_integer("players", true, data.nplayers))
|
||||
, width_(register_integer("width", true, data.width))
|
||||
|
@ -68,7 +64,8 @@ void tgenerator_settings::pre_show(twindow& window)
|
|||
|
||||
gui2::bind_status_label<tslider>(window, "villages", [](tslider& s)->std::string { return formatter() << s.get_value() << _("/1000 tiles"); });
|
||||
gui2::bind_status_label<tslider>(window, "castle_size");
|
||||
gui2::bind_status_label<tslider>(window, "landform", [](tslider& s)->std::string { return landform_label(s); });
|
||||
gui2::bind_status_label<tslider>(window, "landform", [](tslider& s)->std::string {
|
||||
return s.get_value() == 0 ? _("Inland") : (s.get_value() < max_coastal ? _("Coastal") : _("Island")); });
|
||||
}
|
||||
|
||||
void tgenerator_settings::adjust_minimum_size_by_players(twindow& window)
|
||||
|
|
|
@ -33,7 +33,7 @@ template<typename W>
|
|||
std::function<void()> bind_status_label(twindow& window, const std::string& id,
|
||||
std::function<std::string(W&)> value_getter = [](W& w)->std::string { return std::to_string(w.get_value()); })
|
||||
{
|
||||
W& source = find_widget<W>(&window, id, false);
|
||||
W& source = find_widget<W>(&window, id, false);
|
||||
tcontrol& label = find_widget<tcontrol>(&window, id + "_label", false);
|
||||
|
||||
const auto update_label = [&, value_getter]() {
|
||||
|
|
Loading…
Add table
Reference in a new issue