3#include "dcon_generated.hpp"
24 if(map_prov_id && map_prov_id.value <
state.province_definitions.first_sea_province.value) {
25 state.map_state.set_selected_province(map_prov_id);
27 state.map_state.center_map_on_province(
state, map_prov_id);
41 return "goto_location_button";
50 std::vector<dcon::province_id> search_provinces(
sys::state&
state, std::string_view search_term)
noexcept {
51 std::vector<dcon::province_id> results{};
54 if(!search_term.empty()) {
55 state.world.for_each_province([&](dcon::province_id prov_id) {
58 if(
name.starts_with(search_term_lower)) {
59 results.push_back(prov_id);
75 if(
name ==
"cancel") {
76 return make_element_by_type<generic_close_button>(
state,
id);
77 }
else if(
name ==
"goto_edit") {
78 auto ptr = make_element_by_type<province_search_edit>(
state,
id);
81 }
else if(
name ==
"provinces") {
82 auto ptr = make_element_by_type<province_search_list>(
state,
id);
83 search_listbox = ptr.
get();
91 if(payload.holds_type<std::string_view>()) {
92 auto search_term = any_cast<std::string_view>(payload);
void move_child_to_front(element_base *child) noexcept final
virtual message_result get(sys::state &state, Cyto::Any &payload) noexcept
std::vector< RowConT > row_contents
void update(sys::state &state)
void edit_box_update(sys::state &state, std::string_view s) noexcept override
void update(sys::state &state) noexcept override
void button_action(sys::state &state) noexcept override
std::string_view get_row_element_name() override
void on_visible(sys::state &state) noexcept override
std::unique_ptr< element_base > make_child(sys::state &state, std::string_view name, dcon::gui_def_id id) noexcept override
void on_hide(sys::state &state) noexcept override
void on_create(sys::state &state) noexcept override
message_result get(sys::state &state, Cyto::Any &payload) noexcept override
void on_create(sys::state &state) noexcept override
pop_satisfaction_wrapper_fat fatten(data_container const &c, pop_satisfaction_wrapper_id id) noexcept
std::string lowercase_str(std::string_view sv)
std::string produce_simple_string(sys::state const &state, dcon::text_key id)
void send(sys::state &state, element_base *parent, T value)
element_base * edit_target
element_base * province_window