9 result.reserve(sv.length());
11 result += char(tolower(ch));
25 context.
map_of_names.insert_or_assign(std::string(obj_in.
name), dcon::gfx_object_id(uint16_t(gfxindex)));
61 context.
map_of_texture_names.insert_or_assign(stripped, dcon::texture_id(dcon::texture_id::value_base_t(index)));
130 parsers::parse_gfx_object_outer(gen, err, context);
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") ||
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")) {
164 err.
accumulated_errors +=
"tried to parse " + std::string(txt) +
" as an orientation on line " + std::to_string(line) +
186 err.
accumulated_errors +=
"tried to parse " + std::string(txt) +
" as a rotation on line " + std::to_string(line) +
218 if(txt.length() == 0)
224 err.
accumulated_errors +=
"referenced unknown gfx object " + std::string(txt) +
" on line " + std::to_string(line) +
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] ==
'\"') {
284 err.
accumulated_errors +=
"tried to parse " + std::string(t) +
" as a key name on line " + std::to_string(line) +
411 err.
accumulated_errors +=
"tried to parse " + std::string(t) +
" as a key name on line " + std::to_string(line) +
436 err.
accumulated_errors +=
"tried to parse " + std::string(t) +
" as an alignment on line " + std::to_string(line) +
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")) {
449 err.
accumulated_errors +=
"tried to parse " + std::string(t) +
" as a click sound on line " + std::to_string(line) +
456 err.
accumulated_errors +=
"multiple allow conditions for a button defined on line " + std::to_string(line) +
" of file " + err.
file_name +
"\n";
462 err.
accumulated_errors +=
"multiple effects for a button defined on line " + std::to_string(line) +
" of file " + err.
file_name +
"\n";
468 err.
accumulated_errors +=
"multiple allow conditions for a button defined on line " + std::to_string(line) +
" of file " + err.
file_name +
"\n";
474 err.
accumulated_errors +=
"multiple effects for a button defined on line " + std::to_string(line) +
" of file " + err.
file_name +
"\n";
510 "asked for more than 127 frames on line " + std::to_string(line) +
" of file " + err.
file_name +
"\n";
514 if(txt.length() == 0)
520 err.
accumulated_errors +=
"referenced unknown gfx object " + std::string(txt) +
" on line " + std::to_string(line) +
555 err.
accumulated_errors +=
"tried to parse " + std::string(t) +
" as an alignment on line " + std::to_string(line) +
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")) {
572 err.
accumulated_errors +=
"tried to parse " + std::string(t) +
" as a text box background on line " + std::to_string(line) +
584 if(txt.length() == 0)
590 err.
accumulated_errors +=
"referenced unknown gfx object " + std::string(txt) +
" on line " + std::to_string(line) +
619 err.
accumulated_errors +=
"tried to parse " + std::string(t) +
" as an alignment on line " + std::to_string(line) +
683 err.
accumulated_errors +=
"tried to parse " + std::string(t) +
" as a step size on line " + std::to_string(line) +
698 for(
size_t i = v.size(); i-- > 0;) {
699 if(
lowercase_str(state.to_string_view(v[i].name)) == lname) {
821 auto child_id = dcon::gui_def_id(dcon::gui_def_id::value_base_t(first_child + s.child_number));
825 if(s.peffect != -1) {
831 if(s.neffect != -1) {
std::string accumulated_errors
tag_type emplace_back(T &&... ts)
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)
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])
bool is_fixed_token_ci(char const *start, char const *end, char const (&t)[N])
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)
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)
uint16_t name_into_font_id(sys::state &state, std::string_view txt)
@ horizontal_progress_bar
std::vector< pending_button_script > province_buttons_allow
ui::definitions & ui_defs
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 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 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 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)
static constexpr uint8_t ex_is_top_level
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
static constexpr uint8_t do_transparency_check
dcon::gfx_object_id gfx_object
static constexpr uint8_t is_mask_mask
dcon::gfx_object_id background_image
alignment image_alignment
static constexpr uint8_t is_edit_mask
static constexpr uint8_t is_fixed_size_mask
static constexpr uint8_t is_instant_mask
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
overlapping_data overlapping