50 return state.lookup_key(
"null");
70 return state.lookup_key(
"discredit_button");
74 if(!
state.world.nation_get_is_great_power(
state.local_player_nation) ||
state.world.nation_get_is_great_power(target))
76 auto rel =
state.world.get_gp_relationship_by_gp_influence_pair(target,
state.local_player_nation);
77 if(
state.world.gp_relationship_get_influence(rel) <
state.defines.discredit_influence_cost)
103 auto rel =
state.world.get_gp_relationship_by_gp_influence_pair(target,
state.local_player_nation);
117 return state.lookup_key(
"expeladvisors_button");
121 if(!
state.world.nation_get_is_great_power(
state.local_player_nation) ||
state.world.nation_get_is_great_power(target))
124 auto rel =
state.world.get_gp_relationship_by_gp_influence_pair(target,
state.local_player_nation);
125 if(
state.world.gp_relationship_get_influence(rel) <
state.defines.expeladvisors_influence_cost)
154 auto rel =
state.world.get_gp_relationship_by_gp_influence_pair(target,
state.local_player_nation);
168 return state.lookup_key(
"banembassy_button");
172 if(!
state.world.nation_get_is_great_power(
state.local_player_nation) ||
state.world.nation_get_is_great_power(target))
175 auto rel =
state.world.get_gp_relationship_by_gp_influence_pair(target,
state.local_player_nation);
176 if(
state.world.gp_relationship_get_influence(rel) <
state.defines.banembassy_influence_cost)
205 auto rel =
state.world.get_gp_relationship_by_gp_influence_pair(target,
state.local_player_nation);
222 return state.lookup_key(
"decreaseopinion_button");
226 if(!
state.world.nation_get_is_great_power(
state.local_player_nation) ||
state.world.nation_get_is_great_power(target))
229 auto rel =
state.world.get_gp_relationship_by_gp_influence_pair(target,
state.local_player_nation);
230 if(
state.world.gp_relationship_get_influence(rel) <
state.defines.decreaseopinion_influence_cost)
259 auto rel =
state.world.get_gp_relationship_by_gp_influence_pair(target,
state.local_player_nation);
275 return state.lookup_key(
"cancelalliance_button");
277 return state.lookup_key(
"alliance_button");
287 m.from =
state.local_player_nation;
307 if(
state.local_player_nation == target) {
310 if(
state.defines.cancelalliance_diplomatic_cost > 0) {
314 auto rel =
state.world.get_diplomatic_relation_by_diplomatic_pair(target,
state.local_player_nation);
318 auto ol =
state.world.nation_get_overlord_as_subject(
state.local_player_nation);
321 auto asker =
state.local_player_nation;
329 if(
state.defines.alliance_diplomatic_cost > 0) {
332 auto rel =
state.world.get_diplomatic_relation_by_diplomatic_pair(target,
state.local_player_nation);
336 if(
state.defines.alice_allow_subjects_declare_wars == 0) {
337 auto ol =
state.world.nation_get_overlord_as_subject(asker);
339 auto ol2 =
state.world.nation_get_overlord_as_subject(target);
345 if(!
state.world.nation_get_is_player_controlled(target)) {
348 m.from =
state.local_player_nation;
359 dcon::text_key get_name(
sys::state&
state, dcon::nation_id target)
noexcept override {
360 return state.lookup_key(
"callally_button");
363 bool is_available(
sys::state&
state, dcon::nation_id target)
noexcept override {
364 for(
auto war_par :
state.world.nation_get_war_participant(
state.local_player_nation)) {
366 if(!
state.world.nation_get_is_player_controlled(target)) {
369 m.from =
state.local_player_nation;
371 m.data.war = war_par.get_war();
388 auto asker =
state.local_player_nation;
390 for(
auto war_par :
state.world.nation_get_war_participant(asker)) {
393 if(!
state.world.nation_get_is_player_controlled(target)) {
396 m.from =
state.local_player_nation;
398 m.data.war = war_par.get_war();
410 auto asker =
state.local_player_nation;
415 if(
state.defines.callally_diplomatic_cost > 0) {
421 bool possible_war =
false;
422 bool that_ai_will_accept =
false;
424 for(
auto war_par :
state.world.nation_get_war_participant(asker)) {
427 && (!war_par.get_war().get_is_crisis_war() ||
state.military_definitions.great_wars_enabled)) {
430 if(!
state.world.nation_get_is_player_controlled(target)) {
433 m.from =
state.local_player_nation;
435 m.data.war = war_par.get_war();
437 that_ai_will_accept =
true;
443 if(!
state.world.nation_get_is_player_controlled(target)) {
453 auto urid =
state.world.get_unilateral_relationship_by_unilateral_pair(target,
state.local_player_nation);
455 if(
state.world.unilateral_relationship_get_military_access(urid)) {
456 return state.lookup_key(
"cancelaskmilitaryaccess_button");
458 return state.lookup_key(
"askmilitaryaccess_button");
463 auto urid =
state.world.get_unilateral_relationship_by_unilateral_pair(target,
state.local_player_nation);
465 if(
state.world.unilateral_relationship_get_military_access(urid)) {
469 if(!
state.world.nation_get_is_player_controlled(target)) {
472 m.from =
state.local_player_nation;
489 auto urid =
state.world.get_unilateral_relationship_by_unilateral_pair(target,
state.local_player_nation);
491 if(
state.world.unilateral_relationship_get_military_access(urid)) {
499 auto urid =
state.world.get_unilateral_relationship_by_unilateral_pair(target,
state.local_player_nation);
501 if(
state.world.unilateral_relationship_get_military_access(urid)) {
505 if(
state.defines.cancelaskmilaccess_diplomatic_cost > 0) {
512 if(target ==
state.local_player_nation) {
515 if(
state.defines.askmilaccess_diplomatic_cost > 0) {
518 if(!
state.world.nation_get_is_player_controlled(target)) {
521 m.from =
state.local_player_nation;
536 auto urid =
state.world.get_unilateral_relationship_by_unilateral_pair(
state.local_player_nation, target);
538 if(
state.world.unilateral_relationship_get_military_access(urid)) {
539 return state.lookup_key(
"cancelgivemilitaryaccess_button");
541 return state.lookup_key(
"givemilitaryaccess_button");
546 auto urid =
state.world.get_unilateral_relationship_by_unilateral_pair(
state.local_player_nation, target);
548 if(
state.world.unilateral_relationship_get_military_access(urid)) {
556 auto urid =
state.world.get_unilateral_relationship_by_unilateral_pair(
state.local_player_nation, target);
558 if(
state.world.unilateral_relationship_get_military_access(urid)) {
566 auto urid =
state.world.get_unilateral_relationship_by_unilateral_pair(
state.local_player_nation, target);
568 if(
state.world.unilateral_relationship_get_military_access(urid)) {
572 if(
state.defines.cancelgivemilaccess_diplomatic_cost > 0) {
579 if(target ==
state.local_player_nation) {
582 if(
state.defines.givemilaccess_diplomatic_cost > 0) {
593 return state.lookup_key(
"increaserelation_button");
608 if(target ==
state.local_player_nation) {
614 auto rel =
state.world.get_diplomatic_relation_by_diplomatic_pair(
state.local_player_nation, target);
624 return state.lookup_key(
"decreaserelation_button");
639 if(target ==
state.local_player_nation) {
645 auto rel =
state.world.get_diplomatic_relation_by_diplomatic_pair(
state.local_player_nation, target);
656 auto rel =
state.world.get_unilateral_relationship_by_unilateral_pair(target,
state.local_player_nation);
657 bool subsidies =
state.world.unilateral_relationship_get_war_subsidies(rel);
660 return state.lookup_key(
"cancel_warsubsidies_button");
662 return state.lookup_key(
"warsubsidies_button");
667 auto rel =
state.world.get_unilateral_relationship_by_unilateral_pair(target,
state.local_player_nation);
668 bool subsidies =
state.world.unilateral_relationship_get_war_subsidies(rel);
678 auto rel =
state.world.get_unilateral_relationship_by_unilateral_pair(target,
state.local_player_nation);
679 bool subsidies =
state.world.unilateral_relationship_get_war_subsidies(rel);
688 auto rel =
state.world.get_unilateral_relationship_by_unilateral_pair(target,
state.local_player_nation);
689 bool subsidies =
state.world.unilateral_relationship_get_war_subsidies(rel);
697 if(
state.defines.cancelwarsubsidy_diplomatic_cost > 0) {
705 if(
state.local_player_nation == target) {
708 if(
state.defines.warsubsidy_diplomatic_cost > 0) {
721 return state.lookup_key(
"peace_button");
723 return state.lookup_key(
"war_button");
738 dcon::nation_id content = retrieve<dcon::nation_id>(
state, parent);
740 parent->impl_get(
state, ac_payload);
745 auto source =
state.local_player_nation;
751 auto ol =
state.world.nation_get_overlord_as_subject(source);
756 auto ol =
state.world.nation_get_overlord_as_subject(target);
762 if(
state.world.war_get_is_crisis_war(war)) {
763 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);
766 bool one_is_wl = [&]() {
767 if(
state.world.war_get_primary_attacker(war) == source) {
770 }
else if(
state.world.war_get_primary_defender(war) == source) {
773 }
else if(
state.world.war_get_primary_attacker(war) == target) {
776 }
else if(
state.world.war_get_primary_defender(war) == target) {
790 if(source == target) {
793 if(
state.defines.declarewar_diplomatic_cost > 0) {
806 return state.lookup_key(
"alice_diplo_release_subject");
826 return state.lookup_key(
"increaseopinion_button");
838 auto source =
state.local_player_nation;
847 auto rel =
state.world.get_gp_relationship_by_gp_influence_pair(target, source);
862 return state.lookup_key(
"addtosphere_button");
874 auto source =
state.local_player_nation;
883 auto rel =
state.world.get_gp_relationship_by_gp_influence_pair(target, source);
900 return state.lookup_key(
"removefromsphere_button");
912 auto source =
state.local_player_nation;
913 bool in_players_sphere =
state.world.nation_get_in_sphere_of(target) == source;
916 if(in_players_sphere) {
917 if(
state.defines.removefromsphere_infamy_cost != 0) {
920 if(
state.defines.removefromsphere_prestige_cost != 0) {
930 auto rel =
state.world.get_gp_relationship_by_gp_influence_pair(target,
state.local_player_nation);
939 if(!in_players_sphere) {
949 bool has_any_justifiable_cb(
sys::state&
state, dcon::nation_id source, dcon::nation_id target)
noexcept {
951 state.world.for_each_cb_type([&](dcon::cb_type_id cb) {
960 return state.lookup_key(
"make_cb_button");
964 auto source =
state.local_player_nation;
966 auto can_subjects_declare =
state.defines.alice_allow_subjects_declare_wars;
970 if(
state.world.nation_get_constructing_cb_type(source))
972 auto ol =
state.world.nation_get_overlord_as_subject(source);
973 if(
state.defines.alice_allow_subjects_declare_wars < 1 &&
state.world.overlord_get_ruler(ol) &&
state.world.overlord_get_ruler(ol) != target)
975 if(
state.world.nation_get_in_sphere_of(target) == source)
977 if(
state.world.nation_get_diplomatic_points(source) <
state.defines.make_cb_diplomatic_cost)
981 if(!has_any_justifiable_cb(
state, source, target))
990 parent->impl_get(
state, payload);
995 auto source =
state.local_player_nation;
998 if(source == target) {
1001 if(
state.defines.make_cb_diplomatic_cost > 0) {
1005 if(
state.defines.alice_allow_subjects_declare_wars < 1) {
1006 auto ol =
state.world.nation_get_overlord_as_subject(source);
1020 return "alliancetitle";
1022 return "cancelalliancetitle";
1024 return "callallytitle";
1028 return "askmilitaryaccesstitle";
1030 return "cancelaskmilitaryaccesstitle";
1032 return "givemilitaryaccesstitle";
1034 return "cancelgivemilitaryaccesstitle";
1036 return "increaserelationtitle";
1038 return "decreaserelationtitle";
1040 return "warsubsidiestitle";
1042 return "cancel_warsubsidiestitle";
1044 return "increaseopiniontitle";
1046 return "addtospheretitle";
1048 return "removefromspheretitle";
1050 return "make_cbtitle";
1052 return "give_unit_commandtitle";
1054 return "cancel_unit_commandtitle";
1056 return "make_peacetitle";
1071 return "alliancenewdesc";
1073 return "breakalliancenewdesc";
1075 return "callally_desc";
1079 return "askmilitaryaccess_desc";
1081 return "cancelaskmilitaryaccess_desc";
1083 return "givemilitaryaccess_desc";
1085 return "cancelgivemilitaryaccess_desc";
1087 return "increaserelation_desc";
1089 return "decreaserelation_desc";
1091 return "warsubsidies_desc";
1093 return "cancel_warsubsidies_desc";
1095 return "increaseopinion_desc";
1097 return "addtosphere_desc";
1099 return "removefromsphere_desc";
1101 return "make_cb_desc";
1103 return "give_unit_command_desc";
1105 return "cancel_unit_command_desc";
1107 return "make_peace_desc";
1126 auto target = retrieve<dcon::nation_id>(
state,
parent);
1196 auto target = retrieve<dcon::nation_id>(
state,
parent);
1277 if(
name ==
"title") {
1278 return make_element_by_type<diplomacy_action_dialog_title_text>(
state,
id);
1279 }
else if(
name ==
"description") {
1280 return make_element_by_type<diplomacy_action_dialog_description_text>(
state,
id);
1281 }
else if(
name ==
"chance_string") {
1282 return make_element_by_type<simple_text_element_base>(
state,
id);
1283 }
else if(
name ==
"agreebutton") {
1284 return make_element_by_type<diplomacy_action_dialog_agree_button>(
state,
id);
1285 }
else if(
name ==
"declinebutton") {
1286 return make_element_by_type<diplomacy_action_dialog_decline_button>(
state,
id);
1287 }
else if(
name ==
"leftshield") {
1288 return make_element_by_type<nation_player_flag>(
state,
id);
1289 }
else if(
name ==
"rightshield") {
1290 return make_element_by_type<flag_button>(
state,
id);
1291 }
else if(
name ==
"background") {
1292 auto ptr = make_element_by_type<draggable_target>(
state,
id);
1318 return state.world.nation_get_identity_from_identity_holder(n);
1321 auto this_selection = retrieve<gp_choice_num>(
state,
parent);
1352 auto target = retrieve<dcon::nation_id>(
state,
parent);
1361 auto target = retrieve<dcon::nation_id>(
state,
parent);
1362 auto rel =
state.world.get_gp_relationship_by_gp_influence_pair(target, gp);
1377 auto target = retrieve<dcon::nation_id>(
state,
parent);
1386 auto target = retrieve<dcon::nation_id>(
state,
parent);
1387 auto rel =
state.world.get_gp_relationship_by_gp_influence_pair(target, gp);
1401 auto target = retrieve<dcon::nation_id>(
state,
parent);
1410 auto target = retrieve<dcon::nation_id>(
state,
parent);
1421 if(
name ==
"country_name") {
1422 return make_element_by_type<select_gp_name>(
state,
id);
1423 }
else if(
name ==
"country_flag") {
1424 return make_element_by_type<select_gp_choice_button>(
state,
id);
1425 }
else if(
name ==
"country_selected") {
1426 return make_element_by_type<select_gp_selection_icon>(
state,
id);
1427 }
else if(
name ==
"country_discredited") {
1428 return make_element_by_type<select_gp_discredited>(
state,
id);
1429 }
else if(
name ==
"country_banned_embassy") {
1430 return make_element_by_type<select_gp_banned>(
state,
id);
1431 }
else if(
name ==
"country_opinion") {
1432 return make_element_by_type<select_gp_opinion_detail>(
state,
id);
1433 }
else if(
name ==
"country_influence") {
1434 return make_element_by_type<select_gp_influence_detail>(
state,
id);
1453 switch(retrieve<gp_choice_actions>(
state,
parent)) {
1477 switch(retrieve<gp_choice_actions>(
state,
parent)) {
1516 auto target = retrieve<dcon::nation_id>(
state,
parent);
1518 switch(retrieve<gp_choice_actions>(
state,
parent)) {
1535 auto target = retrieve<dcon::nation_id>(
state,
parent);
1537 switch(retrieve<gp_choice_actions>(
state,
parent)) {
1558 auto target = retrieve<dcon::nation_id>(
state,
parent);
1560 switch(retrieve<gp_choice_actions>(
state,
parent)) {
1563 if(
state.local_player_nation == gp) {
1567 auto rel =
state.world.get_gp_relationship_by_gp_influence_pair(target,
state.local_player_nation);
1578 auto orel =
state.world.get_gp_relationship_by_gp_influence_pair(target, gp);
1586 if(
state.local_player_nation == gp) {
1590 auto rel =
state.world.get_gp_relationship_by_gp_influence_pair(target,
state.local_player_nation);
1607 if(
state.local_player_nation == gp) {
1611 auto rel =
state.world.get_gp_relationship_by_gp_influence_pair(target,
state.local_player_nation);
1627 if(
state.local_player_nation == gp) {
1631 if(
state.world.nation_get_in_sphere_of(target) == gp) {
1635 auto rel =
state.world.get_gp_relationship_by_gp_influence_pair(target,
state.local_player_nation);
1648 state.world.gp_relationship_get_status(
state.world.get_gp_relationship_by_gp_influence_pair(target,
1672 xy_pair gp_base_select_offset =
1674 xy_pair gp_select_offset = gp_base_select_offset;
1676 auto ptr = make_element_by_type<diplomacy_action_gp_dialog_select_window>(
state,
1678 ptr->base_data.position = gp_select_offset;
1681 gp_select_offset.
y += ptr->base_data.size.y;
1682 if(i != 0 && i % 2 == 1) {
1683 gp_select_offset.
x += ptr->base_data.size.x;
1684 gp_select_offset.
y = gp_base_select_offset.
y;
1691 if(
name ==
"title") {
1692 return make_element_by_type<gp_action_choice_title>(
state,
id);
1693 }
else if(
name ==
"description") {
1694 return make_element_by_type<gp_action_choice_desc>(
state,
id);
1695 }
else if(
name ==
"agreebutton") {
1696 return make_element_by_type<gp_action_choice_accept_button>(
state,
id);
1697 }
else if(
name ==
"declinebutton") {
1698 return make_element_by_type<gp_action_choice_cancel_button>(
state,
id);
1699 }
else if(
name ==
"leftshield") {
1700 return make_element_by_type<nation_player_flag>(
state,
id);
1701 }
else if(
name ==
"rightshield") {
1702 return make_element_by_type<flag_button>(
state,
id);
1703 }
else if(
name ==
"background") {
1704 auto ptr = make_element_by_type<draggable_target>(
state,
id);
1714 selected_gp = any_cast<gp_choice_select>(payload).value;
1717 }
else if(payload.holds_type<dcon::nation_id>()) {
1734 return state.lookup_key(
"state_transfer_button");
1738 for(
const auto s :
state.world.nation_get_state_ownership(target)) {
1751 for(
const auto s :
state.world.nation_get_state_ownership(
state.local_player_nation)) {
1758 parent->impl_on_update(
state);
1761 parent->impl_on_update(
state);
1763 state.start_state_selection(seldata);
1767 auto source =
state.local_player_nation;
1783 if(
name ==
"action_option") {
1784 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
virtual dcon::text_key get_name(sys::state &state, dcon::nation_id target)
virtual void update_tooltip(sys::state &state, int32_t x, int32_t y, text::columnar_layout &contents, dcon::nation_id target)
virtual bool is_available(sys::state &state, dcon::nation_id target)
virtual void button_action(sys::state &state, dcon::nation_id target, ui::element_base *parent)
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
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_fabricate_cb(sys::state &state, dcon::nation_id source, dcon::nation_id target, dcon::cb_type_id type, dcon::state_definition_id target_state)
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_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)
Returns the appropriate acceptance evaluation for a given diplomatic message. It is required to defin...
float estimate_war_subsidies(sys::state &state, dcon::nation_fat_id target, dcon::nation_fat_id source)
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
Holds data regarding a diplomatic message between two specified nations at a certain date,...
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
Holds important data about the game world, state, and other data regarding windowing,...
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