11 auto pculture =
state.world.nation_get_primary_culture(
state.local_player_nation);
12 auto ltype = pculture.get_group_from_culture_group_membership().get_leader();
14 auto lid = retrieve<dcon::leader_id>(
state,
parent);
15 auto admiral =
state.world.leader_get_is_admiral(lid);
17 auto arange = ltype.get_admirals();
18 if(arange.size() > 0) {
24 auto grange = ltype.get_generals();
25 if(grange.size() > 0) {
60 auto ptr = make_element_by_type<simple_text_element_base>(
state,
id);
63 }
else if (
name ==
"leader") {
64 return make_element_by_type<leader_portrait>(
state,
id);
65 }
else if(
name ==
"background") {
66 auto ptr = make_element_by_type<simple_text_element_base>(
state,
id);
70 }
else if(
name ==
"personality") {
71 auto ptr = make_element_by_type<simple_text_element_base>(
state,
id);
75 }
else if(
name ==
"use_leader") {
76 return make_element_by_type<invisible_element>(
state,
id);
78 }
else if(
name ==
"army") {
79 auto ptr = make_element_by_type<simple_text_element_base>(
state,
id);
83 }
else if(
name ==
"location") {
84 auto ptr = make_element_by_type<simple_text_element_base>(
state,
id);
88 else if(
name ==
"leader_prestige_bar") {
89 auto ptr = make_element_by_type<leader_prestige_progress_bar<dcon::leader_id>>(
state, id);
93 else if(
name ==
"prestige_bar_frame") {
94 return make_element_by_type<image_element_base>(
state,
id);
104 auto name_content =
state.to_string_view(name_id);
109 auto background_id =
state.world.leader_get_background(
content).get_name();
115 auto personality_id =
state.world.leader_get_personality(
content).get_name();
120 auto army_id =
state.world.leader_get_army_from_army_leadership(
content);
121 if(army_id.value == 0) {
130 auto army_content =
state.to_string_view(
state.world.army_get_name(army_id));
148 return "milview_leader_entry";
154 for(
auto const fat_id :
state.world.nation_get_leader_loyalty(
state.local_player_nation))
178 auto lp =
state.world.nation_get_leadership_points(
state.local_player_nation);
179 int32_t
count = int32_t(lp /
state.defines.leader_recruit_cost);
254 auto general_count = 0;
255 for(
auto const fat_id :
state.world.nation_get_leader_loyalty(
state.local_player_nation)) {
256 auto leader_id = fat_id.get_leader();
257 if(!
state.world.leader_get_is_admiral(leader_id)) {
268 auto admiral_count = 0;
269 for(
auto const fat_id :
state.world.nation_get_leader_loyalty(
state.local_player_nation)) {
270 auto leader_id = fat_id.get_leader();
271 if(
state.world.leader_get_is_admiral(leader_id)) {
282 if(
name ==
"sort_leader_prestige") {
283 return make_element_by_type<leaders_sortby_prestige>(
state,
id);
284 }
else if(
name ==
"sort_prestige_icon") {
285 return make_element_by_type<image_element_base>(
state,
id);
286 }
else if(
name ==
"sort_leader_type") {
287 return make_element_by_type<leaders_sortby_type>(
state,
id);
288 }
else if(
name ==
"sort_leader_name") {
289 return make_element_by_type<leaders_sortby_name>(
state,
id);
290 }
else if(
name ==
"sort_leader_army") {
291 return make_element_by_type<leaders_sortby_army>(
state,
id);
292 }
else if(
name ==
"leader_listbox") {
293 return make_element_by_type<military_leaders_listbox>(
state,
id);
294 }
else if(
name ==
"new_general") {
295 return make_element_by_type<military_make_leader_button<true>>(
state, id);
296 }
else if(
name ==
"new_admiral") {
297 return make_element_by_type<military_make_leader_button<false>>(
state, id);
298 }
else if(
name ==
"generals") {
299 return make_element_by_type<military_general_count>(
state,
id);
300 }
else if(
name ==
"admirals") {
301 return make_element_by_type<military_admiral_count>(
state,
id);
302 }
else if(
name ==
"auto_create") {
303 return make_element_by_type<invisible_element>(
state,
id);
304 }
else if(
name ==
"auto_create_text") {
305 return make_element_by_type<invisible_element>(
state,
id);
306 }
else if(
name ==
"auto_assign") {
307 return make_element_by_type<invisible_element>(
state,
id);
308 }
else if(
name ==
"auto_assign_text") {
309 return make_element_by_type<invisible_element>(
state,
id);
message_result impl_set(sys::state &state, Cyto::Any &payload) noexcept final
virtual message_result get(sys::state &state, Cyto::Any &payload) noexcept
virtual void on_create(sys::state &state) noexcept
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
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
std::unique_ptr< element_base > make_child(sys::state &state, std::string_view name, dcon::gui_def_id id) noexcept override
std::vector< dcon::leader_id > 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
std::string_view get_row_element_name() override
ui::simple_text_element_base * leader_name
ui::simple_text_element_base * background
std::unique_ptr< element_base > make_child(sys::state &state, std::string_view name, dcon::gui_def_id id) noexcept override
ui::simple_text_element_base * location
void on_create(sys::state &state) noexcept override
ui::simple_text_element_base * personality
ui::simple_text_element_base * army
void on_update(sys::state &state) noexcept override
ui::leader_prestige_progress_bar< dcon::leader_id > * prestige
void set_text(sys::state &state, std::string const &new_text)
bool can_make_leader(sys::state &state, dcon::nation_id source, bool general)
uint32_t reduce(uint32_t value_in, uint32_t upper_bound)
uint64_t get_random(sys::state const &state, uint32_t value_in)
layout_box open_layout_box(layout_base &dest, int32_t indent)
void localised_format_box(sys::state &state, layout_base &dest, layout_box &box, std::string_view key, text::substitution_map const &sub)
void add_line(sys::state &state, layout_base &dest, dcon::text_key txt, int32_t indent)
std::string produce_simple_string(sys::state const &state, dcon::text_key id)
void close_layout_box(columnar_layout &dest, layout_box &box)
void display_leader_attributes(sys::state &state, dcon::leader_id lid, text::layout_base &contents, int32_t indent)
union ui::element_data::internal_data data
dcon::gfx_object_id gfx_object