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));
1245 return tooltip_behavior::tooltip;
1249 auto nation_id = retrieve<dcon::nation_id>(
state, parent);
1265 return tooltip_behavior::tooltip;
1269 auto nation_id = retrieve<dcon::nation_id>(
state, parent);
1281 auto nation_id = retrieve<dcon::nation_id>(
state, parent);
1284 color =
state.world.ideology_get_color(ideology);
1292 return fat_id.get_identity_from_identity_holder();
1302 return dcon::national_identity_id{};
1304 return fat_id.get_identity_from_identity_holder();
1311 auto ideology_id = retrieve<dcon::ideology_id>(
state, parent);
1312 color =
state.world.ideology_get_color(ideology_id);
1320 auto nation = retrieve<dcon::nation_id>(
state, parent);
1324 if(fat_id.get_province_ownership().get_nation().get_is_mobilized()) {
1329 }
else if (nation) {
1331 if(fat_id.get_is_mobilized()) {
1343 dcon::pop_type_id type{};
1347 frame = int32_t(
state.world.pop_type_get_sprite(t) - 1);
1351 return tooltip_behavior::tooltip;
1355 auto name =
state.world.pop_type_get_name(type);
1365 auto content = retrieve<dcon::pop_type_id>(
state, parent);
1367 frame = int32_t(fat_id.get_sprite() - 1);
1371 return tooltip_behavior::variable_tooltip;
1375 auto content = retrieve<dcon::pop_type_id>(
state, parent);
1376 auto name =
state.world.pop_type_get_name(content);
1385 auto content = retrieve<dcon::religion_id>(
state, parent);
1387 frame = int32_t(fat_id.get_icon() - 1);
1394 auto nation_id = retrieve<dcon::nation_id>(
state, parent);
1395 auto ideology_id = retrieve<dcon::ideology_id>(
state, parent);
1396 if(nation_id && ideology_id) {
1397 auto percentage = .01f *
state.world.nation_get_upper_house(nation_id, ideology_id);
1406 auto nat_id = retrieve<dcon::nation_id>(
state, parent);
1407 distribution.clear();
1408 for(
auto id :
state.world.in_ideology) {
1409 distribution.emplace_back(
id.
id,
float(
state.world.nation_get_upper_house(nat_id,
id)));
1411 update_chart(
state);
1418 auto nat_id = retrieve<dcon::nation_id>(
state, parent);
1419 distribution.clear();
1420 for(
auto id :
state.world.in_ideology) {
1421 distribution.emplace_back(
id.
id, 0.0f);
1423 for(
auto p :
state.world.nation_get_province_ownership(nat_id)) {
1424 for(
auto pop_loc :
state.world.province_get_pop_location(p.get_province())) {
1425 auto pop_id = pop_loc.get_pop();
1428 state.world.for_each_ideology([&](dcon::ideology_id iid) {
1436 update_chart(
state);
1443 auto province_id = retrieve<dcon::province_id>(
state, parent);
1452 auto province_id = retrieve<dcon::province_id>(
state, parent);
1462 auto province_id = retrieve<dcon::province_id>(
state, parent);
1472 auto province_id = retrieve<dcon::province_id>(
state, parent);
1483 auto province_id = retrieve<dcon::province_id>(
state, parent);
1490 auto province_id = retrieve<dcon::province_id>(
state, parent);
1497 auto province_id = retrieve<dcon::province_id>(
state, parent);
1504 auto province_id = retrieve<dcon::province_id>(
state, parent);
1512 auto province_id = retrieve<dcon::province_id>(
state, parent);
1520 auto province_id = retrieve<dcon::province_id>(
state, parent);
1528 auto province_id = retrieve<dcon::province_id>(
state, parent);
1533 auto p = retrieve<dcon::province_id>(
state, parent);
1535 auto n =
state.world.province_get_nation_from_province_ownership(p);
1537 state.world.for_each_commodity([&](dcon::commodity_id c) {
1540 if(production < 0.0001f) {
1545 auto name_box = base_box;
1546 name_box.x_size = 75;
1547 auto production_box = base_box;
1548 production_box.x_position += 120.f;
1561 auto province_id = retrieve<dcon::province_id>(
state, parent);
1566 return tooltip_behavior::variable_tooltip;
1570 auto p = retrieve<dcon::province_id>(
state, parent);
1572 auto n =
state.world.province_get_nation_from_province_ownership(p);
1574 state.world.for_each_commodity([&](dcon::commodity_id c) {
1575 auto profit =
state.world.province_get_rgo_profit_per_good(p, c);
1582 auto name_box = base_box;
1583 name_box.x_size = 75;
1584 auto profit_box = base_box;
1585 profit_box.x_position += 120.f;
1598 auto province_id = retrieve<dcon::province_id>(
state, parent);
1603 return tooltip_behavior::variable_tooltip;
1607 auto p = retrieve<dcon::province_id>(
state, parent);
1609 auto n =
state.world.province_get_nation_from_province_ownership(p);
1610 auto s =
state.world.province_get_state_membership(p);
1611 auto m =
state.world.state_instance_get_market_from_local_market(s);
1617 col_2.x_position += 90.f;
1619 col_3.x_position += 180.f;
1621 col_4.x_position += 250.f;
1629 state.world.for_each_commodity([&](dcon::commodity_id c) {
1635 if(max_employment < 1.f) {
1639 auto name_box = base_box;
1640 name_box.x_size = 75;
1641 auto employment_box = base_box;
1642 employment_box.x_position += 120.f;
1643 auto max_employment_box = base_box;
1644 max_employment_box.x_position += 180.f;
1645 auto expected_profit_box = base_box;
1646 expected_profit_box.x_position += 250.f;
1662 auto expected_profit = 0.f;
1665 auto name_box = base_box;
1666 name_box.x_size = 75;
1667 auto employment_box = base_box;
1668 employment_box.x_position += 120.f;
1669 auto max_employment_box = base_box;
1670 max_employment_box.x_position += 180.f;
1671 auto expected_profit_box = base_box;
1672 expected_profit_box.x_position += 250.f;
1684 if(
auto owner =
state.world.province_get_nation_from_province_ownership(p); owner)
1687 if(
auto owner =
state.world.province_get_nation_from_province_ownership(p); owner)
1695 auto province_id = retrieve<dcon::province_id>(
state, parent);
1703 auto factory_id = retrieve<dcon::factory_id>(
state, parent);
1704 auto flid =
state.world.factory_get_factory_location_as_factory(factory_id);
1705 auto pid =
state.world.factory_location_get_province(flid);
1706 auto sdef =
state.world.province_get_state_from_abstract_state_membership(pid);
1707 dcon::state_instance_id sid{};
1708 state.world.for_each_state_instance([&](dcon::state_instance_id
id) {
1709 if(
state.world.state_instance_get_definition(
id) == sdef)
1718 auto factory_id = retrieve<dcon::factory_id>(
state, parent);
1719 auto cid =
state.world.factory_get_building_type(factory_id).get_output();
1726 auto factory_id = retrieve<dcon::factory_id>(
state, parent);
1733 auto factory_id = retrieve<dcon::factory_id>(
state, parent);
1740 auto factory_id = retrieve<dcon::factory_id>(
state, parent);
1747 base_data.size.x += int16_t(20);
1750 auto factory_id = retrieve<dcon::factory_id>(
state, parent);
1751 set_text(
state, std::to_string(
uint32_t(
state.world.factory_get_level(factory_id))));
1757 auto content = retrieve<dcon::factory_id>(
state, parent);
1759 auto profit =
state.world.factory_get_full_profit(content);
1760 bool is_positive =
profit >= 0.f;
1775 auto content = retrieve<dcon::factory_id>(
state, parent);
1776 float profit =
state.world.factory_get_full_profit(content);
1780 }
else if (
profit < 0.f) {
1790 auto content = retrieve<dcon::factory_id>(
state, parent);
1798 frame = int32_t(
state.world.commodity_get_icon(retrieve<dcon::commodity_id>(
state, parent)));
1801 return tooltip_behavior::variable_tooltip;
1805 auto com = retrieve<dcon::commodity_id>(
state, parent);
1809 auto n = retrieve<dcon::nation_id>(
state, parent);
1810 auto p = retrieve<dcon::province_id>(
state, parent);
1818 auto commodity_mod_description = [&](
float value, std::string_view locale_base_name, std::string_view locale_farm_base_name) {
1831 commodity_mod_description(
state.world.nation_get_factory_goods_output(n, com),
"tech_output",
"tech_output");
1832 commodity_mod_description(
state.world.nation_get_rgo_goods_output(n, com),
"tech_mine_output",
"tech_farm_output");
1833 commodity_mod_description(
state.world.nation_get_rgo_size(n, com),
"tech_mine_size",
"tech_farm_size");
1849 if(
state.world.commodity_get_is_mine(com)) {
1878 for(
const auto tid :
state.world.in_technology) {
1879 if(
state.world.nation_get_active_technologies(n, tid)) {
1880 bool have_header =
false;
1881 auto commodity_technology_mod_description = [&](
auto const&
list, std::string_view locale_base_name, std::string_view locale_farm_base_name) {
1882 for(
const auto mod :
list) {
1883 if(mod.type != com || mod.amount == 0.f)
1891 auto name =
state.world.commodity_get_name(mod.type);
1902 commodity_technology_mod_description(
state.world.technology_get_factory_goods_output(tid),
"tech_output",
"tech_output");
1903 commodity_technology_mod_description(
state.world.technology_get_rgo_goods_output(tid),
"tech_mine_output",
"tech_farm_output");
1904 commodity_technology_mod_description(
state.world.technology_get_rgo_size(tid),
"tech_mine_size",
"tech_farm_size");
1907 for(
const auto iid :
state.world.in_invention) {
1908 if(
state.world.nation_get_active_inventions(n, iid)) {
1909 bool have_header =
false;
1910 auto commodity_invention_mod_description = [&](
auto const&
list, std::string_view locale_base_name, std::string_view locale_farm_base_name) {
1911 for(
const auto mod :
list) {
1912 if(mod.type != com || mod.amount == 0.f)
1920 auto name =
state.world.commodity_get_name(mod.type);
1931 commodity_invention_mod_description(
state.world.invention_get_factory_goods_output(iid),
"tech_output",
"tech_output");
1932 commodity_invention_mod_description(
state.world.invention_get_rgo_goods_output(iid),
"tech_mine_output",
"tech_farm_output");
1933 commodity_invention_mod_description(
state.world.invention_get_rgo_size(iid),
"tech_mine_size",
"tech_farm_size");
1947 auto nfid = retrieve<dcon::national_focus_id>(
state, parent);
1948 auto sid = retrieve<dcon::state_instance_id>(
state, parent);
1950 frame =
state.world.national_focus_get_icon(nfid) - 1;
1954 return tooltip_behavior::variable_tooltip;
1958 auto content = retrieve<dcon::national_focus_id>(
state, parent);
1960 auto sid = retrieve<dcon::state_instance_id>(
state, parent);
1970 if(fat_nf.get_promotion_type()) {
1972 if(fat_nf.get_promotion_type() ==
state.culture_definitions.clergy) {
1976 }
else if(fat_nf.get_promotion_type() ==
state.culture_definitions.bureaucrat) {
1985 if(
auto mid =
state.world.national_focus_get_modifier(content); mid) {
1988 auto state_cap =
state.world.state_instance_get_capital(sid);
1994 auto content = retrieve<dcon::state_instance_id>(
state, parent);
1995 auto nat_focus = retrieve<dcon::national_focus_id>(
state, parent);
2004 if(
name ==
"focus_icon") {
2005 return make_element_by_type<national_focus_icon>(
state,
id);
2015 return "focus_item";
2026 if(
name ==
"name") {
2027 auto ptr = make_element_by_type<simple_text_element_base>(
state,
id);
2028 category_label = ptr.
get();
2030 }
else if(
name ==
"focus_icons") {
2031 auto ptr = make_element_by_type<national_focus_category_list>(
state,
id);
2032 focus_list = ptr.
get();
2041 auto category = any_cast<nations::focus_type>(payload);
2047 state.world.for_each_national_focus([&](dcon::national_focus_id focus_id) {
2049 if(fat_id.get_type() ==
uint8_t(category))
2054 return message_result::consumed;
2056 return message_result::unseen;
2064 auto content = retrieve<dcon::state_instance_id>(
state, parent);
2073 window_element_base::on_create(
state);
2074 auto start = make_element_by_type<window_element_base>(
state,
"focuscategory_start");
2075 auto current_pos = start->base_data.position;
2076 auto step = make_element_by_type<window_element_base>(
state,
"focuscategory_step");
2077 auto step_y = step->base_data.position.y;
2080 auto ptr = make_element_by_type<national_focus_category>(
state,
"focus_category");
2081 ptr->base_data.position = current_pos;
2082 current_pos =
xy_pair{current_pos.
x, int16_t(current_pos.y + step_y)};
2085 ptr->impl_set(
state, foc_type_payload);
2087 add_child_to_front(std::move(ptr));
2092 if(
name ==
"close_button") {
2093 return make_element_by_type<generic_close_button>(
state,
id);
2094 }
else if(
name ==
"background") {
2095 return make_element_by_type<draggable_target>(
state,
id);
2096 }
else if(
name ==
"cancel_button") {
2097 return make_element_by_type<national_focus_remove_button>(
state,
id);
2104 set_visible(
state,
false);
2105 return message_result::consumed;
2107 return window_element_base::get(
state, payload);
2114 auto content = retrieve<military::wg_summary>(
state, parent).cb;
2115 frame =
state.world.cb_type_get_sprite_index(content) - 1;
2119 return tooltip_behavior::variable_tooltip;
2123 auto wg = retrieve<military::wg_summary>(
state, parent);
2132 }
else if(wg.secondary_nation) {
2141 if(
name ==
"wargoal_icon") {
2142 return make_element_by_type<wg_icon>(
state,
id);
2152 auto content = retrieve<sys::full_wg>(
state, parent).cb;
2153 frame =
state.world.cb_type_get_sprite_index(content) - 1;
2157 return tooltip_behavior::variable_tooltip;
2161 auto wg = retrieve<sys::full_wg>(
state, parent);
2172 }
else if(wg.secondary_nation) {
2181 if(
name ==
"wargoal_icon") {
2182 return make_element_by_type<full_wg_icon>(
state,
id);
2192 button_element_base::on_create(
state);
2197 auto content = retrieve<dcon::state_instance_id>(
state, parent);
2202 auto content = retrieve<dcon::state_instance_id>(
state, parent);
2207 return tooltip_behavior::variable_tooltip;
2211 auto state_instance_id = retrieve<dcon::state_instance_id>(
state, parent);
2238 bool sort_ascend =
true;
2241template<country_list_filter category>
2246 if constexpr(category == country_list_filter::all) {
2247 send(
state, parent, dcon::modifier_id{});
2252 if constexpr(category == country_list_filter::allies) {
2253 send(
state, parent, country_list_filter::find_allies);
2254 }
else if constexpr(category == country_list_filter::sphere) {
2255 send(
state, parent, country_list_filter::influenced);
2256 }
else if constexpr(category == country_list_filter::neighbors) {
2257 send(
state, parent, country_list_filter::neighbors_no_vassals);
2260 if constexpr(category == country_list_filter::all) {
2261 send(
state, parent, dcon::modifier_id{});
2267 auto filter_settings = retrieve<country_filter_setting>(
state, parent);
2268 auto t_category = filter_settings.general_category;
2269 switch(t_category) {
2270 case country_list_filter::influenced:
2271 t_category = country_list_filter::sphere;
2273 case country_list_filter::find_allies:
2274 t_category = country_list_filter::allies;
2276 case country_list_filter::neighbors_no_vassals:
2277 t_category = country_list_filter::neighbors;
2282 disabled = t_category != category;
2283 button_element_base::render(
state, x, y);
2288 return tooltip_behavior::variable_tooltip;
2293 case country_list_filter::all:
2296 case country_list_filter::neighbors:
2297 case country_list_filter::neighbors_no_vassals:
2300 case country_list_filter::sphere:
2301 case country_list_filter::influenced:
2304 case country_list_filter::enemies:
2307 case country_list_filter::find_allies:
2308 case country_list_filter::allies:
2311 case country_list_filter::best_guess:
2329 auto filter_settings = retrieve<country_filter_setting>(
state, parent);
2330 disabled = filter_settings.continent !=
continent;
2331 button_element_base::render(
state, x, y);
2348 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)
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::market_id m, 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)
std::vector< dcon::factory_type_id > commodity_get_factory_types_as_output(sys::state const &state, dcon::commodity_id output_good)
float gdp_adjusted(sys::state &state, dcon::market_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)
table::column< dcon::commodity_id > rgo_employment
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)
Holds important data about the game world, state, and other data regarding windowing,...
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