31 dcon::province_land_construction_id
land_id;
53 if(
state.world.nation_get_disarmed_until(
state.local_player_nation)
54 &&
state.current_date <
state.world.nation_get_disarmed_until(
state.local_player_nation)) {
67 auto content = retrieve<buildable_unit_entry_info>(
state,
parent);
69 if(
is_navy ==
false && std::max(
state.defines.alice_full_reinforce,
state.world.pop_get_size(content.pop_info) /
state.defines.pop_size_per_regiment) < 1.f) {
80 dcon::nation_id n = retrieve<dcon::nation_id>(
state,
parent);
82 dcon::unit_type_id utid = info.
utid ? info.
utid : retrieve<dcon::unit_type_id>(
state,
parent);
83 dcon::province_id p = retrieve<dcon::province_id>(
state,
parent);
89 dcon::culture_id c = retrieve<dcon::culture_id>(
state,
parent);
101 dcon::unit_type_id utid = retrieve<dcon::unit_type_id>(
state,
parent);
102 dcon::province_id p = retrieve<dcon::province_id>(
state,
parent);
108 if(
state.world.nation_get_unit_stats(
state.local_player_nation, utid).siege_or_torpedo_attack > 0) {
113 if(
state.military_definitions.unit_base_definitions[utid].discipline_or_evasion > 0) {
122 if(std::max(
state.defines.alice_full_reinforce,
state.world.pop_get_size(info.
pop_info) /
state.defines.pop_size_per_regiment) < 1.f) {
126 if(
state.world.nation_get_unit_stats(
state.local_player_nation, utid).reconnaissance_or_fire_range > 0) {
129 if(
state.world.nation_get_unit_stats(
state.local_player_nation, utid).siege_or_torpedo_attack > 0) {
135 if(
state.military_definitions.unit_base_definitions[utid].support > 0) {
149 dcon::unit_type_id utid = retrieve<dcon::unit_type_id>(
state,
parent);
150 dcon::modifier_id
con = retrieve<dcon::modifier_id>(
state,
parent);
151 for(
auto po :
state.world.nation_get_province_ownership_as_nation(
state.local_player_nation)) {
152 auto p = po.get_province();
153 if(
state.world.province_get_continent(p) ==
con) {
159 state.world.for_each_culture([&](dcon::culture_id c) {
161 command::start_land_unit_construction(state, state.local_player_nation, p, c, utid);
185 if(
name ==
"goods_type") {
186 auto ptr = make_element_by_type<image_element_base>(
state,
id);
189 }
else if(
name ==
"value") {
190 auto ptr = make_element_by_type<simple_text_element_base>(
state,
id);
208 if(!local_unit_entry.
is_navy) {
209 dcon::nation_id n =
state.world.province_land_construction_get_nation(local_unit_entry.
land_id);
210 dcon::unit_type_id utid =
state.world.province_land_construction_get_type(local_unit_entry.
land_id);
211 dcon::province_id p =
state.world.pop_get_province_from_pop_location(
state.world.province_land_construction_get_pop(local_unit_entry.
land_id));
212 dcon::culture_id c =
state.world.pop_get_culture(
state.world.province_land_construction_get_pop(local_unit_entry.
land_id));
215 dcon::nation_id n =
state.world.province_naval_construction_get_nation(local_unit_entry.
naval_id);
216 dcon::unit_type_id utid =
state.world.province_naval_construction_get_type(local_unit_entry.
naval_id);
217 dcon::province_id p =
state.world.province_naval_construction_get_province(local_unit_entry.
naval_id);
258 for(
auto lc :
state.world.nation_get_province_naval_construction(
state.local_player_nation)) {
262 for(
auto lc :
state.world.nation_get_province_land_construction(
state.local_player_nation)) {
277 if(payload.holds_type<dcon::army_id>()) {
280 }
else if(payload.holds_type<dcon::navy_id>()) {
298 dcon::nation_id n = retrieve<dcon::nation_id>(
state,
parent);
300 state.military_definitions.unit_base_definitions[
unit_type].active ==
false;
309 if(
state.military_definitions.unit_base_definitions[
unit_type].is_land) {
310 if(
state.world.nation_get_unit_stats(
state.local_player_nation,
unit_type).reconnaissance_or_fire_range > 0) {
313 if(
state.world.nation_get_unit_stats(
state.local_player_nation,
unit_type).siege_or_torpedo_attack > 0) {
319 if(
state.military_definitions.unit_base_definitions[
unit_type].support > 0) {
328 if(
state.world.nation_get_unit_stats(
state.local_player_nation,
unit_type).siege_or_torpedo_attack > 0) {
333 if(
state.military_definitions.unit_base_definitions[
unit_type].discipline_or_evasion > 0) {
340 for(
const auto inv :
state.world.in_invention) {
378 auto ptr = make_element_by_type<resource_cost>(
state,
state.ui_state.
defs_by_name.find(
state.lookup_key(
"build_resource_cost"))->second.definition);
386 if(
name ==
"build_button") {
387 auto ptr = make_element_by_type<unit_build_button>(
state,
id);
388 ptr->set_button_text(
state,
"");
391 }
else if(
name ==
"build_button_group") {
392 auto ptr = make_element_by_type<unit_build_button_group>(
state,
id);
393 ptr->set_button_text(
state,
"");
396 }
else if(
name ==
"name") {
397 auto ptr = make_element_by_type<simple_text_element_base>(
state,
id);
400 }
else if(
name ==
"unit_strip") {
401 auto ptr = make_element_by_type<image_element_base>(
state,
id);
404 }
else if(
name ==
"province") {
405 auto ptr = make_element_by_type<simple_text_element_base>(
state,
id);
408 }
else if(
name ==
"time_to_build") {
409 auto ptr = make_element_by_type<simple_text_element_base>(
state,
id);
412 }
else if(
name ==
"popsize") {
413 auto ptr = make_element_by_type<simple_text_element_base>(
state,
id);
415 auto ptr2 = make_element_by_type<simple_text_element_base>(
state,
id);
416 ptr2->base_data.position.y += 14;
429 auto const& udef =
state.military_definitions.unit_base_definitions[utid];
438 ele->set_visible(
state,
false);
440 for(
auto com : udef.build_cost.commodity_type) {
441 if(udef.build_cost.commodity_amounts[r] > 0.0f) {
445 resource_cost_elements[r]->good_quantity = udef.build_cost.commodity_amounts[r] * (2.0f -
state.world.nation_get_administrative_efficiency(
state.local_player_nation));
464 int num_of_brigades = 0;
468 for(
auto pl :
state.world.province_get_pop_location_as_province(
state.world.pop_get_province_from_pop_location(
content.
pop_info))) {
469 if(pl.get_pop().get_poptype() ==
state.culture_definitions.soldiers) {
470 for(
auto i :
state.world.pop_get_regiment_source(pl.get_pop())) {
471 num_of_brigades += 1;
507 ele->set_visible(
state,
false);
509 for(
auto com : udef.build_cost.commodity_type) {
510 if(udef.build_cost.commodity_amounts[r] > 0.0f) {
535 if(payload.holds_type<dcon::culture_id>()) {
538 }
else if(payload.holds_type<dcon::province_id>()) {
541 }
else if(payload.holds_type<dcon::modifier_id>()) {
544 }
else if(payload.holds_type< dcon::unit_type_id>()) {
555 return "build_unit_entry_wide";
565 dcon::unit_type_id utid = retrieve<dcon::unit_type_id>(
state,
parent);
570 group_info.
utid = utid;
571 std::vector<dcon::modifier_const_fat_id> continent_list;
572 std::vector<buildable_unit_entry_info> list_of_possible_units;
574 for(
auto po :
state.world.nation_get_province_ownership_as_nation(
state.local_player_nation)) {
575 auto p = po.get_province();
576 state.world.for_each_culture([&](dcon::culture_id c) {
578 buildable_unit_entry_info info;
580 info.is_navy = false;
581 for(auto pl : state.world.province_get_pop_location_as_province(p)) {
582 if(pl.get_pop().get_culture() == c) {
583 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) {
584 info.pop_info = pl.get_pop();
585 auto pop_possible = int16_t(military::regiments_possible_from_pop(state, pl.get_pop()));
586 const auto lc = pl.get_pop().get_province_land_construction_as_pop();
587 pop_possible -= int16_t(lc.end() - lc.begin());
588 const auto ar = pl.get_pop().get_regiment_source();
589 pop_possible -= int16_t(ar.end() - ar.begin());
590 info.num_possible += std::max(pop_possible, int16_t(0));
595 info.province_info = p;
596 if(info.num_possible > 0) {
597 if(!std::count(continent_list.begin(), continent_list.end(), state.world.province_get_continent(p))) {
598 continent_list.push_back(state.world.province_get_continent(p));
600 info.continent =
state.world.province_get_continent(p);
601 list_of_possible_units.push_back(info);
606 group_info.pop_info = dcon::pop_id{};
607 group_info.province_info = dcon::province_id{};
608 group_info.is_navy =
false;
609 int16_t num_units_on_con = 0;
610 for(
auto con : continent_list) {
611 group_info.continent =
con;
612 for(
auto bu : list_of_possible_units) {
613 if(bu.continent ==
con) {
614 num_units_on_con += bu.num_possible;
617 group_info.num_on_continent = num_units_on_con;
620 for(
auto bu : list_of_possible_units) {
621 if(bu.continent ==
con && std::max(
state.defines.alice_full_reinforce,
state.world.pop_get_size(bu.pop_info) /
state.defines.pop_size_per_regiment) >= 1.f) {
622 bu.continent = dcon::modifier_id{};
627 for(
auto bu : list_of_possible_units) {
628 if(bu.continent ==
con && std::max(
state.defines.alice_full_reinforce,
state.world.pop_get_size(bu.pop_info) /
state.defines.pop_size_per_regiment) < 1.f) {
629 bu.continent = dcon::modifier_id{};
633 num_units_on_con = 0;
636 for(
auto po :
state.world.nation_get_province_ownership_as_nation(
state.local_player_nation)) {
637 auto p = po.get_province();
639 buildable_unit_entry_info info;
642 info.continent =
state.world.province_get_continent(p);
643 info.pop_info = dcon::pop_id{};
644 info.province_info = p;
645 if(!std::count(continent_list.begin(), continent_list.end(),
state.world.province_get_continent(p))) {
646 continent_list.push_back(
state.world.province_get_continent(p));
648 list_of_possible_units.push_back(info);
651 group_info.pop_info = dcon::pop_id{};
652 group_info.province_info = dcon::province_id{};
653 group_info.is_navy =
true;
654 int16_t num_units_on_con = 0;
655 for(
auto con : continent_list) {
656 group_info.continent =
con;
657 for(
auto bu : list_of_possible_units) {
658 if(bu.continent ==
con) {
662 group_info.num_on_continent = num_units_on_con;
663 row_contents.push_back(group_info);
664 for(
auto bu : list_of_possible_units) {
665 if(bu.continent ==
con) {
666 bu.continent = dcon::modifier_id{};
667 row_contents.push_back(bu);
670 num_units_on_con = 0;
684 if(
name ==
"button") {
685 return make_element_by_type<invisible_element>(
state,
id);
686 }
else if(
name ==
"button2") {
687 auto ptr = make_element_by_type<ui::unit_queue_button>(
state,
id);
688 ptr->set_button_text(
state,
"");
689 queue_button = ptr.
get();
691 }
else if(
name ==
"unit_strip") {
692 auto ptr = make_element_by_type<image_element_base>(
state,
id);
693 unit_icon = ptr.
get();
695 }
else if(
name ==
"name") {
696 auto ptr = make_element_by_type<simple_text_element_base>(
state,
id);
697 unit_name = ptr.
get();
699 }
else if(
name ==
"province") {
700 return make_element_by_type<generic_name_text<dcon::province_id>>(
state, id);
701 }
else if(
name ==
"continent") {
702 return make_element_by_type<generic_name_text<dcon::modifier_id>>(
state, id);
709 if(!content.is_navy) {
710 auto c = content.land_id;
712 dcon::unit_type_id utid =
state.world.province_land_construction_get_type(c);
714 unit_icon->
frame =
state.military_definitions.unit_base_definitions[utid].icon - 1;
717 state.world.pop_get_culture(
state.world.province_land_construction_get_pop(c)).get_name());
719 unit_name->
set_text(
state, culture_content +
" " + unit_type_name);
722 }
else if(content.is_navy) {
723 auto c = content.naval_id;
725 dcon::unit_type_id utid =
state.world.province_naval_construction_get_type(c);
727 unit_icon->
frame =
state.military_definitions.unit_base_definitions[utid].icon - 1;
736 if(payload.holds_type<dcon::province_id>()) {
737 dcon::province_id p{};
738 if(!content.is_navy) {
739 auto c = content.land_id;
740 p =
state.world.pop_location_get_province(
state.world.pop_get_pop_location_as_pop(
state.world.province_land_construction_get_pop(c)));
741 }
else if(content.is_navy) {
742 auto c = content.naval_id;
743 p =
state.world.province_naval_construction_get_province(c);
745 payload.emplace<dcon::province_id>(p);
746 return message_result::consumed;
747 }
else if(payload.holds_type<dcon::modifier_id>()) {
748 dcon::province_id p{};
749 if(!content.is_navy) {
750 auto c = content.land_id;
751 p =
state.world.pop_location_get_province(
state.world.pop_get_pop_location_as_pop(
state.world.province_land_construction_get_pop(c)));
752 }
else if(content.is_navy) {
753 auto c = content.naval_id;
754 p =
state.world.province_naval_construction_get_province(c);
756 payload.emplace<dcon::modifier_id>(
state.world.province_get_continent(p));
757 return message_result::consumed;
760 return message_result::consumed;
769 return "queue_unit_entry";
778 row_contents.clear();
779 if(is_navy ==
false) {
780 state.world.nation_for_each_province_land_construction_as_nation(
state.local_player_nation, [&](dcon::province_land_construction_id c) { row_contents.push_back(ui::queue_unit_entry_info{ c, dcon::province_naval_construction_id{0}, false }); });
782 state.world.nation_for_each_province_naval_construction_as_nation(
state.local_player_nation, [&](dcon::province_naval_construction_id c) { row_contents.push_back(
ui::queue_unit_entry_info{ dcon::province_land_construction_id{0}, c,
true }); });
791 auto cstr_range =
state.world.nation_get_province_land_construction(
state.local_player_nation);
792 set_text(
state, std::to_string(cstr_range.end() - cstr_range.begin()));
799 auto cstr_range =
state.world.nation_get_province_naval_construction(
state.local_player_nation);
800 set_text(
state, std::to_string(cstr_range.end() - cstr_range.begin()));
805 dcon::unit_type_id unit_type{};
806 dcon::unit_type_id first_land_type{};
807 dcon::unit_type_id first_naval_type{};
811 window_element_base::on_create(
state);
812 set_visible(
state,
false);
816 if(
name ==
"cancel_all_units") {
817 return make_element_by_type<cancel_all_units_button>(
state,
id);
818 }
else if(
name ==
"build_army_label") {
819 auto ptr = make_element_by_type<simple_text_element_base>(
state,
id);
820 army_elements.push_back(ptr.get());
822 }
else if(
name ==
"build_navy_label") {
823 auto ptr = make_element_by_type<simple_text_element_base>(
state,
id);
824 navy_elements.push_back(ptr.get());
826 }
else if(
name ==
"close") {
827 return make_element_by_type<build_unit_close_button>(
state,
id);
828 }
else if(
name ==
"list") {
829 auto ptr = make_element_by_type<units_build_listbox>(
state,
id);
830 units_listbox = ptr.get();
832 }
else if(
name ==
"queue") {
833 auto ptr = make_element_by_type<units_queue_listbox>(
state,
id);
834 units_queue = ptr.get();
836 }
else if(
name ==
"external_scroll_slider_list") {
837 return make_element_by_type<invisible_element>(
state,
id);
838 }
else if(
name ==
"units_being_built_number") {
840 auto ptr = make_element_by_type<land_unit_under_construction_count>(
state,
id);
841 army_elements.push_back(ptr.get());
842 add_child_to_back(std::move(ptr));
845 auto ptr = make_element_by_type<naval_unit_under_construction_count>(
state,
id);
846 navy_elements.push_back(ptr.get());
849 }
else if(
name ==
"external_scroll_slider_queue") {
850 return make_element_by_type<invisible_element>(
state,
id);
851 }
else if(
name.substr(0, 12) ==
"unit_folder_") {
852 auto ptr = make_element_by_type<unit_folder_button>(
state,
id);
853 int32_t value = std::stoi(std::string(
name.substr(12)));
854 for(
uint8_t i = 0; i <
state.military_definitions.unit_base_definitions.size(); i++) {
855 auto const& def =
state.military_definitions.unit_base_definitions[dcon::unit_type_id(i)];
856 if(def.icon == value) {
857 ptr->unit_type = dcon::unit_type_id(i);
859 first_land_type = ptr->unit_type;
860 army_elements.push_back(ptr.get());
862 first_naval_type = ptr->unit_type;
863 navy_elements.push_back(ptr.get());
868 }
else if(
name ==
"military_recruit_bg") {
869 return make_element_by_type<opaque_element_base>(
state,
id);
876 units_queue->is_navy = units_listbox->is_navy =
false;
877 for(
auto element : army_elements)
878 element->set_visible(
state,
true);
879 units_listbox->impl_on_update(
state);
880 units_queue->impl_on_update(
state);
884 for(
auto element : army_elements)
885 element->set_visible(
state,
false);
889 units_queue->is_navy = units_listbox->is_navy =
true;
890 for(
auto element : navy_elements)
891 element->set_visible(
state,
true);
892 units_listbox->impl_on_update(
state);
893 units_queue->impl_on_update(
state);
897 for(
auto element : navy_elements)
898 element->set_visible(
state,
false);
902 if(payload.holds_type<dcon::army_id>()) {
903 unit_type = first_land_type;
904 set_navy_invisible(
state);
905 set_army_visible(
state);
907 impl_set(
state, unit_type_payload);
908 return message_result::consumed;
909 }
else if(payload.holds_type<dcon::navy_id>()) {
910 unit_type = first_naval_type;
911 set_army_invisible(
state);
912 set_navy_visible(
state);
914 impl_set(
state, unit_type_payload);
915 return message_result::consumed;
917 return message_result::unseen;
922 unit_type = Cyto::any_cast<element_selection_wrapper<dcon::unit_type_id>>(payload).data;
923 units_listbox->impl_on_update(
state);
924 units_queue->impl_on_update(
state);
925 impl_set(
state, payload);
926 return message_result::consumed;
927 }
else if(payload.holds_type<dcon::unit_type_id>()) {
928 payload.emplace<dcon::unit_type_id>(unit_type);
929 return message_result::consumed;
931 return message_result::unseen;
943 return "build_unit_entry";
948 row_contents.clear();
949 for(
uint8_t i = 2; i <
state.military_definitions.unit_base_definitions.size(); i++) {
950 auto utid = dcon::unit_type_id(i);
952 auto const& def =
state.military_definitions.unit_base_definitions[utid];
953 if(!def.active && !
state.world.nation_get_active_unit(
state.local_player_nation, utid))
955 if(def.is_land != !is_navy)
957 auto p = retrieve<dcon::province_id>(
state, parent);
962 if(is_navy ==
false) {
963 state.world.for_each_culture([&](dcon::culture_id c) {
965 for(auto pl : state.world.province_get_pop_location_as_province(p)) {
966 if(pl.get_pop().get_culture() == c) {
967 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) {
968 info.pop_info = pl.get_pop();
969 auto pop_possible = int16_t(military::regiments_possible_from_pop(state, pl.get_pop()));
970 const auto lc = pl.get_pop().get_province_land_construction_as_pop();
971 pop_possible -= int16_t(lc.end() - lc.begin());
972 const auto ar = pl.get_pop().get_regiment_source();
973 pop_possible -= int16_t(ar.end() - ar.begin());
974 info.num_possible += std::max(pop_possible, int16_t(0));
980 row_contents.push_back(info);
984 row_contents.push_back(info);
994 return "queue_unit_entry";
999 auto p = retrieve<dcon::province_id>(
state, parent);
1000 row_contents.clear();
1001 if(is_navy ==
false) {
1002 state.world.nation_for_each_province_land_construction_as_nation(
state.local_player_nation, [&](dcon::province_land_construction_id c) {
1003 if(p == state.world.pop_get_province_from_pop_location(state.world.province_land_construction_get_pop(c)))
1004 row_contents.push_back(ui::queue_unit_entry_info{ c, dcon::province_naval_construction_id{0}, is_navy });
1007 state.world.province_for_each_province_naval_construction(p, [&](dcon::province_naval_construction_id c) { row_contents.push_back(
ui::queue_unit_entry_info{ dcon::province_land_construction_id{0}, c, is_navy }); });
1015 bool is_navy =
false;
1017 auto p = retrieve<dcon::province_id>(
state, parent);
1018 if(is_navy ==
false) {
1019 state.world.nation_for_each_province_land_construction_as_nation(
state.local_player_nation, [&](dcon::province_land_construction_id c) {
1020 auto lc = dcon::fatten(state.world, c);
1021 if(p == state.world.pop_get_province_from_pop_location(state.world.province_land_construction_get_pop(c)))
1022 command::cancel_land_unit_construction(state, state.local_player_nation, lc.get_pop().get_province_from_pop_location(), lc.get_pop().get_culture(), lc.get_type());
1025 state.world.province_for_each_province_naval_construction(p, [&](dcon::province_naval_construction_id c) {
1032 return tooltip_behavior::variable_tooltip;
1044 if(
state.world.nation_get_disarmed_until(
state.local_player_nation)
1045 &&
state.current_date <
state.world.nation_get_disarmed_until(
state.local_player_nation)) {
1051 std::vector<element_base*> army_elements;
1052 std::vector<element_base*> navy_elements;
1058 window_element_base::on_create(
state);
1059 set_visible(
state,
false);
1063 if(
name ==
"cancel_all_units") {
1064 auto ptr = make_element_by_type<build_unit_province_cancel_all_units_button>(
state,
id);
1065 cancel_all_btn = ptr.
get();
1067 }
else if(
name ==
"close") {
1068 return make_element_by_type<build_unit_province_close_button>(
state,
id);
1069 }
else if(
name ==
"list") {
1070 auto ptr = make_element_by_type<units_province_build_listbox>(
state,
id);
1071 units_listbox = ptr.
get();
1073 }
else if(
name ==
"queue") {
1074 auto ptr = make_element_by_type<units_province_queue_listbox>(
state,
id);
1075 units_queue = ptr.
get();
1077 }
else if(
name ==
"province_recruit_bg") {
1078 return make_element_by_type<opaque_element_base>(
state,
id);
1079 }
else if(
name ==
"external_scroll_slider_list"
1080 ||
name ==
"external_scroll_slider_queue"
1081 ||
name ==
"cell_window_list"
1082 ||
name ==
"cell_window_queue") {
1083 return make_element_by_type<invisible_element>(
state,
id);
1090 if(payload.holds_type<dcon::army_id>()) {
1094 return message_result::consumed;
1095 }
else if(payload.holds_type<dcon::navy_id>()) {
1099 return message_result::consumed;
1101 return message_result::unseen;
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 set(sys::state &state, Cyto::Any &payload) noexcept override
message_result get(sys::state &state, Cyto::Any &payload) noexcept override
void set_navy_invisible(sys::state &state)
std::vector< element_base * > army_elements
void set_army_visible(sys::state &state)
void set_navy_visible(sys::state &state)
void set_army_invisible(sys::state &state)
std::vector< element_base * > navy_elements
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
dcon::province_id province_info
bool operator==(buildable_unit_entry_info const &o) const
bool operator!=(buildable_unit_entry_info const &o) const
dcon::modifier_id continent
void add_child_to_back(std::unique_ptr< element_base > child) noexcept final
void add_child_to_front(std::unique_ptr< element_base > child) noexcept final
void impl_on_update(sys::state &state) noexcept override
virtual message_result 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 on_update(sys::state &state) noexcept override
std::vector< buildable_unit_entry_info > row_contents
message_result get(sys::state &state, Cyto::Any &payload) noexcept override
buildable_unit_entry_info content
void on_update(sys::state &state) noexcept override
bool operator!=(queue_unit_entry_info const &o) const
dcon::province_naval_construction_id naval_id
bool operator==(queue_unit_entry_info const &o) const
dcon::province_land_construction_id land_id
void on_update(sys::state &state) noexcept override
simple_text_element_base * value
std::unique_ptr< element_base > make_child(sys::state &state, std::string_view name, dcon::gui_def_id id) noexcept override
image_element_base * goods_type
void set_text(sys::state &state, std::string const &new_text)
void on_update(sys::state &state) noexcept override
ui::image_element_base * unit_icon
ui::simple_text_element_base * build_time
void on_create(sys::state &state) noexcept override
ui::simple_text_element_base * brigades
ui::simple_text_element_base * unit_name
std::string pop_size_text
ui::simple_text_element_base * pop_size
ui::unit_build_button * build_button
std::vector< resource_cost * > resource_cost_elements
ui::unit_build_button_group * build_button_group
message_result get(sys::state &state, Cyto::Any &payload) 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
std::string_view get_row_element_name() 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
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
void on_update(sys::state &state) 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 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)
void 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)
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)
@ cancel_land_unit_construction
@ cancel_naval_unit_construction
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
int32_t regiments_max_possible_from_province(sys::state &state, dcon::province_id p)
uint32_t pack_color(float r, float g, float b)
std::string resolve_string_substitution(sys::state &state, dcon::text_key source_text, substitution_map const &mp)
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_to_substitution_map(substitution_map &mp, variable_type key, substitution value)
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)
std::string format_percentage(float num, size_t digits)
int32_t to_generic(dcon::province_id v)
void additive_value_modifier_description(sys::state &state, text::layout_base &layout, dcon::value_modifier_key modifier, int32_t primary, int32_t this_slot, int32_t from_slot)
void send(sys::state &state, element_base *parent, T value)
static constexpr uint32_t set_size
element_base * unit_window_army
element_base * unit_window_navy
ankerl::unordered_dense::map< dcon::text_key, element_target, hash_text_key > defs_by_name
element_base * build_unit_window
element_base * build_province_unit_window