Project Alice
Loading...
Searching...
No Matches
gui_leader_select.hpp
Go to the documentation of this file.
1#pragma once
2#include "dcon_generated.hpp"
3#include "commands.hpp"
5#include "prng.hpp"
6#include "text.hpp"
7
8namespace ui {
9
12};
13
15public:
16 void button_action(sys::state& state) noexcept override {
17 if(auto a = retrieve<dcon::army_id>(state, parent); a) {
18 command::change_general(state, state.local_player_nation, a, dcon::leader_id{});
19 } else if(auto v = retrieve<dcon::navy_id>(state, parent); v){
20 command::change_admiral(state, state.local_player_nation, v, dcon::leader_id{});
21 }
23 }
24};
25
27public:
28 dcon::gfx_object_id default_img;
29
30 void on_update(sys::state& state) noexcept override {
31 if(!default_img)
33
34 dcon::leader_id lid = retrieve<dcon::leader_id>(state, parent);
35
36 auto pculture = state.world.nation_get_primary_culture(state.local_player_nation);
37 auto ltype = pculture.get_group_from_culture_group_membership().get_leader();
38
39 if(ltype && lid) {
40 auto admiral = state.world.leader_get_is_admiral(lid);
41 if(admiral) {
42 auto arange = ltype.get_admirals();
43 if(arange.size() > 0) {
44 auto rval = rng::get_random(state, uint32_t(state.world.leader_get_since(lid).value), uint32_t(lid.value));
45 auto in_range = rng::reduce(uint32_t(rval), arange.size());
46 base_data.data.image.gfx_object = arange[in_range];
47 }
48 } else {
49 auto grange = ltype.get_generals();
50 if(grange.size() > 0) {
51 auto rval = rng::get_random(state, uint32_t(state.world.leader_get_since(lid).value), uint32_t(lid.value));
52 auto in_range = rng::reduce(uint32_t(rval), grange.size());
53 base_data.data.image.gfx_object = grange[in_range];
54 }
55 }
56 } else {
58 }
59 }
60};
61
63public:
64 void on_update(sys::state& state) noexcept override {
65 dcon::leader_id lid = retrieve<dcon::leader_id>(state, parent);
66 if(lid) {
67 set_text(state, std::string(state.to_string_view(state.world.leader_get_name(lid))));
68 } else {
70 }
71 }
72};
73
75 void on_update(sys::state& state) noexcept override {
76 dcon::leader_id lid = retrieve<dcon::leader_id>(state, parent);
77 if(lid) {
78 auto attack = state.world.leader_trait_get_attack(state.world.leader_get_background(lid)) + state.world.leader_trait_get_attack(state.world.leader_get_personality(lid));
79 if(attack > 0) {
80 set_text(state, std::string("+") + text::format_float(attack, 2));
82 } else if(attack == 0) {
83 set_text(state, "0");
85 } else {
88 }
89 } else {
90 set_text(state, "0");
92 }
93 }
94};
96 void on_update(sys::state& state) noexcept override {
97 dcon::leader_id lid = retrieve<dcon::leader_id>(state, parent);
98 if(lid) {
99 auto v = state.world.leader_trait_get_defense(state.world.leader_get_background(lid)) + state.world.leader_trait_get_defense(state.world.leader_get_personality(lid));
100 if(v > 0) {
101 set_text(state, std::string("+") + text::format_float(v, 2));
103 } else if(v == 0) {
104 set_text(state, "0");
106 } else {
109 }
110 } else {
111 set_text(state, "0");
113 }
114 }
115};
117 void on_update(sys::state& state) noexcept override {
118 dcon::leader_id lid = retrieve<dcon::leader_id>(state, parent);
119 if(lid) {
120 auto v = state.world.leader_trait_get_organisation(state.world.leader_get_background(lid)) + state.world.leader_trait_get_organisation(state.world.leader_get_personality(lid));
121 if(v > 0) {
122 set_text(state, std::string("+") + text::format_float(v, 2));
124 } else if(v == 0) {
125 set_text(state, "0");
127 } else {
130 }
131 } else {
132 set_text(state, "0");
134 }
135 }
136};
138 void on_update(sys::state& state) noexcept override {
139 dcon::leader_id lid = retrieve<dcon::leader_id>(state, parent);
140 if(lid) {
141 auto v = state.world.leader_trait_get_morale(state.world.leader_get_background(lid)) + state.world.leader_trait_get_morale(state.world.leader_get_personality(lid));
142 if(v > 0) {
143 set_text(state, std::string("+") + text::format_float(v, 2));
145 } else if(v == 0) {
146 set_text(state, "0");
148 } else {
151 }
152 } else {
153 set_text(state, "0");
155 }
156 }
157};
159 void on_update(sys::state& state) noexcept override {
160 dcon::leader_id lid = retrieve<dcon::leader_id>(state, parent);
161 if(lid) {
162 auto v = state.world.leader_trait_get_speed(state.world.leader_get_background(lid)) + state.world.leader_trait_get_speed(state.world.leader_get_personality(lid));
163 if(v > 0) {
164 set_text(state, std::string("+") + text::format_float(v, 2));
166 } else if(v == 0) {
167 set_text(state, "0");
169 } else {
172 }
173 } else {
174 set_text(state, "0");
176 }
177 }
178};
180 void on_update(sys::state& state) noexcept override {
181 dcon::leader_id lid = retrieve<dcon::leader_id>(state, parent);
182 if(lid) {
183 auto v = state.world.leader_trait_get_reconnaissance(state.world.leader_get_background(lid)) + state.world.leader_trait_get_reconnaissance(state.world.leader_get_personality(lid));
184 if(v > 0) {
185 set_text(state, std::string("+") + text::format_float(v, 2));
187 } else if(v == 0) {
188 set_text(state, "0");
190 } else {
193 }
194 } else {
195 set_text(state, "0");
197 }
198 }
199};
201 void on_update(sys::state& state) noexcept override {
202 dcon::leader_id lid = retrieve<dcon::leader_id>(state, parent);
203 if(lid) {
204 auto v = state.world.leader_trait_get_reliability(state.world.leader_get_background(lid)) + state.world.leader_trait_get_reliability(state.world.leader_get_personality(lid));
205 if(v > 0) {
206 set_text(state, std::string("+") + text::format_float(v, 2));
208 } else if(v == 0) {
209 set_text(state, "0");
211 } else {
214 }
215 } else {
216 set_text(state, "0");
218 }
219 }
220};
222 void on_update(sys::state& state) noexcept override {
223 dcon::leader_id lid = retrieve<dcon::leader_id>(state, parent);
224 if(lid) {
225 auto v = state.world.leader_trait_get_experience(state.world.leader_get_background(lid)) + state.world.leader_trait_get_experience(state.world.leader_get_personality(lid));
226 if(v > 0) {
227 set_text(state, std::string("+") + text::format_float(v, 2));
229 } else if(v == 0) {
230 set_text(state, "0");
232 } else {
235 }
236 } else {
237 set_text(state, "0");
239 }
240 }
241};
242
244public:
245 void button_action(sys::state& state) noexcept override {
247 }
250 }
251 void update_tooltip(sys::state& state, int32_t x, int32_t y, text::columnar_layout& contents) noexcept override {
252 auto box = text::open_layout_box(contents);
253 text::localised_format_box(state, contents, box, "sort_by");
254 text::add_space_to_layout_box(state, contents, box);
255 text::localised_format_box(state, contents, box, "trait_attack");
256 text::close_layout_box(contents, box);
257 }
258};
260public:
261 void button_action(sys::state& state) noexcept override {
263 }
266 }
267 void update_tooltip(sys::state& state, int32_t x, int32_t y, text::columnar_layout& contents) noexcept override {
268 auto box = text::open_layout_box(contents);
269 text::localised_format_box(state, contents, box, "sort_by");
270 text::add_space_to_layout_box(state, contents, box);
271 text::localised_format_box(state, contents, box, "trait_defend");
272 text::close_layout_box(contents, box);
273 }
274};
276public:
277 void button_action(sys::state& state) noexcept override {
279 }
282 }
283 void update_tooltip(sys::state& state, int32_t x, int32_t y, text::columnar_layout& contents) noexcept override {
284 auto box = text::open_layout_box(contents);
285 text::localised_format_box(state, contents, box, "sort_by");
286 text::add_space_to_layout_box(state, contents, box);
287 text::localised_format_box(state, contents, box, "trait_organisation");
288 text::close_layout_box(contents, box);
289 }
290};
292public:
293 void button_action(sys::state& state) noexcept override {
295 }
298 }
299 void update_tooltip(sys::state& state, int32_t x, int32_t y, text::columnar_layout& contents) noexcept override {
300 auto box = text::open_layout_box(contents);
301 text::localised_format_box(state, contents, box, "sort_by");
302 text::add_space_to_layout_box(state, contents, box);
303 text::localised_format_box(state, contents, box, "trait_morale");
304 text::close_layout_box(contents, box);
305 }
306};
308public:
309 void button_action(sys::state& state) noexcept override {
311 }
314 }
315 void update_tooltip(sys::state& state, int32_t x, int32_t y, text::columnar_layout& contents) noexcept override {
316 auto box = text::open_layout_box(contents);
317 text::localised_format_box(state, contents, box, "sort_by");
318 text::add_space_to_layout_box(state, contents, box);
319 text::localised_format_box(state, contents, box, "trait_speed");
320 text::close_layout_box(contents, box);
321 }
322};
324public:
325 void button_action(sys::state& state) noexcept override {
327 }
330 }
331 void update_tooltip(sys::state& state, int32_t x, int32_t y, text::columnar_layout& contents) noexcept override {
332 auto box = text::open_layout_box(contents);
333 text::localised_format_box(state, contents, box, "sort_by");
334 text::add_space_to_layout_box(state, contents, box);
335 text::localised_format_box(state, contents, box, "trait_reconaissance");
336 text::close_layout_box(contents, box);
337 }
338};
340public:
341 void button_action(sys::state& state) noexcept override {
343 }
346 }
347 void update_tooltip(sys::state& state, int32_t x, int32_t y, text::columnar_layout& contents) noexcept override {
348 auto box = text::open_layout_box(contents);
349 text::localised_format_box(state, contents, box, "sort_by");
350 text::add_space_to_layout_box(state, contents, box);
351 text::localised_format_box(state, contents, box, "trait_reliability");
352 text::close_layout_box(contents, box);
353 }
354};
356public:
357 void button_action(sys::state& state) noexcept override {
359 }
362 }
363 void update_tooltip(sys::state& state, int32_t x, int32_t y, text::columnar_layout& contents) noexcept override {
364 auto box = text::open_layout_box(contents);
365 text::localised_format_box(state, contents, box, "sort_by");
366 text::add_space_to_layout_box(state, contents, box);
367 text::localised_format_box(state, contents, box, "trait_experience");
368 text::close_layout_box(contents, box);
369 }
370};
371
373public:
374 void button_action(sys::state& state) noexcept override {
375 auto lid = retrieve<dcon::leader_id>(state, parent);
376 if(auto a = retrieve<dcon::army_id>(state, parent); a) {
377 command::change_general(state, state.local_player_nation, a, lid);
378 } else if(auto v = retrieve<dcon::navy_id>(state, parent); v) {
379 command::change_admiral(state, state.local_player_nation, v, lid);
380 }
382 }
383};
384
385template<typename T>
387public:
388 void on_update(sys::state& state) noexcept override {
389 dcon::leader_id lid = get_leader_id(state);
390 progress = state.world.leader_get_prestige(lid);
391 }
392
393 void on_create(sys::state& state) noexcept override {
395
396 dcon::leader_id lid = get_leader_id(state);
397 progress = state.world.leader_get_prestige(lid);
398 }
399
402 }
403
404 void update_tooltip(sys::state& state, int32_t x, int32_t y, text::columnar_layout& contents) noexcept override {
405 dcon::leader_id lid = get_leader_id(state);
406 auto prestige = state.world.leader_get_prestige(lid);
407
408 auto box = text::open_layout_box(contents);
409 text::localised_format_box(state, contents, box, "leader_prestige");
410 text::add_space_to_layout_box(state, contents, box);
411 if(prestige > 0) {
413 } else {
415 }
416 text::close_layout_box(contents, box);
417 }
418
419 dcon::leader_id get_leader_id(sys::state& state) noexcept {
420 if constexpr(std::is_same_v<T, dcon::army_id>) {
421 auto content = retrieve<dcon::army_id>(state, parent);
422
423 return state.world.army_get_general_from_army_leadership(content);
424 }
425 else if constexpr(std::is_same_v<T, dcon::navy_id>) {
426 auto content = retrieve<dcon::navy_id>(state, parent);
427
428 return state.world.navy_get_admiral_from_navy_leadership(content);
429 }
430 else if constexpr(std::is_same_v<T, dcon::leader_id>) {
431 dcon::leader_id lid = retrieve<dcon::leader_id>(state, parent);
432
433 return lid;
434 }
435 }
436};
437
438class leader_select_row : public listbox_row_element_base<dcon::leader_id> {
439public:
440 void on_create(sys::state& state) noexcept override {
443 }
444
445 std::unique_ptr<element_base> make_child(sys::state& state, std::string_view name, dcon::gui_def_id id) noexcept override {
446 if(name == "leader_button") {
447 return make_element_by_type<set_leader_button>(state, id);
448 }
449 else if(name == "leader_prestige_bar") {
450 return make_element_by_type<leader_prestige_progress_bar<dcon::leader_id>>(state, id);
451 }
452 else if(name == "photo") {
453 return make_element_by_type<passive_leader_image>(state, id);
454 } else if(name == "leader_name") {
455 return make_element_by_type<passive_leader_name>(state, id);
456 } else if(name == "unitleader_a") {
457 return make_element_by_type < passive_leader_attack>(state, id);
458 } else if(name == "unitleader_b") {
459 return make_element_by_type <passive_leader_defense >(state, id);
460 } else if(name == "unitleader_c") {
461 return make_element_by_type < passive_leader_org>(state, id);
462 } else if(name == "unitleader_d") {
463 return make_element_by_type < passive_leader_morale>(state, id);
464 } else if(name == "unitleader_e") {
465 return make_element_by_type < passive_leader_speed>(state, id);
466 } else if(name == "unitleader_f") {
467 return make_element_by_type < passive_leader_recon>(state, id);
468 } else if(name == "unitleader_g") {
469 return make_element_by_type < passive_leader_reliability>(state, id);
470 } else if(name == "unitleader_h") {
471 return make_element_by_type < passive_leader_exp>(state, id);
472 } else {
473 return nullptr;
474 }
475 }
476};
477
478class leader_select_listbox : public listbox_element_base<leader_select_row, dcon::leader_id> {
479protected:
480 std::string_view get_row_element_name() override {
481 return "alice_leader_entry";
482 }
483
484public:
486
487 void on_update(sys::state& state) noexcept override {
488 row_contents.clear();
489
490 if(auto a = retrieve<dcon::army_id>(state, parent); a) {
491 for(auto l : state.world.nation_get_leader_loyalty(state.local_player_nation)) {
492 if(l.get_leader().get_is_admiral() == false) {
493 if(bool(l.get_leader().get_army_from_army_leadership()) == false)
494 row_contents.push_back(l.get_leader());
495 }
496 }
497 } else if(auto v = retrieve<dcon::navy_id>(state, parent); v) {
498 for(auto l : state.world.nation_get_leader_loyalty(state.local_player_nation)) {
499 if(l.get_leader().get_is_admiral() == true) {
500 if(bool(l.get_leader().get_navy_from_navy_leadership()) == false)
501 row_contents.push_back(l.get_leader());
502 }
503 }
504 }
505
506 switch(sort_type) {
508 std::sort(row_contents.begin(), row_contents.end(), [&](dcon::leader_id a, dcon::leader_id b) {
509 auto av = state.world.leader_trait_get_attack(state.world.leader_get_background(a)) + state.world.leader_trait_get_attack(state.world.leader_get_personality(a));
510 auto bv = state.world.leader_trait_get_attack(state.world.leader_get_background(b)) + state.world.leader_trait_get_attack(state.world.leader_get_personality(b));
511 if(av != bv)
512 return av > bv;
513 else
514 return a.index() < b.index();
515 });
516 break;
518 std::sort(row_contents.begin(), row_contents.end(), [&](dcon::leader_id a, dcon::leader_id b) {
519 auto av = state.world.leader_trait_get_defense(state.world.leader_get_background(a)) + state.world.leader_trait_get_defense(state.world.leader_get_personality(a));
520 auto bv = state.world.leader_trait_get_defense(state.world.leader_get_background(b)) + state.world.leader_trait_get_defense(state.world.leader_get_personality(b));
521 if(av != bv)
522 return av > bv;
523 else
524 return a.index() < b.index();
525 });
526 break;
528 std::sort(row_contents.begin(), row_contents.end(), [&](dcon::leader_id a, dcon::leader_id b) {
529 auto av = state.world.leader_trait_get_reconnaissance(state.world.leader_get_background(a)) + state.world.leader_trait_get_reconnaissance(state.world.leader_get_personality(a));
530 auto bv = state.world.leader_trait_get_reconnaissance(state.world.leader_get_background(b)) + state.world.leader_trait_get_reconnaissance(state.world.leader_get_personality(b));
531 if(av != bv)
532 return av > bv;
533 else
534 return a.index() < b.index();
535 });
536 break;
538 std::sort(row_contents.begin(), row_contents.end(), [&](dcon::leader_id a, dcon::leader_id b) {
539 auto av = state.world.leader_trait_get_morale(state.world.leader_get_background(a)) + state.world.leader_trait_get_morale(state.world.leader_get_personality(a));
540 auto bv = state.world.leader_trait_get_morale(state.world.leader_get_background(b)) + state.world.leader_trait_get_morale(state.world.leader_get_personality(b));
541 if(av != bv)
542 return av > bv;
543 else
544 return a.index() < b.index();
545 });
546 break;
548 std::sort(row_contents.begin(), row_contents.end(), [&](dcon::leader_id a, dcon::leader_id b) {
549 auto av = state.world.leader_trait_get_reliability(state.world.leader_get_background(a)) + state.world.leader_trait_get_reliability(state.world.leader_get_personality(a));
550 auto bv = state.world.leader_trait_get_reliability(state.world.leader_get_background(b)) + state.world.leader_trait_get_reliability(state.world.leader_get_personality(b));
551 if(av != bv)
552 return av > bv;
553 else
554 return a.index() < b.index();
555 });
556 break;
558 std::sort(row_contents.begin(), row_contents.end(), [&](dcon::leader_id a, dcon::leader_id b) {
559 auto av = state.world.leader_trait_get_organisation(state.world.leader_get_background(a)) + state.world.leader_trait_get_organisation(state.world.leader_get_personality(a));
560 auto bv = state.world.leader_trait_get_organisation(state.world.leader_get_background(b)) + state.world.leader_trait_get_organisation(state.world.leader_get_personality(b));
561 if(av != bv)
562 return av > bv;
563 else
564 return a.index() < b.index();
565 });
566 break;
568 std::sort(row_contents.begin(), row_contents.end(), [&](dcon::leader_id a, dcon::leader_id b) {
569 auto av = state.world.leader_trait_get_speed(state.world.leader_get_background(a)) + state.world.leader_trait_get_speed(state.world.leader_get_personality(a));
570 auto bv = state.world.leader_trait_get_speed(state.world.leader_get_background(b)) + state.world.leader_trait_get_speed(state.world.leader_get_personality(b));
571 if(av != bv)
572 return av > bv;
573 else
574 return a.index() < b.index();
575 });
576 break;
578 std::sort(row_contents.begin(), row_contents.end(), [&](dcon::leader_id a, dcon::leader_id b) {
579 auto av = state.world.leader_trait_get_experience(state.world.leader_get_background(a)) + state.world.leader_trait_get_experience(state.world.leader_get_personality(a));
580 auto bv = state.world.leader_trait_get_experience(state.world.leader_get_background(b)) + state.world.leader_trait_get_experience(state.world.leader_get_personality(b));
581 if(av != bv)
582 return av > bv;
583 else
584 return a.index() < b.index();
585 });
586 break;
587 }
588
589 update(state);
590 }
591};
592
594public:
595
596 dcon::army_id a;
597 dcon::navy_id v;
599
600 std::unique_ptr<element_base> make_child(sys::state& state, std::string_view name, dcon::gui_def_id id) noexcept override {
601 if(name == "select_leader_bg") {
602 return make_element_by_type<opaque_element_base>(state, id);
603 } else if(name == "prestige_bar_frame") {
604 return make_element_by_type<image_element_base>(state, id);
605 } else if(name == "leader_prestige_bar") {
606 return make_element_by_type<leader_prestige_progress_bar<dcon::leader_id>>(state, id);
607 } else if(name == "selected_photo") {
608 return make_element_by_type<passive_leader_image>(state, id);
609 } else if(name == "selected_leader_name") {
610 return make_element_by_type<passive_leader_name>(state, id);
611 } else if(name == "unitleader_a") {
612 return make_element_by_type < passive_leader_attack>(state, id);
613 } else if(name == "unitleader_b") {
614 return make_element_by_type <passive_leader_defense >(state, id);
615 } else if(name == "unitleader_c") {
616 return make_element_by_type < passive_leader_org>(state, id);
617 } else if(name == "unitleader_d") {
618 return make_element_by_type < passive_leader_morale>(state, id);
619 } else if(name == "unitleader_e") {
620 return make_element_by_type < passive_leader_speed>(state, id);
621 } else if(name == "unitleader_f") {
622 return make_element_by_type < passive_leader_recon>(state, id);
623 } else if(name == "unitleader_g") {
624 return make_element_by_type < passive_leader_reliability>(state, id);
625 } else if(name == "unitleader_h") {
626 return make_element_by_type < passive_leader_exp>(state, id);
627 } else if(name == "sort_prestige") {
628 return make_element_by_type<button_element_base>(state, id);
629 } else if(name == "sort_prestige_icon") {
630 return nullptr;
631 } else if(name == "sort_name") {
632 return nullptr;
633 } else if(name == "sort_a") {
634 return make_element_by_type<sort_leader_attack>(state, id);
635 } else if(name == "sort_b") {
636 return make_element_by_type<sort_leader_def>(state, id);
637 } else if(name == "sort_c") {
638 return make_element_by_type<sort_leader_org>(state, id);
639 } else if(name == "sort_d") {
640 return make_element_by_type<sort_leader_morale>(state, id);
641 } else if(name == "sort_e") {
642 return make_element_by_type<sort_leader_speed>(state, id);
643 } else if(name == "sort_f") {
644 return make_element_by_type<sort_leader_recon>(state, id);
645 } else if(name == "sort_g") {
646 return make_element_by_type<sort_leader_reliable>(state, id);
647 } else if(name == "sort_h") {
648 return make_element_by_type<sort_leader_exp>(state, id);
649 } else if(name == "back_button") {
650 return make_element_by_type<generic_close_button>(state, id);
651 } else if(name == "noleader_button") {
652 return make_element_by_type<unset_leader_button>(state, id);
653 } else if(name == "leaderlist") {
654 auto ptr = make_element_by_type<leader_select_listbox>(state, id);
655 lb = ptr.get();
656 return ptr;
657 } else {
658 return nullptr;
659 }
660 }
661
662 message_result get(sys::state& state, Cyto::Any& payload) noexcept override {
663 if(payload.holds_type<dcon::leader_id>()) {
664 if(a)
665 payload.emplace<dcon::leader_id>(state.world.army_get_general_from_army_leadership(a));
666 else if(v)
667 payload.emplace<dcon::leader_id>(state.world.navy_get_admiral_from_navy_leadership(v));
669 } else if(payload.holds_type<dcon::army_id>()) {
670 payload.emplace<dcon::army_id>(a);
672 } else if(payload.holds_type<dcon::navy_id>()) {
673 payload.emplace<dcon::navy_id>(v);
675 } else if(payload.holds_type<leader_select_sort>()) {
676 lb->sort_type = any_cast<leader_select_sort>(payload);
679 }
680 return window_element_base::get(state, payload);
681 }
682};
683
684void open_leader_selection(sys::state& state, dcon::army_id a, dcon::navy_id v, int32_t x, int32_t y);
685
686}
void impl_on_update(sys::state &state) noexcept override
element_base * parent
virtual message_result get(sys::state &state, Cyto::Any &payload) noexcept
virtual void on_create(sys::state &state) noexcept
element_data base_data
void set_visible(sys::state &state, bool vis)
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
dcon::leader_id get_leader_id(sys::state &state) noexcept
void on_create(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
std::string_view get_row_element_name() 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
message_result get(sys::state &state, Cyto::Any &payload) noexcept override
leader_select_listbox * lb
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
dcon::gfx_object_id default_img
void on_update(sys::state &state) noexcept override
void button_action(sys::state &state) noexcept override
void set_text(sys::state &state, std::string const &new_text)
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
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 button_action(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 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
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
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 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
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 button_action(sys::state &state) noexcept override
void button_action(sys::state &state) noexcept override
void on_create(sys::state &state) noexcept override
uint32_t reduce(uint32_t value_in, uint32_t upper_bound)
Definition: prng.cpp:46
uint64_t get_random(sys::state const &state, uint32_t value_in)
Definition: prng.cpp:8
void add_to_layout_box(sys::state &state, layout_base &dest, layout_box &box, embedded_flag ico)
Definition: text.cpp:1165
layout_box open_layout_box(layout_base &dest, int32_t indent)
Definition: text.cpp:1799
void localised_format_box(sys::state &state, layout_base &dest, layout_box &box, std::string_view key, text::substitution_map const &sub)
Definition: text.cpp:1880
std::string format_float(float num, size_t digits)
Definition: text.cpp:981
std::string produce_simple_string(sys::state const &state, dcon::text_key id)
Definition: text.cpp:617
void add_space_to_layout_box(sys::state &state, layout_base &dest, layout_box &box)
Definition: text.cpp:1788
void close_layout_box(columnar_layout &dest, layout_box &box)
Definition: text.cpp:1807
void open_leader_selection(sys::state &state, dcon::army_id a, dcon::navy_id v, int32_t x, int32_t y)
tooltip_behavior
void send(sys::state &state, element_base *parent, T value)
message_result
uint uint32_t
union ui::element_data::internal_data data
dcon::gfx_object_id gfx_object
element_base * change_leader_window