Project Alice
Loading...
Searching...
No Matches
gui_graphics_parsers.cpp
Go to the documentation of this file.
1#include "gui_graphics.hpp"
3#include "system_state.hpp"
4#include "fonts.hpp"
5
6namespace parsers {
7std::string lowercase_str(std::string_view sv) {
8 std::string result;
9 result.reserve(sv.length());
10 for(auto ch : sv) {
11 result += char(tolower(ch));
12 }
13 return result;
14}
15
17 ui::gfx_object* obj = nullptr;
18 bool horizontal = false;
19};
21 auto gfxindex = context.ui_defs.gfx.size();
22 context.ui_defs.gfx.emplace_back();
23 ui::gfx_object& new_obj = context.ui_defs.gfx.back();
24
25 context.map_of_names.insert_or_assign(std::string(obj_in.name), dcon::gfx_object_id(uint16_t(gfxindex)));
26
27 if(obj_in.allwaystransparent) {
29 }
30 if(obj_in.clicksound_set) {
32 }
33 if(obj_in.flipv) {
35 }
36 if(obj_in.transparencecheck) {
38 }
39
40 new_obj.number_of_frames = uint8_t(obj_in.noofframes);
41
42 if(obj_in.primary_texture.length() > 0) {
44 if(auto it = context.map_of_texture_names.find(std::string(stripped)); it != context.map_of_texture_names.end()) {
45 new_obj.primary_texture_handle = it->second;
46 } else {
47 auto index = context.ui_defs.textures.size();
48 context.ui_defs.textures.emplace_back(context.full_state.add_key_win1252(stripped));
49 new_obj.primary_texture_handle = dcon::texture_id(dcon::texture_id::value_base_t(index));
50 context.map_of_texture_names.insert_or_assign(stripped, new_obj.primary_texture_handle);
51 }
52 }
53 if(obj_in.secondary_texture.length() > 0) {
55 if(auto it = context.map_of_texture_names.find(stripped); it != context.map_of_texture_names.end()) {
56 new_obj.type_dependent = uint16_t(it->second.index() + 1);
57 } else {
58 auto index = context.ui_defs.textures.size();
59 context.ui_defs.textures.emplace_back(context.full_state.add_key_win1252(stripped));
60 new_obj.type_dependent = uint16_t(index + 1);
61 context.map_of_texture_names.insert_or_assign(stripped, dcon::texture_id(dcon::texture_id::value_base_t(index)));
62 }
63 }
64
65 if(obj_in.size) {
66 new_obj.size.x = int16_t(*obj_in.size);
67 new_obj.size.y = int16_t(*obj_in.size);
68 }
69 if(obj_in.size_obj) {
70 new_obj.size.x = int16_t(obj_in.size_obj->x);
71 new_obj.size.y = int16_t(obj_in.size_obj->y);
72 }
73 if(obj_in.bordersize) {
74 new_obj.type_dependent = uint16_t(obj_in.bordersize->x);
75 }
76
77 return obj_and_horizontal{&new_obj, obj_in.horizontal};
78}
79
81 building_gfx_context& context) {
82 auto res = common_create_object(obj, context);
84}
86 building_gfx_context& context) {
87 auto res = common_create_object(obj, context);
88 res.obj->flags |= uint8_t(ui::object_type::bordered_rect);
89}
91 building_gfx_context& context) {
92 auto res = common_create_object(obj, context);
93 res.obj->flags |= uint8_t(ui::object_type::flag_mask);
94}
96 building_gfx_context& context) {
97 auto res = common_create_object(obj, context);
98 res.obj->flags |= uint8_t(ui::object_type::text_sprite);
99}
101 building_gfx_context& context) {
102 auto res = common_create_object(obj, context);
103 res.obj->flags |= uint8_t(ui::object_type::tile_sprite);
104}
106 building_gfx_context& context) {
107 auto res = common_create_object(obj, context);
108 if(res.horizontal)
110 else
112}
114 building_gfx_context& context) {
115 auto res = common_create_object(obj, context);
116 res.obj->flags |= uint8_t(ui::object_type::barchart);
117}
119 building_gfx_context& context) {
120 auto res = common_create_object(obj, context);
121 res.obj->flags |= uint8_t(ui::object_type::piechart);
122}
124 building_gfx_context& context) {
125 auto res = common_create_object(obj, context);
126 res.obj->flags |= uint8_t(ui::object_type::linegraph);
127}
128
130 parsers::parse_gfx_object_outer(gen, err, context);
131}
132
134 a.x = int16_t(b.x);
135 a.y = int16_t(b.y);
136}
137
138void gui_element_common::size(gfx_xy_pair const& pr, error_handler& err, int32_t line, building_gfx_context& context) {
139 assign(target.size, pr);
140}
141void gui_element_common::position(gfx_xy_pair const& pr, error_handler& err, int32_t line, building_gfx_context& context) {
143}
144
145void gui_element_common::orientation(association_type, std::string_view txt, error_handler& err, int32_t line,
146 building_gfx_context& context) {
147 if(is_fixed_token_ci(txt.data(), txt.data() + txt.length(), "center") ||
148 is_fixed_token_ci(txt.data(), txt.data() + txt.length(), "centre")) {
150 } else if(is_fixed_token_ci(txt.data(), txt.data() + txt.length(), "lower_left")) {
152 } else if(is_fixed_token_ci(txt.data(), txt.data() + txt.length(), "lower_right")) {
154 } else if(is_fixed_token_ci(txt.data(), txt.data() + txt.length(), "upper_left") ||
155 is_fixed_token_ci(txt.data(), txt.data() + txt.length(), "upperl_left")) {
157 } else if(is_fixed_token_ci(txt.data(), txt.data() + txt.length(), "upper_right")) {
159 } else if(is_fixed_token_ci(txt.data(), txt.data() + txt.length(), "center_up")) {
161 } else if(is_fixed_token_ci(txt.data(), txt.data() + txt.length(), "center_down")) {
163 } else {
164 err.accumulated_errors += "tried to parse " + std::string(txt) + " as an orientation on line " + std::to_string(line) +
165 " of file " + err.file_name + "\n";
166 }
167}
168void gui_element_common::name(association_type, std::string_view txt, error_handler& err, int32_t line,
169 building_gfx_context& context) {
170 target.name = context.full_state.add_key_win1252(txt);
171}
172void gui_element_common::extends(association_type, std::string_view txt, error_handler& err, int32_t line, building_gfx_context& context) {
173 extension = context.full_state.add_key_win1252(txt);
174}
175void gui_element_common::rotation(association_type, std::string_view txt, error_handler& err, int32_t line,
176 building_gfx_context& context) {
177 if(is_fixed_token_ci(txt.data(), txt.data() + txt.length(), "-1.5708")
178 || is_fixed_token_ci(txt.data(), txt.data() + txt.length(), "-1.570796")) {
180 } else if(is_fixed_token_ci(txt.data(), txt.data() + txt.length(), "1.5708")
181 || is_fixed_token_ci(txt.data(), txt.data() + txt.length(), "1.570796")) {
183 } else if(parse_float(txt, line, err) == 0.0f) {
185 } else {
186 err.accumulated_errors += "tried to parse " + std::string(txt) + " as a rotation on line " + std::to_string(line) +
187 " of file " + err.file_name + "\n";
188 }
189}
191 target.size.x = int16_t(v);
192}
194 target.size.y = int16_t(v);
195}
196void gui_element_common::maxsize(gfx_xy_pair const& pr, error_handler& err, int32_t line, building_gfx_context& context) {
197 target.size.x = int16_t(pr.x);
198 target.size.y = int16_t(pr.y);
199}
200void gui_element_common::add_size(gfx_xy_pair const& pr, error_handler& err, int32_t line, building_gfx_context& context) {
201 target.size.x += int16_t(pr.x);
202 target.size.y += int16_t(pr.y);
203}
205 target.position.x += int16_t(pr.x);
206 target.position.y += int16_t(pr.y);
207}
209 target.position.x += int16_t(target.size.x) * int16_t(pr.x);
210 target.position.y += int16_t(target.size.y) * int16_t(pr.y);
211}
212
216}
217void button::spritetype(association_type, std::string_view txt, error_handler& err, int32_t line, building_gfx_context& context) {
218 if(txt.length() == 0)
219 return;
220 auto it = context.map_of_names.find(std::string(txt));
221 if(it != context.map_of_names.end()) {
222 target.data.button.button_image = it->second;
223 } else {
224 err.accumulated_errors += "referenced unknown gfx object " + std::string(txt) + " on line " + std::to_string(line) +
225 " of file " + err.file_name + "\n";
226 }
227}
228
229void button::shortcut(association_type, std::string_view t, error_handler& err, int32_t line, building_gfx_context& context) {
230 if(t.length() == size_t(0))
232 else if(t.length() == size_t(1)) {
233 if((t[0] >= 'a') && (t[0] <= 'z')) {
235 } else if((t[0] >= 'A') && (t[0] <= 'Z')) {
237 } else if((t[0] >= '0') && (t[0] <= '9')) {
239 } else if(t[0] == ':') {
241 } else if(t[0] == ';') {
243 } else if(t[0] == '+') {
245 } else if(t[0] == '=') {
247 } else if(t[0] == '<') {
249 } else if(t[0] == ',') {
251 } else if(t[0] == '-') {
253 } else if(t[0] == '_') {
255 } else if(t[0] == '.') {
257 } else if(t[0] == '>') {
259 } else if(t[0] == '?') {
261 } else if(t[0] == '/') {
263 } else if(t[0] == '~') {
265 } else if(t[0] == '`') {
267 } else if(t[0] == '{') {
269 } else if(t[0] == '[') {
271 } else if(t[0] == '|') {
273 } else if(t[0] == '\\') {
275 } else if(t[0] == '}') {
277 } else if(t[0] == ']') {
279 } else if(t[0] == '\'') {
281 } else if(t[0] == '\"') {
283 } else {
284 err.accumulated_errors += "tried to parse " + std::string(t) + " as a key name on line " + std::to_string(line) +
285 " of file " + err.file_name + "\n";
286 }
287 } else {
288 if(is_fixed_token_ci(t.data(), t.data() + t.length(), "none")) {
290 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "backspace")) {
292 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "back")) {
294 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "tab")) {
296 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "return")) {
298 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "enter")) {
300 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "esc")) {
302 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "escape")) {
304 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "space")) {
306 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "page_up")) {
308 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "page_down")) {
310 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "end")) {
312 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "home")) {
314 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "left")) {
316 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "up")) {
318 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "right")) {
320 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "down")) {
322 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "select")) {
324 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "insert")) {
326 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "delete")) {
328 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "del")) {
330 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "f1")) {
332 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "f2")) {
334 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "f3")) {
336 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "f4")) {
338 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "f5")) {
340 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "f6")) {
342 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "f7")) {
344 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "f8")) {
346 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "f9")) {
348 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "f10")) {
350 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "f11")) {
352 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "f12")) {
354 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "f13")) {
356 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "f14")) {
358 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "f15")) {
360 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "f16")) {
362 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "f17")) {
364 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "f18")) {
366 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "f19")) {
368 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "f20")) {
370 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "f21")) {
372 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "f22")) {
374 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "f23")) {
376 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "f24")) {
378 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "numpad0")) {
380 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "numpad1")) {
382 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "numpad2")) {
384 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "numpad3")) {
386 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "numpad4")) {
388 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "numpad5")) {
390 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "numpad6")) {
392 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "numpad7")) {
394 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "numpad8")) {
396 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "numpad9")) {
398 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "multiply")) {
400 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "add")) {
402 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "separator")) {
404 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "subtract")) {
406 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "decimal")) {
408 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "divide")) {
410 } else {
411 err.accumulated_errors += "tried to parse " + std::string(t) + " as a key name on line " + std::to_string(line) +
412 " of file " + err.file_name + "\n";
413 }
414 }
415}
416
417void button::buttontext(association_type, std::string_view txt, error_handler& err, int32_t line, building_gfx_context& context) {
419}
420
421void button::buttonfont(association_type, std::string_view txt, error_handler& err, int32_t line, building_gfx_context& context) {
423}
424
425void button::format(association_type, std::string_view t, error_handler& err, int32_t line, building_gfx_context& context) {
426 if(is_fixed_token_ci(t.data(), t.data() + t.length(), "centre") ||
427 is_fixed_token_ci(t.data(), t.data() + t.length(), "center")) {
429 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "left")) {
431 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "right")) {
433 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "justified")) {
435 } else {
436 err.accumulated_errors += "tried to parse " + std::string(t) + " as an alignment on line " + std::to_string(line) +
437 " of file " + err.file_name + "\n";
438 }
439}
440
441void button::clicksound(association_type, std::string_view t, error_handler& err, int32_t line, building_gfx_context& context) {
442 if(is_fixed_token(t.data(), t.data() + t.length(), "click")) {
444 } else if(is_fixed_token(t.data(), t.data() + t.length(), "close_window")) {
446 } else if(is_fixed_token(t.data(), t.data() + t.length(), "start_game")) {
448 } else {
449 err.accumulated_errors += "tried to parse " + std::string(t) + " as a click sound on line " + std::to_string(line) +
450 " of file " + err.file_name + "\n";
451 }
452}
453
454void nation_script_button::allow(bool, error_handler& err, int32_t line, building_gfx_context& context) {
455 if(added_allow != -1) {
456 err.accumulated_errors += "multiple allow conditions for a button defined on line " + std::to_string(line) + " of file " + err.file_name + "\n";
457 }
458 added_allow = int32_t(context.nation_buttons_allow.size()) - 1;
459}
460void nation_script_button::effect(bool, error_handler& err, int32_t line, building_gfx_context& context) {
461 if(added_effect != -1) {
462 err.accumulated_errors += "multiple effects for a button defined on line " + std::to_string(line) + " of file " + err.file_name + "\n";
463 }
464 added_effect = int32_t(context.nation_buttons_effect.size()) - 1;
465}
466void province_script_button::allow(bool, error_handler& err, int32_t line, building_gfx_context& context) {
467 if(added_allow != -1) {
468 err.accumulated_errors += "multiple allow conditions for a button defined on line " + std::to_string(line) + " of file " + err.file_name + "\n";
469 }
470 added_allow = int32_t(context.province_buttons_allow.size()) - 1;
471}
472void province_script_button::effect(bool, error_handler& err, int32_t line, building_gfx_context& context) {
473 if(added_effect != -1) {
474 err.accumulated_errors += "multiple effects for a button defined on line " + std::to_string(line) + " of file " + err.file_name + "\n";
475 }
476 added_effect = int32_t(context.province_buttons_effect.size()) - 1;
477}
478
479
481 context.province_buttons_allow.push_back(pending_button_script{ err.file_name, gen, dcon::gui_def_id{} });
482 gen.discard_group();
483 return true;
484}
486 context.province_buttons_effect.push_back(pending_button_script{ err.file_name, gen, dcon::gui_def_id{} });
487 gen.discard_group();
488 return true;
489}
491 context.nation_buttons_allow.push_back(pending_button_script{ err.file_name, gen, dcon::gui_def_id{} });
492 gen.discard_group();
493 return true;
494}
496 context.nation_buttons_effect.push_back(pending_button_script{ err.file_name, gen, dcon::gui_def_id{} });
497 gen.discard_group();
498 return true;
499}
500
504}
506 if(v <= 127) {
508 } else {
509 err.accumulated_errors +=
510 "asked for more than 127 frames on line " + std::to_string(line) + " of file " + err.file_name + "\n";
511 }
512}
513void image::spritetype(association_type, std::string_view txt, error_handler& err, int32_t line, building_gfx_context& context) {
514 if(txt.length() == 0)
515 return;
516 auto it = context.map_of_names.find(std::string(txt));
517 if(it != context.map_of_names.end()) {
518 target.data.image.gfx_object = it->second;
519 } else {
520 err.accumulated_errors += "referenced unknown gfx object " + std::string(txt) + " on line " + std::to_string(line) +
521 " of file " + err.file_name + "\n";
522 }
523}
524void image::scale(association_type, float v, error_handler& err, int32_t line, building_gfx_context& context) {
526}
527
531}
532
533void textbox::bordersize(gfx_xy_pair const& pr, error_handler& err, int32_t line, building_gfx_context& context) {
535}
536void textbox::fixedsize(association_type, bool v, error_handler& err, int32_t line, building_gfx_context& context) {
537 if(v) {
539 }
540}
541void textbox::font(association_type, std::string_view txt, error_handler& err, int32_t line, building_gfx_context& context) {
543}
544void textbox::format(association_type, std::string_view t, error_handler& err, int32_t line, building_gfx_context& context) {
545 if(is_fixed_token_ci(t.data(), t.data() + t.length(), "centre") ||
546 is_fixed_token_ci(t.data(), t.data() + t.length(), "center")) {
548 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "left")) {
550 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "right")) {
552 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "justified")) {
554 } else {
555 err.accumulated_errors += "tried to parse " + std::string(t) + " as an alignment on line " + std::to_string(line) +
556 " of file " + err.file_name + "\n";
557 }
558}
559void textbox::text(association_type, std::string_view txt, error_handler& err, int32_t line, building_gfx_context& context) {
561}
562void textbox::texturefile(association_type, std::string_view t, error_handler& err, int32_t line, building_gfx_context& context) {
563 if(t.length() == 0) {
565 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "gfx\\\\interface\\\\tiles_dialog.tga")) {
567 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "gfx\\\\interface\\\\transparency.tga")) {
569 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "gfx\\\\interface\\\\small_tiles_dialog.dds")) {
571 } else {
572 err.accumulated_errors += "tried to parse " + std::string(t) + " as a text box background on line " + std::to_string(line) +
573 " of file " + err.file_name + "\n";
574 }
575}
576
580}
581
582void listbox::background(association_type, std::string_view txt, error_handler& err, int32_t line,
583 building_gfx_context& context) {
584 if(txt.length() == 0)
585 return;
586 auto it = context.map_of_names.find(std::string(txt));
587 if(it != context.map_of_names.end()) {
589 } else {
590 err.accumulated_errors += "referenced unknown gfx object " + std::string(txt) + " on line " + std::to_string(line) +
591 " of file " + err.file_name + "\n";
592 }
593}
594void listbox::bordersize(gfx_xy_pair const& pr, error_handler& err, int32_t line, building_gfx_context& context) {
596}
597void listbox::offset(gfx_xy_pair const& pr, error_handler& err, int32_t line, building_gfx_context& context) {
599}
602}
603
607}
608void overlapping::format(association_type, std::string_view t, error_handler& err, int32_t line, building_gfx_context& context) {
609 if(is_fixed_token_ci(t.data(), t.data() + t.length(), "centre") ||
610 is_fixed_token_ci(t.data(), t.data() + t.length(), "center")) {
612 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "left")) {
614 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "right")) {
616 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "justified")) {
618 } else {
619 err.accumulated_errors += "tried to parse " + std::string(t) + " as an alignment on line " + std::to_string(line) +
620 " of file " + err.file_name + "\n";
621 }
622}
623void overlapping::spacing(association_type, float v, error_handler& err, int32_t line, building_gfx_context& context) {
625}
626
630}
632 if(v)
634}
635void scrollbar::leftbutton(association_type, std::string_view txt, error_handler& err, int32_t line,
636 building_gfx_context& context) {
637 leftbutton_ = txt;
638}
639void scrollbar::rightbutton(association_type, std::string_view txt, error_handler& err, int32_t line,
640 building_gfx_context& context) {
641 rightbutton_ = txt;
642}
643void scrollbar::rangelimitmaxicon(association_type, std::string_view txt, error_handler& err, int32_t line,
644 building_gfx_context& context) {
645 rangelimitmaxicon_ = txt;
646}
647void scrollbar::rangelimitminicon(association_type, std::string_view txt, error_handler& err, int32_t line,
648 building_gfx_context& context) {
649 rangelimitminicon_ = txt;
650}
651void scrollbar::slider(association_type, std::string_view txt, error_handler& err, int32_t line, building_gfx_context& context) {
652 slider_ = txt;
653}
654void scrollbar::track(association_type, std::string_view txt, error_handler& err, int32_t line, building_gfx_context& context) {
655 track_ = txt;
656}
657void scrollbar::lockable(association_type, bool v, error_handler& err, int32_t line, building_gfx_context& context) {
658 if(v)
660}
662 if(v)
664}
666 target.data.scrollbar.max_value = uint16_t(v);
667}
668void scrollbar::stepsize(association_type, std::string_view t, error_handler& err, int32_t line, building_gfx_context& context) {
669 if(is_fixed_token_ci(t.data(), t.data() + t.length(), "1")) {
671 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "2")) {
673 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "0.1")) {
675 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "0.01")) {
677 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "0.001")) {
679 // Non vanilla accomodation
680 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "25")) {
682 } else {
683 err.accumulated_errors += "tried to parse " + std::string(t) + " as a step size on line " + std::to_string(line) +
684 " of file " + err.file_name + "\n";
685 }
686}
687void scrollbar::bordersize(gfx_xy_pair const& pr, error_handler& err, int32_t line, building_gfx_context& context) {
689}
690void scrollbar::guibuttontype(button const& v, error_handler& err, int32_t line, building_gfx_context& context) {
691 children.push_back(v.target);
692}
693void scrollbar::icontype(image const& v, error_handler& err, int32_t line, building_gfx_context& context) {
694 children.push_back(v.target);
695}
696auto find_in_children(std::string_view name, std::vector<ui::element_data> const& v, sys::state const& state) {
697 auto lname = lowercase_str(name);
698 for(size_t i = v.size(); i-- > 0;) {
699 if(lowercase_str(state.to_string_view(v[i].name)) == lname) {
700 return i;
701 }
702 }
703 return size_t(-1);
704}
706 if(auto fr = find_in_children(leftbutton_, children, context.full_state);
707 fr != size_t(-1) && leftbutton_.length() > 0 && children.size() > 0) {
708 if(fr != 0) {
709 std::swap(children[0], children[fr]);
710 }
711 }
712 if(auto fr = find_in_children(rightbutton_, children, context.full_state);
713 fr != size_t(-1) && rightbutton_.length() > 0 && children.size() > 1) {
714 if(fr != 1) {
715 std::swap(children[1], children[fr]);
716 }
717 }
718 if(auto fr = find_in_children(slider_, children, context.full_state);
719 fr != size_t(-1) && slider_.length() > 0 && children.size() > 2) {
720 if(fr != 2) {
721 std::swap(children[2], children[fr]);
722 }
723 }
724 if(auto fr = find_in_children(track_, children, context.full_state);
725 fr != size_t(-1) && track_.length() > 0 && children.size() > 3) {
726 if(fr != 3) {
727 std::swap(children[3], children[fr]);
728 }
729 }
731 fr != size_t(-1) && rangelimitmaxicon_.length() > 0 && children.size() > 4) {
732 if(fr != 4) {
733 std::swap(children[4], children[fr]);
734 }
735 }
737 fr != size_t(-1) && rangelimitminicon_.length() > 0 && children.size() > 5) {
738 if(fr != 5) {
739 std::swap(children[5], children[fr]);
740 }
741 }
742 auto first_child = context.full_state.ui_defs.gui.size();
743 for(auto& ch : children) {
744 context.full_state.ui_defs.gui.push_back(ch);
745 }
747 target.data.scrollbar.first_child = dcon::gui_def_id(dcon::gui_def_id::value_base_t(first_child));
748}
749
753}
754void window::fullscreen(association_type, bool v, error_handler& err, int32_t line, building_gfx_context& context) {
755 if(v)
757}
758void window::moveable(association_type, bool v, error_handler& err, int32_t line, building_gfx_context& context) {
759 if(v)
761}
762
763void window::guibuttontype(button const& v, error_handler& err, int32_t line, building_gfx_context& context) {
764 children.push_back(v.target);
765}
766void window::icontype(image const& v, error_handler& err, int32_t line, building_gfx_context& context) {
767 children.push_back(v.target);
768}
769void window::eu3dialogtype(window const& v, error_handler& err, int32_t line, building_gfx_context& context) {
770 children.push_back(v.target);
771 children.back().data.window.flags |= ui::window_data::is_dialog_mask;
772}
773void window::instanttextboxtype(textbox const& v, error_handler& err, int32_t line, building_gfx_context& context) {
774 children.push_back(v.target);
775 children.back().data.text.flags |= ui::text_data::is_instant_mask;
776}
777void window::listboxtype(listbox const& v, error_handler& err, int32_t line, building_gfx_context& context) {
778 children.push_back(v.target);
779}
780void window::positiontype(gui_element_common const& v, error_handler& err, int32_t line, building_gfx_context& context) {
781 children.push_back(v.target);
782}
783void window::scrollbartype(scrollbar const& v, error_handler& err, int32_t line, building_gfx_context& context) {
784 children.push_back(v.target);
785}
786void window::windowtype(window const& v, error_handler& err, int32_t line, building_gfx_context& context) {
787 children.push_back(v.target);
788}
789void window::checkboxtype(button const& v, error_handler& err, int32_t line, building_gfx_context& context) {
790 children.push_back(v.target);
791 children.back().data.button.flags |= ui::button_data::is_checkbox_mask;
792}
793void window::shieldtype(image const& v, error_handler& err, int32_t line, building_gfx_context& context) {
794 children.push_back(v.target);
795 children.back().data.image.flags |= ui::image_data::is_mask_mask;
796}
798 children.push_back(v.target);
799}
800void window::editboxtype(textbox const& v, error_handler& err, int32_t line, building_gfx_context& context) {
801 children.push_back(v.target);
802 children.back().data.text.flags |= ui::text_data::is_edit_mask;
803}
804void window::textboxtype(textbox const& v, error_handler& err, int32_t line, building_gfx_context& context) {
805 children.push_back(v.target);
806}
808 children.push_back(v.target);
809 sc.push_back(window::scripted_children{ uint32_t(children.size() - 1), v.added_allow, v.added_effect, -1, -1 });
810}
812 children.push_back(v.target);
813 sc.push_back(window::scripted_children{ uint32_t(children.size() - 1), -1, -1, v.added_allow, v.added_effect});
814}
816 auto first_child = context.full_state.ui_defs.gui.size();
817 for(auto& ch : children) {
818 context.full_state.ui_defs.gui.push_back(ch);
819 }
820 for(auto& s : sc) {
821 auto child_id = dcon::gui_def_id(dcon::gui_def_id::value_base_t(first_child + s.child_number));
822 if(s.pallow != -1) {
823 context.province_buttons_allow[s.pallow].button_element = child_id;
824 }
825 if(s.peffect != -1) {
826 context.province_buttons_effect[s.peffect].button_element = child_id;
827 }
828 if(s.nallow != -1) {
829 context.nation_buttons_allow[s.nallow].button_element = child_id;
830 }
831 if(s.neffect != -1) {
832 context.nation_buttons_effect[s.neffect].button_element = child_id;
833 }
834 }
836 target.data.window.first_child = dcon::gui_def_id(dcon::gui_def_id::value_base_t(first_child));
837}
838
839void guitypes::guibuttontype(button const& v, error_handler& err, int32_t line, building_gfx_context& context) {
840 context.full_state.ui_defs.gui.push_back(v.target);
841 context.full_state.ui_defs.gui.back().ex_flags |= ui::element_data::ex_is_top_level;
842 if(v.extension) {
843 context.ui_defs.extensions.push_back(ui::window_extension{ v.extension, dcon::gui_def_id(dcon::gui_def_id::value_base_t(context.full_state.ui_defs.gui.size() - 1)) });
844 }
845}
846void guitypes::icontype(image const& v, error_handler& err, int32_t line, building_gfx_context& context) {
847 context.full_state.ui_defs.gui.push_back(v.target);
848 context.full_state.ui_defs.gui.back().ex_flags |= ui::element_data::ex_is_top_level;
849 if(v.extension) {
850 context.ui_defs.extensions.push_back(ui::window_extension{ v.extension, dcon::gui_def_id(dcon::gui_def_id::value_base_t(context.full_state.ui_defs.gui.size() - 1)) });
851 }
852}
853void guitypes::eu3dialogtype(window const& v, error_handler& err, int32_t line, building_gfx_context& context) {
854 context.full_state.ui_defs.gui.push_back(v.target);
855 context.full_state.ui_defs.gui.back().data.window.flags |= ui::window_data::is_dialog_mask;
856 context.full_state.ui_defs.gui.back().ex_flags |= ui::element_data::ex_is_top_level;
857 if(v.extension) {
858 context.ui_defs.extensions.push_back(ui::window_extension{ v.extension, dcon::gui_def_id(dcon::gui_def_id::value_base_t(context.full_state.ui_defs.gui.size() - 1)) });
859 }
860}
861void guitypes::instanttextboxtype(textbox const& v, error_handler& err, int32_t line, building_gfx_context& context) {
862 context.full_state.ui_defs.gui.push_back(v.target);
863 context.full_state.ui_defs.gui.back().data.text.flags |= ui::text_data::is_instant_mask;
864 context.full_state.ui_defs.gui.back().ex_flags |= ui::element_data::ex_is_top_level;
865 if(v.extension) {
866 context.ui_defs.extensions.push_back(ui::window_extension{ v.extension, dcon::gui_def_id(dcon::gui_def_id::value_base_t(context.full_state.ui_defs.gui.size() - 1)) });
867 }
868}
869void guitypes::listboxtype(listbox const& v, error_handler& err, int32_t line, building_gfx_context& context) {
870 context.full_state.ui_defs.gui.push_back(v.target);
871 context.full_state.ui_defs.gui.back().ex_flags |= ui::element_data::ex_is_top_level;
872 if(v.extension) {
873 context.ui_defs.extensions.push_back(ui::window_extension{ v.extension, dcon::gui_def_id(dcon::gui_def_id::value_base_t(context.full_state.ui_defs.gui.size() - 1)) });
874 }
875}
877 context.full_state.ui_defs.gui.push_back(v.target);
878 context.full_state.ui_defs.gui.back().ex_flags |= ui::element_data::ex_is_top_level;
879}
880void guitypes::scrollbartype(scrollbar const& v, error_handler& err, int32_t line, building_gfx_context& context) {
881 context.full_state.ui_defs.gui.push_back(v.target);
882 context.full_state.ui_defs.gui.back().ex_flags |= ui::element_data::ex_is_top_level;
883 if(v.extension) {
884 context.ui_defs.extensions.push_back(ui::window_extension{ v.extension, dcon::gui_def_id(dcon::gui_def_id::value_base_t(context.full_state.ui_defs.gui.size() - 1)) });
885 }
886}
887void guitypes::windowtype(window const& v, error_handler& err, int32_t line, building_gfx_context& context) {
888 context.full_state.ui_defs.gui.push_back(v.target);
889 context.full_state.ui_defs.gui.back().ex_flags |= ui::element_data::ex_is_top_level;
890 if(v.extension) {
891 context.ui_defs.extensions.push_back(ui::window_extension{ v.extension, dcon::gui_def_id(dcon::gui_def_id::value_base_t(context.full_state.ui_defs.gui.size() - 1)) });
892 }
893}
894void guitypes::checkboxtype(button const& v, error_handler& err, int32_t line, building_gfx_context& context) {
895 context.full_state.ui_defs.gui.push_back(v.target);
896 context.full_state.ui_defs.gui.back().data.button.flags |= ui::button_data::is_checkbox_mask;
897 context.full_state.ui_defs.gui.back().ex_flags |= ui::element_data::ex_is_top_level;
898 if(v.extension) {
899 context.ui_defs.extensions.push_back(ui::window_extension{ v.extension, dcon::gui_def_id(dcon::gui_def_id::value_base_t(context.full_state.ui_defs.gui.size() - 1)) });
900 }
901}
902void guitypes::shieldtype(image const& v, error_handler& err, int32_t line, building_gfx_context& context) {
903 context.full_state.ui_defs.gui.push_back(v.target);
904 context.full_state.ui_defs.gui.back().data.image.flags |= ui::image_data::is_mask_mask;
905 context.full_state.ui_defs.gui.back().ex_flags |= ui::element_data::ex_is_top_level;
906 if(v.extension) {
907 context.ui_defs.extensions.push_back(ui::window_extension{ v.extension, dcon::gui_def_id(dcon::gui_def_id::value_base_t(context.full_state.ui_defs.gui.size() - 1)) });
908 }
909}
911 context.full_state.ui_defs.gui.push_back(v.target);
912 context.full_state.ui_defs.gui.back().ex_flags |= ui::element_data::ex_is_top_level;
913 if(v.extension) {
914 context.ui_defs.extensions.push_back(ui::window_extension{ v.extension, dcon::gui_def_id(dcon::gui_def_id::value_base_t(context.full_state.ui_defs.gui.size() - 1)) });
915 }
916}
917void guitypes::editboxtype(textbox const& v, error_handler& err, int32_t line, building_gfx_context& context) {
918 context.full_state.ui_defs.gui.push_back(v.target);
919 context.full_state.ui_defs.gui.back().data.text.flags |= ui::text_data::is_edit_mask;
920 context.full_state.ui_defs.gui.back().ex_flags |= ui::element_data::ex_is_top_level;
921 if(v.extension) {
922 context.ui_defs.extensions.push_back(ui::window_extension{ v.extension, dcon::gui_def_id(dcon::gui_def_id::value_base_t(context.full_state.ui_defs.gui.size() - 1)) });
923 }
924}
925void guitypes::textboxtype(textbox const& v, error_handler& err, int32_t line, building_gfx_context& context) {
926 context.full_state.ui_defs.gui.push_back(v.target);
927 context.full_state.ui_defs.gui.back().ex_flags |= ui::element_data::ex_is_top_level;
928 if(v.extension) {
929 context.ui_defs.extensions.push_back(ui::window_extension{ v.extension, dcon::gui_def_id(dcon::gui_def_id::value_base_t(context.full_state.ui_defs.gui.size() - 1)) });
930 }
931}
932
934 context.full_state.ui_defs.gui.push_back(v.target);
935 context.full_state.ui_defs.gui.back().ex_flags |= ui::element_data::ex_is_top_level;
936 if(v.added_allow != -1) {
937 context.province_buttons_allow[v.added_allow].button_element = dcon::gui_def_id(dcon::gui_def_id::value_base_t(context.full_state.ui_defs.gui.size() - 1));
938 }
939 if(v.added_effect != -1) {
940 context.province_buttons_effect[v.added_effect].button_element = dcon::gui_def_id(dcon::gui_def_id::value_base_t(context.full_state.ui_defs.gui.size() - 1));
941 }
942 if(v.extension) {
943 context.ui_defs.extensions.push_back(ui::window_extension{ v.extension, dcon::gui_def_id(dcon::gui_def_id::value_base_t(context.full_state.ui_defs.gui.size() - 1)) });
944 }
945}
947 context.full_state.ui_defs.gui.push_back(v.target);
948 context.full_state.ui_defs.gui.back().ex_flags |= ui::element_data::ex_is_top_level;
949 if(v.added_allow != -1) {
950 context.nation_buttons_allow[v.added_allow].button_element = dcon::gui_def_id(dcon::gui_def_id::value_base_t(context.full_state.ui_defs.gui.size() - 1));
951 }
952 if(v.added_effect != -1) {
953 context.nation_buttons_effect[v.added_effect].button_element = dcon::gui_def_id(dcon::gui_def_id::value_base_t(context.full_state.ui_defs.gui.size() - 1));
954 }
955 if(v.extension) {
956 context.ui_defs.extensions.push_back(ui::window_extension{ v.extension, dcon::gui_def_id(dcon::gui_def_id::value_base_t(context.full_state.ui_defs.gui.size() - 1)) });
957 }
958}
959
960} // namespace parsers
std::string accumulated_errors
Definition: parsers.hpp:62
std::string file_name
Definition: parsers.hpp:61
tag_type emplace_back(T &&... ts)
auto size() const
tagged_vector< element_data, dcon::gui_def_id > gui
std::vector< window_extension > extensions
tagged_vector< gfx_object, dcon::gfx_object_id > gfx
tagged_vector< dcon::text_key, dcon::texture_id > textures
bool province_button_allow(token_generator &gen, error_handler &err, building_gfx_context &context)
std::string lowercase_str(std::string_view sv)
association_type
Definition: parsers.hpp:28
void assign(ui::xy_pair &a, parsers::gfx_xy_pair const &b)
bool province_button_effect(token_generator &gen, error_handler &err, building_gfx_context &context)
auto find_in_children(std::string_view name, std::vector< ui::element_data > const &v, sys::state const &state)
bool is_fixed_token(char const *start, char const *end, char const (&t)[N])
Definition: parsers.hpp:264
bool is_fixed_token_ci(char const *start, char const *end, char const (&t)[N])
Definition: parsers.hpp:275
bool nation_button_allow(token_generator &gen, error_handler &err, building_gfx_context &context)
obj_and_horizontal common_create_object(gfx_object const &obj_in, building_gfx_context &context)
float parse_float(std::string_view content, int32_t line, error_handler &err)
Definition: parsers.cpp:208
void gfx_add_obj(parsers::token_generator &gen, parsers::error_handler &err, building_gfx_context &context)
bool nation_button_effect(token_generator &gen, error_handler &err, building_gfx_context &context)
std::string remove_double_backslashes(std::string_view data_in)
virtual_key
Definition: constants.hpp:5
uint16_t name_into_font_id(sys::state &state, std::string_view txt)
Definition: fonts.cpp:93
uint uint32_t
uchar uint8_t
std::vector< pending_button_script > province_buttons_allow
std::vector< pending_button_script > nation_buttons_allow
std::vector< pending_button_script > nation_buttons_effect
std::vector< pending_button_script > province_buttons_effect
ankerl::unordered_dense::map< std::string, dcon::gfx_object_id > map_of_names
ankerl::unordered_dense::map< std::string, dcon::texture_id > map_of_texture_names
void spritetype(association_type, std::string_view txt, error_handler &err, int32_t line, building_gfx_context &context)
void buttontext(association_type, std::string_view txt, error_handler &err, int32_t line, building_gfx_context &context)
void clicksound(association_type, std::string_view txt, error_handler &err, int32_t line, building_gfx_context &context)
void format(association_type, std::string_view txt, error_handler &err, int32_t line, building_gfx_context &context)
void shortcut(association_type, std::string_view txt, error_handler &err, int32_t line, building_gfx_context &context)
void buttonfont(association_type, std::string_view txt, error_handler &err, int32_t line, building_gfx_context &context)
void textspritetype(gfx_object const &obj, parsers::error_handler &err, int32_t line, building_gfx_context &context)
void linecharttype(gfx_object const &obj, parsers::error_handler &err, int32_t line, building_gfx_context &context)
void progressbartype(gfx_object const &obj, parsers::error_handler &err, int32_t line, building_gfx_context &context)
void piecharttype(gfx_object const &obj, parsers::error_handler &err, int32_t line, building_gfx_context &context)
void corneredtilespritetype(gfx_object const &obj, parsers::error_handler &err, int32_t line, building_gfx_context &context)
void maskedshieldtype(gfx_object const &obj, parsers::error_handler &err, int32_t line, building_gfx_context &context)
void barcharttype(gfx_object const &obj, parsers::error_handler &err, int32_t line, building_gfx_context &context)
void spritetype(gfx_object const &obj, parsers::error_handler &err, int32_t line, building_gfx_context &context)
void tilespritetype(gfx_object const &obj, parsers::error_handler &err, int32_t line, building_gfx_context &context)
std::optional< gfx_xy_pair > size_obj
std::string_view secondary_texture
std::optional< int32_t > size
std::string_view primary_texture
std::optional< gfx_xy_pair > bordersize
void extends(association_type, std::string_view txt, error_handler &err, int32_t line, building_gfx_context &context)
void rotation(association_type, std::string_view txt, error_handler &err, int32_t line, building_gfx_context &context)
void maxsize(gfx_xy_pair const &pr, error_handler &err, int32_t line, building_gfx_context &context)
void orientation(association_type, std::string_view txt, error_handler &err, int32_t line, building_gfx_context &context)
void table_layout(gfx_xy_pair const &pr, error_handler &err, int32_t line, building_gfx_context &context)
void position(gfx_xy_pair const &pr, error_handler &err, int32_t line, building_gfx_context &context)
void add_position(gfx_xy_pair const &pr, error_handler &err, int32_t line, building_gfx_context &context)
void maxwidth(association_type, int32_t v, error_handler &err, int32_t line, building_gfx_context &context)
void name(association_type, std::string_view txt, error_handler &err, int32_t line, building_gfx_context &context)
void maxheight(association_type, int32_t v, error_handler &err, int32_t line, building_gfx_context &context)
void size(gfx_xy_pair const &pr, error_handler &err, int32_t line, building_gfx_context &context)
void add_size(gfx_xy_pair const &pr, error_handler &err, int32_t line, building_gfx_context &context)
void positiontype(gui_element_common const &v, error_handler &err, int32_t line, building_gfx_context &context)
void editboxtype(textbox const &v, error_handler &err, int32_t line, building_gfx_context &context)
void windowtype(window const &v, error_handler &err, int32_t line, building_gfx_context &context)
void checkboxtype(button const &v, error_handler &err, int32_t line, building_gfx_context &context)
void textboxtype(textbox const &v, error_handler &err, int32_t line, building_gfx_context &context)
void listboxtype(listbox const &v, error_handler &err, int32_t line, building_gfx_context &context)
void overlappingelementsboxtype(overlapping const &v, error_handler &err, int32_t line, building_gfx_context &context)
void shieldtype(image const &v, error_handler &err, int32_t line, building_gfx_context &context)
void provincescriptbuttontype(province_script_button const &v, error_handler &err, int32_t line, building_gfx_context &context)
void scrollbartype(scrollbar const &v, error_handler &err, int32_t line, building_gfx_context &context)
void eu3dialogtype(window const &v, error_handler &err, int32_t line, building_gfx_context &context)
void icontype(image const &v, error_handler &err, int32_t line, building_gfx_context &context)
void instanttextboxtype(textbox const &v, error_handler &err, int32_t line, building_gfx_context &context)
void guibuttontype(button const &v, error_handler &err, int32_t line, building_gfx_context &context)
void nationscriptbuttontype(nation_script_button const &v, error_handler &err, int32_t line, building_gfx_context &context)
void frame(association_type, uint32_t v, error_handler &err, int32_t line, building_gfx_context &context)
void spritetype(association_type, std::string_view txt, error_handler &err, int32_t line, building_gfx_context &context)
void scale(association_type, float v, error_handler &err, int32_t line, building_gfx_context &context)
void offset(gfx_xy_pair const &pr, error_handler &err, int32_t line, building_gfx_context &context)
void bordersize(gfx_xy_pair const &pr, error_handler &err, int32_t line, building_gfx_context &context)
void background(association_type, std::string_view txt, error_handler &err, int32_t line, building_gfx_context &context)
void spacing(association_type, uint32_t v, error_handler &err, int32_t line, building_gfx_context &context)
void effect(bool, error_handler &err, int32_t line, building_gfx_context &context)
void allow(bool, error_handler &err, int32_t line, building_gfx_context &context)
void spacing(association_type, float v, error_handler &err, int32_t line, building_gfx_context &context)
void format(association_type, std::string_view txt, error_handler &err, int32_t line, building_gfx_context &context)
void effect(bool, error_handler &err, int32_t line, building_gfx_context &context)
void allow(bool, error_handler &err, int32_t line, building_gfx_context &context)
void guibuttontype(button const &v, error_handler &err, int32_t line, building_gfx_context &context)
void finish(building_gfx_context &context)
void rightbutton(association_type, std::string_view txt, error_handler &err, int32_t line, building_gfx_context &context)
void rangelimitminicon(association_type, std::string_view txt, error_handler &err, int32_t line, building_gfx_context &context)
void lockable(association_type, bool v, error_handler &err, int32_t line, building_gfx_context &context)
void maxvalue(association_type, uint32_t v, error_handler &err, int32_t line, building_gfx_context &context)
void bordersize(gfx_xy_pair const &pr, error_handler &err, int32_t line, building_gfx_context &context)
std::string_view rightbutton_
void track(association_type, std::string_view txt, error_handler &err, int32_t line, building_gfx_context &context)
void stepsize(association_type, std::string_view txt, error_handler &err, int32_t line, building_gfx_context &context)
void icontype(image const &v, error_handler &err, int32_t line, building_gfx_context &context)
void horizontal(association_type, bool v, error_handler &err, int32_t line, building_gfx_context &context)
std::string_view rangelimitminicon_
std::vector< ui::element_data > children
std::string_view rangelimitmaxicon_
void leftbutton(association_type, std::string_view txt, error_handler &err, int32_t line, building_gfx_context &context)
void slider(association_type, std::string_view txt, error_handler &err, int32_t line, building_gfx_context &context)
void rangelimitmaxicon(association_type, std::string_view txt, error_handler &err, int32_t line, building_gfx_context &context)
std::string_view leftbutton_
void userangelimit(association_type, bool v, error_handler &err, int32_t line, building_gfx_context &context)
void fixedsize(association_type, bool v, error_handler &err, int32_t line, building_gfx_context &context)
void format(association_type, std::string_view txt, error_handler &err, int32_t line, building_gfx_context &context)
void text(association_type, std::string_view txt, error_handler &err, int32_t line, building_gfx_context &context)
void font(association_type, std::string_view txt, error_handler &err, int32_t line, building_gfx_context &context)
void bordersize(gfx_xy_pair const &pr, error_handler &err, int32_t line, building_gfx_context &context)
void texturefile(association_type, std::string_view txt, error_handler &err, int32_t line, building_gfx_context &context)
void positiontype(gui_element_common const &v, error_handler &err, int32_t line, building_gfx_context &context)
void windowtype(window const &v, error_handler &err, int32_t line, building_gfx_context &context)
std::vector< ui::element_data > children
void provincescriptbuttontype(province_script_button const &v, error_handler &err, int32_t line, building_gfx_context &context)
void icontype(image const &v, error_handler &err, int32_t line, building_gfx_context &context)
void guibuttontype(button const &v, error_handler &err, int32_t line, building_gfx_context &context)
void fullscreen(association_type, bool v, error_handler &err, int32_t line, building_gfx_context &context)
void eu3dialogtype(window const &v, error_handler &err, int32_t line, building_gfx_context &context)
void instanttextboxtype(textbox const &v, error_handler &err, int32_t line, building_gfx_context &context)
void nationscriptbuttontype(nation_script_button const &v, error_handler &err, int32_t line, building_gfx_context &context)
void scrollbartype(scrollbar const &v, error_handler &err, int32_t line, building_gfx_context &context)
void finish(building_gfx_context &context)
void textboxtype(textbox const &v, error_handler &err, int32_t line, building_gfx_context &context)
void editboxtype(textbox const &v, error_handler &err, int32_t line, building_gfx_context &context)
void overlappingelementsboxtype(overlapping const &v, error_handler &err, int32_t line, building_gfx_context &context)
std::vector< scripted_children > sc
void shieldtype(image const &v, error_handler &err, int32_t line, building_gfx_context &context)
void moveable(association_type, bool v, error_handler &err, int32_t line, building_gfx_context &context)
void listboxtype(listbox const &v, error_handler &err, int32_t line, building_gfx_context &context)
void checkboxtype(button const &v, error_handler &err, int32_t line, building_gfx_context &context)
dcon::text_key add_key_win1252(std::string const &text)
ui::definitions ui_defs
dcon::gfx_object_id button_image
static constexpr uint16_t is_checkbox_mask
sys::virtual_key shortcut
static constexpr uint8_t ex_is_top_level
dcon::text_key name
union ui::element_data::internal_data data
dcon::texture_id primary_texture_handle
static constexpr uint8_t has_click_sound
static constexpr uint8_t always_transparent
static constexpr uint8_t flip_v
uint16_t type_dependent
static constexpr uint8_t do_transparency_check
uint8_t number_of_frames
dcon::gfx_object_id gfx_object
static constexpr uint8_t is_mask_mask
dcon::gfx_object_id background_image
static constexpr uint8_t is_range_limited_mask
dcon::gui_def_id first_child
static constexpr uint8_t is_horizontal_mask
static constexpr uint8_t is_lockable_mask
dcon::text_key txt
static constexpr uint8_t is_edit_mask
static constexpr uint8_t is_fixed_size_mask
static constexpr uint8_t is_instant_mask
xy_pair border_size
dcon::gui_def_id first_child
static constexpr uint8_t is_fullscreen_mask
static constexpr uint8_t is_moveable_mask
static constexpr uint8_t is_dialog_mask