Project Alice
Loading...
Searching...
No Matches
gui_element_types.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "dcon_generated.hpp"
4#include "gui_graphics.hpp"
6#include "opengl_wrapper.hpp"
7#include "sound.hpp"
8#include "system_state.hpp"
9#include "text.hpp"
10#include "texture.hpp"
11#include <cstdint>
12#include <functional>
13#include <unordered_map>
14#include <variant>
15#include <vector>
16
17namespace ui {
18
19template<typename T, typename ...Params>
20std::unique_ptr<element_base> make_element_by_type(sys::state& state, std::string_view name, Params&&... params) { // also bypasses global creation hooks
21 auto it = state.ui_state.defs_by_name.find(state.lookup_key(name));
22 if(it != state.ui_state.defs_by_name.end()) {
23 auto res = std::make_unique<T>(std::forward<Params>(params)...);
24 std::memcpy(&(res->base_data), &(state.ui_defs.gui[it->second.definition]), sizeof(ui::element_data));
25 make_size_from_graphics(state, res->base_data);
26 res->on_create(state);
27 return res;
28 }
29 return std::unique_ptr<element_base>{};
30}
31template<typename T, typename ...Params>
32std::unique_ptr<T> make_element_by_type(sys::state& state, dcon::gui_def_id id, Params&&... params) { // also bypasses global creation hooks
33 auto res = std::make_unique<T>(std::forward<Params>(params)...);
34 std::memcpy(&(res->base_data), &(state.ui_defs.gui[id]), sizeof(ui::element_data));
35 make_size_from_graphics(state, res->base_data);
36 res->on_create(state);
37 return res;
38}
39
40ogl::color_modification get_color_modification(bool is_under_mouse, bool is_disabled, bool is_interactable);
42
44public:
45 std::vector<std::unique_ptr<element_base>> children;
46
47 mouse_probe impl_probe_mouse(sys::state& state, int32_t x, int32_t y, mouse_probe_type type) noexcept override;
49 void impl_on_update(sys::state& state) noexcept override;
50 message_result impl_set(sys::state& state, Cyto::Any& payload) noexcept final;
51 void impl_render(sys::state& state, int32_t x, int32_t y) noexcept override;
52 void impl_on_reset_text(sys::state& state) noexcept override;
53
54 std::unique_ptr<element_base> remove_child(element_base* child) noexcept final;
55 void move_child_to_front(element_base* child) noexcept final;
56 void move_child_to_back(element_base* child) noexcept final;
57 void add_child_to_front(std::unique_ptr<element_base> child) noexcept final;
58 void add_child_to_back(std::unique_ptr<element_base> child) noexcept final;
59 element_base* get_child_by_name(sys::state const& state, std::string_view name) noexcept final;
60 element_base* get_child_by_index(sys::state const& state, int32_t index) noexcept final;
61};
62
64public:
65 int32_t frame = 0; // if it is from an icon strip
66 bool disabled = false;
67 bool interactable = false;
68 void render(sys::state& state, int32_t x, int32_t y) noexcept override;
69 void on_create(sys::state& state) noexcept override;
70
71 virtual bool get_horizontal_flip(sys::state& state) noexcept {
72 return state.world.locale_get_native_rtl(state.font_collection.get_current_locale());
73 }
74
75 message_result test_mouse(sys::state& state, int32_t x, int32_t y, mouse_probe_type type) noexcept override {
79 }
80};
81
83public:
84 void on_create(sys::state& state) noexcept override {
85 set_visible(state, false);
86 }
87};
88
90public:
94
95 void render(sys::state& state, int32_t x, int32_t y) noexcept override;
96};
97
99public:
100 message_result test_mouse(sys::state& state, int32_t x, int32_t y, mouse_probe_type type) noexcept override {
104 }
105 message_result on_lbutton_down(sys::state& state, int32_t x, int32_t y, sys::key_modifiers mods) noexcept override {
107 }
108 message_result on_rbutton_down(sys::state& state, int32_t x, int32_t y, sys::key_modifiers mods) noexcept override {
110 }
113 }
114};
115
117 dcon::texture_id texture_id;
118public:
119 message_result test_mouse(sys::state& state, int32_t x, int32_t y, mouse_probe_type type) noexcept override {
121 auto& texhandle = state.open_gl.asset_textures[texture_id];
122 uint8_t* texture = texhandle.data;
123 int32_t size_x = texhandle.size_x;
124 int32_t size_y = texhandle.size_y;
125 int32_t channels = texhandle.channels;
126 size_t size_m = (texhandle.size_x * texhandle.size_y) * 4;
127 if(texture && channels == 4) {
128 // texture memory layout RGBA accessed through uint8_t pointer
129 size_t index = (x + (y * size_x)) * 4 + 3;
130 if(index < size_m && texture[index] == 0x00) {
132 }
133 }
135 }
137 }
138
139 void on_create(sys::state& state) noexcept override {
141 dcon::gfx_object_id gid;
146 }
147 if(gid) {
148 texture_id = state.ui_defs.gfx[gid].primary_texture_handle;
149 }
150 }
151
152 // MAYBE this function has to be changed when make_element_by_type() is changed
153 static std::unique_ptr<partially_transparent_image> make_element_by_type_alias(sys::state& state, dcon::gui_def_id id) {
154 auto res = std::make_unique<partially_transparent_image>();
155 std::memcpy(&(res->base_data), &(state.ui_defs.gui[id]), sizeof(ui::element_data));
156
157 dcon::gfx_object_id gfx_handle;
158
159 if(res->base_data.get_element_type() == ui::element_type::image) {
160 gfx_handle = res->base_data.data.image.gfx_object;
161 } else if(res->base_data.get_element_type() == ui::element_type::button) {
162 gfx_handle = res->base_data.data.button.button_image;
163 }
164 if(gfx_handle) {
165 auto tex_handle = state.ui_defs.gfx[gfx_handle].primary_texture_handle;
166 if(tex_handle) {
167 state.ui_defs.gfx[gfx_handle].flags |= ui::gfx_object::do_transparency_check;
168 }
169 }
170
171 make_size_from_graphics(state, res->base_data);
172 res->on_create(state);
173 return res;
174 }
175};
176
177
179public:
180 float progress = 0.f;
181 void render(sys::state& state, int32_t x, int32_t y) noexcept override;
182 message_result test_mouse(sys::state& state, int32_t x, int32_t y, mouse_probe_type type) noexcept override {
184 }
185 message_result on_lbutton_down(sys::state& state, int32_t x, int32_t y, sys::key_modifiers mods) noexcept override {
186 return image_element_base::on_lbutton_down(state, x, y, mods);
187 }
188 message_result on_rbutton_down(sys::state& state, int32_t x, int32_t y, sys::key_modifiers mods) noexcept override {
189 return image_element_base::on_rbutton_down(state, x, y, mods);
190 }
191};
192
194public:
195 void on_create(sys::state& state) noexcept override {
196 std::swap(base_data.size.x, base_data.size.y);
199 }
200};
201
203protected:
205 std::string cached_text;
206 bool black_text = true;
207
208public:
210 interactable = true;
211 }
212
213 void set_button_text(sys::state& state, std::string const& new_text);
214 void on_reset_text(sys::state& state) noexcept override;
215
216 virtual void button_action(sys::state& state) noexcept { }
217 virtual void button_right_action(sys::state& state) noexcept {
219 }
220 virtual void button_shift_action(sys::state& state) noexcept {
222 }
225 }
226 virtual void button_ctrl_action(sys::state& state) noexcept {
228 }
229 virtual void button_ctrl_right_action(sys::state& state) noexcept {
231 }
232 virtual void button_ctrl_shift_action(sys::state& state) noexcept {
234 }
237 }
240 }
241
242 message_result on_lbutton_down(sys::state& state, int32_t x, int32_t y, sys::key_modifiers mods) noexcept override {
243 if(!state.user_settings.left_mouse_click_hold_and_release && !disabled) {
244 sound::play_interface_sound(state, get_click_sound(state), state.user_settings.interface_volume * state.user_settings.master_volume);
249 else
251 }
253 }
254 message_result on_rbutton_down(sys::state& state, int32_t x, int32_t y, sys::key_modifiers mods) noexcept override {
255 if(!disabled) {
256 sound::play_interface_sound(state, get_click_sound(state), state.user_settings.interface_volume * state.user_settings.master_volume);
261 else
263 }
265 }
266 message_result on_lbutton_up(sys::state& state, int32_t x, int32_t y, sys::key_modifiers mods, bool under_mouse) noexcept override {
267 if(state.user_settings.left_mouse_click_hold_and_release && !disabled && under_mouse) {
268 sound::play_interface_sound(state, get_click_sound(state), state.user_settings.interface_volume * state.user_settings.master_volume);
273 else
275 }
277 }
280 sound::play_interface_sound(state, get_click_sound(state), state.user_settings.interface_volume * state.user_settings.master_volume);
285 else
288 } else {
290 }
291 }
292
293 void on_create(sys::state& state) noexcept override;
294 void render(sys::state& state, int32_t x, int32_t y) noexcept override;
296};
297
299public:
301 void render(sys::state& state, int32_t x, int32_t y) noexcept override;
302};
303
305public:
306 virtual void button_right_action(sys::state& state) noexcept override { }
307 message_result on_rbutton_down(sys::state& state, int32_t x, int32_t y, sys::key_modifiers mods) noexcept final {
308 if(!disabled) {
309 sound::play_interface_sound(state, get_click_sound(state), state.user_settings.interface_volume * state.user_settings.master_volume);
311 }
313 }
314};
315
317public:
318 virtual void button_right_action(sys::state& state) noexcept override { }
319 message_result on_rbutton_down(sys::state& state, int32_t x, int32_t y, sys::key_modifiers mods) noexcept final {
320 if(!disabled) {
321 sound::play_interface_sound(state, get_click_sound(state), state.user_settings.interface_volume * state.user_settings.master_volume);
323 }
325 }
326};
327
328class line_graph : public element_base {
329private:
330 ogl::lines lines;
331public:
332 bool is_coloured = false;
333 float r = 0.f;
334 float g = 0.f;
335 float b = 0.f;
336
338
339 line_graph(uint32_t sz) : lines(sz), count(sz) {
340 is_coloured = false;
341 r = 0.f;
342 g = 0.f;
343 b = 0.f;
344 }
345
346 void set_data_points(sys::state& state, std::vector<float> const& datapoints) noexcept;
347 void set_data_points(sys::state& state, std::vector<float> const& datapoints, float min, float max) noexcept;
348 void on_create(sys::state& state) noexcept override;
349 void render(sys::state& state, int32_t x, int32_t y) noexcept override;
350
351 message_result test_mouse(sys::state& state, int32_t x, int32_t y, mouse_probe_type type) noexcept override {
355 }
356};
357
359protected:
360 std::string cached_text;
362public:
363 bool black_text = true;
364 int32_t data = 0;
365 int32_t casualties = 0;
366
367 void set_text(sys::state& state, std::string const& new_text);
368 void on_reset_text(sys::state& state) noexcept override;
369 void on_create(sys::state& state) noexcept override;
370 void render(sys::state& state, int32_t x, int32_t y) noexcept override;
372
373 std::string_view get_text(sys::state& state) const {
374 return cached_text;
375 }
376
377 message_result test_mouse(sys::state& state, int32_t x, int32_t y, mouse_probe_type type) noexcept override {
381 }
382};
383
385public:
387 void render(sys::state& state, int32_t x, int32_t y) noexcept override;
388};
389
391public:
392 void on_create(sys::state& state) noexcept override;
393 void set_text(sys::state& state, std::string const& new_text);
394 void render(sys::state& state, int32_t x, int32_t y) noexcept override;
395 void on_reset_text(sys::state& state) noexcept override;
396};
397
399protected:
400 int32_t edit_index = 0;
401
402public:
403 virtual void edit_box_tab(sys::state& state, std::string_view s) noexcept { }
404 virtual void edit_box_enter(sys::state& state, std::string_view s) noexcept { }
405 virtual void edit_box_update(sys::state& state, std::string_view s) noexcept { }
406 virtual void edit_box_up(sys::state& state) noexcept { }
407 virtual void edit_box_down(sys::state& state) noexcept { }
408 virtual void edit_box_esc(sys::state& state) noexcept { }
409 virtual void edit_box_backtick(sys::state& state) noexcept { }
410 virtual void edit_box_back_slash(sys::state& state) noexcept { }
411 virtual void edit_index_position(sys::state& state, int32_t index) noexcept {
412 edit_index = index;
413 }
414 void on_reset_text(sys::state& state) noexcept override;
415 void on_create(sys::state& state) noexcept override;
416
417 message_result test_mouse(sys::state& state, int32_t x, int32_t y, mouse_probe_type type) noexcept override {
419 }
420 message_result on_lbutton_down(sys::state& state, int32_t x, int32_t y, sys::key_modifiers mods) noexcept override;
422 void on_text(sys::state& state, char32_t ch) noexcept override;
423 void render(sys::state& state, int32_t x, int32_t y) noexcept override;
424};
425
426class tool_tip : public element_base {
427public:
430 void render(sys::state& state, int32_t x, int32_t y) noexcept override;
431};
432
434public:
435 message_result test_mouse(sys::state& state, int32_t x, int32_t y, mouse_probe_type type) noexcept override {
439 }
440 message_result on_lbutton_down(sys::state& state, int32_t x, int32_t y, sys::key_modifiers mods) noexcept override;
441};
442
444public:
445 virtual std::unique_ptr<element_base> make_child(sys::state& state, std::string_view name, dcon::gui_def_id id) noexcept {
446 return nullptr;
447 }
448 void on_create(sys::state& state) noexcept override;
449 void on_drag(sys::state& state, int32_t oldx, int32_t oldy, int32_t x, int32_t y, sys::key_modifiers mods) noexcept override;
450
451 message_result test_mouse(sys::state& state, int32_t x, int32_t y, mouse_probe_type type) noexcept override {
455 }
456};
457
458template<class TabT>
460public:
461 TabT active_tab = TabT();
462 message_result test_mouse(sys::state& state, int32_t x, int32_t y, mouse_probe_type type) noexcept override {
464 }
465};
466
468public:
469 void button_action(sys::state& state) noexcept override {
470 if(parent) {
471 parent->set_visible(state, false);
472 }
473 }
474};
475
477public:
478 virtual bool is_active(sys::state& state) noexcept {
479 return false;
480 }
481
484 }
485
486 void render(sys::state& state, int32_t x, int32_t y) noexcept override {
487 frame = int32_t(is_active(state));
489 }
490};
491
492template<class RowConT>
494public:
495 RowConT content;
497 content = RowConT{};
498 }
500 content = con;
501 }
502};
503
504template<class ItemWinT, class ItemConT>
506private:
507 int16_t subwindow_width = 0;
508
509protected:
510 std::vector<ItemWinT*> windows{};
511
512 virtual std::string_view get_row_element_name() {
513 return std::string_view{};
514 }
515
516 virtual void update_subwindow(sys::state& state, ItemWinT& subwindow, ItemConT content) {
517 send(state, &subwindow, wrapped_listbox_row_content<ItemConT>(content));
518 subwindow.impl_on_update(state);
519 }
520
521public:
522 std::vector<ItemConT> row_contents{};
523 void update(sys::state& state);
524};
525
527public:
528 dcon::gui_def_id base_definition;
529
531 void button_action(sys::state& state) noexcept override;
532 void on_update(sys::state& state) noexcept override;
535 }
536 void update_tooltip(sys::state& state, int32_t x, int32_t y, text::columnar_layout& contents) noexcept override;
537};
539public:
540 dcon::gui_def_id base_definition;
541
543 void button_action(sys::state& state) noexcept override;
544 void on_update(sys::state& state) noexcept override;
547 }
548 void update_tooltip(sys::state& state, int32_t x, int32_t y, text::columnar_layout& contents) noexcept override;
549};
550
552protected:
554
555public:
556 virtual dcon::national_identity_id get_current_nation(sys::state& state) noexcept;
557 virtual dcon::rebel_faction_id get_current_rebel_faction(sys::state& state) noexcept;
558 virtual void set_current_nation(sys::state& state, dcon::national_identity_id identity) noexcept;
559 void button_action(sys::state& state) noexcept override;
560 void on_update(sys::state& state) noexcept override;
561 void on_create(sys::state& state) noexcept override;
562 void render(sys::state& state, int32_t x, int32_t y) noexcept override;
565 }
566 void update_tooltip(sys::state& state, int32_t x, int32_t y, text::columnar_layout& contents) noexcept override;
567};
568
570public:
572
573 void button_action(sys::state& state) noexcept override;
574 void on_update(sys::state& state) noexcept override;
575 void render(sys::state& state, int32_t x, int32_t y) noexcept override;
578 }
579 void update_tooltip(sys::state& state, int32_t x, int32_t y, text::columnar_layout& contents) noexcept override;
580};
581
583private:
584 dcon::national_identity_id stored_identity{};
585
586public:
587 dcon::national_identity_id get_current_nation(sys::state& state) noexcept override {
588 return stored_identity;
589 }
590 void set_current_nation(sys::state& state, dcon::national_identity_id identity) noexcept override {
591 stored_identity = identity;
593 }
596 }
597};
598
599class overlapping_flags_box : public overlapping_listbox_element_base<overlapping_flags_flag_button, dcon::national_identity_id> {
600protected:
601 dcon::nation_id current_nation{};
602
603 virtual void populate_flags(sys::state& state) { }
604
605public:
606 std::string_view get_row_element_name() override;
607 void update_subwindow(sys::state& state, overlapping_flags_flag_button& subwindow, dcon::national_identity_id content) override;
608 void on_update(sys::state& state) noexcept override;
609};
610
612protected:
613 void populate_flags(sys::state& state) override;
614};
615
617protected:
618 void populate_flags(sys::state& state) override;
619};
620
622protected:
623 void populate_flags(sys::state& state) override;
624};
625
627protected:
628 void populate_flags(sys::state& state) override;
629};
630
632protected:
633 void populate_flags(sys::state& state) override;
634};
635
637protected:
638 void populate_flags(sys::state& state) override;
639};
640
641
643public:
644 dcon::nation_id n;
646
647 void upate_truce(sys::state& state, dcon::nation_id i, sys::date u) {
648 n = i;
649 until = u;
650 }
651 dcon::national_identity_id get_current_nation(sys::state& state) noexcept override {
652 return state.world.nation_get_identity_from_identity_holder(n);
653 }
656 }
657 void update_tooltip(sys::state& state, int32_t x, int32_t y, text::columnar_layout& contents) noexcept override;
658};
659
661 dcon::nation_id n;
663};
664
665class overlapping_truce_flags : public overlapping_listbox_element_base<overlapping_truce_flag_button, truce_pair> {
666public:
667 dcon::nation_id current_nation{};
668 std::string_view get_row_element_name() override;
669 void update_subwindow(sys::state& state, overlapping_truce_flag_button& subwindow, truce_pair content) override;
670 void on_update(sys::state& state) noexcept override;
671};
672
673template<class TabT>
675public:
678 }
679
680 bool is_active(sys::state& state) noexcept final {
681 return parent && static_cast<generic_tabbed_window<TabT>*>(parent)->active_tab == target;
682 }
683
684 void button_action(sys::state& state) noexcept final {
686 }
687
688 TabT target = TabT();
689};
690
691template<class TabT>
693public:
694 bool is_active(sys::state& state) noexcept final {
695 return parent && static_cast<generic_tabbed_window<TabT>*>(parent)->active_tab == target;
696 }
697
698 void button_action(sys::state& state) noexcept final {
700 }
701
702 void on_create(sys::state& state) noexcept final{};
703
704 TabT target = TabT();
705};
706
707template<class T>
708class piechart : public element_base {
709public:
710
711 static constexpr int32_t resolution = 200;
712 static constexpr size_t channels = 3;
713
714 struct entry {
715 float value;
718 entry(T key, float value) : value(value), key(key), slices(0) { }
719 entry() : value(0.0f), key(), slices(0) { }
720 };
721
723 std::vector<entry> distribution;
724 float radius = 0.f;
725
727
728 void on_create(sys::state& state) noexcept override;
729 void render(sys::state& state, int32_t x, int32_t y) noexcept override;
730 void update_tooltip(sys::state& state, int32_t x, int32_t y, text::columnar_layout& contents) noexcept override;
731 virtual void populate_tooltip(sys::state& state, T t, float percentage, text::columnar_layout& contents) noexcept;
732
735 }
736 message_result test_mouse(sys::state& state, int32_t x, int32_t y, mouse_probe_type type) noexcept override {
739
740 float dx = float(x) - radius;
741 float dy = float(y) - radius;
742 auto dist = sqrt(dx * dx + dy * dy);
744 }
745 message_result on_lbutton_down(sys::state& state, int32_t x, int32_t y, sys::key_modifiers mods) noexcept override {
747 }
748 message_result on_rbutton_down(sys::state& state, int32_t x, int32_t y, sys::key_modifiers mods) noexcept override {
750 }
751};
752
753template<class SrcT, class DemoT>
754class demographic_piechart : public piechart<DemoT> {
755public:
756 void on_update(sys::state& state) noexcept override;
757 virtual void for_each_demo(sys::state& state, std::function<void(DemoT)> fun) { }
758};
759
760template<class SrcT>
761class culture_piechart : public demographic_piechart<SrcT, dcon::culture_id> {
762protected:
763 void for_each_demo(sys::state& state, std::function<void(dcon::culture_id)> fun) override {
764 state.world.for_each_culture(fun);
765 }
766};
767
768template<class SrcT>
769class workforce_piechart : public demographic_piechart<SrcT, dcon::pop_type_id> {
770protected:
771 void for_each_demo(sys::state& state, std::function<void(dcon::pop_type_id)> fun) override {
772 state.world.for_each_pop_type(fun);
773 }
774};
775
776template<class SrcT>
777class ideology_piechart : public demographic_piechart<SrcT, dcon::ideology_id> {
778protected:
779 void for_each_demo(sys::state& state, std::function<void(dcon::ideology_id)> fun) override {
780 state.world.for_each_ideology(fun);
781 }
782};
783
785public:
786 int32_t step_size = 1;
789 }
790 void button_action(sys::state& state) noexcept final;
791 void button_shift_action(sys::state& state) noexcept final;
792 void button_shift_right_action(sys::state& state) noexcept final;
793 message_result set(sys::state& state, Cyto::Any& payload) noexcept final;
796 }
797 void update_tooltip(sys::state& state, int32_t x, int32_t y, text::columnar_layout& contents) noexcept override {
798 auto box = text::open_layout_box(contents, 0);
802 text::localised_format_box(state, contents, box, std::string_view("alice_slider_controls"), sub);
803 text::close_layout_box(contents, box);
804 }
805};
806
808public:
809 int32_t step_size = 1;
812 }
813 void button_action(sys::state& state) noexcept final;
814 void button_shift_action(sys::state& state) noexcept final;
815 void button_shift_right_action(sys::state& state) noexcept final;
816 message_result set(sys::state& state, Cyto::Any& payload) noexcept final;
819 }
820 void update_tooltip(sys::state& state, int32_t x, int32_t y, text::columnar_layout& contents) noexcept override {
821 auto box = text::open_layout_box(contents, 0);
825 text::localised_format_box(state, contents, box, std::string_view("alice_slider_controls_2"), sub);
826 text::close_layout_box(contents, box);
827 }
828};
829
831public:
832 message_result on_lbutton_down(sys::state& state, int32_t x, int32_t y, sys::key_modifiers mods) noexcept final;
834 void update_tooltip(sys::state& state, int32_t x, int32_t y, text::columnar_layout& contents) noexcept final;
835};
836
838public:
839 message_result on_lbutton_down(sys::state& state, int32_t x, int32_t y, sys::key_modifiers mods) noexcept final;
840 void on_drag(sys::state& state, int32_t oldx, int32_t oldy, int32_t x, int32_t y, sys::key_modifiers mods) noexcept final;
841 void on_drag_finish(sys::state& state) noexcept final;
842};
843
845 int32_t lower_value = 0;
846 int32_t upper_value = 100;
847 int32_t lower_limit = 0;
848 int32_t upper_limit = 0;
849 bool using_limits = false;
850};
851
853 int32_t lower_value = 0;
854 int32_t upper_value = 100;
855 int32_t lower_limit = 0;
856 int32_t upper_limit = 0;
857
858 int32_t buttons_size = 20;
859 int32_t track_size = 180;
860 int32_t scaling_factor = 0;
861
862 bool using_limits = false;
863 bool vertical = false;
864};
865
867 int32_t new_value = 0;
868 bool move_slider = false;
869 bool is_relative = false;
870};
871
872class scrollbar : public container_base {
873
874protected:
878
879public:
882 int32_t stored_value = 0;
883
885
887 virtual void on_value_change(sys::state& state, int32_t v) noexcept { }
888
889 void update_raw_value(sys::state& state, int32_t v);
890 void update_scaled_value(sys::state& state, float v);
891
892 float scaled_value() const;
893 int32_t raw_value() const;
894
896
897 void on_create(sys::state& state) noexcept override;
898 message_result get(sys::state& state, Cyto::Any& payload) noexcept final;
899};
900
902public:
903 float line_height = 0.f;
904 int32_t current_line = 0;
905 int32_t visible_lines = 0;
906 bool black_text = true;
908
909 void on_create(sys::state& state) noexcept override;
910 void on_reset_text(sys::state& state) noexcept override;
911 void render(sys::state& state, int32_t x, int32_t y) noexcept override;
912 message_result on_lbutton_down(sys::state& state, int32_t x, int32_t y, sys::key_modifiers mods) noexcept override;
913 message_result on_rbutton_down(sys::state& state, int32_t x, int32_t y, sys::key_modifiers mods) noexcept override;
914 message_result test_mouse(sys::state& state, int32_t x, int32_t y, mouse_probe_type type) noexcept override;
915};
916
918public:
919 float line_height = 0.f;
920 int32_t current_line = 0;
921 int32_t visible_lines = 0;
922
923 void on_reset_text(sys::state& state) noexcept override;
924 void on_create(sys::state& state) noexcept override;
925 void render(sys::state& state, int32_t x, int32_t y) noexcept override;
926};
927
929 int32_t new_value;
930};
931
933public:
934 void on_create(sys::state& state) noexcept override;
935 void scale_to_parent();
936};
937
939public:
940 void on_value_change(sys::state& state, int32_t v) noexcept override;
941};
942
944protected:
946
947public:
949 void on_create(sys::state& state) noexcept override;
950 message_result get(sys::state& state, Cyto::Any& payload) noexcept override;
951 void calibrate_scrollbar(sys::state& state) noexcept;
952 message_result on_scroll(sys::state& state, int32_t x, int32_t y, float amount, sys::key_modifiers mods) noexcept override;
953 message_result test_mouse(sys::state& state, int32_t x, int32_t y, mouse_probe_type type) noexcept override {
957 }
958};
959
961public:
962 dcon::text_key text_id{};
963
964 void on_update(sys::state& state) noexcept override {
966 text::layout_parameters{0, 0, static_cast<int16_t>(base_data.size.x), static_cast<int16_t>(base_data.size.y),
968 auto box = text::open_layout_box(layout, 0);
970 text::close_layout_box(layout, box);
971 }
972};
973
974template<class RowWinT, class RowConT>
976public:
977 void on_value_change(sys::state& state, int32_t v) noexcept override;
978};
979
980template<class RowConT>
982protected:
983 RowConT content{};
984
985public:
986 message_result get(sys::state& state, Cyto::Any& payload) noexcept override;
987};
988
989template<class RowConT>
991protected:
992 RowConT content{};
993
994public:
995 virtual void update(sys::state& state) noexcept { }
996 message_result get(sys::state& state, Cyto::Any& payload) noexcept override;
997};
998
999template<class RowWinT, class RowConT>
1001protected:
1002 std::vector<RowWinT*> row_windows{};
1003
1004 virtual std::string_view get_row_element_name() {
1005 return std::string_view{};
1006 }
1007 virtual bool is_reversed() {
1008 return false;
1009 }
1010
1011public:
1013 std::vector<RowConT> row_contents{};
1014
1015 void update(sys::state& state);
1016 message_result on_scroll(sys::state& state, int32_t x, int32_t y, float amount, sys::key_modifiers mods) noexcept override;
1017 void on_create(sys::state& state) noexcept override;
1018 void render(sys::state& state, int32_t x, int32_t y) noexcept override;
1020 message_result test_mouse(sys::state& state, int32_t x, int32_t y, mouse_probe_type type) noexcept override {
1022 }
1023};
1024
1026public:
1027 void on_value_change(sys::state& state, int32_t v) noexcept override;
1028};
1029
1031public:
1032 message_result get(sys::state& state, Cyto::Any& payload) noexcept override;
1033};
1034
1036};
1039};
1040
1041template<typename contents_type>
1043public:
1044 std::vector<ui::element_base*> row_windows{};
1046 int32_t stored_index = 0;
1049
1052
1053 virtual std::unique_ptr<element_base> make_row(sys::state& state) noexcept = 0;
1054
1055 std::vector<contents_type> row_contents;
1056
1057 message_result on_scroll(sys::state& state, int32_t x, int32_t y, float amount, sys::key_modifiers mods) noexcept override;
1058 void on_update(sys::state& state) noexcept override;
1059 message_result get(sys::state& state, Cyto::Any& payload) noexcept override;
1060
1061 void on_create(sys::state& state) noexcept override;
1062 void render(sys::state& state, int32_t x, int32_t y) noexcept override;
1063
1064 void resize(sys::state& state, int32_t height);
1065
1066 message_result test_mouse(sys::state& state, int32_t x, int32_t y, mouse_probe_type type) noexcept override {
1068 }
1069};
1070
1071template<typename T>
1073 T data{};
1074};
1075
1076void populate_shortcut_tooltip(sys::state& state, ui::element_base& elm, text::columnar_layout& contents) noexcept;
1077
1078} // namespace ui
void on_create(sys::state &state) noexcept override
virtual void button_ctrl_shift_right_action(sys::state &state) noexcept
void set_button_text(sys::state &state, std::string const &new_text)
virtual void button_ctrl_action(sys::state &state) noexcept
virtual void button_shift_action(sys::state &state) noexcept
message_result on_rbutton_down(sys::state &state, int32_t x, int32_t y, sys::key_modifiers mods) noexcept override
void render(sys::state &state, int32_t x, int32_t y) noexcept override
message_result on_key_down(sys::state &state, sys::virtual_key key, sys::key_modifiers mods) noexcept final
virtual void button_ctrl_shift_action(sys::state &state) noexcept
message_result on_lbutton_up(sys::state &state, int32_t x, int32_t y, sys::key_modifiers mods, bool under_mouse) noexcept override
virtual sound::audio_instance & get_click_sound(sys::state &state) noexcept
virtual void button_action(sys::state &state) noexcept
void on_create(sys::state &state) noexcept override
void format_text(sys::state &state)
virtual void button_right_action(sys::state &state) noexcept
virtual void button_shift_right_action(sys::state &state) noexcept
virtual void button_ctrl_right_action(sys::state &state) noexcept
message_result on_lbutton_down(sys::state &state, int32_t x, int32_t y, sys::key_modifiers mods) noexcept override
void on_reset_text(sys::state &state) noexcept override
sound::audio_instance & get_click_sound(sys::state &state) noexcept override
void render(sys::state &state, int32_t x, int32_t y) noexcept override
virtual bool is_active(sys::state &state) noexcept
void render(sys::state &state, int32_t x, int32_t y) noexcept override
void move_child_to_back(element_base *child) noexcept final
void impl_render(sys::state &state, int32_t x, int32_t y) noexcept override
message_result impl_set(sys::state &state, Cyto::Any &payload) noexcept final
void add_child_to_back(std::unique_ptr< element_base > child) noexcept final
std::unique_ptr< element_base > remove_child(element_base *child) noexcept final
void impl_on_reset_text(sys::state &state) noexcept override
void add_child_to_front(std::unique_ptr< element_base > child) noexcept final
mouse_probe impl_probe_mouse(sys::state &state, int32_t x, int32_t y, mouse_probe_type type) noexcept override
void move_child_to_front(element_base *child) noexcept final
element_base * get_child_by_name(sys::state const &state, std::string_view name) noexcept final
message_result impl_on_key_down(sys::state &state, sys::virtual_key key, sys::key_modifiers mods) noexcept final
std::vector< std::unique_ptr< element_base > > children
void impl_on_update(sys::state &state) noexcept override
element_base * get_child_by_index(sys::state const &state, int32_t index) noexcept final
void for_each_demo(sys::state &state, std::function< void(dcon::culture_id)> fun) override
void on_update(sys::state &state) noexcept override
virtual void for_each_demo(sys::state &state, std::function< void(DemoT)> fun)
message_result on_lbutton_down(sys::state &state, int32_t x, int32_t y, sys::key_modifiers mods) noexcept override
message_result test_mouse(sys::state &state, int32_t x, int32_t y, mouse_probe_type type) noexcept override
virtual void edit_box_backtick(sys::state &state) noexcept
virtual void edit_box_enter(sys::state &state, std::string_view s) noexcept
void on_create(sys::state &state) noexcept override
virtual void edit_box_tab(sys::state &state, std::string_view s) noexcept
message_result on_key_down(sys::state &state, sys::virtual_key key, sys::key_modifiers mods) noexcept override
void on_reset_text(sys::state &state) noexcept override
virtual void edit_index_position(sys::state &state, int32_t index) noexcept
message_result on_lbutton_down(sys::state &state, int32_t x, int32_t y, sys::key_modifiers mods) noexcept override
virtual void edit_box_update(sys::state &state, std::string_view s) noexcept
virtual void edit_box_down(sys::state &state) noexcept
virtual void edit_box_esc(sys::state &state) noexcept
virtual void edit_box_back_slash(sys::state &state) noexcept
message_result test_mouse(sys::state &state, int32_t x, int32_t y, mouse_probe_type type) noexcept override
virtual void edit_box_up(sys::state &state) noexcept
void render(sys::state &state, int32_t x, int32_t y) noexcept override
virtual tooltip_behavior has_tooltip(sys::state &state) noexcept
element_base * parent
virtual message_result on_lbutton_down(sys::state &state, int32_t x, int32_t y, sys::key_modifiers mods) noexcept
virtual void on_create(sys::state &state) noexcept
element_data base_data
void set_visible(sys::state &state, bool vis)
virtual message_result on_rbutton_down(sys::state &state, int32_t x, int32_t y, sys::key_modifiers mods) noexcept
friend void sys::state::on_text(char32_t c)
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 render(sys::state &state, int32_t x, int32_t y) noexcept override
void button_action(sys::state &state) noexcept override
tooltip_behavior has_tooltip(sys::state &state) noexcept override
void on_create(sys::state &state) noexcept override
void button_action(sys::state &state) noexcept override
virtual dcon::national_identity_id get_current_nation(sys::state &state) noexcept
void update_tooltip(sys::state &state, int32_t x, int32_t y, text::columnar_layout &contents) noexcept override
virtual dcon::rebel_faction_id get_current_rebel_faction(sys::state &state) noexcept
tooltip_behavior has_tooltip(sys::state &state) noexcept override
void render(sys::state &state, int32_t x, int32_t y) noexcept override
virtual void set_current_nation(sys::state &state, dcon::national_identity_id identity) noexcept
void on_update(sys::state &state) noexcept override
void button_action(sys::state &state) noexcept override
bool is_active(sys::state &state) noexcept final
void on_create(sys::state &state) noexcept final
void button_action(sys::state &state) noexcept final
sound::audio_instance & get_click_sound(sys::state &state) noexcept override
void button_action(sys::state &state) noexcept final
bool is_active(sys::state &state) noexcept final
message_result test_mouse(sys::state &state, int32_t x, int32_t y, mouse_probe_type type) noexcept override
void for_each_demo(sys::state &state, std::function< void(dcon::ideology_id)> fun) override
void render(sys::state &state, int32_t x, int32_t y) noexcept override
message_result test_mouse(sys::state &state, int32_t x, int32_t y, mouse_probe_type type) noexcept override
virtual bool get_horizontal_flip(sys::state &state) noexcept
void on_create(sys::state &state) noexcept override
void on_create(sys::state &state) noexcept override
void on_create(sys::state &state) noexcept override
const uint32_t count
void render(sys::state &state, int32_t x, int32_t y) noexcept override
line_graph(uint32_t sz)
message_result test_mouse(sys::state &state, int32_t x, int32_t y, mouse_probe_type type) noexcept override
void set_data_points(sys::state &state, std::vector< float > const &datapoints) noexcept
void on_create(sys::state &state) noexcept override
listbox2_scrollbar * list_scrollbar
virtual std::unique_ptr< element_base > make_row(sys::state &state) noexcept=0
message_result on_scroll(sys::state &state, int32_t x, int32_t y, float amount, sys::key_modifiers mods) noexcept override
message_result get(sys::state &state, Cyto::Any &payload) noexcept override
std::vector< ui::element_base * > row_windows
message_result test_mouse(sys::state &state, int32_t x, int32_t y, mouse_probe_type type) noexcept override
void resize(sys::state &state, int32_t height)
void render(sys::state &state, int32_t x, int32_t y) noexcept override
listbox2_base(bool scrollbar_is_internal)
std::vector< contents_type > row_contents
void on_update(sys::state &state) noexcept override
message_result get(sys::state &state, Cyto::Any &payload) noexcept override
void on_value_change(sys::state &state, int32_t v) noexcept override
std::vector< RowConT > row_contents
message_result on_scroll(sys::state &state, int32_t x, int32_t y, float amount, sys::key_modifiers mods) noexcept override
std::vector< RowWinT * > row_windows
standard_listbox_scrollbar< RowWinT, RowConT > * list_scrollbar
message_result test_mouse(sys::state &state, int32_t x, int32_t y, mouse_probe_type type) noexcept override
void scroll_to_bottom(sys::state &state)
virtual std::string_view get_row_element_name()
void update(sys::state &state)
void on_create(sys::state &state) noexcept override
void render(sys::state &state, int32_t x, int32_t y) noexcept override
virtual void update(sys::state &state) noexcept
message_result get(sys::state &state, Cyto::Any &payload) noexcept override
message_result get(sys::state &state, Cyto::Any &payload) noexcept override
void on_reset_text(sys::state &state) noexcept override
void on_create(sys::state &state) noexcept override
void render(sys::state &state, int32_t x, int32_t y) noexcept override
message_result on_lbutton_down(sys::state &state, int32_t x, int32_t y, sys::key_modifiers mods) noexcept override
message_result on_rbutton_down(sys::state &state, int32_t x, int32_t y, sys::key_modifiers mods) noexcept override
void on_create(sys::state &state) noexcept override
message_result test_mouse(sys::state &state, int32_t x, int32_t y, mouse_probe_type type) noexcept override
void render(sys::state &state, int32_t x, int32_t y) noexcept override
void on_reset_text(sys::state &state) noexcept override
void on_value_change(sys::state &state, int32_t v) noexcept override
void update_tooltip(sys::state &state, int32_t x, int32_t y, text::columnar_layout &contents) noexcept override
nation_script_button(dcon::gui_def_id base_definition)
void button_action(sys::state &state) noexcept override
dcon::gui_def_id base_definition
void on_update(sys::state &state) noexcept override
tooltip_behavior has_tooltip(sys::state &state) noexcept override
message_result test_mouse(sys::state &state, int32_t x, int32_t y, mouse_probe_type type) noexcept override
message_result on_rbutton_down(sys::state &state, int32_t x, int32_t y, sys::key_modifiers mods) noexcept override
tooltip_behavior has_tooltip(sys::state &state) noexcept override
message_result on_lbutton_down(sys::state &state, int32_t x, int32_t y, sys::key_modifiers mods) noexcept override
void populate_flags(sys::state &state) override
void populate_flags(sys::state &state) override
void populate_flags(sys::state &state) override
void on_update(sys::state &state) noexcept override
std::string_view get_row_element_name() override
void update_subwindow(sys::state &state, overlapping_flags_flag_button &subwindow, dcon::national_identity_id content) override
virtual void populate_flags(sys::state &state)
dcon::national_identity_id get_current_nation(sys::state &state) noexcept override
void set_current_nation(sys::state &state, dcon::national_identity_id identity) noexcept override
tooltip_behavior has_tooltip(sys::state &state) noexcept override
void populate_flags(sys::state &state) override
virtual std::string_view get_row_element_name()
virtual void update_subwindow(sys::state &state, ItemWinT &subwindow, ItemConT content)
void populate_flags(sys::state &state) override
void populate_flags(sys::state &state) override
void update_tooltip(sys::state &state, int32_t x, int32_t y, text::columnar_layout &contents) noexcept override
dcon::national_identity_id get_current_nation(sys::state &state) noexcept override
void upate_truce(sys::state &state, dcon::nation_id i, sys::date u)
tooltip_behavior has_tooltip(sys::state &state) noexcept override
std::string_view get_row_element_name() override
void on_update(sys::state &state) noexcept override
void update_subwindow(sys::state &state, overlapping_truce_flag_button &subwindow, truce_pair content) override
static std::unique_ptr< partially_transparent_image > make_element_by_type_alias(sys::state &state, dcon::gui_def_id id)
void on_create(sys::state &state) noexcept override
message_result test_mouse(sys::state &state, int32_t x, int32_t y, mouse_probe_type type) noexcept override
ogl::data_texture data_texture
virtual void populate_tooltip(sys::state &state, T t, float percentage, text::columnar_layout &contents) noexcept
void update_chart(sys::state &state)
std::vector< entry > distribution
void render(sys::state &state, int32_t x, int32_t y) noexcept override
message_result on_rbutton_down(sys::state &state, int32_t x, int32_t y, sys::key_modifiers mods) noexcept override
message_result test_mouse(sys::state &state, int32_t x, int32_t y, mouse_probe_type type) noexcept override
void on_create(sys::state &state) noexcept override
tooltip_behavior has_tooltip(sys::state &state) noexcept override
static constexpr int32_t resolution
message_result on_lbutton_down(sys::state &state, int32_t x, int32_t y, sys::key_modifiers mods) noexcept override
static constexpr size_t channels
void update_tooltip(sys::state &state, int32_t x, int32_t y, text::columnar_layout &contents) noexcept override
message_result on_lbutton_down(sys::state &state, int32_t x, int32_t y, sys::key_modifiers mods) noexcept override
message_result on_rbutton_down(sys::state &state, int32_t x, int32_t y, sys::key_modifiers mods) noexcept override
void render(sys::state &state, int32_t x, int32_t y) noexcept override
message_result test_mouse(sys::state &state, int32_t x, int32_t y, mouse_probe_type type) 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 button_action(sys::state &state) noexcept override
province_script_button(dcon::gui_def_id base_definition)
tooltip_behavior has_tooltip(sys::state &state) noexcept override
message_result on_rbutton_down(sys::state &state, int32_t x, int32_t y, sys::key_modifiers mods) noexcept final
virtual void button_right_action(sys::state &state) noexcept override
void calibrate_scrollbar(sys::state &state) noexcept
message_result get(sys::state &state, Cyto::Any &payload) noexcept override
message_result test_mouse(sys::state &state, int32_t x, int32_t y, mouse_probe_type type) noexcept override
message_result on_scroll(sys::state &state, int32_t x, int32_t y, float amount, sys::key_modifiers mods) noexcept override
void on_create(sys::state &state) noexcept override
multiline_text_element_base * delegate
multiline_text_scrollbar * text_scrollbar
message_result set(sys::state &state, Cyto::Any &payload) noexcept final
void update_tooltip(sys::state &state, int32_t x, int32_t y, text::columnar_layout &contents) noexcept override
sound::audio_instance & get_click_sound(sys::state &state) noexcept override
tooltip_behavior has_tooltip(sys::state &state) noexcept override
void button_action(sys::state &state) noexcept final
void button_shift_right_action(sys::state &state) noexcept final
void button_shift_action(sys::state &state) noexcept final
void button_shift_right_action(sys::state &state) noexcept final
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 final
void button_shift_action(sys::state &state) noexcept final
message_result set(sys::state &state, Cyto::Any &payload) noexcept final
sound::audio_instance & get_click_sound(sys::state &state) noexcept override
tooltip_behavior has_tooltip(sys::state &state) noexcept override
void on_drag_finish(sys::state &state) noexcept final
void on_drag(sys::state &state, int32_t oldx, int32_t oldy, int32_t x, int32_t y, sys::key_modifiers mods) noexcept final
message_result on_lbutton_down(sys::state &state, int32_t x, int32_t y, sys::key_modifiers mods) noexcept final
message_result on_lbutton_down(sys::state &state, int32_t x, int32_t y, sys::key_modifiers mods) noexcept final
tooltip_behavior has_tooltip(sys::state &state) noexcept final
void update_tooltip(sys::state &state, int32_t x, int32_t y, text::columnar_layout &contents) noexcept final
image_element_base * right_limit
scrollbar_slider * slider
void change_settings(sys::state &state, mutable_scrollbar_settings const &settings_s)
void on_create(sys::state &state) noexcept override
virtual void on_value_change(sys::state &state, int32_t v) noexcept
scrollbar_settings settings
scrollbar_right * right
scrollbar_left * left
message_result get(sys::state &state, Cyto::Any &payload) noexcept final
scrollbar_track * track
int32_t raw_value() const
void update_scaled_value(sys::state &state, float v)
float scaled_value() const
void update_raw_value(sys::state &state, int32_t v)
image_element_base * left_limit
void on_create(sys::state &state) noexcept override
void on_reset_text(sys::state &state) noexcept override
void render(sys::state &state, int32_t x, int32_t y) noexcept override
void set_text(sys::state &state, std::string const &new_text)
void render(sys::state &state, int32_t x, int32_t y) noexcept override
void on_create(sys::state &state) noexcept override
void set_text(sys::state &state, std::string const &new_text)
message_result test_mouse(sys::state &state, int32_t x, int32_t y, mouse_probe_type type) noexcept override
std::string_view get_text(sys::state &state) const
void on_reset_text(sys::state &state) noexcept override
void format_text(sys::state &state)
void on_update(sys::state &state) noexcept override
void on_value_change(sys::state &state, int32_t v) noexcept override
void render(sys::state &state, int32_t x, int32_t y) noexcept override
void render(sys::state &state, int32_t x, int32_t y) noexcept override
virtual void button_right_action(sys::state &state) noexcept override
message_result on_rbutton_down(sys::state &state, int32_t x, int32_t y, sys::key_modifiers mods) noexcept final
void render(sys::state &state, int32_t x, int32_t y) noexcept override
text::layout internal_layout
void on_create(sys::state &state) noexcept override
message_result test_mouse(sys::state &state, int32_t x, int32_t y, mouse_probe_type type) noexcept override
void on_create(sys::state &state) noexcept override
void on_drag(sys::state &state, int32_t oldx, int32_t oldy, int32_t x, int32_t y, sys::key_modifiers mods) noexcept override
virtual std::unique_ptr< element_base > make_child(sys::state &state, std::string_view name, dcon::gui_def_id id) noexcept
void for_each_demo(sys::state &state, std::function< void(dcon::pop_type_id)> fun) override
color_modification
audio_instance & get_click_left_sound(sys::state &state)
Definition: sound_nix.cpp:266
audio_instance & get_click_right_sound(sys::state &state)
Definition: sound_nix.cpp:269
audio_instance & get_checkbox_sound(sys::state &state)
Definition: sound_nix.cpp:278
void play_interface_sound(sys::state &state, audio_instance &s, float volume)
Definition: sound_nix.cpp:203
audio_instance & get_click_sound(sys::state &state)
Definition: sound_nix.cpp:263
audio_instance & get_subtab_sound(sys::state &state)
Definition: sound_nix.cpp:284
virtual_key
Definition: constants.hpp:5
key_modifiers
Definition: constants.hpp:156
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
endless_layout create_endless_layout(sys::state &state, layout &dest, layout_parameters const &params)
Definition: text.cpp:1100
void add_to_substitution_map(substitution_map &mp, variable_type key, substitution value)
Definition: text.cpp:1068
ankerl::unordered_dense::map< uint32_t, substitution > substitution_map
Definition: text.hpp:794
text_color
Definition: text.hpp:18
void close_layout_box(columnar_layout &dest, layout_box &box)
Definition: text.cpp:1807
void make_size_from_graphics(sys::state &state, ui::element_data &dat)
std::unique_ptr< element_base > make_element_by_type(sys::state &state, std::string_view name, Params &&... params)
void populate_shortcut_tooltip(sys::state &state, ui::element_base &elm, text::columnar_layout &contents) noexcept
tooltip_behavior
void send(sys::state &state, element_base *parent, T value)
ogl::color3f get_text_color(sys::state &state, text::text_color text_color)
message_result
ogl::color_modification get_color_modification(bool is_under_mouse, bool is_disabled, bool is_interactable)
uint uint32_t
uchar uint8_t
dcon::gfx_object_id button_image
sys::virtual_key shortcut
element_type get_element_type() const
union ui::element_data::internal_data data
static constexpr uint8_t do_transparency_check
dcon::gfx_object_id gfx_object
listbox2_row_element * row
entry(T key, float value)
ankerl::unordered_dense::map< dcon::text_key, element_target, hash_text_key > defs_by_name
dcon::nation_id n