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 new_obj.name = context.full_state.add_key_win1252(obj_in.name);
26 context.map_of_names.insert_or_assign(std::string(obj_in.name), dcon::gfx_object_id(uint16_t(gfxindex)));
27
28 if(obj_in.allwaystransparent) {
30 }
31 if(obj_in.clicksound_set) {
33 }
34 if(obj_in.flipv) {
36 }
37 if(obj_in.transparencecheck) {
39 }
40
41 new_obj.number_of_frames = uint8_t(obj_in.noofframes);
42
43 if(obj_in.primary_texture.length() > 0) {
45 if(auto it = context.map_of_texture_names.find(std::string(stripped)); it != context.map_of_texture_names.end()) {
46 new_obj.primary_texture_handle = it->second;
47 } else {
48 auto index = context.ui_defs.textures.size();
49 context.ui_defs.textures.emplace_back(context.full_state.add_key_win1252(stripped));
50 new_obj.primary_texture_handle = dcon::texture_id(dcon::texture_id::value_base_t(index));
51 context.map_of_texture_names.insert_or_assign(stripped, new_obj.primary_texture_handle);
52 }
53 }
54 if(obj_in.secondary_texture.length() > 0) {
56 if(auto it = context.map_of_texture_names.find(stripped); it != context.map_of_texture_names.end()) {
57 new_obj.type_dependent = uint16_t(it->second.index() + 1);
58 } else {
59 auto index = context.ui_defs.textures.size();
60 context.ui_defs.textures.emplace_back(context.full_state.add_key_win1252(stripped));
61 new_obj.type_dependent = uint16_t(index + 1);
62 context.map_of_texture_names.insert_or_assign(stripped, dcon::texture_id(dcon::texture_id::value_base_t(index)));
63 }
64 }
65
66 if(obj_in.size) {
67 new_obj.size.x = int16_t(*obj_in.size);
68 new_obj.size.y = int16_t(*obj_in.size);
69 }
70 if(obj_in.size_obj) {
71 new_obj.size.x = int16_t(obj_in.size_obj->x);
72 new_obj.size.y = int16_t(obj_in.size_obj->y);
73 }
74 if(obj_in.bordersize) {
75 new_obj.type_dependent = uint16_t(obj_in.bordersize->x);
76 }
77
78 return obj_and_horizontal{&new_obj, obj_in.horizontal};
79}
80
82 building_gfx_context& context) {
83 auto res = common_create_object(obj, context);
85}
87 building_gfx_context& context) {
88 auto res = common_create_object(obj, context);
89 res.obj->flags |= uint8_t(ui::object_type::bordered_rect);
90}
92 building_gfx_context& context) {
93 auto res = common_create_object(obj, context);
94 res.obj->flags |= uint8_t(ui::object_type::flag_mask);
95}
97 building_gfx_context& context) {
98 auto res = common_create_object(obj, context);
99 res.obj->flags |= uint8_t(ui::object_type::text_sprite);
100}
102 building_gfx_context& context) {
103 auto res = common_create_object(obj, context);
104 res.obj->flags |= uint8_t(ui::object_type::tile_sprite);
105}
107 building_gfx_context& context) {
108 auto res = common_create_object(obj, context);
109 if(res.horizontal)
111 else
113}
115 building_gfx_context& context) {
116 auto res = common_create_object(obj, context);
117 res.obj->flags |= uint8_t(ui::object_type::barchart);
118}
120 building_gfx_context& context) {
121 auto res = common_create_object(obj, context);
122 res.obj->flags |= uint8_t(ui::object_type::piechart);
123}
125 building_gfx_context& context) {
126 auto res = common_create_object(obj, context);
127 res.obj->flags |= uint8_t(ui::object_type::linegraph);
128}
129
131 parsers::parse_gfx_object_outer(gen, err, context);
132}
133
135 a.x = int16_t(b.x);
136 a.y = int16_t(b.y);
137}
138
139void gui_element_common::size(gfx_xy_pair const& pr, error_handler& err, int32_t line, building_gfx_context& context) {
140 assign(target.size, pr);
141}
142void gui_element_common::position(gfx_xy_pair const& pr, error_handler& err, int32_t line, building_gfx_context& context) {
144}
145
146void gui_element_common::orientation(association_type, std::string_view txt, error_handler& err, int32_t line,
147 building_gfx_context& context) {
148 if(is_fixed_token_ci(txt.data(), txt.data() + txt.length(), "center") ||
149 is_fixed_token_ci(txt.data(), txt.data() + txt.length(), "centre")) {
151 } else if(is_fixed_token_ci(txt.data(), txt.data() + txt.length(), "lower_left")) {
153 } else if(is_fixed_token_ci(txt.data(), txt.data() + txt.length(), "lower_right")) {
155 } else if(is_fixed_token_ci(txt.data(), txt.data() + txt.length(), "upper_left") ||
156 is_fixed_token_ci(txt.data(), txt.data() + txt.length(), "upperl_left")) {
158 } else if(is_fixed_token_ci(txt.data(), txt.data() + txt.length(), "upper_right")) {
160 } else if(is_fixed_token_ci(txt.data(), txt.data() + txt.length(), "center_up")) {
162 } else if(is_fixed_token_ci(txt.data(), txt.data() + txt.length(), "center_down")) {
164 } else {
165 err.accumulated_errors += "tried to parse " + std::string(txt) + " as an orientation on line " + std::to_string(line) +
166 " of file " + err.file_name + "\n";
167 }
168}
169void gui_element_common::name(association_type, std::string_view txt, error_handler& err, int32_t line,
170 building_gfx_context& context) {
171 target.name = context.full_state.add_key_win1252(txt);
172}
173void gui_element_common::extends(association_type, std::string_view txt, error_handler& err, int32_t line, building_gfx_context& context) {
174 extension = context.full_state.add_key_win1252(txt);
175}
176void gui_element_common::rotation(association_type, std::string_view txt, error_handler& err, int32_t line,
177 building_gfx_context& context) {
178 if(is_fixed_token_ci(txt.data(), txt.data() + txt.length(), "-1.5708")
179 || is_fixed_token_ci(txt.data(), txt.data() + txt.length(), "-1.570796")) {
181 } else if(is_fixed_token_ci(txt.data(), txt.data() + txt.length(), "1.5708")
182 || is_fixed_token_ci(txt.data(), txt.data() + txt.length(), "1.570796")) {
184 } else if(parse_float(txt, line, err) == 0.0f) {
186 } else {
187 err.accumulated_errors += "tried to parse " + std::string(txt) + " as a rotation on line " + std::to_string(line) +
188 " of file " + err.file_name + "\n";
189 }
190}
192 target.size.x = int16_t(v);
193}
195 target.size.y = int16_t(v);
196}
197void gui_element_common::maxsize(gfx_xy_pair const& pr, error_handler& err, int32_t line, building_gfx_context& context) {
198 target.size.x = int16_t(pr.x);
199 target.size.y = int16_t(pr.y);
200}
201void gui_element_common::add_size(gfx_xy_pair const& pr, error_handler& err, int32_t line, building_gfx_context& context) {
202 target.size.x += int16_t(pr.x);
203 target.size.y += int16_t(pr.y);
204}
206 target.position.x += int16_t(pr.x);
207 target.position.y += int16_t(pr.y);
208}
210 target.position.x += int16_t(target.size.x) * int16_t(pr.x);
211 target.position.y += int16_t(target.size.y) * int16_t(pr.y);
212}
213
217}
218void button::spritetype(association_type, std::string_view txt, error_handler& err, int32_t line, building_gfx_context& context) {
219 if(txt.length() == 0)
220 return;
221 auto it = context.map_of_names.find(std::string(txt));
222 if(it != context.map_of_names.end()) {
223 target.data.button.button_image = it->second;
224 } else {
225 err.accumulated_errors += "referenced unknown gfx object " + std::string(txt) + " on line " + std::to_string(line) +
226 " of file " + err.file_name + "\n";
227 }
228}
229
230void button::shortcut(association_type, std::string_view t, error_handler& err, int32_t line, building_gfx_context& context) {
231 if(t.length() == size_t(0))
233 else if(t.length() == size_t(1)) {
234 if((t[0] >= 'a') && (t[0] <= 'z')) {
236 } else if((t[0] >= 'A') && (t[0] <= 'Z')) {
238 } else if((t[0] >= '0') && (t[0] <= '9')) {
240 } else if(t[0] == ':') {
242 } else if(t[0] == ';') {
244 } else if(t[0] == '+') {
246 } else if(t[0] == '=') {
248 } else if(t[0] == '<') {
250 } else if(t[0] == ',') {
252 } else if(t[0] == '-') {
254 } else if(t[0] == '_') {
256 } else if(t[0] == '.') {
258 } else if(t[0] == '>') {
260 } else if(t[0] == '?') {
262 } else if(t[0] == '/') {
264 } else if(t[0] == '~') {
266 } else if(t[0] == '`') {
268 } else if(t[0] == '{') {
270 } else if(t[0] == '[') {
272 } else if(t[0] == '|') {
274 } else if(t[0] == '\\') {
276 } else if(t[0] == '}') {
278 } else if(t[0] == ']') {
280 } else if(t[0] == '\'') {
282 } else if(t[0] == '\"') {
284 } else {
285 err.accumulated_errors += "tried to parse " + std::string(t) + " as a key name on line " + std::to_string(line) +
286 " of file " + err.file_name + "\n";
287 }
288 } else {
289 if(is_fixed_token_ci(t.data(), t.data() + t.length(), "none")) {
291 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "backspace")) {
293 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "back")) {
295 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "tab")) {
297 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "return")) {
299 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "enter")) {
301 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "esc")) {
303 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "escape")) {
305 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "space")) {
307 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "page_up")) {
309 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "page_down")) {
311 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "end")) {
313 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "home")) {
315 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "left")) {
317 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "up")) {
319 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "right")) {
321 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "down")) {
323 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "select")) {
325 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "insert")) {
327 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "delete")) {
329 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "del")) {
331 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "f1")) {
333 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "f2")) {
335 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "f3")) {
337 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "f4")) {
339 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "f5")) {
341 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "f6")) {
343 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "f7")) {
345 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "f8")) {
347 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "f9")) {
349 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "f10")) {
351 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "f11")) {
353 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "f12")) {
355 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "f13")) {
357 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "f14")) {
359 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "f15")) {
361 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "f16")) {
363 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "f17")) {
365 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "f18")) {
367 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "f19")) {
369 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "f20")) {
371 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "f21")) {
373 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "f22")) {
375 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "f23")) {
377 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "f24")) {
379 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "numpad0")) {
381 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "numpad1")) {
383 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "numpad2")) {
385 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "numpad3")) {
387 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "numpad4")) {
389 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "numpad5")) {
391 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "numpad6")) {
393 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "numpad7")) {
395 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "numpad8")) {
397 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "numpad9")) {
399 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "multiply")) {
401 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "add")) {
403 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "separator")) {
405 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "subtract")) {
407 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "decimal")) {
409 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "divide")) {
411 } else {
412 err.accumulated_errors += "tried to parse " + std::string(t) + " as a key name on line " + std::to_string(line) +
413 " of file " + err.file_name + "\n";
414 }
415 }
416}
417
418void button::buttontext(association_type, std::string_view txt, error_handler& err, int32_t line, building_gfx_context& context) {
420}
421
422void button::buttonfont(association_type, std::string_view txt, error_handler& err, int32_t line, building_gfx_context& context) {
424}
425
426void button::format(association_type, std::string_view t, error_handler& err, int32_t line, building_gfx_context& context) {
427 if(is_fixed_token_ci(t.data(), t.data() + t.length(), "centre") ||
428 is_fixed_token_ci(t.data(), t.data() + t.length(), "center")) {
430 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "left")) {
432 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "right")) {
434 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "justified")) {
436 } else {
437 err.accumulated_errors += "tried to parse " + std::string(t) + " as an alignment on line " + std::to_string(line) +
438 " of file " + err.file_name + "\n";
439 }
440}
441
442void button::clicksound(association_type, std::string_view t, error_handler& err, int32_t line, building_gfx_context& context) {
443 if(is_fixed_token(t.data(), t.data() + t.length(), "click")) {
445 } else if(is_fixed_token(t.data(), t.data() + t.length(), "close_window")) {
447 } else if(is_fixed_token(t.data(), t.data() + t.length(), "start_game")) {
449 } else {
450 err.accumulated_errors += "tried to parse " + std::string(t) + " as a click sound on line " + std::to_string(line) +
451 " of file " + err.file_name + "\n";
452 }
453}
454
455void nation_script_button::allow(bool, error_handler& err, int32_t line, building_gfx_context& context) {
456 if(added_allow != -1) {
457 err.accumulated_errors += "multiple allow conditions for a button defined on line " + std::to_string(line) + " of file " + err.file_name + "\n";
458 }
459 added_allow = int32_t(context.nation_buttons_allow.size()) - 1;
460}
461void nation_script_button::effect(bool, error_handler& err, int32_t line, building_gfx_context& context) {
462 if(added_effect != -1) {
463 err.accumulated_errors += "multiple effects for a button defined on line " + std::to_string(line) + " of file " + err.file_name + "\n";
464 }
465 added_effect = int32_t(context.nation_buttons_effect.size()) - 1;
466}
467void province_script_button::allow(bool, error_handler& err, int32_t line, building_gfx_context& context) {
468 if(added_allow != -1) {
469 err.accumulated_errors += "multiple allow conditions for a button defined on line " + std::to_string(line) + " of file " + err.file_name + "\n";
470 }
471 added_allow = int32_t(context.province_buttons_allow.size()) - 1;
472}
473void province_script_button::effect(bool, error_handler& err, int32_t line, building_gfx_context& context) {
474 if(added_effect != -1) {
475 err.accumulated_errors += "multiple effects for a button defined on line " + std::to_string(line) + " of file " + err.file_name + "\n";
476 }
477 added_effect = int32_t(context.province_buttons_effect.size()) - 1;
478}
479
480
482 context.province_buttons_allow.push_back(pending_button_script{ err.file_name, gen, dcon::gui_def_id{} });
483 gen.discard_group();
484 return true;
485}
487 context.province_buttons_effect.push_back(pending_button_script{ err.file_name, gen, dcon::gui_def_id{} });
488 gen.discard_group();
489 return true;
490}
492 context.nation_buttons_allow.push_back(pending_button_script{ err.file_name, gen, dcon::gui_def_id{} });
493 gen.discard_group();
494 return true;
495}
497 context.nation_buttons_effect.push_back(pending_button_script{ err.file_name, gen, dcon::gui_def_id{} });
498 gen.discard_group();
499 return true;
500}
501
505}
507 if(v <= 127) {
509 } else {
510 err.accumulated_errors +=
511 "asked for more than 127 frames on line " + std::to_string(line) + " of file " + err.file_name + "\n";
512 }
513}
514void image::spritetype(association_type, std::string_view txt, error_handler& err, int32_t line, building_gfx_context& context) {
515 if(txt.length() == 0)
516 return;
517 auto it = context.map_of_names.find(std::string(txt));
518 if(it != context.map_of_names.end()) {
519 target.data.image.gfx_object = it->second;
520 } else {
521 err.accumulated_errors += "referenced unknown gfx object " + std::string(txt) + " on line " + std::to_string(line) +
522 " of file " + err.file_name + "\n";
523 }
524}
525void image::scale(association_type, float v, error_handler& err, int32_t line, building_gfx_context& context) {
527}
528
532}
533
534void textbox::bordersize(gfx_xy_pair const& pr, error_handler& err, int32_t line, building_gfx_context& context) {
536}
537void textbox::fixedsize(association_type, bool v, error_handler& err, int32_t line, building_gfx_context& context) {
538 if(v) {
540 }
541}
542void textbox::font(association_type, std::string_view txt, error_handler& err, int32_t line, building_gfx_context& context) {
544}
545void textbox::format(association_type, std::string_view t, error_handler& err, int32_t line, building_gfx_context& context) {
546 if(is_fixed_token_ci(t.data(), t.data() + t.length(), "centre") ||
547 is_fixed_token_ci(t.data(), t.data() + t.length(), "center")) {
549 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "left")) {
551 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "right")) {
553 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "justified")) {
555 } else {
556 err.accumulated_errors += "tried to parse " + std::string(t) + " as an alignment on line " + std::to_string(line) +
557 " of file " + err.file_name + "\n";
558 }
559}
560void textbox::text(association_type, std::string_view txt, error_handler& err, int32_t line, building_gfx_context& context) {
562}
563void textbox::texturefile(association_type, std::string_view t, error_handler& err, int32_t line, building_gfx_context& context) {
564 if(t.length() == 0) {
566 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "gfx\\\\interface\\\\tiles_dialog.tga")) {
568 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "gfx\\\\interface\\\\transparency.tga")) {
570 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "gfx\\\\interface\\\\small_tiles_dialog.dds")) {
572 } else {
573 err.accumulated_errors += "tried to parse " + std::string(t) + " as a text box background on line " + std::to_string(line) +
574 " of file " + err.file_name + "\n";
575 }
576}
577
581}
582
583void listbox::background(association_type, std::string_view txt, error_handler& err, int32_t line,
584 building_gfx_context& context) {
585 if(txt.length() == 0)
586 return;
587 auto it = context.map_of_names.find(std::string(txt));
588 if(it != context.map_of_names.end()) {
590 } else {
591 err.accumulated_errors += "referenced unknown gfx object " + std::string(txt) + " on line " + std::to_string(line) +
592 " of file " + err.file_name + "\n";
593 }
594}
595void listbox::bordersize(gfx_xy_pair const& pr, error_handler& err, int32_t line, building_gfx_context& context) {
597}
598void listbox::offset(gfx_xy_pair const& pr, error_handler& err, int32_t line, building_gfx_context& context) {
600}
603}
604
608}
609void overlapping::format(association_type, std::string_view t, error_handler& err, int32_t line, building_gfx_context& context) {
610 if(is_fixed_token_ci(t.data(), t.data() + t.length(), "centre") ||
611 is_fixed_token_ci(t.data(), t.data() + t.length(), "center")) {
613 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "left")) {
615 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "right")) {
617 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "justified")) {
619 } else {
620 err.accumulated_errors += "tried to parse " + std::string(t) + " as an alignment on line " + std::to_string(line) +
621 " of file " + err.file_name + "\n";
622 }
623}
624void overlapping::spacing(association_type, float v, error_handler& err, int32_t line, building_gfx_context& context) {
626}
627
631}
633 if(v)
635}
636void scrollbar::leftbutton(association_type, std::string_view txt, error_handler& err, int32_t line,
637 building_gfx_context& context) {
638 leftbutton_ = txt;
639}
640void scrollbar::rightbutton(association_type, std::string_view txt, error_handler& err, int32_t line,
641 building_gfx_context& context) {
642 rightbutton_ = txt;
643}
644void scrollbar::rangelimitmaxicon(association_type, std::string_view txt, error_handler& err, int32_t line,
645 building_gfx_context& context) {
646 rangelimitmaxicon_ = txt;
647}
648void scrollbar::rangelimitminicon(association_type, std::string_view txt, error_handler& err, int32_t line,
649 building_gfx_context& context) {
650 rangelimitminicon_ = txt;
651}
652void scrollbar::slider(association_type, std::string_view txt, error_handler& err, int32_t line, building_gfx_context& context) {
653 slider_ = txt;
654}
655void scrollbar::track(association_type, std::string_view txt, error_handler& err, int32_t line, building_gfx_context& context) {
656 track_ = txt;
657}
658void scrollbar::lockable(association_type, bool v, error_handler& err, int32_t line, building_gfx_context& context) {
659 if(v)
661}
663 if(v)
665}
667 target.data.scrollbar.max_value = uint16_t(v);
668}
669void scrollbar::stepsize(association_type, std::string_view t, error_handler& err, int32_t line, building_gfx_context& context) {
670 if(is_fixed_token_ci(t.data(), t.data() + t.length(), "1")) {
672 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "2")) {
674 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "0.1")) {
676 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "0.01")) {
678 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "0.001")) {
680 // Non vanilla accomodation
681 } else if(is_fixed_token_ci(t.data(), t.data() + t.length(), "25")) {
683 } else {
684 err.accumulated_errors += "tried to parse " + std::string(t) + " as a step size on line " + std::to_string(line) +
685 " of file " + err.file_name + "\n";
686 }
687}
688void scrollbar::bordersize(gfx_xy_pair const& pr, error_handler& err, int32_t line, building_gfx_context& context) {
690}
691void scrollbar::guibuttontype(button const& v, error_handler& err, int32_t line, building_gfx_context& context) {
692 children.push_back(v.target);
693}
694void scrollbar::icontype(image const& v, error_handler& err, int32_t line, building_gfx_context& context) {
695 children.push_back(v.target);
696}
697auto find_in_children(std::string_view name, std::vector<ui::element_data> const& v, sys::state const& state) {
698 auto lname = lowercase_str(name);
699 for(size_t i = v.size(); i-- > 0;) {
700 if(lowercase_str(state.to_string_view(v[i].name)) == lname) {
701 return i;
702 }
703 }
704 return size_t(-1);
705}
707 if(auto fr = find_in_children(leftbutton_, children, context.full_state);
708 fr != size_t(-1) && leftbutton_.length() > 0 && children.size() > 0) {
709 if(fr != 0) {
710 std::swap(children[0], children[fr]);
711 }
712 }
713 if(auto fr = find_in_children(rightbutton_, children, context.full_state);
714 fr != size_t(-1) && rightbutton_.length() > 0 && children.size() > 1) {
715 if(fr != 1) {
716 std::swap(children[1], children[fr]);
717 }
718 }
719 if(auto fr = find_in_children(slider_, children, context.full_state);
720 fr != size_t(-1) && slider_.length() > 0 && children.size() > 2) {
721 if(fr != 2) {
722 std::swap(children[2], children[fr]);
723 }
724 }
725 if(auto fr = find_in_children(track_, children, context.full_state);
726 fr != size_t(-1) && track_.length() > 0 && children.size() > 3) {
727 if(fr != 3) {
728 std::swap(children[3], children[fr]);
729 }
730 }
732 fr != size_t(-1) && rangelimitmaxicon_.length() > 0 && children.size() > 4) {
733 if(fr != 4) {
734 std::swap(children[4], children[fr]);
735 }
736 }
738 fr != size_t(-1) && rangelimitminicon_.length() > 0 && children.size() > 5) {
739 if(fr != 5) {
740 std::swap(children[5], children[fr]);
741 }
742 }
743 auto first_child = context.full_state.ui_defs.gui.size();
744 for(auto& ch : children) {
745 context.full_state.ui_defs.gui.push_back(ch);
746 }
748 target.data.scrollbar.first_child = dcon::gui_def_id(dcon::gui_def_id::value_base_t(first_child));
749}
750
754}
755void window::fullscreen(association_type, bool v, error_handler& err, int32_t line, building_gfx_context& context) {
756 if(v)
758}
759void window::moveable(association_type, bool v, error_handler& err, int32_t line, building_gfx_context& context) {
760 if(v)
762}
763
764void window::guibuttontype(button const& v, error_handler& err, int32_t line, building_gfx_context& context) {
765 children.push_back(v.target);
766}
767void window::icontype(image const& v, error_handler& err, int32_t line, building_gfx_context& context) {
768 children.push_back(v.target);
769}
770void window::eu3dialogtype(window const& v, error_handler& err, int32_t line, building_gfx_context& context) {
771 children.push_back(v.target);
772 children.back().data.window.flags |= ui::window_data::is_dialog_mask;
773}
774void window::instanttextboxtype(textbox const& v, error_handler& err, int32_t line, building_gfx_context& context) {
775 children.push_back(v.target);
776 children.back().data.text.flags |= ui::text_data::is_instant_mask;
777}
778void window::listboxtype(listbox const& v, error_handler& err, int32_t line, building_gfx_context& context) {
779 children.push_back(v.target);
780}
781void window::positiontype(gui_element_common const& v, error_handler& err, int32_t line, building_gfx_context& context) {
782 children.push_back(v.target);
783}
784void window::scrollbartype(scrollbar const& v, error_handler& err, int32_t line, building_gfx_context& context) {
785 children.push_back(v.target);
786}
787void window::windowtype(window const& v, error_handler& err, int32_t line, building_gfx_context& context) {
788 children.push_back(v.target);
789}
790void window::checkboxtype(button const& v, error_handler& err, int32_t line, building_gfx_context& context) {
791 children.push_back(v.target);
792 children.back().data.button.flags |= ui::button_data::is_checkbox_mask;
793}
794void window::shieldtype(image const& v, error_handler& err, int32_t line, building_gfx_context& context) {
795 children.push_back(v.target);
796 children.back().data.image.flags |= ui::image_data::is_mask_mask;
797}
799 children.push_back(v.target);
800}
801void window::editboxtype(textbox const& v, error_handler& err, int32_t line, building_gfx_context& context) {
802 children.push_back(v.target);
803 children.back().data.text.flags |= ui::text_data::is_edit_mask;
804}
805void window::textboxtype(textbox const& v, error_handler& err, int32_t line, building_gfx_context& context) {
806 children.push_back(v.target);
807}
809 children.push_back(v.target);
810 sc.push_back(window::scripted_children{ uint32_t(children.size() - 1), v.added_allow, v.added_effect, -1, -1 });
811}
813 children.push_back(v.target);
814 sc.push_back(window::scripted_children{ uint32_t(children.size() - 1), -1, -1, v.added_allow, v.added_effect});
815}
817 auto first_child = context.full_state.ui_defs.gui.size();
818 for(auto& ch : children) {
819 context.full_state.ui_defs.gui.push_back(ch);
820 }
821 for(auto& s : sc) {
822 auto child_id = dcon::gui_def_id(dcon::gui_def_id::value_base_t(first_child + s.child_number));
823 if(s.pallow != -1) {
824 context.province_buttons_allow[s.pallow].button_element = child_id;
825 }
826 if(s.peffect != -1) {
827 context.province_buttons_effect[s.peffect].button_element = child_id;
828 }
829 if(s.nallow != -1) {
830 context.nation_buttons_allow[s.nallow].button_element = child_id;
831 }
832 if(s.neffect != -1) {
833 context.nation_buttons_effect[s.neffect].button_element = child_id;
834 }
835 }
837 target.data.window.first_child = dcon::gui_def_id(dcon::gui_def_id::value_base_t(first_child));
838}
839
840void guitypes::guibuttontype(button const& v, error_handler& err, int32_t line, building_gfx_context& context) {
841 context.full_state.ui_defs.gui.push_back(v.target);
842 context.full_state.ui_defs.gui.back().ex_flags |= ui::element_data::ex_is_top_level;
843 if(v.extension) {
844 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)) });
845 }
846}
847void guitypes::icontype(image const& v, error_handler& err, int32_t line, building_gfx_context& context) {
848 context.full_state.ui_defs.gui.push_back(v.target);
849 context.full_state.ui_defs.gui.back().ex_flags |= ui::element_data::ex_is_top_level;
850 if(v.extension) {
851 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)) });
852 }
853}
854void guitypes::eu3dialogtype(window const& v, error_handler& err, int32_t line, building_gfx_context& context) {
855 context.full_state.ui_defs.gui.push_back(v.target);
856 context.full_state.ui_defs.gui.back().data.window.flags |= ui::window_data::is_dialog_mask;
857 context.full_state.ui_defs.gui.back().ex_flags |= ui::element_data::ex_is_top_level;
858 if(v.extension) {
859 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)) });
860 }
861}
862void guitypes::instanttextboxtype(textbox const& v, error_handler& err, int32_t line, building_gfx_context& context) {
863 context.full_state.ui_defs.gui.push_back(v.target);
864 context.full_state.ui_defs.gui.back().data.text.flags |= ui::text_data::is_instant_mask;
865 context.full_state.ui_defs.gui.back().ex_flags |= ui::element_data::ex_is_top_level;
866 if(v.extension) {
867 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)) });
868 }
869}
870void guitypes::listboxtype(listbox const& v, error_handler& err, int32_t line, building_gfx_context& context) {
871 context.full_state.ui_defs.gui.push_back(v.target);
872 context.full_state.ui_defs.gui.back().ex_flags |= ui::element_data::ex_is_top_level;
873 if(v.extension) {
874 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)) });
875 }
876}
878 context.full_state.ui_defs.gui.push_back(v.target);
879 context.full_state.ui_defs.gui.back().ex_flags |= ui::element_data::ex_is_top_level;
880}
881void guitypes::scrollbartype(scrollbar const& v, error_handler& err, int32_t line, building_gfx_context& context) {
882 context.full_state.ui_defs.gui.push_back(v.target);
883 context.full_state.ui_defs.gui.back().ex_flags |= ui::element_data::ex_is_top_level;
884 if(v.extension) {
885 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)) });
886 }
887}
888void guitypes::windowtype(window const& v, error_handler& err, int32_t line, building_gfx_context& context) {
889 context.full_state.ui_defs.gui.push_back(v.target);
890 context.full_state.ui_defs.gui.back().ex_flags |= ui::element_data::ex_is_top_level;
891 if(v.extension) {
892 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)) });
893 }
894}
895void guitypes::checkboxtype(button const& v, error_handler& err, int32_t line, building_gfx_context& context) {
896 context.full_state.ui_defs.gui.push_back(v.target);
897 context.full_state.ui_defs.gui.back().data.button.flags |= ui::button_data::is_checkbox_mask;
898 context.full_state.ui_defs.gui.back().ex_flags |= ui::element_data::ex_is_top_level;
899 if(v.extension) {
900 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)) });
901 }
902}
903void guitypes::shieldtype(image const& v, error_handler& err, int32_t line, building_gfx_context& context) {
904 context.full_state.ui_defs.gui.push_back(v.target);
905 context.full_state.ui_defs.gui.back().data.image.flags |= ui::image_data::is_mask_mask;
906 context.full_state.ui_defs.gui.back().ex_flags |= ui::element_data::ex_is_top_level;
907 if(v.extension) {
908 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)) });
909 }
910}
912 context.full_state.ui_defs.gui.push_back(v.target);
913 context.full_state.ui_defs.gui.back().ex_flags |= ui::element_data::ex_is_top_level;
914 if(v.extension) {
915 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)) });
916 }
917}
918void guitypes::editboxtype(textbox const& v, error_handler& err, int32_t line, building_gfx_context& context) {
919 context.full_state.ui_defs.gui.push_back(v.target);
920 context.full_state.ui_defs.gui.back().data.text.flags |= ui::text_data::is_edit_mask;
921 context.full_state.ui_defs.gui.back().ex_flags |= ui::element_data::ex_is_top_level;
922 if(v.extension) {
923 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)) });
924 }
925}
926void guitypes::textboxtype(textbox const& v, error_handler& err, int32_t line, building_gfx_context& context) {
927 context.full_state.ui_defs.gui.push_back(v.target);
928 context.full_state.ui_defs.gui.back().ex_flags |= ui::element_data::ex_is_top_level;
929 if(v.extension) {
930 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)) });
931 }
932}
933
935 context.full_state.ui_defs.gui.push_back(v.target);
936 context.full_state.ui_defs.gui.back().ex_flags |= ui::element_data::ex_is_top_level;
937 if(v.added_allow != -1) {
938 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));
939 }
940 if(v.added_effect != -1) {
941 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));
942 }
943 if(v.extension) {
944 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)) });
945 }
946}
948 context.full_state.ui_defs.gui.push_back(v.target);
949 context.full_state.ui_defs.gui.back().ex_flags |= ui::element_data::ex_is_top_level;
950 if(v.added_allow != -1) {
951 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));
952 }
953 if(v.added_effect != -1) {
954 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));
955 }
956 if(v.extension) {
957 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)) });
958 }
959}
960
961} // 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)
NLOHMANN_BASIC_JSON_TPL_DECLARATION void swap(nlohmann::NLOHMANN_BASIC_JSON_TPL &j1, nlohmann::NLOHMANN_BASIC_JSON_TPL &j2) noexcept(//NOLINT(readability-inconsistent-declaration-parameter-name, cert-dcl58-cpp) is_nothrow_move_constructible< nlohmann::NLOHMANN_BASIC_JSON_TPL >::value &&//NOLINT(misc-redundant-expression, cppcoreguidelines-noexcept-swap, performance-noexcept-swap) is_nothrow_move_assignable< nlohmann::NLOHMANN_BASIC_JSON_TPL >::value)
exchanges the values of two JSON objects
Definition: json.hpp:24635
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)
Holds important data about the game world, state, and other data regarding windowing,...
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
dcon::text_key name
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