47 auto window = make_element_by_type<province_search_window>(
state,
"goto_box");
73 auto window = make_element_by_type<ledger_window>(
state,
"ledger");
765 auto window = make_element_by_type<message_filters_window>(
state,
"message_filters");
869 auto window = make_element_by_type<main_menu_window>(
state,
"alice_main_menu");
900 frame = (toggle) ? 1 : 0;
938 const std::string_view mapmode_btn_prefix{
"mapmode_"};
940 bool expand_mapmodes =
false;
941 std::array<minimap_mapmode_button*, 45> mapmode_buttons = {};
944 if(
name ==
"messagelog_window") {
945 auto ptr = make_element_by_type<message_log_window>(
state,
id);
946 ptr->base_data.position.y += 1;
948 ptr->set_visible(
state,
false);
950 }
else if(
name ==
"minimap_bg") {
951 return make_element_by_type<opaque_element_base>(
state,
id);
952 }
else if(
name ==
"openbutton") {
953 auto ptr = make_element_by_type<minimap_open_message_log_button>(
state,
id);
954 ptr->base_data.position.y += 1;
955 open_btn = ptr.
get();
957 }
else if(
name ==
"menu_button") {
958 return make_element_by_type<minimap_menu_button>(
state,
id);
959 }
else if(
name ==
"button_macro") {
960 return make_element_by_type<minimap_macro_builder_button>(
state,
id);
961 }
else if(
name ==
"button_console") {
962 return make_element_by_type<minimap_console_button>(
state,
id);
963 }
else if(
name ==
"button_goto") {
964 return make_element_by_type<minimap_goto_button>(
state,
id);
965 }
else if(
name ==
"ledger_button") {
966 return make_element_by_type<minimap_ledger_button>(
state,
id);
967 }
else if(
name ==
"map_zoom_in") {
968 return make_element_by_type<minimap_zoom_in_button>(
state,
id);
969 }
else if(
name ==
"map_zoom_out") {
970 return make_element_by_type<minimap_zoom_out_button>(
state,
id);
971 }
else if(
name ==
"menubar_bg") {
973 }
else if(
name ==
"chat_window"
974 ||
name ==
"menubar_mail_bg"
975 ||
name ==
"menubar_msg_settings"
976 ||
name ==
"menubar_msg_combat"
977 ||
name ==
"menubar_msg_diplo"
978 ||
name ==
"menubar_msg_unit"
979 ||
name ==
"menubar_msg_province"
980 ||
name ==
"menubar_msg_event"
981 ||
name ==
"menubar_msg_other"
982 ||
name ==
"menubar_plans_toggle"
983 ||
name ==
"menubar_plans_open") {
984 return make_element_by_type<invisible_element>(
state,
id);
985 }
else if(
name.starts_with(mapmode_btn_prefix)) {
986 auto ptr = make_element_by_type<minimap_mapmode_button>(
state,
id);
987 size_t num_index =
name.rfind(
"_") + 1;
989 for(
size_t i = num_index; i <
name.size(); i++) {
991 num +=
name[i] -
'0';
995 if(num > 22 && !expand_mapmodes) {
996 ptr->set_visible(
state,
false);
999 mapmode_buttons[num] = ptr.get();
1002 else if(
name ==
"expand_mapmodes_button") {
1003 auto ptr = make_element_by_type<expand_mapmodes_button>(
state,
id);
1016 for(
size_t i = 0; i < mapmode_buttons.size(); i++) {
1017 auto ptr = mapmode_buttons[i];
1018 if(ptr ==
nullptr) {
1021 if(i > 22 && !expand_mapmodes) {
1022 ptr->set_visible(
state,
false);
1025 ptr->set_visible(
state,
true);
1042 auto p = any_cast<expand_mapmodes_data>(payload);
1043 expand_mapmodes = p.expand;
1065 state.map_state.set_pos(glm::vec2(x, y) / minimap_size);
static void show_toggle(sys::state &state)
virtual void render(sys::state &state, int32_t x, int32_t y) noexcept
virtual message_result get(sys::state &state, Cyto::Any &payload) noexcept
void set_visible(sys::state &state, bool vis)
void on_update(sys::state &state) noexcept override
message_result get(sys::state &state, Cyto::Any &payload) noexcept override
std::unique_ptr< element_base > make_child(sys::state &state, std::string_view name, dcon::gui_def_id id) noexcept override
void render(sys::state &state, int32_t x, int32_t y) noexcept override
bool get_horizontal_flip(sys::state &state) noexcept override
void render(sys::state &state, int32_t x, int32_t y) noexcept override
message_result on_scroll(sys::state &state, int32_t x, int32_t y, float amount, sys::key_modifiers mods) noexcept override
message_result on_lbutton_down(sys::state &state, int32_t x, int32_t y, sys::key_modifiers mods) noexcept override
static std::unique_ptr< partially_transparent_image > make_element_by_type_alias(sys::state &state, dcon::gui_def_id id)
std::unique_ptr< ui::element_base > make_macrobuilder2_main(sys::state &state)
void set_map_mode(sys::state &state, mode mode)
layout_box open_layout_box(layout_base &dest, int32_t indent)
void localised_format_box(sys::state &state, layout_base &dest, layout_box &box, std::string_view key, text::substitution_map const &sub)
void add_line(sys::state &state, layout_base &dest, dcon::text_key txt, int32_t indent)
ankerl::unordered_dense::map< uint32_t, substitution > substitution_map
void close_layout_box(columnar_layout &dest, layout_box &box)
int32_t ui_height(sys::state const &state)
int32_t ui_width(sys::state const &state)
void send(sys::state &state, element_base *parent, T value)
Holds important data about the game world, state, and other data regarding windowing,...
element_base * msg_log_window
element_base * search_window
std::unique_ptr< element_base > root
element_base * macro_builder_window
element_base * msg_filters_window
element_base * ledger_window