34 if(
state.cheat_data.show_province_id_tooltip) {
54 auto nation_id = retrieve<dcon::nation_id>(
state,
parent);
95 auto nation_id = retrieve<dcon::nation_id>(
state,
parent);
111 auto nation_id = retrieve<dcon::nation_id>(
state,
parent);
127 auto nation_id = retrieve<dcon::nation_id>(
state,
parent);
170 for(
size_t i = 0; i <
state.player_data_cache.treasury_record.size(); ++i)
171 datapoints[i] =
state.player_data_cache.treasury_record[(
state.ui_date.value + 1 + i) % 32] -
state.player_data_cache.treasury_record[(
state.ui_date.value + 0 + i) % 32];
198 auto nation_id = retrieve<dcon::nation_id>(
state,
parent);
229 auto nation_id = retrieve<dcon::nation_id>(
state,
parent);
251 auto pop_amount =
state.player_data_cache.population_record[
state.ui_date.value % 32];
252 auto pop_change =
state.ui_date.value <= 32
253 ? (
state.ui_date.value <= 2 ? 0.0f : pop_amount -
state.player_data_cache.population_record[2])
254 : (pop_amount -
state.player_data_cache.population_record[(
state.ui_date.value - 30) % 32]);
277 auto nation_id = retrieve<dcon::nation_id>(
state,
parent);
279 auto pop_amount =
state.player_data_cache.population_record[
state.ui_date.value % 32];
280 auto pop_change =
state.ui_date.value <= 30 ? 0.0f : (pop_amount -
state.player_data_cache.population_record[(
state.ui_date.value - 30) % 32]);
303 auto current_day_record =
state.player_data_cache.treasury_record[
state.ui_date.value % 32];
304 auto previous_day_record =
state.player_data_cache.treasury_record[(
state.ui_date.value + 31) % 32];
305 auto change = current_day_record - previous_day_record;
417 for(
auto n :
state.world.in_nation) {
418 auto rel =
state.world.nation_get_overlord_as_subject(n);
419 auto overlord =
state.world.overlord_get_ruler(rel);
421 if(overlord ==
state.local_player_nation) {
428 auto amt =
state.world.nation_get_private_investment(n) *
state.defines.alice_privateinvestment_subject_transfer / 100.f;
462 if(private_constr < 1.f && upgrades.size() == 0 && constructions.size() == 0 && province_constr.size() == 0) {
463 auto rel =
state.world.nation_get_overlord_as_subject(
state.local_player_nation);
464 auto overlord =
state.world.overlord_get_ruler(rel);
466 auto amt =
state.world.nation_get_private_investment(
state.local_player_nation) *
state.defines.alice_privateinvestment_subject_transfer / 100.f;
493 auto nation_id = retrieve<dcon::nation_id>(
state,
parent);
497 if(in_use < available) {
505 auto nation_id = retrieve<dcon::nation_id>(
state,
parent);
508 float relevant_pop =
state.world.nation_get_demographics(nation_id,
510 for(
auto ac :
state.world.in_culture) {
511 if(
state.world.nation_get_accepted_cultures(nation_id, ac)) {
516 auto fPoints = relevant_pop /
state.defines.national_focus_divider;
527 nation_fat_id.for_each_state_ownership([&](dcon::state_ownership_id so) {
529 if(fat_state_id.is_valid()) {
530 auto staat = fat_state_id.get_state();
531 if(staat.is_valid()) {
532 auto natl_fat_id = staat.get_owner_focus();
533 if(natl_fat_id.is_valid()) {
558 auto nation_id = retrieve<dcon::nation_id>(
state,
parent);
569 auto nation_id = retrieve<dcon::nation_id>(
state,
parent);
602 auto nation_id = retrieve<dcon::nation_id>(
state,
parent);
609 auto nation_id = retrieve<dcon::nation_id>(
state,
parent);
647 auto nation_id = retrieve<dcon::nation_id>(
state,
parent);
681 auto nation_id = retrieve<dcon::nation_id>(
state,
parent);
702 int32_t num_ships = 0;
703 for(
auto nv :
state.world.nation_get_navy_control(n)) {
704 num_ships += int32_t(nv.get_navy().get_navy_membership().end() - nv.get_navy().get_navy_membership().begin());
712 for(
const auto nv :
state.world.nation_get_navy_control_as_controller(n)) {
714 for(
const auto memb : nv.get_navy().get_navy_membership()) {
715 total +=
state.military_definitions.unit_base_definitions[memb.get_ship().get_type()].supply_consumption_score;
739 int32_t possible_sum = 0;
740 int32_t raised_sum = 0;
742 for(
auto prov_own : fat_id.get_province_ownership_as_nation()) {
743 auto prov = prov_own.get_province();
746 for(
auto prov_own : fat_id.get_province_ownership_as_nation()) {
747 auto prov = prov_own.get_province();
772 float getResearchPointsFromPop(
sys::state&
state, dcon::pop_type_id pop, dcon::nation_id n) {
782 state.world.pop_type_get_research_optimum(
state.culture_definitions.officers));
797 state.world.pop_type_get_name(
state.culture_definitions.officers));
831 auto const override_and_show_tab = [&]() {
840 override_and_show_tab();
843 override_and_show_tab();
918 auto const override_and_show_tab = [&]() {
932 override_and_show_tab();
935 override_and_show_tab();
957 for(
auto pl :
state.network_state.clients) {
958 if(!pl.is_active()) {
986 if(
state.actual_game_speed <= 0) {
993 if(
state.actual_game_speed <= 0) {
997 state.actual_game_speed = 0;
1008 disabled =
state.internally_paused ||
state.ui_pause.load(std::memory_order::acquire);
1024 auto ymd =
state.current_date.to_ymd(
state.start_date);
1031 float nh_temp = 15.f;
1032 std::string nh_season;
1033 if(ymd.month == 12 || ymd.month <= 2) {
1035 }
else if(ymd.month >= 3 && ymd.month <= 5) {
1037 }
else if(ymd.month >= 6 && ymd.month <= 8) {
1039 }
else if(ymd.month >= 9 && ymd.month <= 11) {
1044 std::string sh_season;
1045 if(ymd.month >= 6 && ymd.month <= 8) {
1047 }
else if(ymd.month >= 9 && ymd.month <= 11) {
1049 }
else if(ymd.month == 12 || ymd.month <= 2) {
1051 }
else if(ymd.month >= 3 && ymd.month <= 5) {
1072 if(
state.actual_game_speed > 0) {
1073 state.actual_game_speed = std::min(5,
state.actual_game_speed.load() + 1);
1102 if(
state.actual_game_speed > 0) {
1103 state.actual_game_speed = std::max(1,
state.actual_game_speed.load() - 1);
1127 if(
state.internally_paused ||
state.ui_pause.load(std::memory_order::acquire)) {
1143 state.world.nation_get_rank(nation_id) > uint16_t(
state.defines.great_nations_count)));
1153 }
else if(
state.world.nation_get_rank(
state.local_player_nation) > uint16_t(
state.defines.great_nations_count)) {
1158 for(
const auto gp :
state.great_nations) {
1159 if(gp.nation ==
state.local_player_nation) {
1166 }
else if(
state.world.nation_get_rank(
state.local_player_nation) <= uint16_t(
state.defines.great_nations_count)) {
1193 auto nation_id = any_cast<dcon::nation_id>(payload);
1201 nation_fat_id.for_each_state_building_construction([&](dcon::state_building_construction_id building_slim_id) {
1203 auto stateName = building_fat_id.get_state().get_definition().get_name();
1204 auto factoryType = building_fat_id.get_type().get_name();
1231 auto nation_id = any_cast<dcon::nation_id>(payload);
1240 for(
auto staat_owner : nation_fat.get_state_ownership()) {
1241 auto staat = staat_owner.get_state().get_definition();
1242 bool new_staat =
true;
1243 for(
auto abstract : staat.get_abstract_state_membership()) {
1244 auto prov = abstract.get_province();
1245 for(
auto factloc : prov.get_factory_location()) {
1246 auto scale = factloc.get_factory().get_production_scale();
1272 visible = (
state.world.nation_get_spending_level(
state.local_player_nation) < 1.0f);
1292 auto nation_id = retrieve<dcon::nation_id>(
state,
parent);
1293 bool has_unemployed =
false;
1295 std::array<dcon::pop_type_id, 2> factory_workers{
1296 state.culture_definitions.primary_factory_worker,
1297 state.culture_definitions.secondary_factory_worker
1299 for(
auto pt : factory_workers) {
1300 for(
auto si :
state.world.nation_get_state_ownership(nation_id)) {
1301 auto state_instance = si.get_state();
1304 if(unemployed >= 1.0f) {
1305 has_unemployed =
true;
1312 frame = has_unemployed ? 0 : 1;
1320 auto nation_id = retrieve<dcon::nation_id>(
state,
parent);
1322 std::array<dcon::pop_type_id, 2> factory_workers{
1323 state.culture_definitions.primary_factory_worker,
1324 state.culture_definitions.secondary_factory_worker
1326 for(
auto pt : factory_workers) {
1327 for(
auto si :
state.world.nation_get_state_ownership(nation_id)) {
1328 auto state_instance = si.get_state();
1331 if(unemployed >= 1.f) {
1348 std::array<dcon::pop_type_id, 2> rgo_workers{
1349 state.culture_definitions.farmers,
1350 state.culture_definitions.laborers
1352 for(
auto pt : rgo_workers) {
1353 for(
auto si :
state.world.nation_get_state_ownership(nation_id)) {
1354 auto state_instance = si.get_state();
1357 if(unemployed >= 1.f) {
1391 auto nation_id = retrieve<dcon::nation_id>(
state,
parent);
1401 auto last_date =
state.world.nation_get_last_issue_or_reform_change(nation_id);
1402 if(
bool(last_date) && (last_date + int32_t(
state.defines.min_delay_between_reforms * 30.0f)) >
state.current_date) {
1406 if(
state.world.nation_get_is_civilized(nation_id)) {
1407 for(
auto i :
state.culture_definitions.political_issues) {
1408 for(
auto o :
state.world.issue_get_options(i)) {
1419 for(
auto i :
state.culture_definitions.social_issues) {
1420 for(
auto o :
state.world.issue_get_options(i)) {
1434 for(
auto i :
state.culture_definitions.military_issues) {
1435 for(
auto o :
state.world.reform_get_options(i)) {
1446 for(
auto i :
state.culture_definitions.economic_issues) {
1447 for(
auto o :
state.world.reform_get_options(i)) {
1463 auto const override_and_show_tab = [&]() {
1477 override_and_show_tab();
1479 override_and_show_tab();
1496 auto nation_id = retrieve<dcon::nation_id>(
state,
parent);
1505 state.world.for_each_decision([&](dcon::decision_id di) {
1506 if(nation_id !=
state.local_player_nation || !
state.world.decision_get_hide_notification(di)) {
1507 auto lim = state.world.decision_get_potential(di);
1508 if(!lim || trigger::evaluate(state, lim, trigger::to_generic(nation_id), trigger::to_generic(nation_id), 0)) {
1509 auto allow = state.world.decision_get_allow(di);
1510 if(!allow || trigger::evaluate(state, allow, trigger::to_generic(nation_id), trigger::to_generic(nation_id), 0)) {
1511 auto fat_id = dcon::fatten(state.world, di);
1512 auto box = text::open_layout_box(contents);
1513 text::add_to_layout_box(state, contents, box, fat_id.get_name(), m);
1514 text::close_layout_box(contents, box);
1523 auto const override_and_show_tab = [&]() {
1537 override_and_show_tab();
1539 override_and_show_tab();
1552 return tooltip_behavior::variable_tooltip;
1556 auto nation_id = retrieve<dcon::nation_id>(
state, parent);
1577 for(
auto rf :
state.world.nation_get_rebellion_within(
state.local_player_nation)) {
1578 auto org = rf.get_rebels().get_organization();
1588 return tooltip_behavior::variable_tooltip;
1592 bool showed_title =
false;
1594 for(
auto rf :
state.world.nation_get_rebellion_within(
state.local_player_nation)) {
1595 auto org = rf.get_rebels().get_organization();
1600 showed_title =
true;
1603 auto rebelsize = rf.get_rebels().get_possible_regiments();
1614 auto const override_and_show_tab = [&]() {
1618 Cyto::Any defs = Cyto::make_any<politics_window_tab>(politics_window_tab::movements);
1628 override_and_show_tab();
1630 override_and_show_tab();
1639 dcon::province_id get_state_def_province(
sys::state&
state, dcon::state_definition_id sdef)
noexcept {
1640 for(
auto const p :
state.world.state_definition_get_abstract_state_membership(sdef)) {
1641 if(!p.get_province().get_nation_from_province_ownership()) {
1642 return p.get_province();
1645 return dcon::province_id{};
1649 std::vector<dcon::province_id>
provinces;
1650 auto nation_id = retrieve<dcon::nation_id>(
state, parent);
1652 for(
auto si :
state.world.nation_get_state_ownership(nation_id)) {
1654 provinces.push_back(si.get_state().get_capital());
1658 state.world.for_each_state_definition([&](dcon::state_definition_id sdef) {
1661 for(
auto p :
state.world.state_definition_get_abstract_state_membership(sdef)) {
1662 if(!p.get_province().get_nation_from_province_ownership()) {
1663 province = p.get_province().id;
1673 nation_fat_id.for_each_colonization([&](dcon::colonization_id colony) {
1674 auto sdef =
state.world.colonization_get_state(colony);
1675 if(
state.world.state_definition_get_colonization_stage(sdef) == 3) {
1676 provinces.push_back(get_state_def_province(state, sdef));
1678 provinces.push_back(get_state_def_province(state, sdef));
1680 auto lvl = state.world.colonization_get_level(colony);
1681 for(auto cols : state.world.state_definition_get_colonization(sdef)) {
1682 if(lvl < cols.get_level()) {
1683 provinces.push_back(get_state_def_province(state, sdef));
1694 if(
auto prov = provinces[index];
prov &&
prov.value <
state.province_definitions.first_sea_province.value) {
1696 state.map_state.set_selected_province(prov);
1700 state.map_state.center_map_on_province(state, prov);
1706 bool any_integratable =
false;
1707 for(
auto si :
state.world.nation_get_state_ownership(nation_id)) {
1709 any_integratable =
true;
1713 state.world.for_each_state_definition([&](dcon::state_definition_id sdef) {
1715 any_integratable =
true;
1730 return tooltip_behavior::variable_tooltip;
1734 auto nation_id = retrieve<dcon::nation_id>(
state, parent);
1737 bool is_empty =
true;
1739 for(
auto si :
state.world.nation_get_state_ownership(nation_id)) {
1746 state.world.for_each_state_definition([&](dcon::state_definition_id sdef) {
1753 nation_fat_id.for_each_colonization([&](dcon::colonization_id colony) {
1754 auto sdef =
state.world.colonization_get_state(colony);
1755 if(
state.world.state_definition_get_colonization_stage(sdef) == 3) {
1762 auto lvl =
state.world.colonization_get_level(colony);
1763 for(
auto cols :
state.world.state_definition_get_colonization(sdef)) {
1764 if(lvl < cols.get_level()) {
1782 }
else if(
state.crisis_temperature > 80.f) {
1790 return tooltip_behavior::variable_tooltip;
1818 for(
const auto par :
state.crisis_participants) {
1819 if(!par.merely_interested && par.supports_attacker) {
1825 for(
const auto par :
state.crisis_participants) {
1826 if(!par.merely_interested && !par.supports_attacker) {
1832 for(
const auto par :
state.crisis_participants) {
1833 if(par.merely_interested) {
1838 if(
state.last_crisis_end_date) {
1859 return tooltip_behavior::variable_tooltip;
1863 auto n = retrieve<dcon::nation_id>(
state, parent);
1868 bool added_increase_header =
false;
1870 for(
auto it :
state.world.nation_get_gp_relationship_as_great_power(n)) {
1872 if(it.get_influence() >=
state.defines.increaseopinion_influence_cost
1876 if(!added_increase_header)
1878 added_increase_header =
true;
1880 }
else if(!(it.get_influence_target().get_in_sphere_of()) &&
1881 it.get_influence() >=
state.defines.addtosphere_influence_cost) {
1882 if(!added_increase_header)
1884 added_increase_header =
true;
1886 }
else if(it.get_influence_target().get_in_sphere_of()
1888 it.get_influence() >=
state.defines.removefromsphere_influence_cost) {
1889 if(!added_increase_header)
1891 added_increase_header =
true;
1896 bool added_reb_header =
false;
1897 for(
auto m :
state.world.in_nation) {
1898 if(
state.world.nation_get_in_sphere_of(m) == n) {
1900 for(
auto fac :
state.world.nation_get_rebellion_within(m)) {
1902 if(!added_reb_header)
1904 added_reb_header =
true;
1913 if(!added_increase_header && !added_reb_header)
1922 return tooltip_behavior::variable_tooltip;
1928 expanded_hitbox_text::on_create(
state);
1937 auto nation_id = retrieve<dcon::nation_id>(
state, parent);
1943 for(
auto pt :
state.world.in_pop_type) {
1944 auto rp =
state.world.pop_type_get_research_points(pt);
1967 if(!
bool(tech_id)) {
1983 return tooltip_behavior::variable_tooltip;
2002 for(
auto i = 0; i < 5; i++) {
2003 if(amount.targets[i].nation) {
2005 auto ident =
state.world.nation_get_identity_from_identity_holder(amount.targets[i].nation);
2007 add_space_to_layout_box(
state, contents, box);
2022 dcon::commodity_id commodity_id{};
2026 return tooltip_behavior::variable_tooltip;
2042 dcon::nation_id current_nation{};
2043 std::vector<topbar_commodity_xport_icon*> import_icons;
2044 std::vector<topbar_commodity_xport_icon*> export_icons;
2045 std::vector<topbar_commodity_amount_icon*> produced_icons;
2052 window_element_base::on_create(
state);
2053 base_data.position.y += 1;
2055 auto bg_pic = make_element_by_type<background_image>(
state,
"bg_main_menus");
2056 background_pic = bg_pic.get();
2057 background_pic->base_data.position.y -= 1;
2058 add_child_to_back(std::move(bg_pic));
2060 auto dpi_win = make_element_by_type<ui::diplomatic_message_topbar_listbox>(
state,
"alice_diplomessageicons_window");
2062 add_child_to_front(std::move(dpi_win));
2066 auto new_win = make_element_by_type<army_management_window>(
state,
2068 army_mgmt_win = new_win.
get();
2070 add_child_to_front(std::move(new_win));
2076 if(
name ==
"topbar_bg") {
2077 return partially_transparent_image::make_element_by_type_alias(
state,
id);
2078 }
else if(
name ==
"topbar_paper") {
2079 return partially_transparent_image::make_element_by_type_alias(
state,
id);
2080 }
else if(
name ==
"topbarbutton_production") {
2081 auto btn = make_element_by_type<topbar_production_tab_button>(
state,
id);
2083 auto tab = make_element_by_type<production_window>(
state,
"country_production");
2085 state.ui_state.
root->add_child_to_back(std::move(tab));
2087 }
else if(
name ==
"topbarbutton_budget") {
2088 auto btn = make_element_by_type<topbar_budget_tab_button>(
state,
id);
2092 tab->set_visible(
state,
false);
2093 btn->topbar_subwindow = tab.get();
2094 state.ui_state.
root->add_child_to_back(std::move(tab));
2096 }
else if(
name ==
"topbarbutton_tech") {
2097 auto btn = make_element_by_type<topbar_technology_tab_button>(
state,
id);
2099 auto tab = make_element_by_type<technology_window>(
state,
"country_technology");
2100 btn->topbar_subwindow = tab.get();
2103 state.ui_state.
root->add_child_to_back(std::move(tab));
2105 }
else if(
name ==
"topbarbutton_politics") {
2106 auto btn = make_element_by_type<topbar_politics_tab_button>(
state,
id);
2107 auto tab = make_element_by_type<politics_window>(
state,
"country_politics");
2108 btn->topbar_subwindow = tab.get();
2111 state.ui_state.
root->add_child_to_back(std::move(tab));
2113 }
else if(
name ==
"topbarbutton_pops") {
2114 auto btn = make_element_by_type<topbar_population_view_button>(
state,
id);
2115 auto tab = make_element_by_type<population_window>(
state,
"country_pop");
2116 btn->topbar_subwindow = tab.get();
2119 state.ui_state.
root->add_child_to_back(std::move(tab));
2121 }
else if(
name ==
"topbarbutton_trade") {
2122 auto btn = make_element_by_type<topbar_trade_tab_button>(
state,
id);
2124 auto tab = make_element_by_type<trade_window>(
state,
"alice_country_trade");
2125 btn->topbar_subwindow = tab.get();
2128 state.ui_state.
root->add_child_to_back(std::move(tab));
2130 }
else if(
name ==
"topbarbutton_diplomacy") {
2131 auto btn = make_element_by_type<topbar_diplomacy_tab_button>(
state,
id);
2133 auto tab = make_element_by_type<diplomacy_window>(
state,
"country_diplomacy");
2134 btn->topbar_subwindow = tab.get();
2135 state.ui_state.
root->add_child_to_back(std::move(tab));
2137 }
else if(
name ==
"topbarbutton_military") {
2138 auto btn = make_element_by_type<topbar_military_tab_button>(
state,
id);
2140 auto tab = make_element_by_type<military_window>(
state,
"country_military");
2141 btn->topbar_subwindow = tab.get();
2142 state.ui_state.
root->add_child_to_back(std::move(tab));
2144 }
else if(
name ==
"button_speedup") {
2145 return make_element_by_type<topbar_speedup_button>(
state,
id);
2146 }
else if(
name ==
"button_speeddown") {
2147 return make_element_by_type<topbar_speeddown_button>(
state,
id);
2148 }
else if(
name ==
"pause_bg") {
2149 return make_element_by_type<topbar_pause_button>(
state,
id);
2150 }
else if(
name ==
"speed_indicator") {
2151 return make_element_by_type<topbar_speed_indicator>(
state,
id);
2152 }
else if(
name ==
"datetext") {
2153 return make_element_by_type<topbar_date_text>(
state,
id);
2154 }
else if(
name ==
"countryname") {
2155 return make_element_by_type<topbar_nation_name>(
state,
id);
2156 }
else if(
name ==
"player_flag") {
2157 return make_element_by_type<flag_button>(
state,
id);
2158 }
else if(
name ==
"country_prestige") {
2159 return make_element_by_type<topbar_nation_prestige_text>(
state,
id);
2160 }
else if(
name ==
"country_economic") {
2161 return make_element_by_type<topbar_nation_industry_score_text>(
state,
id);
2162 }
else if(
name ==
"country_military") {
2163 return make_element_by_type<topbar_nation_military_score_text>(
state,
id);
2164 }
else if(
name ==
"country_total") {
2165 return make_element_by_type<nation_total_score_text>(
state,
id);
2166 }
else if(
name ==
"country_colonial_power") {
2167 return make_element_by_type<topbar_nation_colonial_power_text>(
state,
id);
2168 }
else if(
name ==
"selected_prestige_rank") {
2169 return make_element_by_type<nation_prestige_rank_text>(
state,
id);
2170 }
else if(
name ==
"selected_industry_rank") {
2171 return make_element_by_type<nation_industry_rank_text>(
state,
id);
2172 }
else if(
name ==
"selected_military_rank") {
2173 return make_element_by_type<nation_military_rank_text>(
state,
id);
2174 }
else if(
name ==
"nation_totalrank") {
2175 return make_element_by_type<nation_rank_text>(
state,
id);
2176 }
else if(
name ==
"topbar_flag_overlay") {
2177 return make_element_by_type<nation_flag_frame>(
state,
id);
2178 }
else if(
name ==
"alert_building_factories") {
2179 return make_element_by_type<topbar_building_factories_icon>(
state,
id);
2180 }
else if(
name ==
"alert_closed_factories") {
2181 return make_element_by_type<topbar_closed_factories_icon>(
state,
id);
2182 }
else if(
name ==
"alert_unemployed_workers") {
2183 return make_element_by_type<topbar_unemployment_icon>(
state,
id);
2184 }
else if(
name ==
"budget_linechart") {
2185 return make_element_by_type<topbar_budget_line_graph>(
state,
id);
2186 }
else if(
name ==
"alice_budget_warning") {
2187 return make_element_by_type<topbar_budget_warning>(
state,
id);
2188 }
else if(
name ==
"budget_funds") {
2189 return make_element_by_type<topbar_treasury_text>(
state,
id);
2190 }
else if(
name ==
"topbar_tech_progress") {
2191 return make_element_by_type<nation_technology_research_progress>(
state,
id);
2192 }
else if(
name ==
"tech_current_research") {
2193 return make_element_by_type<nation_current_research_text>(
state,
id);
2194 }
else if(
name ==
"topbar_researchpoints_value") {
2195 return make_element_by_type<topbar_nation_daily_research_points_text>(
state,
id);
2196 }
else if(
name ==
"tech_literacy_value") {
2197 return make_element_by_type<topbar_nation_literacy_text>(
state,
id);
2198 }
else if(
name ==
"politics_party_icon") {
2199 return make_element_by_type<nation_ruling_party_ideology_plupp>(
state,
id);
2200 }
else if(
name ==
"politics_ruling_party") {
2201 return make_element_by_type<nation_ruling_party_text>(
state,
id);
2202 }
else if(
name ==
"politics_supressionpoints_value") {
2203 return make_element_by_type<nation_suppression_points_text>(
state,
id);
2204 }
else if(
name ==
"politics_infamy_value") {
2205 return make_element_by_type<topbar_nation_infamy_text>(
state,
id);
2206 }
else if(
name ==
"alert_can_do_reforms") {
2207 return make_element_by_type<topbar_available_reforms_icon>(
state,
id);
2208 }
else if(
name ==
"alert_can_do_decisions") {
2209 return make_element_by_type<topbar_available_decisions_icon>(
state,
id);
2210 }
else if(
name ==
"alert_is_in_election") {
2211 return make_element_by_type<topbar_ongoing_election_icon>(
state,
id);
2212 }
else if(
name ==
"alert_have_rebels") {
2213 return make_element_by_type<topbar_rebels_icon>(
state,
id);
2214 }
else if(
name ==
"population_total_value") {
2215 return make_element_by_type<topbar_nation_population_text>(
state,
id);
2216 }
else if(
name ==
"topbar_focus_value") {
2217 return make_element_by_type<topbar_nation_focus_allocation_text>(
state,
id);
2218 }
else if(
name ==
"population_avg_mil_value") {
2219 return make_element_by_type<topbar_nation_militancy_text>(
state,
id);
2220 }
else if(
name ==
"population_avg_con_value") {
2221 return make_element_by_type<topbar_nation_consciousness_text>(
state,
id);
2222 }
else if(
name ==
"diplomacy_status") {
2223 auto ptr = make_element_by_type<topbar_at_peace_text>(
state,
id);
2224 atpeacetext = ptr.
get();
2226 }
else if(
name ==
"diplomacy_at_war") {
2227 auto ptr = make_element_by_type<overlapping_enemy_flags>(
state,
id);
2228 ptr->base_data.position.y -= ptr->base_data.position.y / 4;
2229 ptr->base_data.size.x /= 2;
2231 }
else if(
name ==
"diplomacy_diplopoints_value") {
2232 return make_element_by_type<topbar_nation_diplomatic_points_text>(
state,
id);
2233 }
else if(
name ==
"alert_colony") {
2234 return make_element_by_type<topbar_colony_icon>(
state,
id);
2235 }
else if(
name ==
"alert_crisis") {
2236 return make_element_by_type<topbar_crisis_icon>(
state,
id);
2237 }
else if(
name ==
"alert_can_increase_opinion") {
2238 return make_element_by_type<topbar_sphere_icon>(
state,
id);
2239 }
else if(
name ==
"alert_loosing_gp") {
2240 return make_element_by_type<topbar_losing_gp_status_icon>(
state,
id);
2241 }
else if(
name ==
"military_army_value") {
2242 return make_element_by_type<topbar_nation_brigade_allocation_text>(
state,
id);
2243 }
else if(
name ==
"military_navy_value") {
2244 return make_element_by_type<topbar_nation_navy_allocation_text>(
state,
id);
2245 }
else if(
name ==
"military_manpower_value") {
2246 return make_element_by_type<topbar_nation_mobilization_size_text>(
state,
id);
2247 }
else if(
name ==
"military_leadership_value") {
2248 return make_element_by_type<topbar_nation_leadership_points_text>(
state,
id);
2249 }
else if(
name ==
"topbar_outlinerbutton" ||
name ==
"topbar_outlinerbutton_bg") {
2251 return make_element_by_type<invisible_element>(
state,
id);
2252 }
else if(
name.substr(0, 13) ==
"topbar_import") {
2253 auto ptr = make_element_by_type<topbar_commodity_xport_icon>(
state,
id);
2254 std::string var = std::string{
name.substr(13)};
2255 var.empty() ? ptr->slot =
uint8_t(0) : ptr->slot =
uint8_t(std::stoi(var));
2256 import_icons.push_back(ptr.get());
2258 }
else if(
name.substr(0, 13) ==
"topbar_export") {
2259 auto ptr = make_element_by_type<topbar_commodity_xport_icon>(
state,
id);
2260 std::string var = std::string{
name.substr(13)};
2261 var.empty() ? ptr->slot =
uint8_t(0) : ptr->slot =
uint8_t(std::stoi(var));
2262 export_icons.push_back(ptr.get());
2264 }
else if(
name.substr(0, 15) ==
"topbar_produced") {
2265 auto ptr = make_element_by_type<topbar_commodity_amount_icon>(
state,
id);
2266 std::string var = std::string{
name.substr(15)};
2267 var.empty() ? ptr->slot =
uint8_t(0) : ptr->slot =
uint8_t(std::stoi(var));
2268 produced_icons.push_back(ptr.get());
2270 }
else if (
name ==
"selected_military_icon") {
2271 return make_element_by_type<military_score_icon>(
state,
id);
2279 if(
state.local_player_nation != current_nation) {
2280 current_nation =
state.local_player_nation;
2282 impl_set(
state, payload);
2285 for(
auto& e : export_icons)
2286 e->set_visible(
state,
false);
2287 for(
auto& e : import_icons)
2288 e->set_visible(
state,
false);
2289 for(
auto& e : produced_icons)
2290 e->set_visible(
state,
false);
2293 static std::vector<economy::trade_volume_data_detailed> exported;
2294 static std::vector<economy::trade_volume_data_detailed> imported;
2299 for(dcon::commodity_id cid :
state.world.in_commodity) {
2310 sys::merge_sort(exported.begin(), exported.end(), [&](
auto& a,
auto& b) {
2311 return a.volume > b.volume;
2313 sys::merge_sort(imported.begin(), imported.end(), [&](
auto& a,
auto& b) {
2314 return a.volume > b.volume;
2318 for(
size_t it = 0; it < exported.size(); it++) {
2319 for(
auto const& e : export_icons)
2320 if(e->slot == slot) {
2321 e->frame =
state.world.commodity_get_icon(exported[it].commodity);
2322 e->amount = exported[it];
2323 e->set_visible(
state,
true);
2328 for(
size_t it = 0; it < imported.size(); it++) {
2329 for(
auto const& e : import_icons)
2330 if(e->slot == slot) {
2331 e->frame =
state.world.commodity_get_icon(imported[it].commodity);
2332 e->amount = imported[it];
2333 e->set_visible(
state,
true);
2340 std::map<float, int32_t> v;
2341 for(dcon::commodity_id cid :
state.world.in_commodity) {
2352 for(
auto it = std::rbegin(v); it != std::rend(v); it++) {
2353 for(
auto const& e : produced_icons)
2354 if(e->slot == slot) {
2355 dcon::commodity_id cid = dcon::commodity_id(dcon::commodity_id::value_base_t(it->second));
2356 e->frame =
state.world.commodity_get_icon(cid);
2357 e->commodity_id = cid;
2358 e->amount = it->first;
2359 e->set_visible(
state,
true);
2368 background_pic->set_visible(
state,
true);
2370 background_pic->set_visible(
state,
false);
2372 window_element_base::render(
state, x, y);
2376 if(payload.holds_type<dcon::nation_id>()) {
2377 payload.emplace<dcon::nation_id>(
state.local_player_nation);
2378 return message_result::consumed;
2380 return message_result::unseen;
void render(sys::state &state, int32_t x, int32_t y) noexcept override
virtual message_result impl_set(sys::state &state, Cyto::Any &payload) noexcept
virtual void render(sys::state &state, int32_t x, int32_t y) noexcept
virtual message_result get(sys::state &state, Cyto::Any &payload) noexcept
virtual void impl_on_update(sys::state &state) noexcept
message_result impl_get(sys::state &state, Cyto::Any &payload) noexcept
void set_visible(sys::state &state, bool vis)
ui::xy_pair bottom_right_extension
void on_create(sys::state &state) noexcept override
ui::xy_pair top_left_extension
void render(sys::state &state, int32_t x, int32_t y) noexcept override
void on_create(sys::state &state) noexcept override
void set_data_points(sys::state &state, std::vector< float > const &datapoints) noexcept
text::layout internal_layout
void set_text(sys::state &state, std::string const &new_text)
std::string get_text(sys::state &state, dcon::nation_id nation_id) noexcept override
void button_action(sys::state &state) noexcept override
int32_t get_icon_frame(sys::state &state, dcon::nation_id nation_id) noexcept override
void update_tooltip(sys::state &state, int32_t x, int32_t y, text::columnar_layout &contents) noexcept override
tooltip_behavior has_tooltip(sys::state &state) noexcept override
void on_create(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
topbar_budget_line_graph()
void render(sys::state &state, int32_t x, int32_t y) 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
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
int32_t get_icon_frame(sys::state &state, dcon::nation_id nation_id) noexcept override
void update_tooltip(sys::state &state, int32_t x, int32_t y, text::columnar_layout &contents) noexcept override
int32_t get_icon_frame(sys::state &state, dcon::nation_id nation_id) noexcept override
tooltip_behavior has_tooltip(sys::state &state) noexcept override
int32_t get_icon_frame(sys::state &state, dcon::nation_id nation_id) 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 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
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
int32_t get_icon_frame(sys::state &state, dcon::nation_id nation_id) noexcept override
void on_update(sys::state &state) noexcept override
void update_tooltip(sys::state &state, int32_t x, int32_t y, text::columnar_layout &contents) noexcept override
tooltip_behavior has_tooltip(sys::state &state) noexcept override
tooltip_behavior has_tooltip(sys::state &state) noexcept override
int32_t get_icon_frame(sys::state &state, dcon::nation_id nation_id) noexcept override
void update_tooltip(sys::state &state, int32_t x, int32_t y, text::columnar_layout &contents) noexcept override
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 on_update(sys::state &state) noexcept override
void on_create(sys::state &state) noexcept override
tooltip_behavior has_tooltip(sys::state &state) noexcept override
void update_tooltip(sys::state &state, int32_t x, int32_t y, text::columnar_layout &contents) noexcept override
void on_update(sys::state &state) noexcept override
void on_create(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_create(sys::state &state) noexcept override
void on_create(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
void update_tooltip(sys::state &state, int32_t x, int32_t y, text::columnar_layout &contents) noexcept override
tooltip_behavior has_tooltip(sys::state &state) noexcept override
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_create(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
void update_tooltip(sys::state &state, int32_t x, int32_t y, text::columnar_layout &contents) noexcept override
tooltip_behavior has_tooltip(sys::state &state) noexcept override
tooltip_behavior has_tooltip(sys::state &state) noexcept override
void on_create(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
void update_tooltip(sys::state &state, int32_t x, int32_t y, text::columnar_layout &contents) noexcept override
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
void on_update(sys::state &state) 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
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
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
void update_tooltip(sys::state &state, int32_t x, int32_t y, text::columnar_layout &contents) noexcept override
void on_update(sys::state &state) noexcept override
tooltip_behavior has_tooltip(sys::state &state) noexcept override
void update_tooltip(sys::state &state, int32_t x, int32_t y, text::columnar_layout &contents) noexcept override
void on_update(sys::state &state) noexcept override
tooltip_behavior has_tooltip(sys::state &state) noexcept override
int32_t get_icon_frame(sys::state &state, dcon::nation_id nation_id) noexcept override
void update_tooltip(sys::state &state, int32_t x, int32_t y, text::columnar_layout &contents) noexcept override
void button_action(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
tooltip_behavior has_tooltip(sys::state &state) noexcept override
void update_tooltip(sys::state &state, int32_t x, int32_t y, text::columnar_layout &contents) noexcept override
void render(sys::state &state, int32_t x, int32_t y) noexcept override
void update_tooltip(sys::state &state, int32_t x, int32_t y, text::columnar_layout &contents) noexcept override
int32_t get_icon_frame(sys::state &state, dcon::nation_id nation_id) noexcept override
tooltip_behavior has_tooltip(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
void update_tooltip(sys::state &state, int32_t x, int32_t y, text::columnar_layout &contents) noexcept override
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
void on_update(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
void render(sys::state &state, int32_t x, int32_t y) noexcept override
void on_create(sys::state &state) noexcept override
std::unique_ptr< element_base > make_child(sys::state &state, std::string_view name, dcon::gui_def_id id) noexcept override
message_result get(sys::state &state, Cyto::Any &payload) noexcept override
std::unique_ptr< ui::element_base > make_budgetwindow_main(sys::state &state)
pop_satisfaction_wrapper_fat fatten(data_container const &c, pop_satisfaction_wrapper_id id) noexcept
float get_estimated_literacy_change(sys::state &state, dcon::pop_id ids)
constexpr dcon::demographics_key total(0)
dcon::demographics_key to_key(sys::state const &state, dcon::pop_type_id v)
float get_estimated_mil_change(sys::state &state, dcon::pop_id ids)
constexpr dcon::demographics_key consciousness(3)
float get_estimated_con_change(sys::state &state, dcon::pop_id ids)
dcon::demographics_key to_employment_key(sys::state const &state, dcon::pop_type_id v)
constexpr dcon::demographics_key literacy(5)
constexpr dcon::demographics_key militancy(4)
std::vector< full_construction_state > estimate_private_investment_upgrade(sys::state &state, dcon::nation_id nid)
float supply(sys::state &state, dcon::market_id s, dcon::commodity_id c)
trade_volume_data_detailed import_volume_detailed(sys::state &state, dcon::nation_id s, dcon::commodity_id c)
trade_volume_data_detailed export_volume_detailed(sys::state &state, dcon::nation_id s, dcon::commodity_id c)
float estimate_private_construction_spendings(sys::state &state, dcon::nation_id nid)
float estimate_investment_pool_daily_loss(sys::state &state, dcon::nation_id n)
float import_volume(sys::state &state, dcon::market_id s, dcon::commodity_id c)
bool nation_is_constructing_factories(sys::state &state, dcon::nation_id n)
std::vector< full_construction_state > estimate_private_investment_construct(sys::state &state, dcon::nation_id nid, bool craved)
bool nation_has_closed_factories(sys::state &state, dcon::nation_id n)
std::vector< full_construction_province > estimate_private_investment_province(sys::state &state, dcon::nation_id nid)
constexpr float zoom_very_close
int32_t naval_supply_points_used(sys::state &state, dcon::nation_id n)
int32_t mobilized_regiments_created_from_province(sys::state &state, dcon::province_id p)
int32_t mobilized_regiments_possible_from_province(sys::state &state, dcon::province_id p)
int32_t naval_supply_points(sys::state &state, dcon::nation_id n)
constexpr uint8_t is_banned
constexpr uint8_t level_friendly
constexpr uint8_t level_in_sphere
constexpr uint8_t level_mask
float colonial_points_from_naval_bases(sys::state &state, dcon::nation_id n)
status get_status(sys::state &state, dcon::nation_id n)
bool is_great_power(sys::state const &state, dcon::nation_id id)
int32_t free_colonial_points(sys::state &state, dcon::nation_id n)
bool is_losing_colonial_race(sys::state &state, dcon::nation_id n)
float used_colonial_points(sys::state &state, dcon::nation_id n)
bool can_expand_colony(sys::state &state, dcon::nation_id n)
float diplomatic_points(sys::state const &state, dcon::nation_id n)
float prestige_score(sys::state const &state, dcon::nation_id n)
float colonial_points_from_technology(sys::state &state, dcon::nation_id n)
float monthly_diplomatic_points(sys::state const &state, dcon::nation_id n)
float daily_research_points(sys::state &state, dcon::nation_id n)
bool has_decision_available(sys::state &state, dcon::nation_id n)
int64_t get_monthly_pop_increase_of_nation(sys::state &state, dcon::nation_id n)
bool sphereing_progress_is_possible(sys::state &state, dcon::nation_id n)
int32_t national_focuses_in_use(sys::state &state, dcon::nation_id n)
bool has_reform_available(sys::state &state, dcon::nation_id n)
dcon::technology_id current_research(sys::state const &state, dcon::nation_id n)
int32_t max_national_focuses(sys::state &state, dcon::nation_id n)
float get_treasury(sys::state &state, dcon::nation_id n)
float colonial_points_from_ships(sys::state &state, dcon::nation_id n)
dcon::mp_player_id find_country_player(sys::state &state, dcon::nation_id nation)
bool can_enact_social_reform(sys::state &state, dcon::nation_id n, dcon::issue_option_id o)
bool can_enact_political_reform(sys::state &state, dcon::nation_id nation, dcon::issue_option_id issue_option)
dcon::issue_id get_issue_by_name(sys::state &state, std::string_view name)
bool can_enact_military_reform(sys::state &state, dcon::nation_id n, dcon::reform_option_id o)
bool has_elections(sys::state &state, dcon::nation_id nation)
bool is_election_ongoing(sys::state &state, dcon::nation_id nation)
bool can_enact_economic_reform(sys::state &state, dcon::nation_id n, dcon::reform_option_id o)
bool can_integrate_colony(sys::state &state, dcon::state_instance_id id)
bool can_start_colony(sys::state &state, dcon::nation_id n, dcon::state_definition_id d)
bool can_invest_in_colony(sys::state &state, dcon::nation_id n, dcon::state_definition_id d)
int32_t get_faction_brigades_active(sys::state &state, dcon::rebel_faction_id r)
bool sphere_member_has_ongoing_revolt(sys::state &state, dcon::nation_id n)
std::string rebel_name(sys::state &state, dcon::rebel_faction_id reb)
audio_instance & get_tab_population_sound(sys::state &state)
audio_instance & get_tab_production_sound(sys::state &state)
audio_instance & get_tab_budget_sound(sys::state &state)
audio_instance & get_tab_technology_sound(sys::state &state)
audio_instance & get_unpause_sound(sys::state &state)
audio_instance & get_tab_politics_sound(sys::state &state)
audio_instance & get_pause_sound(sys::state &state)
void play_interface_sound(sys::state &state, audio_instance &s, float volume)
audio_instance & get_tab_diplomacy_sound(sys::state &state)
audio_instance & get_click_sound(sys::state &state)
audio_instance & get_tab_military_sound(sys::state &state)
bool is_leap_year(int32_t year)
@ industrial_and_consumer_goods
void merge_sort(IT first, IT end, CMP const &cmp) noexcept
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)
std::string date_to_string(sys::state &state, sys::date date)
void localised_single_sub_box(sys::state &state, layout_base &dest, layout_box &box, std::string_view key, variable_type subkey, substitution value)
void localised_format_box(sys::state &state, layout_base &dest, layout_box &box, std::string_view key, text::substitution_map const &sub)
std::string prettify(int64_t num)
endless_layout create_endless_layout(sys::state &state, layout &dest, layout_parameters const ¶ms)
std::string format_float(float num, size_t digits)
void add_line(sys::state &state, layout_base &dest, dcon::text_key txt, int32_t indent)
void add_line_break_to_layout(sys::state &state, columnar_layout &dest)
void add_to_substitution_map(substitution_map &mp, variable_type key, substitution value)
void add_divider_to_layout_box(sys::state &state, layout_base &dest, layout_box &box)
std::string get_dynamic_state_name(sys::state &state, dcon::state_instance_id state_id)
ankerl::unordered_dense::map< uint32_t, substitution > substitution_map
std::string produce_simple_string(sys::state const &state, dcon::text_key id)
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 nation_name_and_flag(sys::state &state, dcon::nation_id n, layout_base &dest, int32_t indent)
std::string prettify_currency(float num)
void close_layout_box(columnar_layout &dest, layout_box &box)
int32_t ui_height(sys::state const &state)
int32_t ui_width(sys::state const &state)
void produce_decision_substitutions(sys::state &state, text::substitution_map &m, dcon::nation_id n)
std::variant< std::monostate, dcon::nation_id, dcon::state_instance_id, dcon::province_id > pop_list_filter
bool events_pause_test(sys::state &state)
void active_modifiers_description(sys::state &state, text::layout_base &layout, dcon::nation_id n, int32_t identation, dcon::national_modifier_value nmid, bool header)
Holds important data about the game world, state, and other data regarding windowing,...
union ui::element_data::internal_data data
element_base * technology_subwindow
element_base * trade_subwindow
element_base * topbar_window
float last_tick_investment_pool_change
element_base * topbar_subwindow
ankerl::unordered_dense::map< dcon::text_key, element_target, hash_text_key > defs_by_name
std::unique_ptr< element_base > root
element_base * request_topbar_listbox
element_base * population_subwindow
element_base * politics_subwindow
element_base * production_subwindow