55 auto target = retrieve<dcon::nation_id>(
state,
parent);
59 if(!
state.world.nation_get_is_great_power(
state.local_player_nation) ||
state.world.nation_get_is_great_power(target))
62 auto rel =
state.world.get_gp_relationship_by_gp_influence_pair(target,
state.local_player_nation);
63 if(
state.world.gp_relationship_get_influence(rel) <
state.defines.discredit_influence_cost)
87 auto target = retrieve<dcon::nation_id>(
state,
parent);
96 auto rel =
state.world.get_gp_relationship_by_gp_influence_pair(target,
state.local_player_nation);
118 auto target = retrieve<dcon::nation_id>(
state,
parent);
122 if(!
state.world.nation_get_is_great_power(
state.local_player_nation) ||
state.world.nation_get_is_great_power(target))
125 auto rel =
state.world.get_gp_relationship_by_gp_influence_pair(target,
state.local_player_nation);
126 if(
state.world.gp_relationship_get_influence(rel) <
state.defines.expeladvisors_influence_cost)
150 auto target = retrieve<dcon::nation_id>(
state,
parent);
159 auto rel =
state.world.get_gp_relationship_by_gp_influence_pair(target,
state.local_player_nation);
180 auto target = retrieve<dcon::nation_id>(
state,
parent);
184 if(!
state.world.nation_get_is_great_power(
state.local_player_nation) ||
state.world.nation_get_is_great_power(target))
187 auto rel =
state.world.get_gp_relationship_by_gp_influence_pair(target,
state.local_player_nation);
188 if(
state.world.gp_relationship_get_influence(rel) <
state.defines.banembassy_influence_cost)
212 auto target = retrieve<dcon::nation_id>(
state,
parent);
221 auto rel =
state.world.get_gp_relationship_by_gp_influence_pair(target,
state.local_player_nation);
243 auto target = retrieve<dcon::nation_id>(
state,
parent);
247 if(!
state.world.nation_get_is_great_power(
state.local_player_nation) ||
state.world.nation_get_is_great_power(target))
250 auto rel =
state.world.get_gp_relationship_by_gp_influence_pair(target,
state.local_player_nation);
251 if(
state.world.gp_relationship_get_influence(rel) <
state.defines.decreaseopinion_influence_cost)
275 auto target = retrieve<dcon::nation_id>(
state,
parent);
284 auto rel =
state.world.get_gp_relationship_by_gp_influence_pair(target,
state.local_player_nation);
301 auto content = retrieve<dcon::nation_id>(
state,
parent);
311 m.from =
state.local_player_nation;
318 auto content = retrieve<dcon::nation_id>(
state,
parent);
332 auto content = retrieve<dcon::nation_id>(
state,
parent);
337 if(
state.local_player_nation == content) {
340 if(
state.defines.cancelalliance_diplomatic_cost > 0) {
344 auto rel =
state.world.get_diplomatic_relation_by_diplomatic_pair(content,
state.local_player_nation);
348 auto ol =
state.world.nation_get_overlord_as_subject(
state.local_player_nation);
351 auto asker =
state.local_player_nation;
352 auto target = content;
360 if(
state.defines.alliance_diplomatic_cost > 0) {
363 auto rel =
state.world.get_diplomatic_relation_by_diplomatic_pair(content,
state.local_player_nation);
367 auto ol =
state.world.nation_get_overlord_as_subject(asker);
369 auto ol2 =
state.world.nation_get_overlord_as_subject(target);
374 if(!
state.world.nation_get_is_player_controlled(content)) {
377 m.from =
state.local_player_nation;
396 auto content = retrieve<dcon::nation_id>(
state,
parent);
399 for(
auto war_par :
state.world.nation_get_war_participant(
state.local_player_nation)) {
402 if(!
state.world.nation_get_is_player_controlled(content)) {
405 m.from =
state.local_player_nation;
407 m.data.war = war_par.get_war();
422 auto asker =
state.local_player_nation;
423 auto target = retrieve<dcon::nation_id>(
state,
parent);
425 for(
auto war_par :
state.world.nation_get_war_participant(asker)) {
428 if(!
state.world.nation_get_is_player_controlled(target)) {
431 m.from =
state.local_player_nation;
433 m.data.war = war_par.get_war();
451 auto asker =
state.local_player_nation;
452 auto target = retrieve<dcon::nation_id>(
state,
parent);
457 if(
state.defines.callally_diplomatic_cost > 0) {
463 bool possible_war =
false;
464 bool that_ai_will_accept =
false;
466 for(
auto war_par :
state.world.nation_get_war_participant(asker)) {
469 && (!war_par.get_war().get_is_crisis_war() ||
state.military_definitions.great_wars_enabled)) {
472 if(!
state.world.nation_get_is_player_controlled(target)) {
475 m.from =
state.local_player_nation;
477 m.data.war = war_par.get_war();
479 that_ai_will_accept =
true;
485 if(!
state.world.nation_get_is_player_controlled(target)) {
495 auto target = retrieve<dcon::nation_id>(
state,
parent);
496 auto urid =
state.world.get_unilateral_relationship_by_unilateral_pair(target,
state.local_player_nation);
498 if(
state.world.unilateral_relationship_get_military_access(urid)) {
503 if(!
state.world.nation_get_is_player_controlled(target)) {
506 m.from =
state.local_player_nation;
524 auto target = retrieve<dcon::nation_id>(
state,
parent);
525 auto urid =
state.world.get_unilateral_relationship_by_unilateral_pair(target,
state.local_player_nation);
527 if(
state.world.unilateral_relationship_get_military_access(urid)) {
540 auto target = retrieve<dcon::nation_id>(
state,
parent);
541 auto urid =
state.world.get_unilateral_relationship_by_unilateral_pair(target,
state.local_player_nation);
544 if(
state.world.unilateral_relationship_get_military_access(urid)) {
548 if(
state.defines.cancelaskmilaccess_diplomatic_cost > 0) {
555 if(target ==
state.local_player_nation) {
558 if(
state.defines.askmilaccess_diplomatic_cost > 0) {
561 if(!
state.world.nation_get_is_player_controlled(target)) {
564 m.from =
state.local_player_nation;
579 auto target = retrieve<dcon::nation_id>(
state,
parent);
580 auto urid =
state.world.get_unilateral_relationship_by_unilateral_pair(
state.local_player_nation, target);
582 if(
state.world.unilateral_relationship_get_military_access(urid)) {
592 auto target = retrieve<dcon::nation_id>(
state,
parent);
593 auto urid =
state.world.get_unilateral_relationship_by_unilateral_pair(
state.local_player_nation, target);
595 if(
state.world.unilateral_relationship_get_military_access(urid)) {
608 auto target = retrieve<dcon::nation_id>(
state,
parent);
609 auto urid =
state.world.get_unilateral_relationship_by_unilateral_pair(
state.local_player_nation, target);
611 if(
state.world.unilateral_relationship_get_military_access(urid)) {
615 if(
state.defines.cancelgivemilaccess_diplomatic_cost > 0) {
622 if(target ==
state.local_player_nation) {
625 if(
state.defines.givemilaccess_diplomatic_cost > 0) {
642 auto content = retrieve<dcon::nation_id>(
state,
parent);
658 auto target = retrieve<dcon::nation_id>(
state,
parent);
663 if(target ==
state.local_player_nation) {
669 auto rel =
state.world.get_diplomatic_relation_by_diplomatic_pair(
state.local_player_nation, target);
685 auto content = retrieve<dcon::nation_id>(
state,
parent);
699 auto target = retrieve<dcon::nation_id>(
state,
parent);
704 if(target ==
state.local_player_nation) {
710 auto rel =
state.world.get_diplomatic_relation_by_diplomatic_pair(
state.local_player_nation, target);
721 auto target = retrieve<dcon::nation_id>(
state,
parent);
722 auto rel =
state.world.get_unilateral_relationship_by_unilateral_pair(target,
state.local_player_nation);
723 bool subsidies =
state.world.unilateral_relationship_get_war_subsidies(rel);
731 auto target = retrieve<dcon::nation_id>(
state,
parent);
732 auto rel =
state.world.get_unilateral_relationship_by_unilateral_pair(target,
state.local_player_nation);
733 bool subsidies =
state.world.unilateral_relationship_get_war_subsidies(rel);
746 auto target = retrieve<dcon::nation_id>(
state,
parent);
747 auto rel =
state.world.get_unilateral_relationship_by_unilateral_pair(target,
state.local_player_nation);
748 bool subsidies =
state.world.unilateral_relationship_get_war_subsidies(rel);
752 if(
state.defines.cancelwarsubsidy_diplomatic_cost > 0) {
760 if(
state.local_player_nation == target) {
763 if(
state.defines.warsubsidy_diplomatic_cost > 0) {
775 dcon::nation_id content = retrieve<dcon::nation_id>(
state,
parent);
789 dcon::nation_id content = retrieve<dcon::nation_id>(
state,
parent);
801 auto target = retrieve<dcon::nation_id>(
state,
parent);
802 auto source =
state.local_player_nation;
808 auto ol =
state.world.nation_get_overlord_as_subject(source);
813 auto ol =
state.world.nation_get_overlord_as_subject(target);
819 if(
state.world.war_get_is_crisis_war(war)) {
820 bool both_wl = (
state.world.war_get_primary_attacker(war) == source &&
state.world.war_get_primary_defender(war) == target) || (
state.world.war_get_primary_attacker(war) == target ||
state.world.war_get_primary_defender(war) == source);
823 bool one_is_wl = [&]() {
824 if(
state.world.war_get_primary_attacker(war) == source) {
827 }
else if(
state.world.war_get_primary_defender(war) == source) {
830 }
else if(
state.world.war_get_primary_attacker(war) == target) {
833 }
else if(
state.world.war_get_primary_defender(war) == target) {
847 if(source == target) {
850 if(
state.defines.declarewar_diplomatic_cost > 0) {
896 auto content = retrieve<dcon::nation_id>(
state,
parent);
901 auto content = retrieve<dcon::nation_id>(
state,
parent);
911 auto target = retrieve<dcon::nation_id>(
state,
parent);
912 auto source =
state.local_player_nation;
921 auto rel =
state.world.get_gp_relationship_by_gp_influence_pair(target, source);
941 auto content = retrieve<dcon::nation_id>(
state,
parent);
946 auto content = retrieve<dcon::nation_id>(
state,
parent);
955 auto target = retrieve<dcon::nation_id>(
state,
parent);
956 auto source =
state.local_player_nation;
965 auto rel =
state.world.get_gp_relationship_by_gp_influence_pair(target, source);
987 auto content = retrieve<dcon::nation_id>(
state,
parent);
992 auto content = retrieve<dcon::nation_id>(
state,
parent);
1002 auto target = retrieve<dcon::nation_id>(
state,
parent);
1003 auto source =
state.local_player_nation;
1004 bool in_players_sphere =
state.world.nation_get_in_sphere_of(target) == source;
1007 if(in_players_sphere) {
1008 if(
state.defines.removefromsphere_infamy_cost != 0) {
1011 if(
state.defines.removefromsphere_prestige_cost != 0) {
1021 auto rel =
state.world.get_gp_relationship_by_gp_influence_pair(target,
state.local_player_nation);
1030 if(!in_players_sphere) {
1040 bool has_any_justifiable_cb(
sys::state&
state, dcon::nation_id source, dcon::nation_id target)
noexcept {
1042 state.world.for_each_cb_type([&](dcon::cb_type_id cb) {
1056 auto source =
state.local_player_nation;
1057 auto target = retrieve<dcon::nation_id>(
state,
parent);
1059 auto can_subjects_declare =
state.defines.alice_allow_subjects_declare_wars;
1062 if(source == target)
1064 if(
state.world.nation_get_constructing_cb_type(source))
1066 auto ol =
state.world.nation_get_overlord_as_subject(source);
1067 if(
state.defines.alice_allow_subjects_declare_wars < 1 &&
state.world.overlord_get_ruler(ol) &&
state.world.overlord_get_ruler(ol) != target)
1069 if(
state.world.nation_get_in_sphere_of(target) == source)
1071 if(
state.world.nation_get_diplomatic_points(source) <
state.defines.make_cb_diplomatic_cost)
1075 if(!has_any_justifiable_cb(
state, source, target))
1091 auto source =
state.local_player_nation;
1092 auto target = retrieve<dcon::nation_id>(
state,
parent);
1095 if(source == target) {
1098 if(
state.defines.make_cb_diplomatic_cost > 0) {
1102 if(
state.defines.alice_allow_subjects_declare_wars < 1) {
1103 auto ol =
state.world.nation_get_overlord_as_subject(source);
1117 return "alliancetitle";
1119 return "cancelalliancetitle";
1121 return "callallytitle";
1125 return "askmilitaryaccesstitle";
1127 return "cancelaskmilitaryaccesstitle";
1129 return "givemilitaryaccesstitle";
1131 return "cancelgivemilitaryaccesstitle";
1133 return "increaserelationtitle";
1135 return "decreaserelationtitle";
1137 return "warsubsidiestitle";
1139 return "cancel_warsubsidiestitle";
1141 return "increaseopiniontitle";
1143 return "addtospheretitle";
1145 return "removefromspheretitle";
1147 return "make_cbtitle";
1149 return "give_unit_commandtitle";
1151 return "cancel_unit_commandtitle";
1153 return "make_peacetitle";
1168 return "alliancenewdesc";
1170 return "breakalliancenewdesc";
1172 return "callally_desc";
1176 return "askmilitaryaccess_desc";
1178 return "cancelaskmilitaryaccess_desc";
1180 return "givemilitaryaccess_desc";
1182 return "cancelgivemilitaryaccess_desc";
1184 return "increaserelation_desc";
1186 return "decreaserelation_desc";
1188 return "warsubsidies_desc";
1190 return "cancel_warsubsidies_desc";
1192 return "increaseopinion_desc";
1194 return "addtosphere_desc";
1196 return "removefromsphere_desc";
1198 return "make_cb_desc";
1200 return "give_unit_command_desc";
1202 return "cancel_unit_command_desc";
1204 return "make_peace_desc";
1223 auto target = retrieve<dcon::nation_id>(
state,
parent);
1291 auto target = retrieve<dcon::nation_id>(
state,
parent);
1370 if(
name ==
"title") {
1371 return make_element_by_type<diplomacy_action_dialog_title_text>(
state,
id);
1372 }
else if(
name ==
"description") {
1373 return make_element_by_type<diplomacy_action_dialog_description_text>(
state,
id);
1374 }
else if(
name ==
"chance_string") {
1375 return make_element_by_type<simple_text_element_base>(
state,
id);
1376 }
else if(
name ==
"agreebutton") {
1377 return make_element_by_type<diplomacy_action_dialog_agree_button>(
state,
id);
1378 }
else if(
name ==
"declinebutton") {
1379 return make_element_by_type<diplomacy_action_dialog_decline_button>(
state,
id);
1380 }
else if(
name ==
"leftshield") {
1381 return make_element_by_type<nation_player_flag>(
state,
id);
1382 }
else if(
name ==
"rightshield") {
1383 return make_element_by_type<flag_button>(
state,
id);
1384 }
else if(
name ==
"background") {
1385 auto ptr = make_element_by_type<draggable_target>(
state,
id);
1411 return state.world.nation_get_identity_from_identity_holder(n);
1414 auto this_selection = retrieve<gp_choice_num>(
state,
parent);
1445 auto target = retrieve<dcon::nation_id>(
state,
parent);
1454 auto target = retrieve<dcon::nation_id>(
state,
parent);
1455 auto rel =
state.world.get_gp_relationship_by_gp_influence_pair(target, gp);
1470 auto target = retrieve<dcon::nation_id>(
state,
parent);
1479 auto target = retrieve<dcon::nation_id>(
state,
parent);
1480 auto rel =
state.world.get_gp_relationship_by_gp_influence_pair(target, gp);
1494 auto target = retrieve<dcon::nation_id>(
state,
parent);
1503 auto target = retrieve<dcon::nation_id>(
state,
parent);
1514 if(
name ==
"country_name") {
1515 return make_element_by_type<select_gp_name>(
state,
id);
1516 }
else if(
name ==
"country_flag") {
1517 return make_element_by_type<select_gp_choice_button>(
state,
id);
1518 }
else if(
name ==
"country_selected") {
1519 return make_element_by_type<select_gp_selection_icon>(
state,
id);
1520 }
else if(
name ==
"country_discredited") {
1521 return make_element_by_type<select_gp_discredited>(
state,
id);
1522 }
else if(
name ==
"country_banned_embassy") {
1523 return make_element_by_type<select_gp_banned>(
state,
id);
1524 }
else if(
name ==
"country_opinion") {
1525 return make_element_by_type<select_gp_opinion_detail>(
state,
id);
1526 }
else if(
name ==
"country_influence") {
1527 return make_element_by_type<select_gp_influence_detail>(
state,
id);
1546 switch(retrieve<gp_choice_actions>(
state,
parent)) {
1570 switch(retrieve<gp_choice_actions>(
state,
parent)) {
1609 auto target = retrieve<dcon::nation_id>(
state,
parent);
1611 switch(retrieve<gp_choice_actions>(
state,
parent)) {
1628 auto target = retrieve<dcon::nation_id>(
state,
parent);
1630 switch(retrieve<gp_choice_actions>(
state,
parent)) {
1651 auto target = retrieve<dcon::nation_id>(
state,
parent);
1653 switch(retrieve<gp_choice_actions>(
state,
parent)) {
1656 if(
state.local_player_nation == gp) {
1660 auto rel =
state.world.get_gp_relationship_by_gp_influence_pair(target,
state.local_player_nation);
1671 auto orel =
state.world.get_gp_relationship_by_gp_influence_pair(target, gp);
1679 if(
state.local_player_nation == gp) {
1683 auto rel =
state.world.get_gp_relationship_by_gp_influence_pair(target,
state.local_player_nation);
1700 if(
state.local_player_nation == gp) {
1704 auto rel =
state.world.get_gp_relationship_by_gp_influence_pair(target,
state.local_player_nation);
1720 if(
state.local_player_nation == gp) {
1724 if(
state.world.nation_get_in_sphere_of(target) == gp) {
1728 auto rel =
state.world.get_gp_relationship_by_gp_influence_pair(target,
state.local_player_nation);
1741 state.world.gp_relationship_get_status(
state.world.get_gp_relationship_by_gp_influence_pair(target,
1765 xy_pair gp_base_select_offset =
1767 xy_pair gp_select_offset = gp_base_select_offset;
1769 auto ptr = make_element_by_type<diplomacy_action_gp_dialog_select_window>(
state,
1771 ptr->base_data.position = gp_select_offset;
1774 gp_select_offset.
y += ptr->base_data.size.y;
1775 if(i != 0 && i % 2 == 1) {
1776 gp_select_offset.
x += ptr->base_data.size.x;
1777 gp_select_offset.
y = gp_base_select_offset.
y;
1784 if(
name ==
"title") {
1785 return make_element_by_type<gp_action_choice_title>(
state,
id);
1786 }
else if(
name ==
"description") {
1787 return make_element_by_type<gp_action_choice_desc>(
state,
id);
1788 }
else if(
name ==
"agreebutton") {
1789 return make_element_by_type<gp_action_choice_accept_button>(
state,
id);
1790 }
else if(
name ==
"declinebutton") {
1791 return make_element_by_type<gp_action_choice_cancel_button>(
state,
id);
1792 }
else if(
name ==
"leftshield") {
1793 return make_element_by_type<nation_player_flag>(
state,
id);
1794 }
else if(
name ==
"rightshield") {
1795 return make_element_by_type<flag_button>(
state,
id);
1796 }
else if(
name ==
"background") {
1797 auto ptr = make_element_by_type<draggable_target>(
state,
id);
1807 selected_gp = any_cast<gp_choice_select>(payload).value;
1810 }
else if(payload.holds_type<dcon::nation_id>()) {
1832 auto content = retrieve<dcon::nation_id>(
state,
parent);
1834 for(
const auto s :
state.world.nation_get_state_ownership(content)) {
1843 auto content = retrieve<dcon::nation_id>(
state,
parent);
1847 for(
const auto s :
state.world.nation_get_state_ownership(
state.local_player_nation)) {
1859 state.start_state_selection(seldata);
1867 auto target = retrieve<dcon::nation_id>(
state,
parent);
1868 auto source =
state.local_player_nation;
1885 if(
name ==
"action_option") {
1886 return make_element_by_type<T>(
state,
id);
void add_child_to_front(std::unique_ptr< element_base > child) noexcept final
void impl_on_update(sys::state &state) noexcept override
void on_update(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
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 on_create(sys::state &state) noexcept override
dcon::nation_id action_target
gp_choice_actions current_action
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
virtual message_result get(sys::state &state, Cyto::Any &payload) noexcept
virtual void impl_on_update(sys::state &state) noexcept
message_result impl_get(sys::state &state, Cyto::Any &payload) noexcept
void set_visible(sys::state &state, bool vis)
void on_update(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
void render(sys::state &state, int32_t x, int32_t y) noexcept override
text::layout internal_layout
tooltip_behavior has_tooltip(sys::state &state) noexcept override
void render(sys::state &state, int32_t x, int32_t y) noexcept override
void update_tooltip(sys::state &state, int32_t x, int32_t y, text::columnar_layout &contents) noexcept override
void on_update(sys::state &state) noexcept override
void render(sys::state &state, int32_t x, int32_t y) 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
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 set_text(sys::state &state, std::string const &new_text)
void on_create(sys::state &state) noexcept override
void explain_ai_access_reasons(sys::state &state, dcon::nation_id target, text::layout_base &contents, int32_t indent)
void explain_ai_alliance_reasons(sys::state &state, dcon::nation_id target, text::layout_base &contents, int32_t indent)
bool can_state_transfer(sys::state &state, dcon::nation_id asker, dcon::nation_id target, dcon::state_definition_id sid)
bool can_increase_opinion(sys::state &state, dcon::nation_id source, dcon::nation_id influence_target)
bool can_cancel_military_access(sys::state &state, dcon::nation_id source, dcon::nation_id target, bool ignore_cost)
bool can_release_subject(sys::state &state, dcon::nation_id source, dcon::nation_id target)
bool can_expel_advisors(sys::state &state, dcon::nation_id source, dcon::nation_id influence_target, dcon::nation_id affected_gp)
bool can_add_to_sphere(sys::state &state, dcon::nation_id source, dcon::nation_id influence_target)
bool can_give_war_subsidies(sys::state &state, dcon::nation_id source, dcon::nation_id target)
bool can_give_military_access(sys::state &state, dcon::nation_id asker, dcon::nation_id target, bool ignore_cost)
bool can_cancel_war_subsidies(sys::state &state, dcon::nation_id source, dcon::nation_id target)
void give_war_subsidies(sys::state &state, dcon::nation_id source, dcon::nation_id target)
bool can_call_to_arms(sys::state &state, dcon::nation_id asker, dcon::nation_id target, dcon::war_id w, bool ignore_cost)
bool can_ask_for_access(sys::state &state, dcon::nation_id asker, dcon::nation_id target, bool ignore_cost)
bool can_increase_relations(sys::state &state, dcon::nation_id source, dcon::nation_id target)
bool can_ban_embassy(sys::state &state, dcon::nation_id source, dcon::nation_id influence_target, dcon::nation_id affected_gp)
bool can_decrease_relations(sys::state &state, dcon::nation_id source, dcon::nation_id target)
bool can_start_peace_offer(sys::state &state, dcon::nation_id source, dcon::nation_id target, dcon::war_id war, bool is_concession)
bool can_discredit_advisors(sys::state &state, dcon::nation_id source, dcon::nation_id influence_target, dcon::nation_id affected_gp)
bool can_remove_from_sphere(sys::state &state, dcon::nation_id source, dcon::nation_id influence_target, dcon::nation_id affected_gp)
bool can_decrease_opinion(sys::state &state, dcon::nation_id source, dcon::nation_id influence_target, dcon::nation_id affected_gp)
@ ask_for_military_access
@ cancel_given_military_access
bool can_fabricate_cb(sys::state &state, dcon::nation_id source, dcon::nation_id target, dcon::cb_type_id type)
bool can_cancel_alliance(sys::state &state, dcon::nation_id source, dcon::nation_id target, bool ignore_cost)
bool can_cancel_given_military_access(sys::state &state, dcon::nation_id source, dcon::nation_id target, bool ignore_cost)
bool can_ask_for_alliance(sys::state &state, dcon::nation_id asker, dcon::nation_id target, bool ignore_cost)
pop_satisfaction_wrapper_fat fatten(data_container const &c, pop_satisfaction_wrapper_id id) noexcept
bool ai_will_accept(sys::state &state, message const &m)
float estimate_war_subsidies(sys::state &state, dcon::nation_id n)
bool can_use_cb_against(sys::state &state, dcon::nation_id from, dcon::nation_id target)
bool has_truce_with(sys::state &state, dcon::nation_id attacker, dcon::nation_id target)
bool standard_war_joining_is_possible(sys::state &state, dcon::war_id wfor, dcon::nation_id n, bool as_attacker)
war_role get_role(sys::state const &state, dcon::war_id w, dcon::nation_id n)
bool is_attacker(sys::state &state, dcon::war_id w, dcon::nation_id n)
bool are_in_common_war(sys::state const &state, dcon::nation_id a, dcon::nation_id b)
dcon::war_id find_war_between(sys::state const &state, dcon::nation_id a, dcon::nation_id b)
bool are_at_war(sys::state const &state, dcon::nation_id a, dcon::nation_id b)
bool is_civil_war(sys::state const &state, dcon::war_id w)
constexpr uint8_t is_banned
constexpr uint8_t level_friendly
constexpr uint8_t is_discredited
constexpr uint8_t level_opposed
constexpr uint8_t level_hostile
constexpr uint8_t level_in_sphere
constexpr uint8_t level_mask
int32_t get_level(sys::state &state, dcon::nation_id gp, dcon::nation_id target)
bool is_influence_level_greater_or_equal(int32_t l, int32_t r)
bool are_allied(sys::state &state, dcon::nation_id a, dcon::nation_id b)
dcon::nation_id get_nth_great_power(sys::state const &state, uint16_t n)
std::string resolve_string_substitution(sys::state &state, dcon::text_key source_text, substitution_map const &mp)
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)
std::string format_float(float num, size_t digits)
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)
std::string get_influence_level_name(sys::state const &state, uint8_t v)
void close_layout_box(columnar_layout &dest, layout_box &box)
void send(sys::state &state, element_base *parent, T value)
@ cancel_give_military_access
std::vector< dcon::state_definition_id > selectable_states
std::function< void(sys::state &, dcon::state_definition_id)> on_select
std::function< void(sys::state &)> on_cancel
union ui::element_data::internal_data data
void render(sys::state &state, int32_t x, int32_t y) noexcept override
void on_update(sys::state &state) noexcept override
ankerl::unordered_dense::map< dcon::text_key, element_target, hash_text_key > defs_by_name