10 return state.world.nation_get_identity_from_identity_holder(
state.primary_crisis_attacker);
20 auto colonizers =
state.world.state_definition_get_colonization(
state.crisis_colony);
21 if(colonizers.begin() != colonizers.end()) {
22 auto attacking_colonizer = (*colonizers.begin()).get_colonizer();
23 return state.world.nation_get_identity_from_identity_holder(attacking_colonizer);
26 return state.crisis_liberation_tag;
28 return dcon::national_identity_id{};
34 auto colonizers =
state.world.state_definition_get_colonization(
state.crisis_colony);
35 if(colonizers.begin() != colonizers.end()) {
36 auto attacking_colonizer = (*colonizers.begin()).get_colonizer();
37 show = attacking_colonizer !=
state.primary_crisis_attacker;
42 show =
state.crisis_liberation_tag !=
state.world.nation_get_identity_from_identity_holder(
state.primary_crisis_attacker);
78 void render(
sys::state&
state, int32_t x, int32_t y)
noexcept override {
97 for(
auto& i :
state.crisis_participants) {
98 if(i.id ==
state.local_player_nation) {
122 void render(
sys::state&
state, int32_t x, int32_t y)
noexcept override {
141 for(
auto& i :
state.crisis_participants) {
142 if(i.id ==
state.local_player_nation) {
159 show =
state.local_player_nation ==
state.primary_crisis_attacker;
166 void render(
sys::state&
state, int32_t x, int32_t y)
noexcept override {
182 show =
state.local_player_nation ==
state.primary_crisis_defender;
189 void render(
sys::state&
state, int32_t x, int32_t y)
noexcept override {
212 for(
uint32_t i = 0; i <
state.crisis_participants.size(); i++) {
213 if(!
state.crisis_participants[i].id)
216 if(
state.crisis_participants[i].supports_attacker && !
state.crisis_participants[i].merely_interested &&
state.crisis_participants[i].id !=
state.primary_crisis_attacker) {
218 row_contents.push_back(content.get_identity_from_identity_holder().id);
236 auto colonizers =
state.world.state_definition_get_colonization(
state.crisis_colony);
237 if(colonizers.end() - colonizers.begin() >= 2) {
238 auto def_colonizer = (*(colonizers.begin() + 1)).get_colonizer();
239 auto attacking_colonizer = (*colonizers.begin()).get_colonizer();
245 dcon::national_identity_id{},
247 state.military_definitions.crisis_colony
252 state.primary_crisis_attacker,
253 state.world.state_instance_get_nation_from_state_ownership(
state.crisis_state),
255 state.crisis_liberation_tag,
256 state.world.state_instance_get_definition(
state.crisis_state),
257 state.military_definitions.crisis_liberate
261 for(
auto& par :
state.crisis_participants) {
265 if(par.supports_attacker && par.joined_with_offer.wargoal_type) {
268 par.joined_with_offer.target,
269 par.joined_with_offer.wargoal_secondary_nation,
270 par.joined_with_offer.wargoal_tag,
271 par.joined_with_offer.wargoal_state,
272 par.joined_with_offer.wargoal_type
285 if(
name ==
"country_flag") {
286 return make_element_by_type<diplomacy_crisis_attacker_flag>(
state,
id);
287 }
else if(
name ==
"sponsored_flag") {
288 return make_element_by_type<diplomacy_crisis_sponsored_attacker_flag>(
state,
id);
289 }
else if(
name ==
"country_name") {
290 return make_element_by_type<diplomacy_crisis_attacker_name>(
state,
id);
291 }
else if(
name ==
"wargoals") {
292 return make_element_by_type<crisis_attacker_wargoals>(
state,
id);
293 }
else if(
name ==
"backers") {
294 auto ptr = make_element_by_type<diplomacy_crisis_attacker_backers>(
state,
id);
295 ptr->base_data.position.y -= 6;
297 }
else if(
name ==
"support_side") {
298 return make_element_by_type<support_attacker_button>(
state,
id);
299 }
else if(
name ==
"back_down") {
300 return make_element_by_type<propose_defender_solution_button>(
state,
id);
310 return state.world.nation_get_identity_from_identity_holder(
state.primary_crisis_defender);
320 auto colonizers =
state.world.state_definition_get_colonization(
state.crisis_colony);
321 if(colonizers.end() - colonizers.begin() >= 2) {
322 auto def_colonizer = (*(colonizers.begin() + 1)).get_colonizer();
323 return state.world.nation_get_identity_from_identity_holder(def_colonizer);
326 return state.world.nation_get_identity_from_identity_holder(
state.world.state_instance_get_nation_from_state_ownership(
state.crisis_state));
328 return dcon::national_identity_id{};
334 auto colonizers =
state.world.state_definition_get_colonization(
state.crisis_colony);
335 if(colonizers.end() - colonizers.begin() >= 2) {
336 auto def_colonizer = (*(colonizers.begin() + 1)).get_colonizer();
337 show = def_colonizer !=
state.primary_crisis_defender;
342 show =
state.world.state_instance_get_nation_from_state_ownership(
state.crisis_state) !=
state.primary_crisis_defender;
377 for(
uint32_t i = 0; i <
state.crisis_participants.size(); i++) {
378 if(!
state.crisis_participants[i].id)
381 if(!
state.crisis_participants[i].supports_attacker && !
state.crisis_participants[i].merely_interested &&
state.crisis_participants[i].id !=
state.primary_crisis_defender) {
383 row_contents.push_back(content.get_identity_from_identity_holder().id);
402 auto colonizers =
state.world.state_definition_get_colonization(
state.crisis_colony);
403 if(colonizers.end() - colonizers.begin() >= 2) {
404 auto def_colonizer = (*(colonizers.begin() + 1)).get_colonizer();
405 auto attacking_colonizer = (*colonizers.begin()).get_colonizer();
411 dcon::national_identity_id{},
413 state.military_definitions.crisis_colony
420 for(
auto& par :
state.crisis_participants) {
424 if(!par.supports_attacker && par.joined_with_offer.wargoal_type) {
427 par.joined_with_offer.target,
428 par.joined_with_offer.wargoal_secondary_nation,
429 par.joined_with_offer.wargoal_tag,
430 par.joined_with_offer.wargoal_state,
431 par.joined_with_offer.wargoal_type
444 if(
name ==
"country_flag") {
445 return make_element_by_type<diplomacy_crisis_defender_flag>(
state,
id);
446 }
else if(
name ==
"sponsored_flag") {
447 return make_element_by_type<diplomacy_crisis_sponsored_defender_flag>(
state,
id);
448 }
else if(
name ==
"country_name") {
449 return make_element_by_type<diplomacy_crisis_defender_name>(
state,
id);
450 }
else if(
name ==
"wargoals") {
451 return make_element_by_type<crisis_defender_wargoals>(
state,
id);
452 }
else if(
name ==
"backers") {
453 auto ptr = make_element_by_type<diplomacy_crisis_defender_backers>(
state,
id);
454 ptr->base_data.position.y -= 6;
456 }
else if(
name ==
"support_side") {
457 return make_element_by_type<support_defender_button>(
state,
id);
458 }
else if(
name ==
"back_down") {
459 return make_element_by_type<propose_attacker_solution_button>(
state,
id);
482 switch(
state.current_crisis) {
492 if(
state.world.nation_get_owned_province_count(
state.world.national_identity_get_nation_from_identity_holder(
state.crisis_liberation_tag)) > 0) {
530 switch(
state.current_crisis_mode) {
553 return state.world.nation_get_identity_from_identity_holder(n);
609 if(
name ==
"country_flag") {
610 return make_element_by_type<interested_flag>(
state,
id);
611 }
else if(
name ==
"make_offer") {
612 return make_element_by_type<make_offer_button>(
state,
id);
619 if(payload.holds_type<dcon::nation_id>()) {
622 for(
auto& par:
state.crisis_participants) {
625 if(par.merely_interested) {
633 payload.emplace<dcon::nation_id>(n);
642 for(
auto& par :
state.crisis_participants) {
645 if(par.merely_interested) {
671 if(
name ==
"join_button") {
672 return make_element_by_type<join_crisis_button>(
state,
id);
680 if(!
state.world.nation_get_is_great_power(
state.local_player_nation))
705 auto ptr = make_element_by_type<diplomacy_crisis_interested_container>(
state,
state.ui_state.
defs_by_name.find(
state.lookup_key(
"fence_sitter_entry"))->second.definition);
706 ptr->base_data.position.x = int16_t(0);
707 ptr->base_data.position.y = int16_t(0);
712 auto ptr = make_element_by_type<diplomacy_crisis_interested_container>(
state,
state.ui_state.
defs_by_name.find(
state.lookup_key(
"fence_sitter_entry"))->second.definition);
713 ptr->base_data.position.x = int16_t(70 * 1);
714 ptr->base_data.position.y = int16_t(0);
719 auto ptr = make_element_by_type<diplomacy_crisis_interested_container>(
state,
state.ui_state.
defs_by_name.find(
state.lookup_key(
"fence_sitter_entry"))->second.definition);
720 ptr->base_data.position.x = int16_t(70 * 2);
721 ptr->base_data.position.y = int16_t(0);
726 auto ptr = make_element_by_type<diplomacy_crisis_interested_container>(
state,
state.ui_state.
defs_by_name.find(
state.lookup_key(
"fence_sitter_entry"))->second.definition);
727 ptr->base_data.position.x = int16_t(0);
728 ptr->base_data.position.y = int16_t(75);
733 auto ptr = make_element_by_type<diplomacy_crisis_interested_container>(
state,
state.ui_state.
defs_by_name.find(
state.lookup_key(
"fence_sitter_entry"))->second.definition);
734 ptr->base_data.position.x = int16_t(70 * 1);
735 ptr->base_data.position.y = int16_t(75);
740 auto ptr = make_element_by_type<diplomacy_crisis_interested_container>(
state,
state.ui_state.
defs_by_name.find(
state.lookup_key(
"fence_sitter_entry"))->second.definition);
741 ptr->base_data.position.x = int16_t(70 * 2);
742 ptr->base_data.position.y = int16_t(75);
747 auto ptr = make_element_by_type<diplomacy_crisis_join_container>(
state,
state.ui_state.
defs_by_name.find(
state.lookup_key(
"join_fence_sitter_entry"))->second.definition);
748 ptr->base_data.position.x = int16_t(70 * 2 - 3);
749 ptr->base_data.position.y = int16_t(58);
758 if(
name ==
"crisis_title") {
759 return make_element_by_type<diplomacy_crisis_title_text>(
state,
id);
760 }
else if(
name ==
"crisis_sub_title") {
761 return make_element_by_type<diplomacy_crisis_subtitle_text>(
state,
id);
762 }
else if(
name ==
"crisis_temperature") {
763 return make_element_by_type<diplomacy_crisis_temperature_bar>(
state,
id);
764 }
else if(
name ==
"crisis_status_label") {
765 return make_element_by_type<diplomacy_crisis_status_text>(
state,
id);
766 }
else if(
name ==
"attacker_win") {
767 return make_element_by_type<diplomacy_crisis_attacker_window>(
state,
id);
768 }
else if(
name ==
"defender_win") {
769 return make_element_by_type<diplomacy_crisis_defender_window>(
state,
id);
770 }
else if(
name ==
"fence_sitters_win") {
771 return make_element_by_type< diplomacy_crisis_interested_window>(
state,
id);
dcon::text_key get_name() noexcept
void add_child_to_front(std::unique_ptr< element_base > child) noexcept final
std::string_view get_row_element_name() override
void on_update(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
std::string_view get_row_element_name() override
void populate_flags(sys::state &state) noexcept override
dcon::national_identity_id get_current_nation(sys::state &state) noexcept override
void on_update(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 populate_flags(sys::state &state) noexcept override
dcon::national_identity_id get_current_nation(sys::state &state) noexcept override
void on_update(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
std::unique_ptr< element_base > make_child(sys::state &state, std::string_view name, dcon::gui_def_id id) noexcept override
std::unique_ptr< element_base > make_child(sys::state &state, std::string_view name, dcon::gui_def_id id) noexcept override
mouse_probe impl_probe_mouse(sys::state &state, int32_t x, int32_t y, mouse_probe_type type) noexcept override
void impl_render(sys::state &state, int32_t x, int32_t y) 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_update(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
mouse_probe impl_probe_mouse(sys::state &state, int32_t x, int32_t y, mouse_probe_type type) noexcept override
void impl_render(sys::state &state, int32_t x, int32_t y) noexcept override
void on_update(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
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
tooltip_behavior has_tooltip(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
virtual void impl_render(sys::state &state, int32_t x, int32_t y) noexcept
virtual mouse_probe impl_probe_mouse(sys::state &state, int32_t x, int32_t y, mouse_probe_type type) noexcept
dcon::national_identity_id get_current_nation(sys::state &state) noexcept override
std::vector< dcon::national_identity_id > row_contents
void update(sys::state &state)
void set_text(sys::state &state, std::string const &new_text)
void on_create(sys::state &state) noexcept override
bool can_take_sides_in_crisis(sys::state &state, dcon::nation_id source, bool join_attacker)
@ become_interested_in_crisis
pop_satisfaction_wrapper_fat fatten(data_container const &c, pop_satisfaction_wrapper_id id) noexcept
bool is_committed_in_crisis(sys::state const &state, dcon::nation_id n)
bool is_involved_in_crisis(sys::state const &state, dcon::nation_id n)
std::string resolve_string_substitution(sys::state &state, dcon::text_key source_text, substitution_map const &mp)
void add_line(sys::state &state, layout_base &dest, dcon::text_key txt, int32_t indent)
void add_line_with_condition(sys::state &state, layout_base &dest, std::string_view key, bool condition_met, int32_t indent)
void add_line_break_to_layout(sys::state &state, columnar_layout &dest)
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)
dcon::text_key get_name(sys::state &state, dcon::nation_id id)
void send(sys::state &state, element_base *parent, T value)
ankerl::unordered_dense::map< dcon::text_key, element_target, hash_text_key > defs_by_name