3#include "dcon_generated.hpp"
24 auto p = retrieve<dcon::province_id>(
state,
parent);
25 frame = (
state.world.province_get_land_rally_point(retrieve<dcon::province_id>(
state,
parent))) ? 1 : 0;
26 disabled =
state.world.province_get_nation_from_province_ownership(p) !=
state.local_player_nation;
29 auto p = retrieve<dcon::province_id>(
state,
parent);
43 auto p = retrieve<dcon::province_id>(
state,
parent);
44 frame =
state.world.province_get_naval_rally_point(p) ? 1 : 0;
45 disabled = !(
state.world.province_get_is_coast(p)) ||
state.world.province_get_nation_from_province_ownership(p) !=
state.local_player_nation;
48 auto p = retrieve<dcon::province_id>(
state,
parent);
77 auto prov_id = retrieve<dcon::province_id>(
state,
parent);
78 progress =
state.world.province_get_life_rating(prov_id) / 100.f;
86 dcon::province_id prov_id = retrieve<dcon::province_id>(
state,
parent);
91 for(
auto i :
state.world.in_invention) {
92 auto mod = i.get_modifier();
94 if(mod.get_national_values().offsets[j] == sys::national_mod_offsets::colonial_life_rating) {
98 dcon::technology_id containing_tech;
99 auto lim_trigger_k = i.get_limit();
101 [&](uint16_t* tval) {
102 if((tval[0] & trigger::code_mask) == trigger::technology)
103 containing_tech = trigger::payload(tval[1]).tech_id;
106 if(containing_tech) {
136 frame = fat_id.get_rgo().get_icon();
144 auto prov = retrieve<dcon::province_id>(
state,
parent);
145 auto rgo =
state.world.province_get_rgo(prov);
153 state.map_state.set_selected_province(dcon::province_id{});
161 dcon::province_id province_id = retrieve<dcon::province_id>(
state,
parent);
177 dcon::province_id province_id = retrieve<dcon::province_id>(
state,
parent);
189 dcon::province_id province_id = retrieve<dcon::province_id>(
state,
parent);
191 auto terrain_id = fat_id.get_terrain().id;
192 auto terrain_image =
state.province_definitions.terrain_to_gfx_map[terrain_id];
203 dcon::province_id province_id = retrieve<dcon::province_id>(
state,
parent);
206 if(
auto name = fat_id.get_terrain().get_name();
name) {
211 if(
auto mod_id = fat_id.get_terrain().id; mod_id) {
215 if(
auto name = fat_id.get_climate().get_name();
name) {
220 if(
auto mod_id = fat_id.get_climate().id; mod_id) {
224 if(
auto name = fat_id.get_continent().get_name();
name) {
229 if(
auto mod_id = fat_id.get_continent().id; mod_id) {
238 auto prov = retrieve<dcon::province_id>(
state,
parent);
239 if(
state.world.state_instance_get_flashpoint_tag(
state.world.province_get_state_membership(prov))) {
251 dcon::province_id prov = retrieve<dcon::province_id>(
state,
parent);
252 if(!
state.world.state_instance_get_flashpoint_tag(
state.world.province_get_state_membership(prov)))
267 dcon::province_id province_id = retrieve<dcon::province_id>(
state,
parent);
269 return state.world.nation_get_identity_from_identity_holder(fat_id.get_province_control_as_province().get_nation().id);
271 return dcon::national_identity_id{};
275 dcon::province_id province_id = retrieve<dcon::province_id>(
state,
parent);
277 auto controller = prov_fat.get_province_control_as_province().get_nation();
278 auto rebel_faction = prov_fat.get_province_rebel_control_as_province().get_rebel_faction();
279 if(!controller && !rebel_faction)
289 dcon::province_id province_id = retrieve<dcon::province_id>(
state,
parent);
291 auto controller = prov_fat.get_province_control_as_province().get_nation();
292 auto rebel_faction = prov_fat.get_province_rebel_control_as_province().get_rebel_faction();
293 if(!controller && !rebel_faction)
310 auto content = retrieve<dcon::state_instance_id>(
state,
parent);
311 if(
state.world.state_instance_get_nation_from_flashpoint_focus(content) ==
state.local_player_nation)
312 return state.world.national_focus_get_icon(
state.national_definitions.flashpoint_focus) - 1;
313 return bool(
state.world.state_instance_get_owner_focus(content).id)
314 ?
state.world.state_instance_get_owner_focus(content).get_icon() - 1
319 auto content = retrieve<dcon::state_instance_id>(
state,
parent);
321 for(
auto nfid :
state.world.in_national_focus) {
324 if(
state.world.state_instance_get_nation_from_flashpoint_focus(content) ==
state.local_player_nation)
331 auto content = retrieve<dcon::state_instance_id>(
state,
parent);
341 auto sid = retrieve<dcon::state_instance_id>(
state,
parent);
345 auto content =
state.world.state_instance_get_owner_focus(sid);
351 if(fat_nf.get_promotion_type()) {
353 if(fat_nf.get_promotion_type() ==
state.culture_definitions.clergy) {
357 }
else if(fat_nf.get_promotion_type() ==
state.culture_definitions.bureaucrat) {
367 if(
auto mid =
state.world.national_focus_get_modifier(content); mid) {
391 auto p = retrieve<dcon::province_id>(
state,
parent);
392 auto n =
state.world.province_get_nation_from_province_ownership(p);
396 if(
auto desc =
state.world.modifier_get_desc(mod.
mod_id);
state.key_is_localized(desc)) {
419 if(
name ==
"modifier") {
420 return make_element_by_type<province_modifier_icon>(
state,
id);
439 return "prov_state_modifier";
442 subwindow.
mod = content;
447 auto prov = retrieve<dcon::province_id>(
state,
parent);
449 for(
auto mods :
state.world.province_get_current_modifiers(prov)) {
460 auto p = retrieve<dcon::province_id>(
state,
parent);
465 auto p = retrieve<dcon::province_id>(
state,
parent);
474 auto source =
state.local_player_nation;
475 auto p = retrieve<dcon::province_id>(
state,
parent);
498 if(
name ==
"state_name") {
499 return make_element_by_type<province_state_name_text>(
state,
id);
500 }
else if(
name ==
"province_name") {
501 return make_element_by_type<generic_name_text<dcon::province_id>>(
state, id);
502 }
else if(
name ==
"prov_terrain") {
503 return make_element_by_type<province_terrain_image>(
state,
id);
504 }
else if(
name ==
"province_modifiers") {
505 return make_element_by_type<province_modifiers>(
state,
id);
506 }
else if(
name ==
"slave_state_icon") {
507 auto ptr = make_element_by_type<fixed_pop_type_icon>(
state,
id);
508 slave_icon = ptr.
get();
509 ptr->set_type(
state,
state.culture_definitions.slaves);
511 }
else if(
name ==
"admin_icon") {
512 auto ptr = make_element_by_type<fixed_pop_type_icon>(
state,
id);
513 ptr->set_type(
state,
state.culture_definitions.bureaucrat);
515 }
else if(
name ==
"owner_icon") {
516 auto ptr = make_element_by_type<fixed_pop_type_icon>(
state,
id);
517 ptr->set_type(
state,
state.culture_definitions.aristocrat);
519 }
else if(
name ==
"controller_flag") {
520 return make_element_by_type<province_controller_flag>(
state,
id);
521 }
else if(
name ==
"flashpoint_indicator") {
522 return make_element_by_type<province_flashpoint_indicator>(
state,
id);
523 }
else if(
name ==
"occupation_progress") {
524 return make_element_by_type<invisible_element>(
state,
id);
525 }
else if(
name ==
"occupation_icon") {
526 return make_element_by_type<invisible_element>(
state,
id);
527 }
else if(
name ==
"occupation_flag") {
528 return make_element_by_type<invisible_element>(
state,
id);
529 }
else if(
name ==
"colony_button") {
530 auto btn = make_element_by_type<province_colony_button>(
state,
id);
531 colony_button = btn.
get();
533 }
else if(
name ==
"alice_move_capital") {
534 return make_element_by_type<province_move_capital_button>(
state,
id);
535 }
else if(
name ==
"national_focus") {
536 return make_element_by_type<province_national_focus_button>(
state,
id);
537 }
else if(
name ==
"admin_efficiency") {
538 return make_element_by_type<state_admin_efficiency_text>(
state,
id);
539 }
else if(
name ==
"owner_presence") {
540 return make_element_by_type<state_aristocrat_presence_text>(
state,
id);
541 }
else if(
name ==
"liferating") {
542 return make_element_by_type<province_liferating>(
state,
id);
549 dcon::province_id prov_id = retrieve<dcon::province_id>(
state,
parent);
568 fat_id.for_each_core_as_province([&](dcon::core_id core_id) {
570 auto identity = core_fat_id.get_identity();
582template<economy::province_building_type Value>
586 auto prov_id = retrieve<dcon::province_id>(
state,
parent);
591template<economy::province_building_type Value>
595 auto content = retrieve<dcon::province_id>(
state,
parent);
600 auto content = retrieve<dcon::province_id>(
state,
parent);
607 auto pid = retrieve<dcon::province_id>(
state,
parent);
608 auto si =
state.world.province_get_state_membership(pid);
618 auto content = retrieve<dcon::province_id>(
state,
parent);
619 auto within_nation =
state.world.province_get_nation_from_province_ownership(content);
620 for(
auto p :
state.world.nation_get_province_ownership(within_nation)) {
631 auto id = retrieve<dcon::province_id>(
state,
parent);
633 int32_t current_lvl =
state.world.province_get_building_level(
id,
uint8_t(Value));
634 int32_t max_local_lvl =
state.world.nation_get_max_building_level(
state.local_player_nation,
uint8_t(Value));
639 int32_t min_build = int32_t(
state.world.province_get_modifier_values(
id, sys::provincial_mod_offsets::min_build_fort));
647 int32_t min_build = int32_t(
state.world.province_get_modifier_values(
id, sys::provincial_mod_offsets::min_build_naval_base));
649 auto si =
state.world.province_get_state_membership(
id);
658 auto rules =
state.world.nation_get_combined_issue_rules(
state.local_player_nation);
661 int32_t min_build = 0;
663 min_build = int32_t(
state.world.province_get_modifier_values(
id, sys::provincial_mod_offsets::min_build_railroad));
665 min_build = int32_t(
state.world.province_get_modifier_values(
id, sys::provincial_mod_offsets::min_build_bank));
667 min_build = int32_t(
state.world.province_get_modifier_values(
id, sys::provincial_mod_offsets::min_build_university));
676template<economy::province_building_type Value>
685 auto content = retrieve<dcon::province_id>(
state,
parent);
695 auto prov = retrieve<dcon::province_id>(
state,
parent);
697 for(
auto pb_con :
state.world.province_get_province_building_construction(prov)) {
698 if(pb_con.get_type() ==
uint8_t(Value)) {
699 auto&
goods =
state.economy_definitions.building_definitions[int32_t(Value)].cost;
700 auto& cgoods = pb_con.get_purchased_goods();
702 float admin_eff =
state.world.nation_get_administrative_efficiency(pb_con.get_nation());
703 float admin_cost_factor = pb_con.get_is_pop_project() ? 1.0f : 2.0f - admin_eff;
706 if(
goods.commodity_type[i]) {
723template<economy::province_building_type Value>
730 std::string get_icon_name()
noexcept {
733 return "build_icon0";
735 return "build_icon1";
737 return "build_icon2";
739 return "build_icon3";
741 return "build_icon4";
743 return "build_icon0";
747 bool is_being_built(
sys::state&
state, dcon::province_id
id)
noexcept {
748 for(
auto pb :
state.world.province_get_province_building_construction(
id))
756 if(
name == get_icon_name()) {
757 return make_element_by_type<province_building_icon<Value>>(
state, id);
758 }
else if(
name ==
"underconstruction_icon") {
759 auto ptr = make_element_by_type<image_element_base>(
state,
id);
760 under_construction_icon = ptr.
get();
762 }
else if(
name ==
"building_progress") {
763 auto ptr = make_element_by_type<province_building_progress<Value>>(
state, id);
764 building_progress = ptr.
get();
766 }
else if(
name ==
"expand_text") {
767 auto ptr = make_element_by_type<simple_text_element_base>(
state,
id);
768 expanding_text = ptr.
get();
770 }
else if(
name ==
"expand") {
771 auto ptr = make_element_by_type<province_building_expand_button<Value>>(
state, id);
772 expand_button = ptr.
get();
774 }
else if(
name ==
"description") {
775 auto ptr = make_element_by_type<simple_text_element_base>(
state,
id);
778 }
else if(
name.substr(0, 10) ==
"build_icon") {
779 return make_element_by_type<invisible_element>(
state,
id);
786 auto content = retrieve<dcon::province_id>(
state,
parent);
800 auto p = retrieve<dcon::province_id>(
state,
parent);
804 for(
auto m :
state.world.province_get_current_modifiers(p)) {
805 if(m.mod_id ==
state.economy_definitions.selector_modifier) {
818 auto content = retrieve<dcon::province_id>(
state,
parent);
822 auto pid = retrieve<dcon::province_id>(
state,
parent);
823 auto si =
state.world.province_get_state_membership(pid);
834 auto p = retrieve<dcon::province_id>(
state,
parent);
836 for(
auto m :
state.world.province_get_current_modifiers(p)) {
837 if(m.mod_id ==
state.economy_definitions.selector_modifier) {
847 if(
name ==
"underconstruction_icon"
848 ||
name ==
"building_progress"
849 ||
name ==
"expand_text") {
850 return make_element_by_type<invisible_element>(
state,
id);
851 }
else if(
name ==
"expand") {
852 return make_element_by_type<province_selector_button>(
state,
id);
853 }
else if(
name ==
"description") {
854 auto ptr = make_element_by_type<simple_text_element_base>(
state,
id);
857 }
else if(
name.substr(0, 10) ==
"build_icon") {
858 int32_t value =
name[10] -
'0';
859 int32_t num_buildings = 0;
860 for(
auto& def :
state.economy_definitions.building_definitions) {
864 if(value == num_buildings) {
865 return make_element_by_type<province_selector_image>(
state,
id);
867 return make_element_by_type<invisible_element>(
state,
id);
880 auto p = retrieve<dcon::province_id>(
state,
parent);
884 for(
auto m :
state.world.province_get_current_modifiers(p)) {
885 if(m.mod_id ==
state.economy_definitions.immigrator_modifier) {
898 auto content = retrieve<dcon::province_id>(
state,
parent);
902 auto pid = retrieve<dcon::province_id>(
state,
parent);
903 auto si =
state.world.province_get_state_membership(pid);
914 auto p = retrieve<dcon::province_id>(
state,
parent);
916 for(
auto m :
state.world.province_get_current_modifiers(p)) {
917 if(m.mod_id ==
state.economy_definitions.immigrator_modifier) {
927 if(
name ==
"underconstruction_icon"
928 ||
name ==
"building_progress"
929 ||
name ==
"expand_text") {
930 return make_element_by_type<invisible_element>(
state,
id);
931 }
else if(
name ==
"expand") {
932 return make_element_by_type<province_immigrator_button>(
state,
id);
933 }
else if(
name ==
"description") {
934 auto ptr = make_element_by_type<simple_text_element_base>(
state,
id);
937 }
else if(
name.substr(0, 10) ==
"build_icon") {
938 int32_t value =
name[10] -
'0';
939 int32_t num_buildings = 0;
940 for(
auto& def :
state.economy_definitions.building_definitions) {
944 if(value == num_buildings + 1) {
945 return make_element_by_type<province_immigrator_image>(
state,
id);
947 return make_element_by_type<invisible_element>(
state,
id);
957 auto content = retrieve<dcon::province_id>(
state,
parent);
961 auto pid = retrieve<dcon::province_id>(
state,
parent);
962 auto si =
state.world.province_get_state_membership(pid);
970 auto pid = retrieve<dcon::province_id>(
state,
parent);
971 auto n =
state.world.province_get_nation_from_province_ownership(pid);
972 for(
auto p :
state.world.nation_get_province_ownership(n)) {
977 auto content = retrieve<dcon::province_id>(
state,
parent);
990template<economy::province_building_type Value>
1024 auto content = retrieve<dcon::province_id>(
state,
parent);
1032 auto content = retrieve<dcon::province_id>(
state,
parent);
1038 for(
auto ft :
state.world.in_factory_type) {
1040 state.world.province_get_state_membership(content), ft,
false)) {
1052 auto province_id = retrieve<dcon::province_id>(
state,
parent);
1063 auto prov = retrieve<dcon::province_id>(
state,
parent);
1071 if(
name ==
"building_progress") {
1072 return make_element_by_type<rr_investment_progress>(
state,
id);
1078 auto prov = retrieve<dcon::province_id>(
state,
parent);
1084 auto prov = retrieve<dcon::province_id>(
state,
parent);
1100 if(
name ==
"country_name") {
1101 return make_element_by_type<generic_name_text<dcon::nation_id>>(
state, id);
1102 }
else if(
name ==
"country_flag") {
1103 auto ptr = make_element_by_type<province_country_flag_button>(
state,
id);
1104 country_flag_button = ptr.
get();
1106 }
else if(
name ==
"country_gov") {
1107 return make_element_by_type<nation_government_type_text>(
state,
id);
1108 }
else if(
name ==
"country_party") {
1109 return make_element_by_type<nation_ruling_party_text>(
state,
id);
1110 }
else if(
name ==
"country_prestige") {
1111 return make_element_by_type<nation_prestige_text>(
state,
id);
1112 }
else if(
name ==
"country_economic") {
1113 return make_element_by_type<nation_industry_score_text>(
state,
id);
1114 }
else if(
name ==
"country_military") {
1115 return make_element_by_type<nation_military_score_text>(
state,
id);
1116 }
else if(
name ==
"country_total") {
1117 return make_element_by_type<nation_total_score_text>(
state,
id);
1118 }
else if(
name ==
"selected_prestige_rank") {
1119 return make_element_by_type<nation_prestige_rank_text>(
state,
id);
1120 }
else if(
name ==
"selected_industry_rank") {
1121 return make_element_by_type<nation_industry_rank_text>(
state,
id);
1122 }
else if(
name ==
"selected_military_rank") {
1123 return make_element_by_type<nation_military_rank_text>(
state,
id);
1124 }
else if(
name ==
"selected_total_rank") {
1125 return make_element_by_type<nation_rank_text>(
state,
id);
1126 }
else if(
name ==
"country_status") {
1127 return make_element_by_type<nation_status_text>(
state,
id);
1128 }
else if(
name ==
"country_flag_overlay") {
1129 return make_element_by_type<nation_flag_frame>(
state,
id);
1130 }
else if(
name ==
"total_population") {
1131 return make_element_by_type<province_population>(
state,
id);
1132 }
else if(
name ==
"sphere_label") {
1133 return make_element_by_type<nation_sphere_list_label>(
state,
id);
1134 }
else if(
name ==
"puppet_label") {
1135 return make_element_by_type<nation_puppet_list_label>(
state,
id);
1136 }
else if(
name ==
"our_relation") {
1137 return make_element_by_type<nation_player_relations_text>(
state,
id);
1138 }
else if(
name ==
"workforce_chart") {
1139 auto ptr = make_element_by_type<workforce_piechart<dcon::province_id>>(
state, id);
1140 workforce_chart = ptr.
get();
1142 }
else if(
name ==
"ideology_chart") {
1143 auto ptr = make_element_by_type<ideology_piechart<dcon::province_id>>(
state, id);
1144 ideology_chart = ptr.
get();
1146 }
else if(
name ==
"culture_chart") {
1147 auto ptr = make_element_by_type<culture_piechart<dcon::province_id>>(
state, id);
1148 culture_chart = ptr.
get();
1150 }
else if(
name ==
"goods_type") {
1151 return make_element_by_type<province_rgo>(
state,
id);
1152 }
else if(
name ==
"build_icon_fort") {
1153 return make_element_by_type<province_view_foreign_building_icon<economy::province_building_type::fort>>(
state, id);
1154 }
else if(
name ==
"build_icon_navalbase") {
1155 return make_element_by_type<province_view_foreign_building_icon<economy::province_building_type::naval_base>>(
state, id);
1156 }
else if(
name ==
"build_icon_infra") {
1157 return make_element_by_type<province_view_foreign_building_icon<economy::province_building_type::railroad>>(
state, id);
1158 }
else if(
name ==
"build_icon_bank") {
1159 return make_element_by_type<province_view_foreign_building_icon<economy::province_building_type::bank>>(
state, id);
1160 }
else if(
name ==
"build_icon_university") {
1161 return make_element_by_type<province_view_foreign_building_icon<economy::province_building_type::university>>(
state, id);
1162 }
else if(
name ==
"infra_progress_win") {
1163 return make_element_by_type<rr_invest_inwdow>(
state,
id);
1164 }
else if(
name ==
"invest_build_infra") {
1165 return make_element_by_type<province_invest_railroad_button>(
state,
id);
1166 }
else if(
name ==
"invest_factory_button") {
1167 return make_element_by_type<province_invest_factory_button>(
state,
id);
1168 }
else if(
name ==
"sphere_targets") {
1169 return make_element_by_type<overlapping_sphere_flags>(
state,
id);
1170 }
else if(
name ==
"puppet_targets") {
1171 return make_element_by_type<overlapping_puppet_flags>(
state,
id);
1172 }
else if(
name ==
"allied_targets") {
1173 return make_element_by_type<overlapping_ally_flags>(
state,
id);
1174 }
else if(
name ==
"war_targets") {
1175 return make_element_by_type<overlapping_enemy_flags>(
state,
id);
1176 }
else if(
name ==
"send_diplomat") {
1177 return make_element_by_type<province_send_diplomat_button>(
state,
id);
1178 }
else if(
name ==
"core_icons") {
1179 return make_element_by_type<province_core_flags>(
state,
id);
1180 }
else if(
name ==
"supply_limit") {
1181 return make_element_by_type<province_supply_limit_text>(
state,
id);
1182 }
else if (
name ==
"selected_military_icon") {
1183 auto ptr = make_element_by_type<military_score_icon>(
state,
id);
1185 }
else if(
name ==
"rallypoint_checkbox") {
1186 return make_element_by_type<land_rally_point>(
state,
id);
1187 }
else if(
name ==
"rallypoint_checkbox_naval") {
1188 return make_element_by_type<naval_rally_point>(
state,
id);
1189 }
else if(
name ==
"rallypoint_merge_checkbox" ||
name ==
"rallypoint_merge_checkbox_naval") {
1190 return make_element_by_type<merge_rally_point>(
state,
id);
1197 auto prov_id = retrieve<dcon::province_id>(
state,
parent);
1199 auto nation_id = fat_id.get_nation_from_province_ownership();
1200 if(!
bool(nation_id) || nation_id.id ==
state.local_player_nation) {
1220 auto prov_id = retrieve<dcon::province_id>(
state,
parent);
1231 auto prov_id = retrieve<dcon::province_id>(
state,
parent);
1242 auto prov_id = retrieve<dcon::province_id>(
state,
parent);
1253 frame = int32_t(10.f * employment_ratio);
1259 auto prov_id = retrieve<dcon::province_id>(
state,
parent);
1260 auto owner =
state.world.province_get_nation_from_province_ownership(prov_id);
1264 bool is_mine =
state.world.commodity_get_is_mine(
state.world.province_get_rgo(prov_id));
1268 float expected_min_wage = is_mine ? laborer_min_wage : farmer_min_wage;
1285 auto prov_id = retrieve<dcon::province_id>(
state,
parent);
1287 frame = fat_id.get_crime().index() + 1;
1301 auto province_id = retrieve<dcon::province_id>(
state,
parent);
1303 auto crime_id = fat_id.get_crime();
1326 auto province_id = retrieve<dcon::province_id>(
state,
parent);
1348 auto content = retrieve<dcon::province_id>(
state,
parent);
1356 auto province_id = retrieve<dcon::province_id>(
state,
parent);
1363 auto content = retrieve<dcon::province_id>(
state,
parent);
1374 auto province_id = retrieve<dcon::province_id>(
state,
parent);
1381 auto content = retrieve<dcon::province_id>(
state,
parent);
1402 auto province_id = retrieve<dcon::province_id>(
state,
parent);
1403 auto migration =
state.world.province_get_daily_net_migration(province_id);
1404 auto immigration =
state.world.province_get_daily_net_immigration(province_id);
1411 auto content = retrieve<dcon::province_id>(
state,
parent);
1414 if(
state.world.province_get_is_colonial(content)) {
1424 auto province_id = retrieve<dcon::province_id>(
state,
parent);
1431 auto content = retrieve<dcon::province_id>(
state,
parent);
1440 auto province_id = retrieve<dcon::province_id>(
state,
parent);
1455 if(
name ==
"goods_type") {
1456 return make_element_by_type<province_owner_rgo>(
state,
id);
1457 }
else if(
name ==
"open_popscreen") {
1458 return make_element_by_type<province_pop_button>(
state,
id);
1459 }
else if(
name ==
"total_population") {
1460 return make_element_by_type<province_population>(
state,
id);
1461 }
else if(
name ==
"workforce_chart") {
1462 auto ptr = make_element_by_type<workforce_piechart<dcon::province_id>>(
state, id);
1463 workforce_chart = ptr.
get();
1465 }
else if(
name ==
"ideology_chart") {
1466 auto ptr = make_element_by_type<ideology_piechart<dcon::province_id>>(
state, id);
1467 ideology_chart = ptr.
get();
1469 }
else if(
name ==
"culture_chart") {
1470 auto ptr = make_element_by_type<culture_piechart<dcon::province_id>>(
state, id);
1471 culture_chart = ptr.
get();
1473 }
else if(
name ==
"core_icons") {
1474 return make_element_by_type<province_core_flags>(
state,
id);
1475 }
else if(
name ==
"supply_limit") {
1476 return make_element_by_type<province_supply_limit_text>(
state,
id);
1477 }
else if(
name ==
"crime_icon") {
1478 return make_element_by_type<province_crime_icon>(
state,
id);
1479 }
else if(
name ==
"crime_name") {
1480 return make_element_by_type<province_crime_name_text>(
state,
id);
1481 }
else if(
name ==
"crimefight_percent") {
1482 return make_element_by_type<province_crime_fighting_text>(
state,
id);
1483 }
else if(
name ==
"rebel_percent") {
1484 return make_element_by_type<province_rebel_percent_text>(
state,
id);
1485 }
else if(
name ==
"employment_ratio") {
1486 return make_element_by_type<province_rgo_employment_progress_icon>(
state,
id);
1487 }
else if(
name ==
"rgo_population") {
1488 return make_element_by_type<province_rgo_workers_text>(
state,
id);
1489 }
else if(
name ==
"rgo_percent") {
1490 return make_element_by_type<province_rgo_employment_percent_text>(
state,
id);
1491 }
else if(
name ==
"produced") {
1492 return make_element_by_type<province_owner_goods_produced_text>(
state,
id);
1493 }
else if(
name ==
"income") {
1494 return make_element_by_type<province_owner_income_text>(
state,
id);
1495 }
else if(
name ==
"growth") {
1496 return make_element_by_type<province_pop_growth_text>(
state,
id);
1497 }
else if(
name ==
"migration") {
1498 return make_element_by_type<province_migration_text>(
state,
id);
1499 }
else if(
name ==
"build_factory_button") {
1500 return make_element_by_type<province_build_new_factory>(
state,
id);
1507 auto prov_id = retrieve<dcon::province_id>(
state,
parent);
1509 auto nation_id = fat_id.get_nation_from_province_ownership();
1510 if(
bool(nation_id) && nation_id.id ==
state.local_player_nation) {
1527 auto p = retrieve<dcon::province_id>(
state,
parent);
1529 if(pop.get_pop().get_poptype() ==
state.culture_definitions.soldiers) {
1530 auto lcs = pop.get_pop().get_province_land_construction();
1531 for(
const auto lc : lcs) {
1532 auto& base_cost =
state.military_definitions.unit_base_definitions[lc.get_type()].build_cost;
1533 auto& current_purchased = lc.get_purchased_goods();
1535 if(base_cost.commodity_type[i]) {
1536 amount += current_purchased.commodity_amounts[i];
1537 total += base_cost.commodity_amounts[i];
1556 auto p = retrieve<dcon::province_id>(
state,
parent);
1557 auto ncs =
state.world.province_get_province_naval_construction(p);
1558 for(
auto nc : ncs) {
1559 auto& base_cost =
state.military_definitions.unit_base_definitions[nc.get_type()].build_cost;
1560 auto& current_purchased = nc.get_purchased_goods();
1562 if(base_cost.commodity_type[i]) {
1563 amount += current_purchased.commodity_amounts[i];
1564 total += base_cost.commodity_amounts[i];
1581 auto p = retrieve<dcon::province_id>(
state,
parent);
1583 if(pop.get_pop().get_poptype() ==
state.culture_definitions.soldiers) {
1584 auto lcs = pop.get_pop().get_province_land_construction();
1585 for(
const auto lc : lcs) {
1586 auto& base_cost =
state.military_definitions.unit_base_definitions[lc.get_type()].build_cost;
1587 auto& current_purchased = lc.get_purchased_goods();
1589 if(base_cost.commodity_type[i]) {
1590 amount += current_purchased.commodity_amounts[i];
1591 total += base_cost.commodity_amounts[i];
1607 auto p = retrieve<dcon::province_id>(
state,
parent);
1608 auto ncs =
state.world.province_get_province_naval_construction(p);
1609 for(
auto nc : ncs) {
1610 auto& base_cost =
state.military_definitions.unit_base_definitions[nc.get_type()].build_cost;
1611 auto& current_purchased = nc.get_purchased_goods();
1613 if(base_cost.commodity_type[i]) {
1614 amount += current_purchased.commodity_amounts[i];
1615 total += base_cost.commodity_amounts[i];
1632 auto p = retrieve<dcon::province_id>(
state,
parent);
1633 for(
uint8_t i = 2; i <
state.military_definitions.unit_base_definitions.size(); i++) {
1634 auto utid = dcon::unit_type_id(i);
1635 auto const& def =
state.military_definitions.unit_base_definitions[utid];
1636 if(!def.active && !
state.world.nation_get_active_unit(
state.local_player_nation, utid))
1638 if(def.is_land != std::is_same_v<T, dcon::army_id>)
1640 if constexpr(std::is_same_v<T, dcon::army_id>) {
1641 for(
const auto c :
state.world.in_culture) {
1643 for(
auto pl :
state.world.province_get_pop_location_as_province(p)) {
1644 if(pl.get_pop().get_culture() == c) {
1645 if(pl.get_pop().get_poptype() ==
state.culture_definitions.soldiers &&
state.world.pop_get_size(pl.get_pop()) >=
state.defines.pop_min_size_for_regiment) {
1653 for(
auto pl :
state.world.province_get_pop_location_as_province(p)) {
1654 auto lc = pl.get_pop().get_province_land_construction();
1655 if(lc.begin() != lc.end()) {
1675 Cyto::Any payload = Cyto::any_cast<T>(T{});
1685 int16_t y_offset = 1;
1687 auto ptr = make_element_by_type<province_building_window<economy::province_building_type::fort>>(
state,
"building");
1688 ptr->base_data.position.y = y_offset;
1693 auto ptr = make_element_by_type<province_building_window<economy::province_building_type::naval_base>>(
state,
"building");
1694 ptr->base_data.position.y = y_offset;
1699 auto ptr = make_element_by_type<province_building_window<economy::province_building_type::railroad>>(
state,
"building");
1700 ptr->base_data.position.y = y_offset;
1705 auto ptr = make_element_by_type<province_building_window<economy::province_building_type::bank>>(
state,
"building");
1706 ptr->base_data.position.y = y_offset;
1711 auto ptr = make_element_by_type<province_building_window<economy::province_building_type::university>>(
state,
"building");
1712 ptr->base_data.position.y = y_offset;
1716 if(
bool(
state.economy_definitions.selector_modifier)) {
1717 auto ptr = make_element_by_type<province_selector_window>(
state,
"building");
1718 ptr->base_data.position.y = y_offset;
1722 if(
bool(
state.economy_definitions.immigrator_modifier)) {
1723 auto ptr = make_element_by_type<province_immigrator_window>(
state,
"building");
1724 ptr->base_data.position.y = y_offset;
1731 if(
name ==
"army_size") {
1732 return make_element_by_type<province_army_size_text>(
state,
id);
1733 }
else if(
name ==
"army_progress") {
1734 return make_element_by_type<province_army_progress>(
state,
id);
1735 }
else if(
name ==
"navy_progress") {
1736 return make_element_by_type<province_navy_progress>(
state,
id);
1737 }
else if(
name ==
"rallypoint_checkbox") {
1738 return make_element_by_type<land_rally_point>(
state,
id);
1739 }
else if(
name ==
"rallypoint_checkbox_naval") {
1740 return make_element_by_type<naval_rally_point>(
state,
id);
1741 }
else if(
name ==
"rallypoint_merge_checkbox" ||
name ==
"rallypoint_merge_checkbox_naval") {
1742 return make_element_by_type<merge_rally_point>(
state,
id);
1743 }
else if(
name ==
"build_army") {
1744 return make_element_by_type<province_build_unit<dcon::army_id>>(
state, id);
1745 }
else if(
name ==
"build_navy") {
1746 return make_element_by_type<province_build_unit<dcon::navy_id>>(
state, id);
1747 }
else if(
name ==
"army_text") {
1748 return make_element_by_type<province_army_progress_text>(
state,
id);
1749 }
else if(
name ==
"navy_text") {
1750 return make_element_by_type<province_navy_progress_text>(
state,
id);
1757 auto prov_id = retrieve<dcon::province_id>(
state,
parent);
1759 auto nation_id = fat_id.get_nation_from_province_ownership();
1760 if(
bool(nation_id) && nation_id.id ==
state.local_player_nation) {
1771 auto content = retrieve<dcon::province_id>(
state,
parent);
1774 state.map_state.set_selected_province(dcon::province_id{});
1778 auto content = retrieve<dcon::province_id>(
state,
parent);
1786 auto content = retrieve<dcon::province_id>(
state,
parent);
1791 auto content = retrieve<dcon::province_id>(
state,
parent);
1799 auto content = retrieve<dcon::province_id>(
state,
parent);
1804 auto content = retrieve<dcon::province_id>(
state,
parent);
1814 auto sdef =
state.world.province_get_state_from_abstract_state_membership(
province);
1815 auto col = retrieve<dcon::colonization_id>(
state,
parent);
1825 bool war_participant =
false;
1826 for(
auto par :
state.world.war_get_war_participant(
state.crisis_war)) {
1827 if(par.get_nation() ==
state.local_player_nation)
1828 war_participant =
true;
1832 float max_life_rating = -1.0f;
1833 for(
auto p :
state.world.state_definition_get_abstract_state_membership(sdef)) {
1834 if(!p.get_province().get_nation_from_province_ownership()) {
1835 max_life_rating = std::max(max_life_rating,
float(p.get_province().get_life_rating()));
1840 state.defines.colonial_liferating +
state.world.nation_get_modifier_values(
state.local_player_nation, sys::national_mod_offsets::colonial_life_rating) <= max_life_rating,
1841 text::variable_type::x, int64_t(
state.defines.colonial_liferating +
state.world.nation_get_modifier_values(
state.local_player_nation, sys::national_mod_offsets::colonial_life_rating)),
1846 auto colonizers =
state.world.state_definition_get_colonization(sdef);
1847 auto num_colonizers = colonizers.end() - colonizers.begin();
1851 bool adjacent = [&]() {
1852 for(
auto p :
state.world.state_definition_get_abstract_state_membership(sdef)) {
1853 if(!p.get_province().get_nation_from_province_ownership()) {
1854 for(
auto adj : p.get_province().get_province_adjacency()) {
1855 auto indx = adj.get_connected_provinces(0) != p.get_province() ? 0 : 1;
1856 auto o = adj.get_connected_provinces(indx).get_nation_from_province_ownership();
1857 if(o ==
state.local_player_nation)
1859 if(o.get_overlord_as_subject().get_ruler() ==
state.local_player_nation)
1867 bool reachable_by_sea =
false;
1869 dcon::province_id coastal_target = [&]() {
1870 for(
auto p :
state.world.state_definition_get_abstract_state_membership(sdef)) {
1871 if(!p.get_province().get_nation_from_province_ownership()) {
1872 if(p.get_province().get_is_coast())
1873 return p.get_province().id;
1876 return dcon::province_id{};
1879 if(!adjacent && coastal_target &&
state.world.nation_get_central_ports(
state.local_player_nation) != 0) {
1880 for(
auto p :
state.world.nation_get_province_ownership(
state.local_player_nation)) {
1883 reachable_by_sea =
true;
1893 auto required_points = int32_t(
state.defines.colonization_interest_cost_initial + (adjacent ?
state.defines.colonization_interest_cost_neighbor_modifier : 0.0f));
1904 bool war_participant =
false;
1905 for(
auto par :
state.world.war_get_war_participant(
state.crisis_war)) {
1906 if(par.get_nation() ==
state.local_player_nation)
1907 war_participant =
true;
1911 auto crange =
state.world.state_definition_get_colonization(sdef);
1912 auto last_investment =
state.world.colonization_get_last_investment(col);
1914 if(crange.end() - crange.begin() <= 1) {
1923 int32_t point_cost = 0;
1924 if(
state.world.state_definition_get_colonization_stage(sdef) == 1) {
1925 point_cost = int32_t(
state.defines.colonization_interest_cost);
1926 }
else if(
state.world.colonization_get_level(col) <= 4) {
1927 point_cost = int32_t(
state.defines.colonization_influence_cost);
1929 point_cost = int32_t(
state.defines.colonization_extra_guard_cost * (
state.world.colonization_get_level(col) - 4) +
state.defines.colonization_influence_cost);
1944 if(
name ==
"progress_icon") {
1945 auto ptr = make_element_by_type<image_element_base>(
state,
id);
1946 progressicon = ptr.
get();
1948 }
else if(
name ==
"progress_button") {
1949 auto ptr = make_element_by_type<colony_invest_button>(
state,
id);
1950 investbutton = ptr.
get();
1973 return "level_entry";
1978 auto content = retrieve<dcon::colonization_id>(
state,
parent);
1986 auto stage =
state.world.state_definition_get_colonization_stage(
state.world.province_get_state_from_abstract_state_membership(
province));
1996 }
else if(fat_colony.get_colonizer() ==
state.local_player_nation) {
1998 for(; i < 4 && i < int32_t(fat_colony.get_level()); ++i) {
2003 for(int8_t i = 0; i < 5 && i < int32_t(fat_colony.get_level()); ++i) {
2015 auto col = retrieve<dcon::colonization_id>(
state,
parent);
2016 auto level =
state.world.colonization_get_level(col);
2027 if(
name ==
"controller_flag") {
2028 return make_element_by_type<flag_button>(
state,
id);
2029 }
else if(
name ==
"levels") {
2030 return make_element_by_type<colonisation_listbox>(
state,
id);
2031 }
else if(
name ==
"progress_counter") {
2032 return make_element_by_type<colonization_level_number>(
state,
id);
2039 if(payload.holds_type<dcon::national_identity_id>()) {
2041 payload.emplace<dcon::national_identity_id>(
dcon::fatten(
state.world,
content).get_colonizer().get_identity_from_identity_holder().id);
2043 payload.emplace<dcon::national_identity_id>(
state.world.nation_get_identity_from_identity_holder(
state.local_player_nation));
2053 return "colonist_item";
2059 auto prov = retrieve<dcon::province_id>(
state,
parent);
2060 auto fat_def =
dcon::fatten(
state.world,
state.world.province_get_state_from_abstract_state_membership(prov));
2064 bool found_player =
false;
2065 int32_t existing_colonizers = 0;
2066 for(
auto colony : fat_def.get_colonization()) {
2067 if(colony.get_colonizer().id ==
state.local_player_nation) {
2068 found_player =
true;
2071 ++existing_colonizers;
2074 if(!found_player && (existing_colonizers == 0 || (fat_def.get_colonization_stage() == 1 && existing_colonizers < 4))) {
2085 auto content = retrieve<dcon::state_instance_id>(
state,
parent);
2097 if(
name ==
"total_population") {
2098 auto ptr = make_element_by_type<simple_text_element_base>(
state,
id);
2099 population_box = ptr.
get();
2101 }
else if(
name ==
"culture_chart") {
2102 auto ptr = make_element_by_type<culture_piechart<dcon::province_id>>(
state, id);
2103 culture_chart = ptr.
get();
2105 }
else if(
name ==
"goods_type") {
2106 return make_element_by_type<province_rgo>(
state,
id);
2107 }
else if(
name ==
"colonize_button") {
2108 return make_element_by_type<province_protectorate_button>(
state,
id);
2109 }
else if(
name ==
"withdraw_button") {
2110 return make_element_by_type<province_withdraw_button>(
state,
id);
2111 }
else if(
name ==
"colonist_list") {
2112 return make_element_by_type<colonist_listbox>(
state,
id);
2113 }
else if(
name ==
"crisis_temperature") {
2114 return make_element_by_type<province_colonisation_temperature>(
state,
id);
2115 }
else if(
name ==
"rallypoint_checkbox") {
2116 return make_element_by_type<land_rally_point>(
state,
id);
2117 }
else if(
name ==
"rallypoint_checkbox_naval") {
2118 return make_element_by_type<naval_rally_point>(
state,
id);
2119 }
else if(
name ==
"rallypoint_merge_checkbox" ||
name ==
"rallypoint_merge_checkbox_naval") {
2120 return make_element_by_type<merge_rally_point>(
state,
id);
2127 auto prov_id = retrieve<dcon::province_id>(
state,
parent);
2129 auto nation_id = fat_id.get_nation_from_province_ownership();
2130 if(
bool(nation_id)) {
2143 dcon::province_id active_province{};
2157 auto ptr = make_element_by_type<build_unit_province_window>(
state,
"build_unit_view");
2163 if(
name ==
"close_button") {
2164 return make_element_by_type<province_close_button>(
state,
id);
2165 }
else if(
name ==
"background") {
2166 return make_element_by_type<draggable_target>(
state,
id);
2167 }
else if(
name ==
"province_view_header") {
2168 auto ptr = make_element_by_type<province_window_header>(
state,
id);
2169 header_window = ptr.
get();
2171 }
else if(
name ==
"province_other") {
2172 auto ptr = make_element_by_type<province_view_foreign_details>(
state,
id);
2173 ptr->set_visible(
state,
false);
2174 foreign_details_window = ptr.
get();
2176 }
else if(
name ==
"province_colony") {
2177 auto ptr = make_element_by_type<province_window_colony>(
state,
id);
2178 ptr->set_visible(
state,
false);
2179 colony_window = ptr.
get();
2181 }
else if(
name ==
"province_statistics") {
2182 auto ptr = make_element_by_type<province_view_statistics>(
state,
id);
2183 local_details_window = ptr.
get();
2184 ptr->set_visible(
state,
false);
2186 }
else if(
name ==
"province_buildings") {
2187 auto ptr = make_element_by_type<province_view_buildings>(
state,
id);
2188 local_buildings_window = ptr.
get();
2189 ptr->set_visible(
state,
false);
2191 }
else if(
name ==
"national_focus_window") {
2192 auto ptr = make_element_by_type<national_focus_window>(
state,
id);
2193 ptr->set_visible(
state,
false);
2202 if(payload.holds_type<dcon::province_id>()) {
2203 payload.emplace<dcon::province_id>(active_province);
2205 }
else if(payload.holds_type<dcon::nation_id>()) {
2206 dcon::nation_id nid =
dcon::fatten(
state.world, active_province).get_nation_from_province_ownership();
2207 payload.emplace<dcon::nation_id>(nid);
2209 }
else if(payload.holds_type<dcon::state_instance_id>()) {
2210 dcon::state_instance_id sid =
dcon::fatten(
state.world, active_province).get_state_membership();
2211 payload.emplace<dcon::state_instance_id>(sid);
2218 if(
bool(map_province)) {
2219 active_province = map_province;
2237 auto n =
state.world.province_get_nation_from_province_ownership(active_province);
void on_update(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 get(sys::state &state, Cyto::Any &payload) noexcept override
std::string_view get_row_element_name() override
void on_update(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
void add_child_to_front(std::unique_ptr< element_base > child) noexcept final
void impl_on_update(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
virtual message_result impl_set(sys::state &state, Cyto::Any &payload) noexcept
virtual message_result get(sys::state &state, Cyto::Any &payload) noexcept
virtual void impl_on_update(sys::state &state) noexcept
virtual void impl_render(sys::state &state, int32_t x, int32_t y) noexcept
message_result impl_get(sys::state &state, Cyto::Any &payload) noexcept
virtual void on_create(sys::state &state) noexcept
void set_visible(sys::state &state, bool vis)
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 button_action(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
std::unique_ptr< element_base > make_child(sys::state &state, std::string_view name, dcon::gui_def_id id) noexcept override
std::vector< dcon::colonization_id > row_contents
void update(sys::state &state)
message_result get(sys::state &state, Cyto::Any &payload) 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_create(sys::state &state) noexcept override
tooltip_behavior has_tooltip(sys::state &state) noexcept override
void button_action(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
std::vector< sys::dated_modifier > row_contents
void update(sys::state &state)
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 button_action(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
void on_create(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
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
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
dcon::national_identity_id get_current_nation(sys::state &state) noexcept override
tooltip_behavior has_tooltip(sys::state &state) noexcept override
void render(sys::state &state, int32_t x, int32_t y) 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
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 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 update_tooltip(sys::state &state, int32_t x, int32_t t, text::columnar_layout &contents) noexcept override
void render(sys::state &state, int32_t x, int32_t y) noexcept override
tooltip_behavior has_tooltip(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
std::unique_ptr< element_base > make_child(sys::state &state, std::string_view name, dcon::gui_def_id id) noexcept override
void 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 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 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::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_update(sys::state &state) noexcept override
std::string_view get_row_element_name() override
void update_subwindow(sys::state &state, province_modifier_win &subwindow, sys::dated_modifier content) 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 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
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 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
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 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 update_tooltip(sys::state &state, int32_t x, int32_t y, text::columnar_layout &contents) 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 on_update(sys::state &state) noexcept override
std::unique_ptr< element_base > make_child(sys::state &state, std::string_view name, dcon::gui_def_id id) noexcept override
void 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 t, text::columnar_layout &contents) noexcept override
void on_update(sys::state &state) noexcept override
std::unique_ptr< element_base > make_child(sys::state &state, std::string_view name, dcon::gui_def_id id) noexcept override
void on_create(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
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
void on_update(sys::state &state) noexcept override
void on_create(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
message_result get(sys::state &state, Cyto::Any &payload) noexcept override
void set_active_province(sys::state &state, dcon::province_id map_province)
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
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 test_mouse(sys::state &state, int32_t x, int32_t y, mouse_probe_type type) noexcept override
void impl_render(sys::state &state, int32_t x, int32_t y) noexcept override
void on_update(sys::state &state) noexcept override
void set_text(sys::state &state, std::string const &new_text)
message_result test_mouse(sys::state &state, int32_t x, int32_t y, mouse_probe_type type) noexcept override
void on_create(sys::state &state) noexcept override
bool can_begin_factory_building_construction(sys::state &state, dcon::nation_id source, dcon::state_instance_id location, dcon::factory_type_id type, bool is_upgrade)
bool can_begin_province_building_construction(sys::state &state, dcon::nation_id source, dcon::province_id p, economy::province_building_type type)
bool can_set_national_focus(sys::state &state, dcon::nation_id source, dcon::state_instance_id target_state, dcon::national_focus_id focus)
bool can_abandon_colony(sys::state &state, dcon::nation_id source, dcon::province_id pr)
bool can_move_capital(sys::state &state, dcon::nation_id source, dcon::province_id p)
void set_national_focus(sys::state &state, dcon::nation_id source, dcon::state_instance_id target_state, dcon::national_focus_id focus)
bool can_toggle_select_province(sys::state &state, dcon::nation_id source, dcon::province_id prov)
bool can_start_land_unit_construction(sys::state &state, dcon::nation_id source, dcon::province_id location, dcon::culture_id soldier_culture, dcon::unit_type_id type, dcon::province_id template_province)
@ toggle_immigrator_province
@ begin_province_building_construction
bool can_invest_in_colony(sys::state &state, dcon::nation_id source, dcon::province_id p)
bool can_finish_colonization(sys::state &state, dcon::nation_id source, dcon::province_id p)
bool can_toggle_immigrator_province(sys::state &state, dcon::nation_id source, dcon::province_id prov)
bool can_start_naval_unit_construction(sys::state &state, dcon::nation_id source, dcon::province_id location, dcon::unit_type_id type, dcon::province_id template_province)
pop_satisfaction_wrapper_fat fatten(data_container const &c, pop_satisfaction_wrapper_id id) noexcept
constexpr dcon::demographics_key total(0)
dcon::demographics_key to_key(sys::state const &state, dcon::pop_type_id v)
float get_monthly_pop_increase(sys::state &state, dcon::pop_id ids)
construction_status province_building_construction(sys::state &state, dcon::province_id p, province_building_type t)
std::string_view province_building_type_get_name(economy::province_building_type v)
float pop_min_wage_factor(sys::state &state, dcon::nation_id n)
float pop_farmer_min_wage(sys::state &state, dcon::nation_id n, float min_wage_factor)
float pop_laborer_min_wage(sys::state &state, dcon::nation_id n, float min_wage_factor)
constexpr uint32_t build_railway
bool province_is_under_siege(sys::state const &state, dcon::province_id ids)
int32_t regiments_created_from_province(sys::state &state, dcon::province_id p)
int32_t regiments_max_possible_from_province(sys::state &state, dcon::province_id p)
float peacetime_attrition_limit(sys::state &state, dcon::nation_id n, dcon::province_id prov)
int32_t free_colonial_points(sys::state &state, dcon::nation_id n)
auto nation_accepts_culture(sys::state const &state, T ids, U cul_ids)
float direct_distance(sys::state &state, dcon::province_id a, dcon::province_id b)
bool is_colonizing(sys::state &state, dcon::nation_id n, dcon::state_definition_id d)
void for_each_province_in_state_instance(sys::state &state, dcon::state_instance_id s, F const &func)
float crime_fighting_efficiency(sys::state &state, dcon::province_id id)
bool has_railroads_being_built(sys::state &state, dcon::province_id id)
float land_maximum_employment(sys::state &state, dcon::province_id id)
float land_employment(sys::state &state, dcon::province_id id)
constexpr float world_circumference
float revolt_risk(sys::state &state, dcon::province_id id)
float state_admin_efficiency(sys::state &state, dcon::state_instance_id id)
std::string rebel_name(sys::state &state, dcon::rebel_faction_id reb)
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_ratio(int32_t left, int32_t right)
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)
std::string prettify(int64_t num)
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)
dcon::text_key get_adjective(sys::state &state, dcon::nation_id id)
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 format_percentage(float num, size_t digits)
void add_space_to_layout_box(sys::state &state, layout_base &dest, layout_box &box)
void close_layout_box(columnar_layout &dest, layout_box &box)
uint16_t * recurse_over_triggers(uint16_t *source, T const &f)
void modifier_description(sys::state &state, text::layout_base &layout, dcon::modifier_id mid, int32_t indentation=0)
std::variant< std::monostate, dcon::nation_id, dcon::state_instance_id, dcon::province_id > pop_list_filter
void open_build_foreign_factory(sys::state &state, dcon::state_instance_id st)
void province_owner_rgo_draw_tooltip(sys::state &state, text::columnar_layout &contents, dcon::province_id prov_id) noexcept
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)
static constexpr uint32_t set_size
static constexpr uint32_t modifier_definition_size
element_type get_element_type() const
union ui::element_data::internal_data data
dcon::gfx_object_id gfx_object
element_base * topbar_subwindow
std::unique_ptr< element_base > root
element_base * province_window
element_base * population_subwindow
element_base * build_province_unit_window