16 return "askmilitaryaccess_di";
22 return "back_crisis_di";
24 return "back_crisis_di";
28 return "back_crisis_di";
30 return "crisis_offer_di";
32 return "state_transfer_di";
40 auto const m = retrieve<diplomatic_message::message>(
state,
parent);
82 auto m = retrieve<diplomatic_message::message>(
state,
parent);
103 if(
name ==
"diplomessageicon_button") {
104 auto ptr = make_element_by_type<diplomatic_message_topbar_button>(
state,
id);
107 }
else if(
name ==
"flag") {
108 return make_element_by_type<diplomatic_message_topbar_flag_button>(
state,
id);
109 }
else if(
name ==
"messageicon_bg_overlay") {
110 return make_element_by_type<image_element_base>(
state,
id);
116 if(payload.holds_type<dcon::nation_id>()) {
119 }
else if(payload.holds_type<dcon::national_identity_id>()) {
120 payload.emplace<dcon::national_identity_id>(
state.world.nation_get_identity_from_identity_holder(
content.
from));
128 std::string_view get_row_element_name()
override {
129 return "alice_diplomessageicon_entry_window";
132 std::vector< diplomatic_message::message>
messages;
135 return m.when + diplomatic_message::expiration_in_days <= state.current_date
136 || !diplomatic_message::can_accept(state, m);
149 auto const m = retrieve<diplomatic_message::message>(
state, parent);
153 dpw->set_visible(
state,
true);
154 dpw->impl_on_update(
state);
157 auto it = std::remove_if(dmtl->messages.begin(), dmtl->messages.end(),
158 [&](
auto& e) { return e.from == m.from && e.to == m.to && e.type == m.type && e.when == m.when; });
159 auto r = std::distance(it, dmtl->messages.end());
160 dmtl->messages.erase(it, dmtl->messages.end());
161 dmtl->impl_on_update(
state);
std::vector< diplomatic_message::message > messages
diplomatic_message_topbar_button * btn
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
std::vector< diplomatic_message::message > messages
void on_update(sys::state &state) noexcept override
virtual message_result get(sys::state &state, Cyto::Any &payload) noexcept
message_result get(sys::state &state, Cyto::Any &payload) noexcept override
diplomatic_message::message content
std::vector< diplomatic_message::message > row_contents
void update(sys::state &state)
constexpr int32_t expiration_in_days
@ be_crisis_primary_attacker
@ be_crisis_primary_defender
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_to_substitution_map(substitution_map &mp, variable_type key, substitution value)
ankerl::unordered_dense::map< uint32_t, substitution > substitution_map
std::string produce_simple_string(sys::state const &state, dcon::text_key id)
void close_layout_box(columnar_layout &dest, layout_box &box)
element_base * request_window
element_base * request_topbar_listbox