5 int32_t index = retrieve<int32_t>(
state, parent);
7 if(index < int32_t(messages.size())) {
8 auto m = messages[index];
28 int32_t index = retrieve<int32_t>(
state, parent);
30 if(index < int32_t(messages.size())) {
31 messages[index].body(
state, contents);
41 if(
name ==
"close" ||
name ==
"closebutton") {
42 return make_element_by_type<message_log_close_button>(
state,
id);
43 }
else if(
name ==
"messagelog") {
44 auto ptr = make_element_by_type<message_log_listbox>(
state,
id);
47 }
else if(
name ==
"messagecat_combat") {
48 return make_element_by_type<message_log_filter_checkbox<message_settings_category::combat>>(
state, id);
49 }
else if(
name ==
"messagecat_diplomacy") {
50 return make_element_by_type<message_log_filter_checkbox<message_settings_category::diplomacy>>(
state, id);
51 }
else if(
name ==
"messagecat_units") {
52 return make_element_by_type<message_log_filter_checkbox<message_settings_category::units>>(
state, id);
53 }
else if(
name ==
"messagecat_provinces") {
54 return make_element_by_type<message_log_filter_checkbox<message_settings_category::provinces>>(
state, id);
55 }
else if(
name ==
"messagecat_events") {
56 return make_element_by_type<message_log_filter_checkbox<message_settings_category::events>>(
state, id);
57 }
else if(
name ==
"messagecat_others") {
58 return make_element_by_type<message_log_filter_checkbox<message_settings_category::others>>(
state, id);
66 if(
auto ex_size = int32_t(messages.size()) - 100; ex_size > 0) {
67 std::rotate(messages.begin(), messages.begin() + ex_size, messages.end());
71 bool at_bottom = log_list->list_scrollbar->raw_value() == log_list->list_scrollbar->settings.upper_limit;
73 log_list->row_contents.clear();
74 for(int32_t i = 0; i < int32_t(messages.size()); ++i)
75 log_list->row_contents.push_back(i);
77 log_list->update(
state);
80 log_list->scroll_to_bottom(
state);
85 auto cat = any_cast<message_settings_category>(payload);
86 payload.emplace<
bool>(cat_filters[
uint8_t(cat)]);
89 auto cat = any_cast<element_selection_wrapper<message_settings_category>>(payload).data;
91 impl_on_update(
state);
void on_update(sys::state &state) noexcept override
void update_tooltip(sys::state &state, int32_t x, int32_t y, text::columnar_layout &contents) noexcept override
std::unique_ptr< element_base > make_child(sys::state &state, std::string_view name, dcon::gui_def_id id) noexcept override
message_result get(sys::state &state, Cyto::Any &payload) noexcept override
void on_update(sys::state &state) noexcept override
void on_create(sys::state &state) noexcept override
void on_create(sys::state &state) noexcept override
void add_to_layout_box(sys::state &state, layout_base &dest, layout_box &box, embedded_flag ico)
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)
endless_layout create_endless_layout(sys::state &state, layout &dest, layout_parameters const ¶ms)
void add_space_to_layout_box(sys::state &state, layout_base &dest, layout_box &box)
void close_layout_box(columnar_layout &dest, layout_box &box)
message_settings_category
element_base * msg_log_window