3#include "dcon_generated.hpp"
16#include <unordered_map>
21typedef std::variant< std::monostate, dcon::nation_id, dcon::state_instance_id, dcon::province_id>
pop_list_filter;
63template<country_list_sort Sort>
80template<
class T,
class K>
86 if(payload.holds_type<K>()) {
88 T::impl_on_update(
state);
162 if(!
state.user_settings.use_classic_fonts) {
188 if(!
state.user_settings.use_classic_fonts) {
278 auto content = retrieve<dcon::state_instance_id>(
state,
parent);
286 auto content = retrieve<dcon::state_instance_id>(
state,
parent);
288 auto txt = std::to_string(
count) +
"/" + std::to_string(int32_t(
state.defines.factories_per_state));
296 auto content = retrieve<dcon::state_instance_id>(
state,
parent);
304 auto content = retrieve<dcon::state_instance_id>(
state,
parent);
307 auto aristocrat_amount =
state.world.state_instance_get_demographics(content, aristocrat_key);
316 auto content = retrieve<dcon::state_instance_id>(
state,
parent);
329 auto content = retrieve<dcon::movement_id>(
state,
parent);
337 auto size =
state.world.movement_get_pop_support(movement_id);
353 auto mid = retrieve<dcon::movement_id>(
state,
parent);
354 auto issue =
state.world.movement_get_associated_issue_option(mid);
366 auto mid = retrieve<dcon::movement_id>(
state,
parent);
367 auto issue =
state.world.movement_get_associated_issue_option(mid);
377 auto content = retrieve<dcon::movement_id>(
state,
parent);
380 text::create_endless_layout(
state,
internal_layout,
text::layout_parameters{0, 0,
base_data.
size.
x,
base_data.
size.
y,
base_data.
data.
text.
font_handle, 0,
text::alignment::left, color,
false});
389 auto independence_target = fat_id.get_associated_independence();
390 if(!independence_target)
395 if(independence_target.get_cultural_union_of().id) {
412 auto mid = retrieve<dcon::movement_id>(
state,
parent);
413 auto independence_target =
state.world.movement_get_associated_independence(mid);
414 if(!independence_target)
416 if(
state.world.national_identity_get_cultural_union_of(independence_target)) {
431 auto content = retrieve<dcon::rebel_faction_id>(
state,
parent);
439 auto content = retrieve<dcon::nation_id>(
state,
parent);
440 if(
state.world.nation_get_is_substate(content))
454 auto content = retrieve<dcon::nation_id>(
state,
parent);
464 if(!
bool(great_power_id))
466 auto great_power_rel =
state.world.get_gp_relationship_by_gp_influence_pair(nation_id, great_power_id);
468 auto influence = fat_id.get_influence();
469 return std::to_string(int32_t(influence));
476 auto uni_rel =
state.world.get_unilateral_relationship_by_unilateral_pair(nation_id,
state.local_player_nation);
487 if(!
bool(great_power_id))
489 auto uni_rel =
state.world.get_unilateral_relationship_by_unilateral_pair(nation_id, great_power_id);
498 dcon::nation_id sphereling_id = retrieve<dcon::nation_id>(
state,
parent);
499 auto ovr_id =
state.world.nation_get_in_sphere_of(sphereling_id);
500 return ovr_id.get_identity_from_identity_holder();
531 return std::to_string(int32_t(fat_id.get_industrial_score()));
540 if(
state.world.nation_get_owned_province_count(n) == 0)
543 auto iweight =
state.defines.investment_score_factor;
544 for(
auto si :
state.world.nation_get_state_ownership(n)) {
545 float total_level = 0;
549 float total_factory_capacity = 0;
551 for(auto f : state.world.province_get_factory_location(p)) {
552 total_factory_capacity +=
553 float(f.get_factory().get_level() * f.get_factory().get_building_type().get_base_workforce());
554 total_level += float(f.get_factory().get_level());
557 float per_state = 4.0f * total_level * std::max(std::min(1.0f, worker_total / total_factory_capacity), 0.05f);
558 if(per_state > 0.f) {
587 if(total_invest > 0.f) {
589 for(
auto ur : state.world.nation_get_unilateral_relationship_as_source(n)) {
590 if(ur.get_foreign_investment() > 0.f) {
607 return std::to_string(int32_t(fat_id.get_military_score()));
611 return tooltip_behavior::variable_tooltip;
615 auto n = retrieve<dcon::nation_id>(
state, parent);
616 auto recruitable =
state.world.nation_get_recruitable_regiments(n);
617 auto active_regs =
state.world.nation_get_active_regiments(n);
618 auto is_disarmed =
state.world.nation_get_disarmed_until(n) >
state.current_date;
619 auto disarm_factor = is_disarmed ?
state.defines.disarmament_army_hit : 1.f;
620 auto supply_mod = std::max(
state.world.nation_get_modifier_values(n, sys::national_mod_offsets::supply_consumption) + 1.0f, 0.1f);
621 auto avg_land_score =
state.world.nation_get_averge_land_unit_score(n);
622 auto gen_range =
state.world.nation_get_leader_loyalty(n);
623 auto num_capital_ships =
state.world.nation_get_capital_ship_score(n);
639 return std::to_string(
670 return std::to_string(fat_id.get_prestige_rank());
678 return std::to_string(fat_id.get_industrial_rank());
686 return std::to_string(fat_id.get_military_rank());
694 return std::to_string(fat_id.get_rank());
722 return tooltip_behavior::variable_tooltip;
726 auto nation_id = retrieve<dcon::nation_id>(
state, parent);
736 for(
auto pi :
state.culture_definitions.party_issues) {
747 auto gov_type_id = fat_id.get_government_type();
748 auto gov_name_seq =
state.world.government_type_get_name(gov_type_id);
753 return tooltip_behavior::variable_tooltip;
757 auto n = retrieve<dcon::nation_id>(
state, parent);
773 if(
bool(fat_id.get_in_sphere_of().id)) {
785 auto puppets_iter =
state.world.nation_get_overlord_as_ruler(nation_id);
786 if(puppets_iter.begin() < puppets_iter.end()) {
788 }
else if(fat_id.get_is_substate()) {
799 auto gp_rel_id =
state.world.get_gp_relationship_by_gp_influence_pair(nation_id,
state.local_player_nation);
800 if(
bool(gp_rel_id)) {
801 auto const status =
state.world.gp_relationship_get_status(gp_rel_id);
812 for(
auto si :
state.world.nation_get_state_ownership(nation_id)) {
815 uint32_t(state.world.province_get_factory_location(p).end() - state.world.province_get_factory_location(p).begin());
818 return std::to_string(num_factories);
825 size_t num_provinces = 0;
826 for(
auto si :
state.world.nation_get_state_ownership(nation_id))
828 return std::to_string(num_provinces);
835 auto rel =
state.world.get_diplomatic_relation_by_diplomatic_pair(nation_id,
state.local_player_nation);
837 return std::to_string(int32_t(fat_rel.get_value()));
947 auto points =
state.world.nation_get_research_points(nation_id);
958 expanded_hitbox_text::on_create(
state);
967 return tooltip_behavior::variable_tooltip;
971 auto n = retrieve<dcon::nation_id>(
state, parent);
973 auto base =
state.defines.suppression_points_gain_base;
974 auto nmod =
state.world.nation_get_modifier_values(n, sys::national_mod_offsets::suppression_points_modifier) + 1.0f;
1010 for(
auto prov_own : fat_id.get_province_ownership_as_nation()) {
1011 auto prov = prov_own.get_province();
1014 return std::to_string(sum);
1021 auto available =
state.world.nation_get_recruitable_regiments(nation_id);
1022 auto in_use =
state.world.nation_get_active_regiments(nation_id);
1093 auto n = retrieve<dcon::nation_id>(
state, parent);
1094 auto mod_id =
state.world.nation_get_tech_school(n);
1102 return tooltip_behavior::variable_tooltip;
1106 auto n =
state.local_player_nation;
1107 auto mod_id =
state.world.nation_get_tech_school(retrieve<dcon::nation_id>(
state, parent));
1111 if(
auto desc =
state.world.modifier_get_desc(mod_id);
state.key_is_localized(desc)) {
1132 auto n = retrieve<dcon::nation_id>(
state, parent);
1133 frame = get_icon_frame(
state, n);
1141 auto nation_id = retrieve<dcon::nation_id>(
state, parent);
1142 progress =
state.world.nation_get_modifier_values(nation_id, sys::national_mod_offsets::civilization_progress_modifier);
1145 return tooltip_behavior::variable_tooltip;
1149 auto nation_id = retrieve<dcon::nation_id>(
state, parent);
1164 auto nation_id = retrieve<dcon::nation_id>(
state, parent);
1173 return tooltip_behavior::variable_tooltip;
1176 auto nation_id = retrieve<dcon::nation_id>(
state, parent);
1199 auto state_instance_id = retrieve<dcon::state_instance_id>(
state, parent);
1200 frame = get_icon_frame(
state, state_instance_id);
1211 auto nation_id = retrieve<dcon::nation_id>(
state, parent);
1212 frame = get_icon_frame(
state, nation_id);
1220 return std::min(3, int32_t(status));
1255 auto nation_id = retrieve<dcon::nation_id>(
state, parent);
1258 color =
state.world.ideology_get_color(ideology);
1266 return fat_id.get_identity_from_identity_holder();
1276 return dcon::national_identity_id{};
1278 return fat_id.get_identity_from_identity_holder();
1285 auto ideology_id = retrieve<dcon::ideology_id>(
state, parent);
1286 color =
state.world.ideology_get_color(ideology_id);
1294 auto nation = retrieve<dcon::nation_id>(
state, parent);
1298 if(fat_id.get_province_ownership().get_nation().get_is_mobilized()) {
1303 }
else if (nation) {
1305 if(fat_id.get_is_mobilized()) {
1317 dcon::pop_type_id type{};
1321 frame = int32_t(
state.world.pop_type_get_sprite(t) - 1);
1325 return tooltip_behavior::tooltip;
1329 auto name =
state.world.pop_type_get_name(type);
1339 auto content = retrieve<dcon::pop_type_id>(
state, parent);
1341 frame = int32_t(fat_id.get_sprite() - 1);
1345 return tooltip_behavior::variable_tooltip;
1349 auto content = retrieve<dcon::pop_type_id>(
state, parent);
1350 auto name =
state.world.pop_type_get_name(content);
1359 auto content = retrieve<dcon::religion_id>(
state, parent);
1361 frame = int32_t(fat_id.get_icon() - 1);
1368 auto nation_id = retrieve<dcon::nation_id>(
state, parent);
1369 auto ideology_id = retrieve<dcon::ideology_id>(
state, parent);
1370 if(nation_id && ideology_id) {
1371 auto percentage = .01f *
state.world.nation_get_upper_house(nation_id, ideology_id);
1380 auto nat_id = retrieve<dcon::nation_id>(
state, parent);
1381 distribution.clear();
1382 for(
auto id :
state.world.in_ideology) {
1383 distribution.emplace_back(
id.
id,
float(
state.world.nation_get_upper_house(nat_id,
id)));
1385 update_chart(
state);
1392 auto nat_id = retrieve<dcon::nation_id>(
state, parent);
1393 distribution.clear();
1394 for(
auto id :
state.world.in_ideology) {
1395 distribution.emplace_back(
id.
id, 0.0f);
1397 for(
auto p :
state.world.nation_get_province_ownership(nat_id)) {
1398 for(
auto pop_loc :
state.world.province_get_pop_location(p.get_province())) {
1399 auto pop_id = pop_loc.get_pop();
1402 state.world.for_each_ideology([&](dcon::ideology_id iid) {
1410 update_chart(
state);
1417 auto province_id = retrieve<dcon::province_id>(
state, parent);
1426 auto province_id = retrieve<dcon::province_id>(
state, parent);
1436 auto province_id = retrieve<dcon::province_id>(
state, parent);
1446 auto province_id = retrieve<dcon::province_id>(
state, parent);
1457 auto province_id = retrieve<dcon::province_id>(
state, parent);
1464 auto province_id = retrieve<dcon::province_id>(
state, parent);
1471 auto province_id = retrieve<dcon::province_id>(
state, parent);
1478 auto province_id = retrieve<dcon::province_id>(
state, parent);
1486 auto province_id = retrieve<dcon::province_id>(
state, parent);
1494 auto province_id = retrieve<dcon::province_id>(
state, parent);
1502 auto province_id = retrieve<dcon::province_id>(
state, parent);
1507 auto p = retrieve<dcon::province_id>(
state, parent);
1509 auto n =
state.world.province_get_nation_from_province_ownership(p);
1511 state.world.for_each_commodity([&](dcon::commodity_id c) {
1514 if(production < 0.0001f) {
1519 auto name_box = base_box;
1520 name_box.x_size = 75;
1521 auto production_box = base_box;
1522 production_box.x_position += 120.f;
1535 auto province_id = retrieve<dcon::province_id>(
state, parent);
1540 return tooltip_behavior::variable_tooltip;
1544 auto p = retrieve<dcon::province_id>(
state, parent);
1546 auto n =
state.world.province_get_nation_from_province_ownership(p);
1548 state.world.for_each_commodity([&](dcon::commodity_id c) {
1549 auto profit =
state.world.province_get_rgo_profit_per_good(p, c);
1556 auto name_box = base_box;
1557 name_box.x_size = 75;
1558 auto profit_box = base_box;
1559 profit_box.x_position += 120.f;
1572 auto province_id = retrieve<dcon::province_id>(
state, parent);
1577 return tooltip_behavior::variable_tooltip;
1581 auto p = retrieve<dcon::province_id>(
state, parent);
1583 auto n =
state.world.province_get_nation_from_province_ownership(p);
1589 col_2.x_position += 90.f;
1591 col_3.x_position += 180.f;
1593 col_4.x_position += 250.f;
1601 state.world.for_each_commodity([&](dcon::commodity_id c) {
1602 auto rgo_employment =
state.world.province_get_rgo_employment_per_good(p, c);
1603 auto current_employment = int64_t(rgo_employment);
1607 if(max_employment < 1.f) {
1611 auto name_box = base_box;
1612 name_box.x_size = 75;
1613 auto employment_box = base_box;
1614 employment_box.x_position += 120.f;
1615 auto max_employment_box = base_box;
1616 max_employment_box.x_position += 180.f;
1617 auto expected_profit_box = base_box;
1618 expected_profit_box.x_position += 250.f;
1631 auto rgo_employment =
state.world.province_get_subsistence_employment(p);
1632 auto current_employment = int64_t(rgo_employment);
1634 auto expected_profit = 0.f;
1637 auto name_box = base_box;
1638 name_box.x_size = 75;
1639 auto employment_box = base_box;
1640 employment_box.x_position += 120.f;
1641 auto max_employment_box = base_box;
1642 max_employment_box.x_position += 180.f;
1643 auto expected_profit_box = base_box;
1644 expected_profit_box.x_position += 250.f;
1656 if(
auto owner =
state.world.province_get_nation_from_province_ownership(p); owner)
1659 if(
auto owner =
state.world.province_get_nation_from_province_ownership(p); owner)
1667 auto province_id = retrieve<dcon::province_id>(
state, parent);
1675 auto factory_id = retrieve<dcon::factory_id>(
state, parent);
1676 auto flid =
state.world.factory_get_factory_location_as_factory(factory_id);
1677 auto pid =
state.world.factory_location_get_province(flid);
1678 auto sdef =
state.world.province_get_state_from_abstract_state_membership(pid);
1679 dcon::state_instance_id sid{};
1680 state.world.for_each_state_instance([&](dcon::state_instance_id
id) {
1681 if(
state.world.state_instance_get_definition(
id) == sdef)
1690 auto factory_id = retrieve<dcon::factory_id>(
state, parent);
1691 auto cid =
state.world.factory_get_building_type(factory_id).get_output();
1698 auto factory_id = retrieve<dcon::factory_id>(
state, parent);
1705 auto factory_id = retrieve<dcon::factory_id>(
state, parent);
1712 auto factory_id = retrieve<dcon::factory_id>(
state, parent);
1719 base_data.size.x += int16_t(20);
1722 auto factory_id = retrieve<dcon::factory_id>(
state, parent);
1723 set_text(
state, std::to_string(
uint32_t(
state.world.factory_get_level(factory_id))));
1729 auto content = retrieve<dcon::factory_id>(
state, parent);
1731 auto profit =
state.world.factory_get_full_profit(content);
1732 bool is_positive =
profit >= 0.f;
1747 auto content = retrieve<dcon::factory_id>(
state, parent);
1748 float profit =
state.world.factory_get_full_profit(content);
1752 }
else if (
profit < 0.f) {
1762 auto content = retrieve<dcon::factory_id>(
state, parent);
1770 frame = int32_t(
state.world.commodity_get_icon(retrieve<dcon::commodity_id>(
state, parent)));
1773 return tooltip_behavior::variable_tooltip;
1777 auto com = retrieve<dcon::commodity_id>(
state, parent);
1781 auto n = retrieve<dcon::nation_id>(
state, parent);
1782 auto p = retrieve<dcon::province_id>(
state, parent);
1790 auto commodity_mod_description = [&](
float value, std::string_view locale_base_name, std::string_view locale_farm_base_name) {
1803 commodity_mod_description(
state.world.nation_get_factory_goods_output(n, com),
"tech_output",
"tech_output");
1804 commodity_mod_description(
state.world.nation_get_rgo_goods_output(n, com),
"tech_mine_output",
"tech_farm_output");
1805 commodity_mod_description(
state.world.nation_get_rgo_size(n, com),
"tech_mine_size",
"tech_farm_size");
1807 if(
state.world.commodity_get_key_factory(com)) {
1821 if(
state.world.commodity_get_is_mine(com)) {
1850 for(
const auto tid :
state.world.in_technology) {
1851 if(
state.world.nation_get_active_technologies(n, tid)) {
1852 bool have_header =
false;
1853 auto commodity_technology_mod_description = [&](
auto const& list, std::string_view locale_base_name, std::string_view locale_farm_base_name) {
1854 for(
const auto mod : list) {
1855 if(mod.type != com || mod.amount == 0.f)
1863 auto name =
state.world.commodity_get_name(mod.type);
1874 commodity_technology_mod_description(
state.world.technology_get_factory_goods_output(tid),
"tech_output",
"tech_output");
1875 commodity_technology_mod_description(
state.world.technology_get_rgo_goods_output(tid),
"tech_mine_output",
"tech_farm_output");
1876 commodity_technology_mod_description(
state.world.technology_get_rgo_size(tid),
"tech_mine_size",
"tech_farm_size");
1879 for(
const auto iid :
state.world.in_invention) {
1880 if(
state.world.nation_get_active_inventions(n, iid)) {
1881 bool have_header =
false;
1882 auto commodity_invention_mod_description = [&](
auto const& list, std::string_view locale_base_name, std::string_view locale_farm_base_name) {
1883 for(
const auto mod : list) {
1884 if(mod.type != com || mod.amount == 0.f)
1892 auto name =
state.world.commodity_get_name(mod.type);
1903 commodity_invention_mod_description(
state.world.invention_get_factory_goods_output(iid),
"tech_output",
"tech_output");
1904 commodity_invention_mod_description(
state.world.invention_get_rgo_goods_output(iid),
"tech_mine_output",
"tech_farm_output");
1905 commodity_invention_mod_description(
state.world.invention_get_rgo_size(iid),
"tech_mine_size",
"tech_farm_size");
1919 auto nfid = retrieve<dcon::national_focus_id>(
state, parent);
1920 auto sid = retrieve<dcon::state_instance_id>(
state, parent);
1922 frame =
state.world.national_focus_get_icon(nfid) - 1;
1926 return tooltip_behavior::variable_tooltip;
1930 auto content = retrieve<dcon::national_focus_id>(
state, parent);
1932 auto sid = retrieve<dcon::state_instance_id>(
state, parent);
1942 if(fat_nf.get_promotion_type()) {
1944 if(fat_nf.get_promotion_type() ==
state.culture_definitions.clergy) {
1948 }
else if(fat_nf.get_promotion_type() ==
state.culture_definitions.bureaucrat) {
1957 if(
auto mid =
state.world.national_focus_get_modifier(content); mid) {
1960 auto state_cap =
state.world.state_instance_get_capital(sid);
1966 auto content = retrieve<dcon::state_instance_id>(
state, parent);
1967 auto nat_focus = retrieve<dcon::national_focus_id>(
state, parent);
1976 if(
name ==
"focus_icon") {
1977 return make_element_by_type<national_focus_icon>(
state,
id);
1987 return "focus_item";
1998 if(
name ==
"name") {
1999 auto ptr = make_element_by_type<simple_text_element_base>(
state,
id);
2000 category_label = ptr.
get();
2002 }
else if(
name ==
"focus_icons") {
2003 auto ptr = make_element_by_type<national_focus_category_list>(
state,
id);
2004 focus_list = ptr.
get();
2013 auto category = any_cast<nations::focus_type>(payload);
2019 state.world.for_each_national_focus([&](dcon::national_focus_id focus_id) {
2021 if(fat_id.get_type() ==
uint8_t(category))
2026 return message_result::consumed;
2028 return message_result::unseen;
2036 auto content = retrieve<dcon::state_instance_id>(
state, parent);
2045 window_element_base::on_create(
state);
2046 auto start = make_element_by_type<window_element_base>(
state,
"focuscategory_start");
2047 auto current_pos = start->base_data.position;
2048 auto step = make_element_by_type<window_element_base>(
state,
"focuscategory_step");
2049 auto step_y = step->base_data.position.y;
2052 auto ptr = make_element_by_type<national_focus_category>(
state,
"focus_category");
2053 ptr->base_data.position = current_pos;
2054 current_pos =
xy_pair{current_pos.
x, int16_t(current_pos.y + step_y)};
2057 ptr->impl_set(
state, foc_type_payload);
2059 add_child_to_front(std::move(ptr));
2064 if(
name ==
"close_button") {
2065 return make_element_by_type<generic_close_button>(
state,
id);
2066 }
else if(
name ==
"background") {
2067 return make_element_by_type<draggable_target>(
state,
id);
2068 }
else if(
name ==
"cancel_button") {
2069 return make_element_by_type<national_focus_remove_button>(
state,
id);
2076 set_visible(
state,
false);
2077 return message_result::consumed;
2079 return window_element_base::get(
state, payload);
2086 auto content = retrieve<military::wg_summary>(
state, parent).cb;
2087 frame =
state.world.cb_type_get_sprite_index(content) - 1;
2091 return tooltip_behavior::variable_tooltip;
2095 auto wg = retrieve<military::wg_summary>(
state, parent);
2104 }
else if(wg.secondary_nation) {
2113 if(
name ==
"wargoal_icon") {
2114 return make_element_by_type<wg_icon>(
state,
id);
2124 auto content = retrieve<military::full_wg>(
state, parent).cb;
2125 frame =
state.world.cb_type_get_sprite_index(content) - 1;
2129 return tooltip_behavior::variable_tooltip;
2133 auto wg = retrieve<military::full_wg>(
state, parent);
2144 }
else if(wg.secondary_nation) {
2153 if(
name ==
"wargoal_icon") {
2154 return make_element_by_type<full_wg_icon>(
state,
id);
2164 button_element_base::on_create(
state);
2169 auto content = retrieve<dcon::state_instance_id>(
state, parent);
2174 auto content = retrieve<dcon::state_instance_id>(
state, parent);
2179 return tooltip_behavior::variable_tooltip;
2183 auto state_instance_id = retrieve<dcon::state_instance_id>(
state, parent);
2210 bool sort_ascend =
true;
2213template<country_list_filter category>
2218 if constexpr(category == country_list_filter::all) {
2219 send(
state, parent, dcon::modifier_id{});
2224 if constexpr(category == country_list_filter::allies) {
2225 send(
state, parent, country_list_filter::find_allies);
2226 }
else if constexpr(category == country_list_filter::sphere) {
2227 send(
state, parent, country_list_filter::influenced);
2228 }
else if constexpr(category == country_list_filter::neighbors) {
2229 send(
state, parent, country_list_filter::neighbors_no_vassals);
2232 if constexpr(category == country_list_filter::all) {
2233 send(
state, parent, dcon::modifier_id{});
2239 auto filter_settings = retrieve<country_filter_setting>(
state, parent);
2240 auto t_category = filter_settings.general_category;
2241 switch(t_category) {
2242 case country_list_filter::influenced:
2243 t_category = country_list_filter::sphere;
2245 case country_list_filter::find_allies:
2246 t_category = country_list_filter::allies;
2248 case country_list_filter::neighbors_no_vassals:
2249 t_category = country_list_filter::neighbors;
2254 disabled = t_category != category;
2255 button_element_base::render(
state, x, y);
2260 return tooltip_behavior::variable_tooltip;
2265 case country_list_filter::all:
2268 case country_list_filter::neighbors:
2269 case country_list_filter::neighbors_no_vassals:
2272 case country_list_filter::sphere:
2273 case country_list_filter::influenced:
2276 case country_list_filter::enemies:
2279 case country_list_filter::find_allies:
2280 case country_list_filter::allies:
2283 case country_list_filter::best_guess:
2301 auto filter_settings = retrieve<country_filter_setting>(
state, parent);
2302 disabled = filter_settings.continent !=
continent;
2303 button_element_base::render(
state, x, y);
2320 if(
state.selected_army_group) {
tooltip_behavior has_tooltip(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
virtual message_result get(sys::state &state, Cyto::Any &payload) noexcept
void on_reset_text(sys::state &state) noexcept override
void render(sys::state &state, int32_t x, int32_t y) noexcept override
ui::xy_pair bottom_right_extension
void on_create(sys::state &state) noexcept override
ui::xy_pair top_left_extension
void on_update(sys::state &state) 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
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 on_update(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
tooltip_behavior has_tooltip(sys::state &state) noexcept override
void update_tooltip(sys::state &state, int32_t x, int32_t y, text::columnar_layout &contents) noexcept override
void set_type(sys::state &state, dcon::pop_type_id t)
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 populate_layout(sys::state &state, text::endless_layout &contents, T id) noexcept
void on_update(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
message_result set(sys::state &state, Cyto::Any &payload) 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
void populate_layout(sys::state &state, text::endless_layout &contents, dcon::movement_id movement_id) noexcept override
tooltip_behavior has_tooltip(sys::state &state) noexcept override
void update_tooltip(sys::state &state, int32_t x, int32_t y, text::columnar_layout &contents) noexcept override
std::string get_text(sys::state &state, dcon::movement_id movement_id) noexcept override
std::string get_text(sys::state &state, dcon::movement_id movement_id) noexcept override
text::layout internal_layout
void render(sys::state &state, int32_t x, int32_t y) noexcept override
std::string get_text(sys::state &state, dcon::nation_id nation_id) noexcept override
std::string get_text(sys::state &state, dcon::nation_id nation_id) noexcept override
std::string get_text(sys::state &state, dcon::nation_id nation_id) noexcept override
std::string get_text(sys::state &state, dcon::nation_id nation_id) noexcept override
std::string get_text(sys::state &state, dcon::nation_id nation_id) noexcept override
std::string get_text(sys::state &state, dcon::nation_id nation_id) noexcept override
std::string get_text(sys::state &state, dcon::nation_id nation_id) noexcept override
std::string get_text(sys::state &state, dcon::nation_id nation_id) noexcept override
std::string get_text(sys::state &state, dcon::nation_id nation_id) noexcept override
std::string get_text(sys::state &state, dcon::nation_id nation_id) noexcept override
std::string get_text(sys::state &state, dcon::nation_id nation_id) noexcept override
std::string get_text(sys::state &state, dcon::nation_id nation_id) noexcept override
int32_t get_icon_frame(sys::state &state, dcon::nation_id nation_id) noexcept override
std::string get_text(sys::state &state, dcon::nation_id nation_id) noexcept override
tooltip_behavior has_tooltip(sys::state &state) noexcept override
void update_tooltip(sys::state &state, int32_t x, int32_t y, text::columnar_layout &contents) noexcept override
std::string get_text(sys::state &state, dcon::nation_id nation_id) noexcept override
dcon::national_identity_id get_current_nation(sys::state &state) noexcept override
std::string get_text(sys::state &state, dcon::nation_id nation_id) noexcept override
std::string get_text(sys::state &state, dcon::nation_id nation_id) noexcept override
void on_update(sys::state &state) noexcept override
std::string get_text(sys::state &state, dcon::nation_id nation_id) noexcept override
std::string get_text(sys::state &state, dcon::nation_id nation_id) noexcept override
void update_tooltip(sys::state &state, int32_t x, int32_t y, text::columnar_layout &contents) noexcept override
std::string get_text(sys::state &state, dcon::nation_id nation_id) noexcept override
tooltip_behavior has_tooltip(sys::state &state) noexcept override
std::string get_text(sys::state &state, dcon::nation_id nation_id) noexcept override
std::string get_text(sys::state &state, dcon::nation_id nation_id) noexcept override
std::string get_text(sys::state &state, dcon::nation_id nation_id) noexcept override
std::string get_text(sys::state &state, dcon::nation_id nation_id) noexcept override
std::string get_text(sys::state &state, dcon::nation_id nation_id) noexcept override
void update_tooltip(sys::state &state, int32_t x, int32_t y, text::columnar_layout &contents) noexcept override
std::string get_text(sys::state &state, dcon::nation_id nation_id) noexcept override
tooltip_behavior has_tooltip(sys::state &state) noexcept override
std::string get_text(sys::state &state, dcon::nation_id nation_id) noexcept override
std::string get_text(sys::state &state, dcon::nation_id nation_id) noexcept override
std::string get_text(sys::state &state, dcon::nation_id nation_id) noexcept override
std::string get_text(sys::state &state, dcon::nation_id nation_id) noexcept override
std::string get_text(sys::state &state, dcon::nation_id nation_id) noexcept override
void render(sys::state &state, int32_t x, int32_t y) noexcept override
dcon::national_identity_id get_current_nation(sys::state &state) 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 button_action(sys::state &state) noexcept override
dcon::national_identity_id get_current_nation(sys::state &state) noexcept override
std::string get_text(sys::state &state, dcon::nation_id nation_id) noexcept override
std::string get_text(sys::state &state, dcon::nation_id nation_id) noexcept override
std::string get_text(sys::state &state, dcon::nation_id nation_id) noexcept override
std::string get_text(sys::state &state, dcon::nation_id nation_id) noexcept override
std::string get_text(sys::state &state, dcon::nation_id nation_id) noexcept override
std::string get_text(sys::state &state, dcon::nation_id nation_id) noexcept override
std::string get_text(sys::state &state, dcon::nation_id nation_id) noexcept override
std::string get_text(sys::state &state, dcon::nation_id nation_id) noexcept override
std::string get_text(sys::state &state, dcon::nation_id nation_id) noexcept override
std::string get_text(sys::state &state, dcon::nation_id nation_id) noexcept override
std::string get_text(sys::state &state, dcon::nation_id nation_id) noexcept override
std::string get_text(sys::state &state, dcon::nation_id nation_id) noexcept override
void on_update(sys::state &state) noexcept override
std::string get_text(sys::state &state, dcon::nation_id nation_id) noexcept override
void update_tooltip(sys::state &state, int32_t x, int32_t y, text::columnar_layout &contents) noexcept override
std::string get_text(sys::state &state, dcon::nation_id nation_id) noexcept override
tooltip_behavior has_tooltip(sys::state &state) noexcept override
std::string get_text(sys::state &state, dcon::nation_id nation_id) noexcept override
std::string get_text(sys::state &state, dcon::nation_id nation_id) noexcept override
std::string get_text(sys::state &state, dcon::nation_id nation_id) noexcept override
void on_create(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
tooltip_behavior has_tooltip(sys::state &state) noexcept override
void update_tooltip(sys::state &state, int32_t x, int32_t y, text::columnar_layout &contents) noexcept override
std::string get_text(sys::state &state, dcon::nation_id nation_id) 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
std::string_view get_row_element_name() override
std::unique_ptr< element_base > make_child(sys::state &state, std::string_view name, dcon::gui_def_id id) noexcept override
message_result set(sys::state &state, Cyto::Any &payload) noexcept override
void update_tooltip(sys::state &state, int32_t x, int32_t y, text::columnar_layout &contents) noexcept override
void button_action(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
tooltip_behavior has_tooltip(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
message_result get(sys::state &state, Cyto::Any &payload) noexcept override
void on_create(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 on_update(sys::state &state) noexcept override
tooltip_behavior has_tooltip(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
std::unique_ptr< element_base > make_child(sys::state &state, std::string_view name, dcon::gui_def_id id) noexcept override
std::vector< ItemConT > row_contents
void update(sys::state &state)
std::unique_ptr< element_base > make_child(sys::state &state, std::string_view name, dcon::gui_def_id id) noexcept override
tooltip_behavior has_tooltip(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
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 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
void on_update(sys::state &state) noexcept override
tooltip_behavior has_tooltip(sys::state &state) 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 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
tooltip_behavior has_tooltip(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
void on_update(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
virtual void populate_layout(sys::state &state, text::endless_layout &contents) noexcept
void on_update(sys::state &state) noexcept override
void render(sys::state &state, int32_t x, int32_t y) noexcept override
virtual void populate_layout(sys::state &state, text::endless_layout &contents) noexcept
void on_update(sys::state &state) noexcept override
void render(sys::state &state, int32_t x, int32_t y) noexcept override
void set_text(sys::state &state, std::string const &new_text)
void on_reset_text(sys::state &state) noexcept override
virtual void populate_layout(sys::state &state, text::endless_layout &contents, dcon::movement_id movement_id) noexcept
void on_update(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
virtual std::string get_text(sys::state &state, dcon::movement_id movement_id) noexcept
void on_update(sys::state &state) noexcept override
virtual int32_t get_icon_frame(sys::state &state, dcon::nation_id nation_id) noexcept
virtual std::string get_text(sys::state &state, dcon::nation_id nation_id) noexcept
void on_update(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
virtual std::string get_text(sys::state &state, dcon::rebel_faction_id rebel_faction_id) noexcept
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 on_update(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
tooltip_behavior has_tooltip(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
bool can_upgrade_colony_to_state(sys::state &state, dcon::nation_id source, dcon::state_instance_id si)
bool can_set_national_focus(sys::state &state, dcon::nation_id source, dcon::state_instance_id target_state, dcon::national_focus_id focus)
void set_national_focus(sys::state &state, dcon::nation_id source, dcon::state_instance_id target_state, dcon::national_focus_id focus)
@ upgrade_colony_to_state
float effective_technology_cost(sys::state &state, uint32_t current_year, dcon::nation_id target_nation, dcon::technology_id tech_id)
pop_satisfaction_wrapper_fat fatten(data_container const &c, pop_satisfaction_wrapper_id id) noexcept
float calculate_nation_sol(sys::state &state, dcon::nation_id nation_id)
constexpr dcon::demographics_key total(0)
dcon::demographics_key to_key(sys::state const &state, dcon::pop_type_id v)
constexpr dcon::demographics_key consciousness(3)
dcon::demographics_key to_employment_key(sys::state const &state, dcon::pop_type_id v)
constexpr dcon::demographics_key literacy(5)
constexpr dcon::demographics_key militancy(4)
float rgo_total_effective_size(sys::state &state, dcon::nation_id n, dcon::province_id p)
int32_t state_factory_count(sys::state &state, dcon::state_instance_id sid, dcon::nation_id n)
float gdp_adjusted(sys::state &state, dcon::nation_id n)
int32_t factory_priority(sys::state const &state, dcon::factory_id f)
float rgo_expected_worker_norm_profit(sys::state &state, dcon::province_id p, dcon::nation_id n, dcon::commodity_id c)
float subsistence_max_pseudoemployment(sys::state &state, dcon::nation_id n, dcon::province_id p)
float rgo_max_employment(sys::state &state, dcon::nation_id n, dcon::province_id p, dcon::commodity_id c)
float factory_total_employment(sys::state const &state, dcon::factory_id f)
float interest_payment(sys::state &state, dcon::nation_id n)
void switch_scene(sys::state &state, scene_id ui_scene)
@ in_game_military_selector
int32_t naval_supply_points_used(sys::state &state, dcon::nation_id n)
int32_t total_regiments(sys::state &state, dcon::nation_id n)
int32_t mobilized_regiments_possible_from_province(sys::state &state, dcon::province_id p)
int32_t total_ships(sys::state &state, dcon::nation_id n)
int32_t naval_supply_points(sys::state &state, dcon::nation_id n)
status get_status(sys::state &state, dcon::nation_id n)
int32_t free_colonial_points(sys::state &state, dcon::nation_id n)
bool has_political_reform_available(sys::state &state, dcon::nation_id n)
float get_foreign_investment(sys::state &state, dcon::nation_id n)
float diplomatic_points(sys::state const &state, dcon::nation_id n)
bool has_social_reform_available(sys::state &state, dcon::nation_id n)
float get_debt(sys::state &state, dcon::nation_id n)
float suppression_points(sys::state const &state, dcon::nation_id n)
dcon::nation_id get_nth_great_power(sys::state const &state, uint16_t n)
float prestige_score(sys::state const &state, dcon::nation_id n)
float leadership_points(sys::state const &state, dcon::nation_id n)
float daily_research_points(sys::state &state, dcon::nation_id n)
float get_bank_funds(sys::state &state, dcon::nation_id n)
sys::date get_research_end_date(sys::state &state, dcon::technology_id tech_id, dcon::nation_id n)
int32_t national_focuses_in_use(sys::state &state, dcon::nation_id n)
dcon::technology_id current_research(sys::state const &state, dcon::nation_id n)
int32_t max_national_focuses(sys::state &state, dcon::nation_id n)
float get_treasury(sys::state &state, dcon::nation_id n)
int32_t max_colonial_points(sys::state &state, dcon::nation_id n)
float pop_vote_weight(sys::state &state, dcon::pop_id p, dcon::nation_id n)
float get_military_reform_multiplier(sys::state &state, dcon::nation_id n)
float get_economic_reform_multiplier(sys::state &state, dcon::nation_id n)
dcon::pop_demographics_key to_key(sys::state const &state, dcon::ideology_id v)
float get_demo(sys::state const &state, dcon::pop_id p, dcon::pop_demographics_key k)
void for_each_province_in_state_instance(sys::state &state, dcon::state_instance_id s, F const &func)
float state_accepted_bureaucrat_size(sys::state &state, dcon::state_instance_id id)
float rgo_production_quantity(sys::state &state, dcon::province_id id, dcon::commodity_id c)
float land_employment(sys::state &state, dcon::province_id id)
float rgo_income(sys::state &state, dcon::province_id id)
float colony_integration_cost(sys::state &state, dcon::state_instance_id id)
float state_admin_efficiency(sys::state &state, dcon::state_instance_id id)
void add_line_break_to_layout_box(sys::state &state, layout_base &dest, layout_box &box)
void add_to_layout_box(sys::state &state, layout_base &dest, layout_box &box, embedded_flag ico)
std::string format_money(float num)
std::string get_focus_category_name(sys::state const &state, nations::focus_type category)
std::string get_name_as_string(sys::state &state, T t)
std::string format_ratio(int32_t left, int32_t right)
layout_box open_layout_box(layout_base &dest, int32_t indent)
void localised_single_sub_box(sys::state &state, layout_base &dest, layout_box &box, std::string_view key, variable_type subkey, substitution value)
void localised_format_box(sys::state &state, layout_base &dest, layout_box &box, std::string_view key, text::substitution_map const &sub)
bool is_black_from_font_id(uint16_t id)
std::string prettify(int64_t num)
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)
std::string get_short_state_name(sys::state &state, dcon::state_instance_id state_id)
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)
void add_divider_to_layout_box(sys::state &state, layout_base &dest, layout_box &box)
dcon::text_key get_adjective(sys::state &state, dcon::nation_id id)
std::string get_dynamic_state_name(sys::state &state, dcon::state_instance_id state_id)
ankerl::unordered_dense::map< uint32_t, substitution > substitution_map
std::string produce_simple_string(sys::state const &state, dcon::text_key id)
std::string get_adjective_as_string(sys::state &state, T t)
std::string format_percentage(float num, size_t digits)
std::string get_influence_level_name(sys::state const &state, uint8_t v)
void add_space_to_layout_box(sys::state &state, layout_base &dest, layout_box &box)
std::string get_province_state_name(sys::state &state, dcon::province_id prov_id)
void close_layout_box(columnar_layout &dest, layout_box &box)
int32_t to_generic(dcon::province_id v)
void modifier_description(sys::state &state, text::layout_base &layout, dcon::modifier_id mid, int32_t indentation=0)
void reform_description(sys::state &state, text::columnar_layout &contents, dcon::issue_option_id ref)
void sort_countries(sys::state &state, std::vector< dcon::nation_id > &list, country_list_sort sort, bool sort_ascend)
void send(sys::state &state, element_base *parent, T value)
void trigger_description(sys::state &state, text::layout_base &layout, dcon::trigger_key k, int32_t primary_slot=-1, int32_t this_slot=-1, int32_t from_slot=-1)
std::variant< std::monostate, dcon::nation_id, dcon::state_instance_id, dcon::province_id > pop_list_filter
std::string get_status_text(sys::state &state, dcon::nation_id nation_id)
void open_foreign_investment(sys::state &state, dcon::nation_id n)
void open_build_foreign_factory(sys::state &state, dcon::state_instance_id st)
bool country_category_filter_check(sys::state &state, country_list_filter filt, dcon::nation_id a, dcon::nation_id b)
void active_modifiers_description(sys::state &state, text::layout_base &layout, dcon::nation_id n, int32_t identation, dcon::national_modifier_value nmid, bool header)
dcon::modifier_id continent
element_type get_element_type() const
union ui::element_data::internal_data data
alignment get_alignment() const
text_base_data text_common