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{};
277 dcon::province_id province_id = retrieve<dcon::province_id>(
state,
parent);
279 auto controller = prov_fat.get_province_control_as_province().get_nation();
280 auto rebel_faction = prov_fat.get_province_rebel_control_as_province().get_rebel_faction();
288 dcon::province_id province_id = retrieve<dcon::province_id>(
state,
parent);
290 auto controller = prov_fat.get_province_control_as_province().get_nation();
291 auto rebel_faction = prov_fat.get_province_rebel_control_as_province().get_rebel_faction();
292 if(!controller && !rebel_faction)
302 dcon::province_id province_id = retrieve<dcon::province_id>(
state,
parent);
304 auto controller = prov_fat.get_province_control_as_province().get_nation();
305 auto rebel_faction = prov_fat.get_province_rebel_control_as_province().get_rebel_faction();
306 if(!controller && !rebel_faction)
323 auto content = retrieve<dcon::state_instance_id>(
state,
parent);
324 if(
state.world.state_instance_get_nation_from_flashpoint_focus(content) ==
state.local_player_nation)
325 return state.world.national_focus_get_icon(
state.national_definitions.flashpoint_focus) - 1;
326 return bool(
state.world.state_instance_get_owner_focus(content).id)
327 ?
state.world.state_instance_get_owner_focus(content).get_icon() - 1
332 auto content = retrieve<dcon::state_instance_id>(
state,
parent);
334 for(
auto nfid :
state.world.in_national_focus) {
337 if(
state.world.state_instance_get_nation_from_flashpoint_focus(content) ==
state.local_player_nation)
344 auto content = retrieve<dcon::state_instance_id>(
state,
parent);
354 auto sid = retrieve<dcon::state_instance_id>(
state,
parent);
358 auto content =
state.world.state_instance_get_owner_focus(sid);
364 if(fat_nf.get_promotion_type()) {
366 if(fat_nf.get_promotion_type() ==
state.culture_definitions.clergy) {
370 }
else if(fat_nf.get_promotion_type() ==
state.culture_definitions.bureaucrat) {
380 if(
auto mid =
state.world.national_focus_get_modifier(content); mid) {
404 auto p = retrieve<dcon::province_id>(
state,
parent);
405 auto n =
state.world.province_get_nation_from_province_ownership(p);
409 if(
auto desc =
state.world.modifier_get_desc(mod.
mod_id);
state.key_is_localized(desc)) {
432 if(
name ==
"modifier") {
433 return make_element_by_type<province_modifier_icon>(
state,
id);
452 return "prov_state_modifier";
455 subwindow.
mod = content;
460 auto prov = retrieve<dcon::province_id>(
state,
parent);
462 for(
auto mods :
state.world.province_get_current_modifiers(prov)) {
473 auto p = retrieve<dcon::province_id>(
state,
parent);
478 auto p = retrieve<dcon::province_id>(
state,
parent);
487 auto source =
state.local_player_nation;
488 auto p = retrieve<dcon::province_id>(
state,
parent);
507 if(
state.defines.alice_allow_revoke_subject_states == 0.0f) {
511 auto p = retrieve<dcon::province_id>(
state,
parent);
516 auto p = retrieve<dcon::province_id>(
state,
parent);
518 auto owner = fid.get_nation_from_province_ownership();
520 if(owner !=
state.local_player_nation) {
528 auto p = retrieve<dcon::province_id>(
state,
parent);
537 auto source =
state.local_player_nation;
538 auto p = retrieve<dcon::province_id>(
state,
parent);
541 auto owner = fid.get_nation_from_province_ownership();
542 auto rel =
state.world.nation_get_overlord_as_subject(owner);
543 auto overlord =
state.world.overlord_get_ruler(rel);
581 auto p = retrieve<dcon::province_id>(
state,
parent);
586 auto p = retrieve<dcon::province_id>(
state,
parent);
588 auto owner = fid.get_nation_from_province_ownership();
590 if(owner ==
state.local_player_nation) {
598 auto p = retrieve<dcon::province_id>(
state,
parent);
607 auto source =
state.local_player_nation;
608 auto p = retrieve<dcon::province_id>(
state,
parent);
620 if(
name ==
"state_name") {
621 return make_element_by_type<province_state_name_text>(
state,
id);
622 }
else if(
name ==
"province_name") {
623 return make_element_by_type<generic_name_text<dcon::province_id>>(
state, id);
624 }
else if(
name ==
"prov_terrain") {
625 return make_element_by_type<province_terrain_image>(
state,
id);
626 }
else if(
name ==
"province_modifiers") {
627 return make_element_by_type<province_modifiers>(
state,
id);
628 }
else if(
name ==
"slave_state_icon") {
629 auto ptr = make_element_by_type<fixed_pop_type_icon>(
state,
id);
630 slave_icon = ptr.
get();
631 ptr->set_type(
state,
state.culture_definitions.slaves);
633 }
else if(
name ==
"admin_icon") {
634 auto ptr = make_element_by_type<fixed_pop_type_icon>(
state,
id);
635 ptr->set_type(
state,
state.culture_definitions.bureaucrat);
637 }
else if(
name ==
"owner_icon") {
638 auto ptr = make_element_by_type<fixed_pop_type_icon>(
state,
id);
639 ptr->set_type(
state,
state.culture_definitions.aristocrat);
641 }
else if(
name ==
"controller_flag") {
642 return make_element_by_type<province_controller_flag>(
state,
id);
643 }
else if(
name ==
"flashpoint_indicator") {
644 return make_element_by_type<province_flashpoint_indicator>(
state,
id);
645 }
else if(
name ==
"occupation_progress") {
646 return make_element_by_type<invisible_element>(
state,
id);
647 }
else if(
name ==
"occupation_icon") {
648 return make_element_by_type<invisible_element>(
state,
id);
649 }
else if(
name ==
"occupation_flag") {
650 return make_element_by_type<invisible_element>(
state,
id);
651 }
else if(
name ==
"colony_button") {
652 auto btn = make_element_by_type<province_colony_button>(
state,
id);
653 colony_button = btn.
get();
655 }
else if(
name ==
"alice_move_capital") {
656 return make_element_by_type<province_move_capital_button>(
state,
id);
657 }
else if(
name ==
"alice_take_province") {
658 return make_element_by_type<province_take_province_button>(
state,
id);
659 }
else if(
name ==
"alice_grant_province") {
660 return make_element_by_type<province_grant_province_button>(
state,
id);
661 }
else if(
name ==
"national_focus") {
662 return make_element_by_type<province_national_focus_button>(
state,
id);
663 }
else if(
name ==
"admin_efficiency") {
664 return make_element_by_type<state_admin_efficiency_text>(
state,
id);
665 }
else if(
name ==
"owner_presence") {
666 return make_element_by_type<state_aristocrat_presence_text>(
state,
id);
667 }
else if(
name ==
"liferating") {
668 return make_element_by_type<province_liferating>(
state,
id);
675 dcon::province_id prov_id = retrieve<dcon::province_id>(
state,
parent);
694 fat_id.for_each_core_as_province([&](dcon::core_id core_id) {
696 auto identity = core_fat_id.get_identity();
708template<economy::province_building_type Value>
712 auto prov_id = retrieve<dcon::province_id>(
state,
parent);
717template<economy::province_building_type Value>
721 auto content = retrieve<dcon::province_id>(
state,
parent);
726 auto content = retrieve<dcon::province_id>(
state,
parent);
733 auto pid = retrieve<dcon::province_id>(
state,
parent);
734 auto si =
state.world.province_get_state_membership(pid);
744 auto content = retrieve<dcon::province_id>(
state,
parent);
745 auto within_nation =
state.world.province_get_nation_from_province_ownership(content);
746 for(
auto p :
state.world.nation_get_province_ownership(within_nation)) {
757 auto id = retrieve<dcon::province_id>(
state,
parent);
759 int32_t current_lvl =
state.world.province_get_building_level(
id,
uint8_t(Value));
760 int32_t max_local_lvl =
state.world.nation_get_max_building_level(
state.local_player_nation,
uint8_t(Value));
765 int32_t min_build = int32_t(
state.world.province_get_modifier_values(
id, sys::provincial_mod_offsets::min_build_fort));
773 int32_t min_build = int32_t(
state.world.province_get_modifier_values(
id, sys::provincial_mod_offsets::min_build_naval_base));
775 auto si =
state.world.province_get_state_membership(
id);
784 auto rules =
state.world.nation_get_combined_issue_rules(
state.local_player_nation);
787 int32_t min_build = 0;
789 min_build = int32_t(
state.world.province_get_modifier_values(
id, sys::provincial_mod_offsets::min_build_railroad));
791 min_build = int32_t(
state.world.province_get_modifier_values(
id, sys::provincial_mod_offsets::min_build_bank));
793 min_build = int32_t(
state.world.province_get_modifier_values(
id, sys::provincial_mod_offsets::min_build_university));
802template<economy::province_building_type Value>
811 auto content = retrieve<dcon::province_id>(
state,
parent);
821 auto prov = retrieve<dcon::province_id>(
state,
parent);
823 for(
auto pb_con :
state.world.province_get_province_building_construction(prov)) {
824 if(pb_con.get_type() ==
uint8_t(Value)) {
825 auto&
goods =
state.economy_definitions.building_definitions[int32_t(Value)].cost;
826 auto& cgoods = pb_con.get_purchased_goods();
828 float admin_eff =
state.world.nation_get_administrative_efficiency(pb_con.get_nation());
829 float admin_cost_factor = pb_con.get_is_pop_project() ? 1.0f : 2.0f - admin_eff;
832 if(
goods.commodity_type[i]) {
835 auto cid =
goods.commodity_type[i];
836 std::string padding = cid.index() < 10 ?
"0" :
"";
837 std::string description =
"@$" + padding + std::to_string(cid.index());
855template<economy::province_building_type Value>
862 std::string get_icon_name()
noexcept {
865 return "build_icon0";
867 return "build_icon1";
869 return "build_icon2";
871 return "build_icon3";
873 return "build_icon4";
875 return "build_icon0";
879 bool is_being_built(
sys::state&
state, dcon::province_id
id)
noexcept {
880 for(
auto pb :
state.world.province_get_province_building_construction(
id))
888 if(
name == get_icon_name()) {
889 return make_element_by_type<province_building_icon<Value>>(
state, id);
890 }
else if(
name ==
"underconstruction_icon") {
891 auto ptr = make_element_by_type<image_element_base>(
state,
id);
892 under_construction_icon = ptr.
get();
894 }
else if(
name ==
"building_progress") {
895 auto ptr = make_element_by_type<province_building_progress<Value>>(
state, id);
896 building_progress = ptr.
get();
898 }
else if(
name ==
"expand_text") {
899 auto ptr = make_element_by_type<simple_text_element_base>(
state,
id);
900 expanding_text = ptr.
get();
902 }
else if(
name ==
"expand") {
903 auto ptr = make_element_by_type<province_building_expand_button<Value>>(
state, id);
904 expand_button = ptr.
get();
906 }
else if(
name ==
"description") {
907 auto ptr = make_element_by_type<simple_text_element_base>(
state,
id);
910 }
else if(
name.substr(0, 10) ==
"build_icon") {
911 return make_element_by_type<invisible_element>(
state,
id);
918 auto content = retrieve<dcon::province_id>(
state,
parent);
932 auto p = retrieve<dcon::province_id>(
state,
parent);
936 for(
auto m :
state.world.province_get_current_modifiers(p)) {
937 if(m.mod_id ==
state.economy_definitions.selector_modifier) {
950 auto content = retrieve<dcon::province_id>(
state,
parent);
954 auto pid = retrieve<dcon::province_id>(
state,
parent);
955 auto si =
state.world.province_get_state_membership(pid);
966 auto p = retrieve<dcon::province_id>(
state,
parent);
968 for(
auto m :
state.world.province_get_current_modifiers(p)) {
969 if(m.mod_id ==
state.economy_definitions.selector_modifier) {
979 if(
name ==
"underconstruction_icon"
980 ||
name ==
"building_progress"
981 ||
name ==
"expand_text") {
982 return make_element_by_type<invisible_element>(
state,
id);
983 }
else if(
name ==
"expand") {
984 return make_element_by_type<province_selector_button>(
state,
id);
985 }
else if(
name ==
"description") {
986 auto ptr = make_element_by_type<simple_text_element_base>(
state,
id);
989 }
else if(
name.substr(0, 10) ==
"build_icon") {
990 int32_t value =
name[10] -
'0';
991 int32_t num_buildings = 0;
992 for(
auto& def :
state.economy_definitions.building_definitions) {
996 if(value == num_buildings) {
997 return make_element_by_type<province_selector_image>(
state,
id);
999 return make_element_by_type<invisible_element>(
state,
id);
1012 auto p = retrieve<dcon::province_id>(
state,
parent);
1016 for(
auto m :
state.world.province_get_current_modifiers(p)) {
1017 if(m.mod_id ==
state.economy_definitions.immigrator_modifier) {
1030 auto content = retrieve<dcon::province_id>(
state,
parent);
1034 auto pid = retrieve<dcon::province_id>(
state,
parent);
1035 auto si =
state.world.province_get_state_membership(pid);
1046 auto p = retrieve<dcon::province_id>(
state,
parent);
1048 for(
auto m :
state.world.province_get_current_modifiers(p)) {
1049 if(m.mod_id ==
state.economy_definitions.immigrator_modifier) {
1059 if(
name ==
"underconstruction_icon"
1060 ||
name ==
"building_progress"
1061 ||
name ==
"expand_text") {
1062 return make_element_by_type<invisible_element>(
state,
id);
1063 }
else if(
name ==
"expand") {
1064 return make_element_by_type<province_immigrator_button>(
state,
id);
1065 }
else if(
name ==
"description") {
1066 auto ptr = make_element_by_type<simple_text_element_base>(
state,
id);
1069 }
else if(
name.substr(0, 10) ==
"build_icon") {
1070 int32_t value =
name[10] -
'0';
1071 int32_t num_buildings = 0;
1072 for(
auto& def :
state.economy_definitions.building_definitions) {
1076 if(value == num_buildings + 1) {
1077 return make_element_by_type<province_immigrator_image>(
state,
id);
1079 return make_element_by_type<invisible_element>(
state,
id);
1089 auto content = retrieve<dcon::province_id>(
state,
parent);
1093 auto pid = retrieve<dcon::province_id>(
state,
parent);
1094 auto si =
state.world.province_get_state_membership(pid);
1102 auto pid = retrieve<dcon::province_id>(
state,
parent);
1103 auto n =
state.world.province_get_nation_from_province_ownership(pid);
1104 for(
auto p :
state.world.nation_get_province_ownership(n)) {
1109 auto content = retrieve<dcon::province_id>(
state,
parent);
1122template<economy::province_building_type Value>
1156 auto content = retrieve<dcon::province_id>(
state,
parent);
1164 auto content = retrieve<dcon::province_id>(
state,
parent);
1170 for(
auto ft :
state.world.in_factory_type) {
1172 state.world.province_get_state_membership(content), ft,
false)) {
1184 auto province_id = retrieve<dcon::province_id>(
state,
parent);
1195 auto prov = retrieve<dcon::province_id>(
state,
parent);
1203 if(
name ==
"building_progress") {
1204 return make_element_by_type<rr_investment_progress>(
state,
id);
1210 auto prov = retrieve<dcon::province_id>(
state,
parent);
1216 auto prov = retrieve<dcon::province_id>(
state,
parent);
1232 if(
name ==
"country_name") {
1233 return make_element_by_type<generic_name_text<dcon::nation_id>>(
state, id);
1234 }
else if(
name ==
"country_flag") {
1235 auto ptr = make_element_by_type<province_country_flag_button>(
state,
id);
1236 country_flag_button = ptr.
get();
1238 }
else if(
name ==
"country_gov") {
1239 return make_element_by_type<nation_government_type_text>(
state,
id);
1240 }
else if(
name ==
"country_party") {
1241 return make_element_by_type<nation_ruling_party_text>(
state,
id);
1242 }
else if(
name ==
"country_prestige") {
1243 return make_element_by_type<nation_prestige_text>(
state,
id);
1244 }
else if(
name ==
"country_economic") {
1245 return make_element_by_type<nation_industry_score_text>(
state,
id);
1246 }
else if(
name ==
"country_military") {
1247 return make_element_by_type<nation_military_score_text>(
state,
id);
1248 }
else if(
name ==
"country_total") {
1249 return make_element_by_type<nation_total_score_text>(
state,
id);
1250 }
else if(
name ==
"selected_prestige_rank") {
1251 return make_element_by_type<nation_prestige_rank_text>(
state,
id);
1252 }
else if(
name ==
"selected_industry_rank") {
1253 return make_element_by_type<nation_industry_rank_text>(
state,
id);
1254 }
else if(
name ==
"selected_military_rank") {
1255 return make_element_by_type<nation_military_rank_text>(
state,
id);
1256 }
else if(
name ==
"selected_total_rank") {
1257 return make_element_by_type<nation_rank_text>(
state,
id);
1258 }
else if(
name ==
"country_status") {
1259 return make_element_by_type<nation_status_text>(
state,
id);
1260 }
else if(
name ==
"country_flag_overlay") {
1261 return make_element_by_type<nation_flag_frame>(
state,
id);
1262 }
else if(
name ==
"total_population") {
1263 return make_element_by_type<province_population>(
state,
id);
1264 }
else if(
name ==
"sphere_label") {
1265 return make_element_by_type<nation_sphere_list_label>(
state,
id);
1266 }
else if(
name ==
"puppet_label") {
1267 return make_element_by_type<nation_puppet_list_label>(
state,
id);
1268 }
else if(
name ==
"our_relation") {
1269 return make_element_by_type<nation_player_relations_text>(
state,
id);
1270 }
else if(
name ==
"workforce_chart") {
1271 auto ptr = make_element_by_type<workforce_piechart<dcon::province_id>>(
state, id);
1272 workforce_chart = ptr.
get();
1274 }
else if(
name ==
"ideology_chart") {
1275 auto ptr = make_element_by_type<ideology_piechart<dcon::province_id>>(
state, id);
1276 ideology_chart = ptr.
get();
1278 }
else if(
name ==
"culture_chart") {
1279 auto ptr = make_element_by_type<culture_piechart<dcon::province_id>>(
state, id);
1280 culture_chart = ptr.
get();
1282 }
else if(
name ==
"goods_type") {
1283 return make_element_by_type<province_rgo>(
state,
id);
1284 }
else if(
name ==
"build_icon_fort") {
1285 return make_element_by_type<province_view_foreign_building_icon<economy::province_building_type::fort>>(
state, id);
1286 }
else if(
name ==
"build_icon_navalbase") {
1287 return make_element_by_type<province_view_foreign_building_icon<economy::province_building_type::naval_base>>(
state, id);
1288 }
else if(
name ==
"build_icon_infra") {
1289 return make_element_by_type<province_view_foreign_building_icon<economy::province_building_type::railroad>>(
state, id);
1290 }
else if(
name ==
"build_icon_bank") {
1291 return make_element_by_type<province_view_foreign_building_icon<economy::province_building_type::bank>>(
state, id);
1292 }
else if(
name ==
"build_icon_university") {
1293 return make_element_by_type<province_view_foreign_building_icon<economy::province_building_type::university>>(
state, id);
1294 }
else if(
name ==
"infra_progress_win") {
1295 return make_element_by_type<rr_invest_inwdow>(
state,
id);
1296 }
else if(
name ==
"invest_build_infra") {
1297 return make_element_by_type<province_invest_railroad_button>(
state,
id);
1298 }
else if(
name ==
"invest_factory_button") {
1299 return make_element_by_type<province_invest_factory_button>(
state,
id);
1300 }
else if(
name ==
"sphere_targets") {
1301 return make_element_by_type<overlapping_sphere_flags>(
state,
id);
1302 }
else if(
name ==
"puppet_targets") {
1303 return make_element_by_type<overlapping_puppet_flags>(
state,
id);
1304 }
else if(
name ==
"allied_targets") {
1305 return make_element_by_type<overlapping_ally_flags>(
state,
id);
1306 }
else if(
name ==
"war_targets") {
1307 return make_element_by_type<overlapping_enemy_flags>(
state,
id);
1308 }
else if(
name ==
"send_diplomat") {
1309 return make_element_by_type<province_send_diplomat_button>(
state,
id);
1310 }
else if(
name ==
"core_icons") {
1311 return make_element_by_type<province_core_flags>(
state,
id);
1312 }
else if(
name ==
"supply_limit") {
1313 return make_element_by_type<province_supply_limit_text>(
state,
id);
1314 }
else if (
name ==
"selected_military_icon") {
1315 auto ptr = make_element_by_type<military_score_icon>(
state,
id);
1317 }
else if(
name ==
"rallypoint_checkbox") {
1318 return make_element_by_type<land_rally_point>(
state,
id);
1319 }
else if(
name ==
"rallypoint_checkbox_naval") {
1320 return make_element_by_type<naval_rally_point>(
state,
id);
1321 }
else if(
name ==
"rallypoint_merge_checkbox" ||
name ==
"rallypoint_merge_checkbox_naval") {
1322 return make_element_by_type<merge_rally_point>(
state,
id);
1329 auto prov_id = retrieve<dcon::province_id>(
state,
parent);
1331 auto nation_id = fat_id.get_nation_from_province_ownership();
1332 if(!
bool(nation_id) || nation_id.id ==
state.local_player_nation) {
1352 auto prov_id = retrieve<dcon::province_id>(
state,
parent);
1363 auto prov_id = retrieve<dcon::province_id>(
state,
parent);
1374 auto prov_id = retrieve<dcon::province_id>(
state,
parent);
1385 frame = int32_t(10.f * employment_ratio);
1391 auto prov_id = retrieve<dcon::province_id>(
state,
parent);
1392 auto owner =
state.world.province_get_nation_from_province_ownership(prov_id);
1411 auto prov_id = retrieve<dcon::province_id>(
state,
parent);
1413 frame = fat_id.get_crime().index() + 1;
1427 auto province_id = retrieve<dcon::province_id>(
state,
parent);
1429 auto crime_id = fat_id.get_crime();
1452 auto province_id = retrieve<dcon::province_id>(
state,
parent);
1474 auto content = retrieve<dcon::province_id>(
state,
parent);
1482 auto province_id = retrieve<dcon::province_id>(
state,
parent);
1489 auto content = retrieve<dcon::province_id>(
state,
parent);
1500 auto province_id = retrieve<dcon::province_id>(
state,
parent);
1507 auto content = retrieve<dcon::province_id>(
state,
parent);
1528 auto province_id = retrieve<dcon::province_id>(
state,
parent);
1529 auto migration =
state.world.province_get_daily_net_migration(province_id);
1530 auto immigration =
state.world.province_get_daily_net_immigration(province_id);
1537 auto content = retrieve<dcon::province_id>(
state,
parent);
1540 if(
state.world.province_get_is_colonial(content)) {
1550 auto province_id = retrieve<dcon::province_id>(
state,
parent);
1557 auto content = retrieve<dcon::province_id>(
state,
parent);
1566 auto province_id = retrieve<dcon::province_id>(
state,
parent);
1581 if(
name ==
"goods_type") {
1582 return make_element_by_type<province_owner_rgo>(
state,
id);
1583 }
else if(
name ==
"open_popscreen") {
1584 return make_element_by_type<province_pop_button>(
state,
id);
1585 }
else if(
name ==
"total_population") {
1586 return make_element_by_type<province_population>(
state,
id);
1587 }
else if(
name ==
"workforce_chart") {
1588 auto ptr = make_element_by_type<workforce_piechart<dcon::province_id>>(
state, id);
1589 workforce_chart = ptr.
get();
1591 }
else if(
name ==
"ideology_chart") {
1592 auto ptr = make_element_by_type<ideology_piechart<dcon::province_id>>(
state, id);
1593 ideology_chart = ptr.
get();
1595 }
else if(
name ==
"culture_chart") {
1596 auto ptr = make_element_by_type<culture_piechart<dcon::province_id>>(
state, id);
1597 culture_chart = ptr.
get();
1599 }
else if(
name ==
"core_icons") {
1600 return make_element_by_type<province_core_flags>(
state,
id);
1601 }
else if(
name ==
"supply_limit") {
1602 return make_element_by_type<province_supply_limit_text>(
state,
id);
1603 }
else if(
name ==
"crime_icon") {
1604 return make_element_by_type<province_crime_icon>(
state,
id);
1605 }
else if(
name ==
"crime_name") {
1606 return make_element_by_type<province_crime_name_text>(
state,
id);
1607 }
else if(
name ==
"crimefight_percent") {
1608 return make_element_by_type<province_crime_fighting_text>(
state,
id);
1609 }
else if(
name ==
"rebel_percent") {
1610 return make_element_by_type<province_rebel_percent_text>(
state,
id);
1611 }
else if(
name ==
"employment_ratio") {
1612 return make_element_by_type<province_rgo_employment_progress_icon>(
state,
id);
1613 }
else if(
name ==
"rgo_population") {
1614 return make_element_by_type<province_rgo_workers_text>(
state,
id);
1615 }
else if(
name ==
"rgo_percent") {
1616 return make_element_by_type<province_rgo_employment_percent_text>(
state,
id);
1617 }
else if(
name ==
"produced") {
1618 return make_element_by_type<province_owner_goods_produced_text>(
state,
id);
1619 }
else if(
name ==
"income") {
1620 return make_element_by_type<province_owner_income_text>(
state,
id);
1621 }
else if(
name ==
"growth") {
1622 return make_element_by_type<province_pop_growth_text>(
state,
id);
1623 }
else if(
name ==
"migration") {
1624 return make_element_by_type<province_migration_text>(
state,
id);
1625 }
else if(
name ==
"build_factory_button") {
1626 return make_element_by_type<province_build_new_factory>(
state,
id);
1633 auto prov_id = retrieve<dcon::province_id>(
state,
parent);
1635 auto nation_id = fat_id.get_nation_from_province_ownership();
1636 if(
bool(nation_id) && nation_id.id ==
state.local_player_nation) {
1653 auto p = retrieve<dcon::province_id>(
state,
parent);
1655 if(pop.get_pop().get_poptype() ==
state.culture_definitions.soldiers) {
1656 auto lcs = pop.get_pop().get_province_land_construction();
1657 for(
const auto lc : lcs) {
1658 auto& base_cost =
state.military_definitions.unit_base_definitions[lc.get_type()].build_cost;
1659 auto& current_purchased = lc.get_purchased_goods();
1661 if(base_cost.commodity_type[i]) {
1662 amount += current_purchased.commodity_amounts[i];
1663 total += base_cost.commodity_amounts[i];
1682 auto p = retrieve<dcon::province_id>(
state,
parent);
1683 auto ncs =
state.world.province_get_province_naval_construction(p);
1684 for(
auto nc : ncs) {
1685 auto& base_cost =
state.military_definitions.unit_base_definitions[nc.get_type()].build_cost;
1686 auto& current_purchased = nc.get_purchased_goods();
1688 if(base_cost.commodity_type[i]) {
1689 amount += current_purchased.commodity_amounts[i];
1690 total += base_cost.commodity_amounts[i];
1707 auto p = retrieve<dcon::province_id>(
state,
parent);
1709 if(pop.get_pop().get_poptype() ==
state.culture_definitions.soldiers) {
1710 auto lcs = pop.get_pop().get_province_land_construction();
1711 for(
const auto lc : lcs) {
1712 auto& base_cost =
state.military_definitions.unit_base_definitions[lc.get_type()].build_cost;
1713 auto& current_purchased = lc.get_purchased_goods();
1715 if(base_cost.commodity_type[i]) {
1716 amount += current_purchased.commodity_amounts[i];
1717 total += base_cost.commodity_amounts[i];
1733 auto p = retrieve<dcon::province_id>(
state,
parent);
1734 auto ncs =
state.world.province_get_province_naval_construction(p);
1735 for(
auto nc : ncs) {
1736 auto& base_cost =
state.military_definitions.unit_base_definitions[nc.get_type()].build_cost;
1737 auto& current_purchased = nc.get_purchased_goods();
1739 if(base_cost.commodity_type[i]) {
1740 amount += current_purchased.commodity_amounts[i];
1741 total += base_cost.commodity_amounts[i];
1758 auto p = retrieve<dcon::province_id>(
state,
parent);
1759 for(
uint8_t i = 2; i <
state.military_definitions.unit_base_definitions.size(); i++) {
1760 auto utid = dcon::unit_type_id(i);
1761 auto const& def =
state.military_definitions.unit_base_definitions[utid];
1762 if(!def.active && !
state.world.nation_get_active_unit(
state.local_player_nation, utid))
1764 if(def.is_land != std::is_same_v<T, dcon::army_id>)
1766 if constexpr(std::is_same_v<T, dcon::army_id>) {
1767 for(
const auto c :
state.world.in_culture) {
1769 for(
auto pl :
state.world.province_get_pop_location_as_province(p)) {
1770 if(pl.get_pop().get_culture() == c) {
1771 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) {
1779 for(
auto pl :
state.world.province_get_pop_location_as_province(p)) {
1780 auto lc = pl.get_pop().get_province_land_construction();
1781 if(lc.begin() != lc.end()) {
1801 Cyto::Any payload = Cyto::any_cast<T>(T{});
1811 int16_t y_offset = 1;
1813 auto ptr = make_element_by_type<province_building_window<economy::province_building_type::fort>>(
state,
"building");
1814 ptr->base_data.position.y = y_offset;
1819 auto ptr = make_element_by_type<province_building_window<economy::province_building_type::naval_base>>(
state,
"building");
1820 ptr->base_data.position.y = y_offset;
1825 auto ptr = make_element_by_type<province_building_window<economy::province_building_type::railroad>>(
state,
"building");
1826 ptr->base_data.position.y = y_offset;
1831 auto ptr = make_element_by_type<province_building_window<economy::province_building_type::bank>>(
state,
"building");
1832 ptr->base_data.position.y = y_offset;
1837 auto ptr = make_element_by_type<province_building_window<economy::province_building_type::university>>(
state,
"building");
1838 ptr->base_data.position.y = y_offset;
1842 if(
bool(
state.economy_definitions.selector_modifier)) {
1843 auto ptr = make_element_by_type<province_selector_window>(
state,
"building");
1844 ptr->base_data.position.y = y_offset;
1848 if(
bool(
state.economy_definitions.immigrator_modifier)) {
1849 auto ptr = make_element_by_type<province_immigrator_window>(
state,
"building");
1850 ptr->base_data.position.y = y_offset;
1857 if(
name ==
"army_size") {
1858 return make_element_by_type<province_army_size_text>(
state,
id);
1859 }
else if(
name ==
"army_progress") {
1860 return make_element_by_type<province_army_progress>(
state,
id);
1861 }
else if(
name ==
"navy_progress") {
1862 return make_element_by_type<province_navy_progress>(
state,
id);
1863 }
else if(
name ==
"rallypoint_checkbox") {
1864 return make_element_by_type<land_rally_point>(
state,
id);
1865 }
else if(
name ==
"rallypoint_checkbox_naval") {
1866 return make_element_by_type<naval_rally_point>(
state,
id);
1867 }
else if(
name ==
"rallypoint_merge_checkbox" ||
name ==
"rallypoint_merge_checkbox_naval") {
1868 return make_element_by_type<merge_rally_point>(
state,
id);
1869 }
else if(
name ==
"build_army") {
1870 return make_element_by_type<province_build_unit<dcon::army_id>>(
state, id);
1871 }
else if(
name ==
"build_navy") {
1872 return make_element_by_type<province_build_unit<dcon::navy_id>>(
state, id);
1873 }
else if(
name ==
"army_text") {
1874 return make_element_by_type<province_army_progress_text>(
state,
id);
1875 }
else if(
name ==
"navy_text") {
1876 return make_element_by_type<province_navy_progress_text>(
state,
id);
1883 auto prov_id = retrieve<dcon::province_id>(
state,
parent);
1885 auto nation_id = fat_id.get_nation_from_province_ownership();
1886 if(
bool(nation_id) && nation_id.id ==
state.local_player_nation) {
1897 auto content = retrieve<dcon::province_id>(
state,
parent);
1900 state.map_state.set_selected_province(dcon::province_id{});
1904 auto content = retrieve<dcon::province_id>(
state,
parent);
1912 auto content = retrieve<dcon::province_id>(
state,
parent);
1917 auto content = retrieve<dcon::province_id>(
state,
parent);
1925 auto content = retrieve<dcon::province_id>(
state,
parent);
1930 auto content = retrieve<dcon::province_id>(
state,
parent);
1940 auto sdef =
state.world.province_get_state_from_abstract_state_membership(
province);
1941 auto col = retrieve<dcon::colonization_id>(
state,
parent);
1947 auto first_wg =
state.crisis_attacker_wargoals.at(0);
1953 bool war_participant =
false;
1954 for(
auto par :
state.world.war_get_war_participant(
state.crisis_war)) {
1955 if(par.get_nation() ==
state.local_player_nation)
1956 war_participant =
true;
1960 float max_life_rating = -1.0f;
1961 for(
auto p :
state.world.state_definition_get_abstract_state_membership(sdef)) {
1962 if(!p.get_province().get_nation_from_province_ownership()) {
1963 max_life_rating = std::max(max_life_rating,
float(p.get_province().get_life_rating()));
1968 state.defines.colonial_liferating +
state.world.nation_get_modifier_values(
state.local_player_nation, sys::national_mod_offsets::colonial_life_rating) <= max_life_rating,
1969 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)),
1974 auto colonizers =
state.world.state_definition_get_colonization(sdef);
1975 auto num_colonizers = colonizers.end() - colonizers.begin();
1979 bool adjacent = [&]() {
1980 for(
auto p :
state.world.state_definition_get_abstract_state_membership(sdef)) {
1981 if(!p.get_province().get_nation_from_province_ownership()) {
1982 for(
auto adj : p.get_province().get_province_adjacency()) {
1983 auto indx = adj.get_connected_provinces(0) != p.get_province() ? 0 : 1;
1984 auto o = adj.get_connected_provinces(indx).get_nation_from_province_ownership();
1985 if(o ==
state.local_player_nation)
1987 if(o.get_overlord_as_subject().get_ruler() ==
state.local_player_nation)
1995 bool reachable_by_sea =
false;
1997 dcon::province_id coastal_target = [&]() {
1998 for(
auto p :
state.world.state_definition_get_abstract_state_membership(sdef)) {
1999 if(!p.get_province().get_nation_from_province_ownership()) {
2000 if(p.get_province().get_is_coast())
2001 return p.get_province().id;
2004 return dcon::province_id{};
2007 if(!adjacent && coastal_target &&
state.world.nation_get_central_ports(
state.local_player_nation) != 0) {
2008 for(
auto p :
state.world.nation_get_province_ownership(
state.local_player_nation)) {
2011 reachable_by_sea =
true;
2021 auto required_points = int32_t(
state.defines.colonization_interest_cost_initial + (adjacent ?
state.defines.colonization_interest_cost_neighbor_modifier : 0.0f));
2029 auto first_wg =
state.crisis_attacker_wargoals.at(0);
2032 bool war_participant =
false;
2033 for(
auto par :
state.world.war_get_war_participant(
state.crisis_war)) {
2034 if(par.get_nation() ==
state.local_player_nation)
2035 war_participant =
true;
2039 auto crange =
state.world.state_definition_get_colonization(sdef);
2040 auto last_investment =
state.world.colonization_get_last_investment(col);
2042 if(crange.end() - crange.begin() <= 1) {
2051 int32_t point_cost = 0;
2052 if(
state.world.state_definition_get_colonization_stage(sdef) == 1) {
2053 point_cost = int32_t(
state.defines.colonization_interest_cost);
2054 }
else if(
state.world.colonization_get_level(col) <= 4) {
2055 point_cost = int32_t(
state.defines.colonization_influence_cost);
2057 point_cost = int32_t(
state.defines.colonization_extra_guard_cost * (
state.world.colonization_get_level(col) - 4) +
state.defines.colonization_influence_cost);
2072 if(
name ==
"progress_icon") {
2073 auto ptr = make_element_by_type<image_element_base>(
state,
id);
2074 progressicon = ptr.
get();
2076 }
else if(
name ==
"progress_button") {
2077 auto ptr = make_element_by_type<colony_invest_button>(
state,
id);
2078 investbutton = ptr.
get();
2101 return "level_entry";
2106 auto content = retrieve<dcon::colonization_id>(
state,
parent);
2114 auto stage =
state.world.state_definition_get_colonization_stage(
state.world.province_get_state_from_abstract_state_membership(
province));
2124 }
else if(fat_colony.get_colonizer() ==
state.local_player_nation) {
2126 for(; i < 4 && i < int32_t(fat_colony.get_level()); ++i) {
2131 for(int8_t i = 0; i < 5 && i < int32_t(fat_colony.get_level()); ++i) {
2143 auto col = retrieve<dcon::colonization_id>(
state,
parent);
2144 auto level =
state.world.colonization_get_level(col);
2155 if(
name ==
"controller_flag") {
2156 return make_element_by_type<flag_button>(
state,
id);
2157 }
else if(
name ==
"levels") {
2158 return make_element_by_type<colonisation_listbox>(
state,
id);
2159 }
else if(
name ==
"progress_counter") {
2160 return make_element_by_type<colonization_level_number>(
state,
id);
2167 if(payload.holds_type<dcon::national_identity_id>()) {
2169 payload.emplace<dcon::national_identity_id>(
dcon::fatten(
state.world,
content).get_colonizer().get_identity_from_identity_holder().id);
2171 payload.emplace<dcon::national_identity_id>(
state.world.nation_get_identity_from_identity_holder(
state.local_player_nation));
2181 return "colonist_item";
2187 auto prov = retrieve<dcon::province_id>(
state,
parent);
2188 auto fat_def =
dcon::fatten(
state.world,
state.world.province_get_state_from_abstract_state_membership(prov));
2192 bool found_player =
false;
2193 int32_t existing_colonizers = 0;
2194 for(
auto colony : fat_def.get_colonization()) {
2195 if(colony.get_colonizer().id ==
state.local_player_nation) {
2196 found_player =
true;
2199 ++existing_colonizers;
2202 if(!found_player && (existing_colonizers == 0 || (fat_def.get_colonization_stage() == 1 && existing_colonizers < 4))) {
2213 auto content = retrieve<dcon::state_instance_id>(
state,
parent);
2225 if(
name ==
"total_population") {
2226 auto ptr = make_element_by_type<simple_text_element_base>(
state,
id);
2227 population_box = ptr.
get();
2229 }
else if(
name ==
"culture_chart") {
2230 auto ptr = make_element_by_type<culture_piechart<dcon::province_id>>(
state, id);
2231 culture_chart = ptr.
get();
2233 }
else if(
name ==
"goods_type") {
2234 return make_element_by_type<province_rgo>(
state,
id);
2235 }
else if(
name ==
"colonize_button") {
2236 return make_element_by_type<province_protectorate_button>(
state,
id);
2237 }
else if(
name ==
"withdraw_button") {
2238 return make_element_by_type<province_withdraw_button>(
state,
id);
2239 }
else if(
name ==
"colonist_list") {
2240 return make_element_by_type<colonist_listbox>(
state,
id);
2241 }
else if(
name ==
"crisis_temperature") {
2242 return make_element_by_type<province_colonisation_temperature>(
state,
id);
2243 }
else if(
name ==
"rallypoint_checkbox") {
2244 return make_element_by_type<land_rally_point>(
state,
id);
2245 }
else if(
name ==
"rallypoint_checkbox_naval") {
2246 return make_element_by_type<naval_rally_point>(
state,
id);
2247 }
else if(
name ==
"rallypoint_merge_checkbox" ||
name ==
"rallypoint_merge_checkbox_naval") {
2248 return make_element_by_type<merge_rally_point>(
state,
id);
2255 auto prov_id = retrieve<dcon::province_id>(
state,
parent);
2257 auto nation_id = fat_id.get_nation_from_province_ownership();
2258 if(
bool(nation_id)) {
2272 .header =
"route_origin",
2274 return a.index() < b.index();
2278 auto sid = retrieve<dcon::state_instance_id>(
state, container);
2279 auto nid =
state.world.state_instance_get_nation_from_state_ownership(sid);
2280 auto niid =
state.world.nation_get_identity_from_identity_holder(nid);
2281 auto ii =
state.world.national_identity_get_identifying_int(niid);
2283 auto prefix =
"@" + tag;
2287 state.world.state_instance_get_capital(sid)
2290 .cell_definition_string =
"thin_cell_name",
2291 .header_definition_string =
"thin_cell_name"
2296 .header =
"route_target",
2299 auto local_market = retrieve<dcon::market_id>(
state, container);
2300 int32_t index_a = 0;
2301 if(local_market ==
dcon::fatten(
state.world, a).get_connected_markets(index_a)) {
2304 int32_t index_b = 0;
2305 if(local_market ==
dcon::fatten(
state.world, b).get_connected_markets(index_b)) {
2311 dcon::fatten(
state.world, a).get_connected_markets(index_a).get_zone_from_local_market().get_capital()
2315 dcon::fatten(
state.world, b).get_connected_markets(index_b).get_zone_from_local_market().get_capital()
2318 if(value_a != value_b)
2319 return value_a > value_b;
2321 return a.index() < b.index();
2324 auto local_market = retrieve<dcon::market_id>(
state, container);
2326 if(local_market ==
dcon::fatten(
state.world, item).get_connected_markets(index)) {
2330 auto sid =
dcon::fatten(
state.world, item).get_connected_markets(index).get_zone_from_local_market();
2331 auto nid =
state.world.state_instance_get_nation_from_state_ownership(sid);
2332 auto niid =
state.world.nation_get_identity_from_identity_holder(nid);
2333 auto ii =
state.world.national_identity_get_identifying_int(niid);
2335 auto prefix =
"@" + tag;
2342 .cell_definition_string =
"thin_cell_name",
2343 .header_definition_string =
"thin_cell_name"
2348 .header =
"price_origin",
2350 return a.index() < b.index();
2355 .get_price(retrieve<dcon::commodity_id>(
state, container))
2362 .header =
"price_target",
2364 auto local_market = retrieve<dcon::market_id>(
state, container);
2365 int32_t index_a = 0;
2366 if(local_market ==
dcon::fatten(
state.world, a).get_connected_markets(index_a)) {
2369 int32_t index_b = 0;
2370 if(local_market ==
dcon::fatten(
state.world, b).get_connected_markets(index_b)) {
2374 auto value_a =
dcon::fatten(
state.world, a).get_connected_markets(index_a).get_price(retrieve<dcon::commodity_id>(
state, container));
2375 auto value_b =
dcon::fatten(
state.world, b).get_connected_markets(index_b).get_price(retrieve<dcon::commodity_id>(
state, container));
2377 if(value_a != value_b)
2378 return value_a > value_b;
2380 return a.index() < b.index();
2383 auto local_market = retrieve<dcon::market_id>(
state, container);
2385 if(local_market ==
dcon::fatten(
state.world, item).get_connected_markets(index)) {
2391 .get_connected_markets(index).get_price(retrieve<dcon::commodity_id>(
state, container))
2398 .header =
"trade_distance",
2403 if(value_a != value_b)
2404 return value_a > value_b;
2406 return a.index() < b.index();
2415 .header =
"desired_volume",
2417 auto local_market = retrieve<dcon::market_id>(
state, container);
2418 int32_t index_a = 0;
2419 if(local_market ==
dcon::fatten(
state.world, a).get_connected_markets(index_a)) {
2422 int32_t index_b = 0;
2423 if(local_market ==
dcon::fatten(
state.world, b).get_connected_markets(index_b)) {
2428 auto value_a =
dcon::fatten(
state.world, a).get_volume(retrieve<dcon::commodity_id>(
state, container)) * ((float)index_a - 0.5f);
2429 auto value_b =
dcon::fatten(
state.world, b).get_volume(retrieve<dcon::commodity_id>(
state, container)) * ((float)index_b - 0.5f);
2431 if(value_a != value_b)
2432 return value_a > value_b;
2434 return a.index() < b.index();
2437 auto local_market = retrieve<dcon::market_id>(
state, container);
2439 if(local_market ==
dcon::fatten(
state.world, item).get_connected_markets(index)) {
2449 .header =
"max_throughput",
2451 auto value_a = std::min(
2455 auto value_b = std::min(
2460 if(value_a != value_b)
2461 return value_a > value_b;
2463 return a.index() < b.index();
2471 .update_tooltip = [](
2475 const dcon::trade_route_id& a,
2476 std::string fallback
2478 auto local_market = retrieve<dcon::market_id>(
state, container);
2480 state.world.for_each_commodity([&](
auto commodity) {
2481 state.world.market_for_each_trade_route(local_market, [&](
auto trade_route) {
2482 total += std::abs(
state.world.trade_route_get_volume(trade_route, commodity));
2485 float max =
state.world.market_get_max_throughput(local_market);
2493 .has_tooltip =
true,
2500 .header =
"trade_margin",
2502 auto local_market = retrieve<dcon::market_id>(
state, container);
2507 if(value_a != value_b)
2508 return value_a > value_b;
2510 return a.index() < b.index();
2513 auto local_market = retrieve<dcon::market_id>(
state, container);
2520 .header =
"trade_good_name_header",
2531 if(value_a != value_b)
2532 return value_a > value_b;
2534 return a.index() < b.index();
2537 std::string padding = item.index() < 10 ?
"0" :
"";
2538 std::string description =
"@$" + padding + std::to_string(item.index());
2545 .cell_definition_string =
"thin_cell_name",
2546 .header_definition_string =
"thin_cell_name"
2553 auto si = retrieve<dcon::state_instance_id>(
state, container);
2554 auto m =
state.world.state_instance_get_market_from_local_market(si);
2561 return a.index() < b.index();
2564 auto si = retrieve<dcon::state_instance_id>(
state, container);
2565 auto m =
state.world.state_instance_get_market_from_local_market(si);
2574 .header =
"rgo_output",
2576 auto p = retrieve<dcon::province_id>(
state, container);
2577 auto si = retrieve<dcon::state_instance_id>(
state, container);
2578 auto m =
state.world.state_instance_get_market_from_local_market(si);
2580 auto av =
state.world.province_get_rgo_actual_production_per_good(p, a);
2581 auto bv =
state.world.province_get_rgo_actual_production_per_good(p, b);
2585 return a.index() < b.index();
2588 auto p = retrieve<dcon::province_id>(
state, container);
2589 auto si = retrieve<dcon::state_instance_id>(
state, container);
2590 auto m =
state.world.state_instance_get_market_from_local_market(si);
2592 auto value =
state.world.province_get_rgo_actual_production_per_good(p,
id);
2599 .header =
"rgo_profit",
2601 auto p = retrieve<dcon::province_id>(
state, container);
2602 auto si = retrieve<dcon::state_instance_id>(
state, container);
2603 auto m =
state.world.state_instance_get_market_from_local_market(si);
2605 auto av =
state.world.province_get_rgo_profit_per_good(p, a);
2606 auto bv =
state.world.province_get_rgo_profit_per_good(p, b);
2610 return a.index() < b.index();
2613 auto p = retrieve<dcon::province_id>(
state, container);
2614 auto si = retrieve<dcon::state_instance_id>(
state, container);
2615 auto m =
state.world.state_instance_get_market_from_local_market(si);
2617 auto value =
state.world.province_get_rgo_profit_per_good(p,
id);
2624 .header =
"rgo_expected_profit",
2626 auto p = retrieve<dcon::province_id>(
state, container);
2627 auto n =
state.world.province_get_nation_from_province_ownership(p);
2628 auto si = retrieve<dcon::state_instance_id>(
state, container);
2629 auto m =
state.world.state_instance_get_market_from_local_market(si);
2636 return a.index() < b.index();
2639 auto p = retrieve<dcon::province_id>(
state, container);
2640 auto n =
state.world.province_get_nation_from_province_ownership(p);
2641 auto si = retrieve<dcon::state_instance_id>(
state, container);
2642 auto m =
state.world.state_instance_get_market_from_local_market(si);
2645 *
state.defines.alice_rgo_per_size_employment;
2652 .header =
"rgo_desired_profit",
2654 return a.index() < b.index();
2657 auto p = retrieve<dcon::province_id>(
state, container);
2658 auto n =
state.world.province_get_nation_from_province_ownership(p);
2659 auto si = retrieve<dcon::state_instance_id>(
state, container);
2660 auto m =
state.world.state_instance_get_market_from_local_market(si);
2665 bool is_mine =
state.world.commodity_get_is_mine(
state.world.province_get_rgo(p));
2668 is_mine ? pop_laborer_min_wage : pop_farmer_min_wage,
2671 auto value = v *
state.defines.alice_rgo_per_size_employment;
2678 .header =
"rgo_employment",
2680 auto p = retrieve<dcon::province_id>(
state, container);
2681 auto n =
state.world.province_get_nation_from_province_ownership(p);
2682 auto si = retrieve<dcon::state_instance_id>(
state, container);
2683 auto m =
state.world.state_instance_get_market_from_local_market(si);
2685 auto av =
state.world.province_get_rgo_employment_per_good(p, a);
2686 auto bv =
state.world.province_get_rgo_employment_per_good(p, b);
2690 return a.index() < b.index();
2693 auto p = retrieve<dcon::province_id>(
state, container);
2694 auto n =
state.world.province_get_nation_from_province_ownership(p);
2695 auto si = retrieve<dcon::state_instance_id>(
state, container);
2696 auto m =
state.world.state_instance_get_market_from_local_market(si);
2698 auto value =
state.world.province_get_rgo_employment_per_good(p,
id);
2705 .header =
"rgo_max_employment",
2707 auto p = retrieve<dcon::province_id>(
state, container);
2708 auto n =
state.world.province_get_nation_from_province_ownership(p);
2709 auto si = retrieve<dcon::state_instance_id>(
state, container);
2710 auto m =
state.world.state_instance_get_market_from_local_market(si);
2717 return a.index() < b.index();
2720 auto p = retrieve<dcon::province_id>(
state, container);
2721 auto n =
state.world.province_get_nation_from_province_ownership(p);
2722 auto si = retrieve<dcon::state_instance_id>(
state, container);
2723 auto m =
state.world.state_instance_get_market_from_local_market(si);
2732 .header =
"rgo_saturation",
2734 auto p = retrieve<dcon::province_id>(
state, container);
2735 auto n =
state.world.province_get_nation_from_province_ownership(p);
2736 auto si = retrieve<dcon::state_instance_id>(
state, container);
2737 auto m =
state.world.state_instance_get_market_from_local_market(si);
2742 auto av =
state.world.province_get_rgo_employment_per_good(p, a);
2743 auto bv =
state.world.province_get_rgo_employment_per_good(p, b);
2745 auto ar = ae > 0.f ? av / ae : 0.f;
2746 auto br = be > 0.f ? bv / be : 0.f;
2751 return a.index() < b.index();
2754 auto p = retrieve<dcon::province_id>(
state, container);
2755 auto n =
state.world.province_get_nation_from_province_ownership(p);
2756 auto si = retrieve<dcon::state_instance_id>(
state, container);
2757 auto m =
state.world.state_instance_get_market_from_local_market(si);
2760 auto v =
state.world.province_get_rgo_employment_per_good(p,
id);
2761 auto r = e > 0.f ? v / e : 0.f;
2772 send<province_economy_toggle_signal>(
state,
parent, { });
2786 if(
name ==
"toggle-economy-province") {
2787 return make_element_by_type<economy_data_toggle>(
state,
id);
2788 }
else if(
name ==
"table_rgo_data") {
2789 std::vector<table::column<dcon::commodity_id>> columns = {
2793 auto ptr = make_element_by_type<table::display<dcon::commodity_id>>(
2796 std::string(
"table_body"),
2802 if(
state.selected_trade_good == a) {
2803 state.selected_trade_good = { };
2805 state.selected_trade_good = a;
2807 state.update_trade_flow.store(
true, std::memory_order::release);
2812 state.world.for_each_commodity([&](dcon::commodity_id
id) {
2817 }
else if(
name ==
"table_trade_route_data") {
2818 std::vector<table::column<dcon::trade_route_id>> columns = {
2824 auto ptr = make_element_by_type<table::display<dcon::trade_route_id>>(
2827 std::string(
"table_body"),
2836 auto origin =
state.world.trade_route_get_connected_markets(t, 0);
2837 auto target =
state.world.trade_route_get_connected_markets(t, 1);
2839 auto s_origin =
state.world.market_get_zone_from_local_market(origin);
2840 auto s_target =
state.world.market_get_zone_from_local_market(target);
2842 auto p_origin =
state.world.state_instance_get_capital(s_origin);
2843 auto p_target =
state.world.state_instance_get_capital(s_target);
2845 auto selected_province =
state.map_state.get_selected_province();
2846 if(selected_province) {
2847 auto selected_province_state =
state.world.province_get_state_membership(selected_province);
2849 if(selected_province_state != s_origin) {
2850 state.map_state.set_selected_province(p_origin);
2852 else if(selected_province_state != s_target) {
2853 state.map_state.set_selected_province(p_target);
2857 state.map_state.center_map_on_province(
state,
state.map_state.get_selected_province());
2859 state.update_trade_flow.store(
true, std::memory_order::release);
2866 }
else if(
name ==
"trade_route_background") {
2867 auto ptr = make_element_by_type<image_element_base>(
state,
id);
2871 }
else if(
name ==
"background") {
2872 auto ptr = make_element_by_type<image_element_base>(
state,
id);
2876 }
else if(
name ==
"table_rgo_headers") {
2877 auto ptr = make_element_by_type<window_element_base>(
state,
id);
2886 auto p = retrieve<dcon::province_id>(
state,
parent);
2887 auto n =
state.world.province_get_nation_from_province_ownership(p);
2888 auto si = retrieve<dcon::state_instance_id>(
state,
parent);
2889 auto m =
state.world.state_instance_get_market_from_local_market(si);
2892 if(
state.selected_trade_good) {
2893 state.world.market_for_each_trade_route_as_connected_markets(m, [&](
auto route) {
2925 dcon::province_id active_province{};
2940 auto ptr = make_element_by_type<build_unit_province_window>(
state,
"build_unit_view");
2946 if(
name ==
"close_button") {
2947 return make_element_by_type<province_close_button>(
state,
id);
2948 }
else if(
name ==
"background") {
2949 return make_element_by_type<draggable_target>(
state,
id);
2950 }
else if(
name ==
"province_view_header") {
2951 auto ptr = make_element_by_type<province_window_header>(
state,
id);
2952 header_window = ptr.
get();
2954 }
else if(
name ==
"province_other") {
2955 auto ptr = make_element_by_type<province_view_foreign_details>(
state,
id);
2956 ptr->set_visible(
state,
false);
2957 foreign_details_window = ptr.
get();
2959 }
else if(
name ==
"province_colony") {
2960 auto ptr = make_element_by_type<province_window_colony>(
state,
id);
2961 ptr->set_visible(
state,
false);
2962 colony_window = ptr.
get();
2964 }
else if(
name ==
"province_statistics") {
2965 auto ptr = make_element_by_type<province_view_statistics>(
state,
id);
2966 local_details_window = ptr.
get();
2967 ptr->set_visible(
state,
false);
2969 }
else if(
name ==
"province_buildings") {
2970 auto ptr = make_element_by_type<province_view_buildings>(
state,
id);
2971 local_buildings_window = ptr.
get();
2972 ptr->set_visible(
state,
false);
2974 }
else if(
name ==
"national_focus_window") {
2975 auto ptr = make_element_by_type<national_focus_window>(
state,
id);
2976 ptr->set_visible(
state,
false);
2979 }
else if(
name ==
"local_economy_view") {
2980 auto ptr = make_element_by_type<province_economy_window>(
state,
id);
2981 economy_window = ptr.
get();
2989 if(payload.holds_type<dcon::province_id>()) {
2990 payload.emplace<dcon::province_id>(active_province);
2992 }
else if(payload.holds_type<dcon::nation_id>()) {
2993 dcon::nation_id nid =
dcon::fatten(
state.world, active_province).get_nation_from_province_ownership();
2994 payload.emplace<dcon::nation_id>(nid);
2996 }
else if(payload.holds_type<dcon::state_instance_id>()) {
2997 dcon::state_instance_id sid =
dcon::fatten(
state.world, active_province).get_state_membership();
2998 payload.emplace<dcon::state_instance_id>(sid);
3000 }
else if(payload.holds_type<dcon::commodity_id>()) {
3001 payload.emplace<dcon::commodity_id>(
state.selected_trade_good);
3003 }
else if(payload.holds_type<dcon::market_id>()) {
3004 dcon::market_id mid =
dcon::fatten(
state.world, active_province).get_state_membership().get_market_from_local_market();
3005 payload.emplace<dcon::market_id>(mid);
3012 if(
bool(map_province)) {
3013 active_province = map_province;
3014 state.map_state.set_selected_province(map_province);
3032 active_province =
state.map_state.get_selected_province();
3035 auto n =
state.world.province_get_nation_from_province_ownership(active_province);
ui::message_result get(sys::state &state, Cyto::Any &payload) noexcept override
std::function< void(sys::state &state, ui::element_base *container, const item_type &a)> row_callback
data< item_type > content
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
void button_action(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
void on_update(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
window_element_base * rgo_headers
message_result get(sys::state &state, Cyto::Any &payload) noexcept override
image_element_base * rgo_bg
table::display< dcon::trade_route_id > * trade_table
image_element_base * trade_routes_bg
table::display< dcon::commodity_id > * rgo_table
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 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_take_province(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)
rgo_workers_breakdown rgo_relevant_population(sys::state &state, dcon::province_id p, dcon::nation_id n)
float farmer_min_wage(sys::state &state, dcon::market_id m, float min_wage_factor)
float price(sys::state const &state, dcon::state_instance_id s, dcon::commodity_id c)
float laborer_min_wage(sys::state &state, dcon::market_id m, float min_wage_factor)
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 rgo_desired_worker_norm_profit(sys::state &state, dcon::province_id p, dcon::market_id m, dcon::nation_id n, float min_wage, float total_relevant_population)
float rgo_max_employment(sys::state &state, dcon::nation_id n, dcon::province_id p, dcon::commodity_id c)
float pop_min_wage_factor(sys::state &state, dcon::nation_id n)
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)
std::string int_to_tag(uint32_t v)
auto nation_accepts_culture(sys::state const &state, T ids, U cul_ids)
GLuint get_rebel_flag_handle(sys::state &state, dcon::rebel_faction_id faction)
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_money(float num)
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 add_unparsed_text_to_layout_box(sys::state &state, layout_base &dest, layout_box &box, std::string_view sv, substitution_map const &mp)
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)
std::string format_wholenum(int32_t num)
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)
table::column< dcon::commodity_id > rgo_profit
table::column< dcon::commodity_id > rgo_expected_profit
table::column< dcon::commodity_id > rgo_name
table::column< dcon::commodity_id > rgo_amount
table::column< dcon::trade_route_id > trade_route_7
table::column< dcon::trade_route_id > trade_route_0
table::column< dcon::commodity_id > rgo_desired_profit
table::column< dcon::trade_route_id > trade_route_6
table::column< dcon::commodity_id > rgo_saturation
table::column< dcon::commodity_id > rgo_employment
std::variant< std::monostate, dcon::nation_id, dcon::state_instance_id, dcon::province_id > pop_list_filter
float trade_route_profit(sys::state &state, dcon::trade_route_id route, dcon::commodity_id c)
table::column< dcon::trade_route_id > trade_route_4
table::column< dcon::trade_route_id > trade_route_5
table::column< dcon::trade_route_id > trade_route_1
table::column< dcon::commodity_id > rgo_price
table::column< dcon::commodity_id > rgo_max_employment
void open_build_foreign_factory(sys::state &state, dcon::state_instance_id st)
table::column< dcon::trade_route_id > trade_route_2
void province_owner_rgo_draw_tooltip(sys::state &state, text::columnar_layout &contents, dcon::province_id prov_id) noexcept
table::column< dcon::trade_route_id > trade_route_3
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
Holds important data about the game world, state, and other data regarding windowing,...
std::vector< item_type > data
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