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);
109 if(
name ==
"diplomessageicon_button") {
110 auto ptr = make_element_by_type<diplomatic_message_topbar_button>(
state,
id);
113 }
else if(
name ==
"flag") {
114 return make_element_by_type<diplomatic_message_topbar_flag_button>(
state,
id);
115 }
else if(
name ==
"messageicon_bg_overlay") {
116 return make_element_by_type<image_element_base>(
state,
id);
122 if(payload.holds_type<dcon::nation_id>()) {
125 }
else if(payload.holds_type<dcon::national_identity_id>()) {
126 payload.emplace<dcon::national_identity_id>(
state.world.nation_get_identity_from_identity_holder(
content.
from));
134 std::string_view get_row_element_name()
override {
135 return "alice_diplomessageicon_entry_window";
138 std::vector< diplomatic_message::message>
messages;
141 return m.when + diplomatic_message::expiration_in_days <= state.current_date
142 || !diplomatic_message::can_accept(state, m);
155 auto const m = retrieve<diplomatic_message::message>(
state, parent);
159 dpw->set_visible(
state,
true);
160 dpw->impl_on_update(
state);
163 auto it = std::remove_if(dmtl->messages.begin(), dmtl->messages.end(),
164 [&](
auto& e) { return e.from == m.from && e.to == m.to && e.type == m.type && e.when == m.when; });
165 auto r = std::distance(it, dmtl->messages.end());
166 dmtl->messages.erase(it, dmtl->messages.end());
167 dmtl->impl_on_update(
state);
171 auto const m = retrieve<diplomatic_message::message>(
state, parent);
174 auto it = std::remove_if(dmtl->messages.begin(), dmtl->messages.end(),
175 [&](
auto& e) { return e.from == m.from && e.to == m.to && e.type == m.type && e.when == m.when; });
176 auto r = std::distance(it, dmtl->messages.end());
177 dmtl->messages.erase(it, dmtl->messages.end());
178 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)
Holds important data about the game world, state, and other data regarding windowing,...
element_base * request_window
element_base * request_topbar_listbox