diff --git a/armorforge/Assets/Scene.arm b/armorforge/Assets/Scene.arm index e71f0cb7..9ffb0ccf 100644 Binary files a/armorforge/Assets/Scene.arm and b/armorforge/Assets/Scene.arm differ diff --git a/armorlab/Assets/Scene.arm b/armorlab/Assets/Scene.arm index 4f4bed38..c731ba9c 100644 Binary files a/armorlab/Assets/Scene.arm and b/armorlab/Assets/Scene.arm differ diff --git a/armorpaint/Assets/Scene.arm b/armorpaint/Assets/Scene.arm index e71f0cb7..9ffb0ccf 100644 Binary files a/armorpaint/Assets/Scene.arm and b/armorpaint/Assets/Scene.arm differ diff --git a/armorpaint/Plugins/kfile.js b/armorpaint/Plugins/kfile.js index 4d9ca9e5..93106c34 100644 --- a/armorpaint/Plugins/kfile.js +++ b/armorpaint/Plugins/kfile.js @@ -1,6 +1,6 @@ let project = new Project('plugins'); -project.addFile('Sources/**'); +// project.addFile('Sources/**'); //// project.addDefine('WITH_PLUGIN_EMBED'); project.addDefine('TINYUSDZ_NO_STB_IMAGE_IMPLEMENTATION'); diff --git a/armorpaint/Sources/tab_layers.ts b/armorpaint/Sources/tab_layers.ts index 287c8160..c2d7b628 100644 --- a/armorpaint/Sources/tab_layers.ts +++ b/armorpaint/Sources/tab_layers.ts @@ -214,7 +214,7 @@ function tab_layers_remap_layer_pointers(nodes: zui_node_t[], pointer_map: map_t let n: zui_node_t = nodes[i]; if (n.type == "LAYER" || n.type == "LAYER_MASK") { let i: i32 = n.buttons[0].default_value[0]; - if (map_get(pointer_map, i) != null) { + if (map_get(pointer_map, i) != -1) { n.buttons[0].default_value[0] = map_get(pointer_map, i); } } @@ -322,7 +322,7 @@ function tab_layers_draw_layer_slot_mini(l: slot_layer_t, i: i32) { let uiy: f32 = ui._y; let state: zui_state_t = tab_layers_draw_layer_icon(l, i, uix, uiy, true); tab_layers_handle_layer_icon_state(l, i, state, uix, uiy); - zui_end_element(); + _zui_end_element(); ui._y += zui_ELEMENT_H(ui); ui._y -= zui_ELEMENT_OFFSET(ui); @@ -439,7 +439,7 @@ function tab_layers_draw_layer_slot_full(l: slot_layer_t, i: i32) { } if (slot_layer_is_group(l)) { - zui_end_element(); + _zui_end_element(); } else { if (slot_layer_is_mask(l)) { @@ -463,23 +463,23 @@ function tab_layers_draw_layer_slot_full(l: slot_layer_t, i: i32) { if (slot_layer_is_group(l) || slot_layer_is_mask(l)) { ui._y -= zui_ELEMENT_OFFSET(ui); - zui_end_element(); + _zui_end_element(); } else { ui._y -= zui_ELEMENT_OFFSET(ui); let row: f32[] = [8 / 100, 16 / 100, 36 / 100, 30 / 100, 10 / 100]; zui_row(row); - zui_end_element(); - zui_end_element(); - zui_end_element(); + _zui_end_element(); + _zui_end_element(); + _zui_end_element(); if (config_raw.touch_ui) { ui._x += 12 * zui_SCALE(ui); } tab_layers_combo_object(ui, l); - zui_end_element(); + _zui_end_element(); } ui._y -= zui_ELEMENT_OFFSET(ui); @@ -936,7 +936,7 @@ function tab_layers_draw_layer_context_menu(l: slot_layer_t, mini: bool) { } ui._y = _y; zui_draw_string(tr("Res"), -1, 0, zui_align_t.RIGHT, true); - zui_end_element(); + _zui_end_element(); ui_menu_fill(ui); ui_menu_align(ui); diff --git a/armorsculpt/Assets/Scene.arm b/armorsculpt/Assets/Scene.arm index e71f0cb7..53b3f639 100644 Binary files a/armorsculpt/Assets/Scene.arm and b/armorsculpt/Assets/Scene.arm differ diff --git a/armorsculpt/Sources/tab_layers.ts b/armorsculpt/Sources/tab_layers.ts index ffd827ab..15f31be6 100644 --- a/armorsculpt/Sources/tab_layers.ts +++ b/armorsculpt/Sources/tab_layers.ts @@ -202,8 +202,8 @@ function tab_layers_draw_layer_slot_mini(l: slot_layer_t, i: i32) { zui_row(row); let uix = ui._x; let uiy = ui._y; - zui_end_element(); - zui_end_element(); + _zui_end_element(); + _zui_end_element(); ui._y += zui_ELEMENT_H(ui); ui._y -= zui_ELEMENT_OFFSET(ui); @@ -305,7 +305,7 @@ function tab_layers_draw_layer_slot_full(l: slot_layer_t, i: i32) { } if (slot_layer_is_group(l)) { - zui_end_element(); + _zui_end_element(); } else { if (slot_layer_is_mask(l)) { @@ -313,7 +313,7 @@ function tab_layers_draw_layer_slot_full(l: slot_layer_t, i: i32) { } // comboBlending(ui, l); - zui_end_element(); + _zui_end_element(); if (slot_layer_is_mask(l)) { ui._y -= center; @@ -330,16 +330,16 @@ function tab_layers_draw_layer_slot_full(l: slot_layer_t, i: i32) { if (slot_layer_is_group(l) || slot_layer_is_mask(l)) { ui._y -= zui_ELEMENT_OFFSET(ui); - zui_end_element(); + _zui_end_element(); } else { ui._y -= zui_ELEMENT_OFFSET(ui); let row: f32 = [8 / 100, 16 / 100, 36 / 100, 30 / 100, 10 / 100]; zui_row(row); - zui_end_element(); - zui_end_element(); - zui_end_element(); + _zui_end_element(); + _zui_end_element(); + _zui_end_element(); if (config_raw.touch_ui) { ui._x += 12 * zui_SCALE(ui); @@ -349,7 +349,7 @@ function tab_layers_draw_layer_slot_full(l: slot_layer_t, i: i32) { tab_layers_combo_object(ui, l); ui._y += center; - zui_end_element(); + _zui_end_element(); } ui._y -= zui_ELEMENT_OFFSET(ui); diff --git a/base/Assets/World_irradiance.arm b/base/Assets/World_irradiance.arm index 0463d624..482f130c 100644 Binary files a/base/Assets/World_irradiance.arm and b/base/Assets/World_irradiance.arm differ diff --git a/base/Assets/shader_datas.arm b/base/Assets/shader_datas.arm index 58c4f5d9..2d2ff099 100644 Binary files a/base/Assets/shader_datas.arm and b/base/Assets/shader_datas.arm differ diff --git a/base/Sources/base.ts b/base/Sources/base.ts index 76e83015..bd6ad8ea 100644 --- a/base/Sources/base.ts +++ b/base/Sources/base.ts @@ -237,9 +237,8 @@ function base_init() { base_color_wheel = image_color_wheel; base_color_wheel_gradient = image_color_wheel_gradient; - // zui_set_enum_texts(base_enum_texts); zui_nodes_enum_texts = base_enum_texts; - zui_tr = tr; + // zui_tr = tr; //// let ops: zui_options_t = { theme: base_theme, font: f.font_, @@ -896,7 +895,7 @@ function base_enum_texts(node_type: string): string[] { ///if (is_paint || is_sculpt) if (node_type == "TEX_IMAGE") { if (project_asset_names.length > 0) { - project_asset_names; + return project_asset_names; } else { let empty: string[] = [""]; diff --git a/base/Sources/box_export.ts b/base/Sources/box_export.ts index a109caff..0b488a98 100644 --- a/base/Sources/box_export.ts +++ b/base/Sources/box_export.ts @@ -149,7 +149,7 @@ function box_export_tab_export_textures(ui: zui_t, title: string, bake_material: let layers_destination_combo: string[] = [tr("Disk"), tr("Packed")]; context_raw.layers_destination = zui_combo(layers_destination_handle, layers_destination_combo, tr("Destination"), true); - zui_end_element(); + _zui_end_element(); zui_row(row); if (zui_button(tr("Cancel"))) { diff --git a/base/Sources/box_preferences.ts b/base/Sources/box_preferences.ts index a32912a0..36773d3b 100644 --- a/base/Sources/box_preferences.ts +++ b/base/Sources/box_preferences.ts @@ -127,7 +127,7 @@ function box_preferences_show() { // zui_text("Node Editor"); // let grid_snap: bool = Zui.check(Zui.handle("boxpreferences_11", { selected: false }), "Grid Snap"); - zui_end_element(); + _zui_end_element(); let row: f32[] = [0.5, 0.5]; zui_row(row); if (zui_button(tr("Restore")) && !ui_menu_show) { @@ -264,10 +264,7 @@ function box_preferences_show() { } }, 11); } - let val: i32 = h.color; - if (val < 0) { - val += 4294967296; - } + let val: u32 = h.color; h.text = i32_to_string_hex(val); zui_text_input(h, "VIEWPORT_COL"); h.color = parse_int_hex(h.text); @@ -291,12 +288,8 @@ function box_preferences_show() { let key: string = zui_theme_keys[i]; let h: zui_handle_t = zui_nest(hlist, i); - let val: i32 = 0; //// theme[key]; - + let val: u32 = 0; //// theme[key]; let is_hex: bool = ends_with(key, "_COL"); - if (is_hex && val < 0) { - val += 4294967296; - } if (is_hex) { let row: f32[] = [1 / 8, 7 / 8]; @@ -579,7 +572,7 @@ function box_preferences_show() { config_raw.pressure_angle = zui_check(h_pressure_angle, tr("Brush Angle")); ///end - zui_end_element(); + _zui_end_element(); let row: f32[] = [0.5]; zui_row(row); if (zui_button(tr("Help"))) { diff --git a/base/Sources/box_projects.ts b/base/Sources/box_projects.ts index d1f818eb..2af9da1c 100644 --- a/base/Sources/box_projects.ts +++ b/base/Sources/box_projects.ts @@ -91,9 +91,9 @@ function box_projects_tab(ui: zui_t) { let imgw: i32 = math_floor(128 * zui_SCALE(ui)); let i: i32 = j + row * num; if (i >= recent_projects.length) { - zui_end_element(imgw); + _zui_end_element(imgw); if (show_asset_names) { - zui_end_element(0); + _zui_end_element(0); } continue; } @@ -171,9 +171,9 @@ function box_projects_tab(ui: zui_t) { } } else { - zui_end_element(0); + _zui_end_element(0); if (show_asset_names) { - zui_end_element(0); + _zui_end_element(0); } ui._x = uix; } @@ -229,7 +229,7 @@ function box_projects_recent_tab(ui: zui_t) { } ui.enabled = true; - zui_end_element(); + _zui_end_element(); if (zui_button(tr("New .."), zui_align_t.LEFT)) { project_new_box(); } @@ -242,7 +242,7 @@ function box_projects_recent_tab(ui: zui_t) { function box_projects_draw_badge(ui: zui_t) { let img: image_t = data_get_image("badge.k"); _zui_image(img); - zui_end_element(); + _zui_end_element(); } function box_projects_get_started_tab(ui: zui_t) { diff --git a/base/Sources/export_arm.ts b/base/Sources/export_arm.ts index 718e5942..bb7b42b4 100644 --- a/base/Sources/export_arm.ts +++ b/base/Sources/export_arm.ts @@ -270,21 +270,21 @@ function export_arm_export_node(n: zui_node_t, assets: asset_t[] = null) { } } // Pack colors - if (n.color > 0) { - n.color -= 4294967296; - } - for (let i: i32 = 0; i < n.inputs.length; ++i) { - let inp: zui_node_socket_t = n.inputs[i]; - if (inp.color > 0) { - inp.color -= 4294967296; - } - } - for (let i: i32 = 0; i < n.outputs.length; ++i) { - let out: zui_node_socket_t = n.outputs[i]; - if (out.color > 0) { - out.color -= 4294967296; - } - } + // if (n.color > 0) { + // n.color -= 4294967296; + // } + // for (let i: i32 = 0; i < n.inputs.length; ++i) { + // let inp: zui_node_socket_t = n.inputs[i]; + // if (inp.color > 0) { + // inp.color -= 4294967296; + // } + // } + // for (let i: i32 = 0; i < n.outputs.length; ++i) { + // let out: zui_node_socket_t = n.outputs[i]; + // if (out.color > 0) { + // out.color -= 4294967296; + // } + // } } ///if (is_paint || is_sculpt) diff --git a/base/Sources/import_arm.ts b/base/Sources/import_arm.ts index dbc2b588..2598b8f3 100644 --- a/base/Sources/import_arm.ts +++ b/base/Sources/import_arm.ts @@ -289,9 +289,9 @@ function import_arm_run_project(path: string) { l.paint_rough = ld.paint_rough; l.paint_met = ld.paint_met; l.paint_nor = ld.paint_nor; - l.paint_nor_blend = ld.paint_nor_blend != null ? ld.paint_nor_blend : true; // TODO: deprecated + l.paint_nor_blend = ld.paint_nor_blend; l.paint_height = ld.paint_height; - l.paint_height_blend = ld.paint_height_blend != null ? ld.paint_height_blend : true; // TODO: deprecated + l.paint_height_blend = ld.paint_height_blend; l.paint_emis = ld.paint_emis; l.paint_subs = ld.paint_subs; ///end diff --git a/base/Sources/import_obj.ts b/base/Sources/import_obj.ts index 49eab005..abbc4238 100644 --- a/base/Sources/import_obj.ts +++ b/base/Sources/import_obj.ts @@ -66,7 +66,9 @@ function import_obj_run(path: string, replace_existing: bool = true) { for (let i: i32 = 0; i < parts.length; ++i) { let j: i32 = i + 1; while (j < parts.length) { - if (parts[i].name == parts[j].name) { + let iname: string = parts[i].name; + let jname: string = parts[j].name; + if (iname == jname) { posa0 = parts[i].posa; posa1 = parts[j].posa; nora0 = parts[i].nora; diff --git a/base/Sources/nodes/float_node.ts b/base/Sources/nodes/float_node.ts index 2d27bc67..c495f6e8 100644 --- a/base/Sources/nodes/float_node.ts +++ b/base/Sources/nodes/float_node.ts @@ -5,13 +5,13 @@ type float_node_t = { image?: image_t; }; -function float_node_create(args: f32): float_node_t { +function float_node_create(args: f32_array_t): float_node_t { let n: float_node_t = {}; n.base = logic_node_create(); n.base.get = float_node_get; n.base.get_as_image = float_node_get_as_image; n.base.set = float_node_set; - n.value = args; + n.value = args[0]; return n; } diff --git a/base/Sources/nodes/vector_node.ts b/base/Sources/nodes/vector_node.ts index 0452ba56..3bd74488 100644 --- a/base/Sources/nodes/vector_node.ts +++ b/base/Sources/nodes/vector_node.ts @@ -14,9 +14,9 @@ function vector_node_create(args: f32_array_t): vector_node_t { n.value = vec4_create(); if (args != null) { - logic_node_add_input(n.base, float_node_create(args[0]).base, 0); - logic_node_add_input(n.base, float_node_create(args[1]).base, 0); - logic_node_add_input(n.base, float_node_create(args[2]).base, 0); + logic_node_add_input(n.base, float_node_create(f32_array_create_x(args[0])).base, 0); + logic_node_add_input(n.base, float_node_create(f32_array_create_x(args[1])).base, 0); + logic_node_add_input(n.base, float_node_create(f32_array_create_x(args[2])).base, 0); } return n; diff --git a/base/Sources/parser_logic.ts b/base/Sources/parser_logic.ts index f91d1e09..2c764dd8 100644 --- a/base/Sources/parser_logic.ts +++ b/base/Sources/parser_logic.ts @@ -74,7 +74,9 @@ function parser_logic_safe_src(s: string): string { } function parser_logic_node_name(node: zui_node_t): string { - let s: string = parser_logic_safe_src(node.name) + node.id; + let safe: string = parser_logic_safe_src(node.name); + let nid: i32 = node.id; + let s: string = safe + nid; return s; } @@ -131,7 +133,9 @@ function parser_logic_build_node(node: zui_node_t): string { // Is linked - find node let l: zui_node_link_t = parser_logic_get_input_link(inp); if (l != null) { - inp_node = map_get(parser_logic_node_map, parser_logic_build_node(parser_logic_get_node(l.from_id))); + let n: zui_node_t = parser_logic_get_node(l.from_id); + let s: string = parser_logic_build_node(n); + inp_node = map_get(parser_logic_node_map, s); inp_from = l.from_socket; } // Not linked - create node with default values diff --git a/base/Sources/project.ts b/base/Sources/project.ts index 4125c916..ae0a4399 100644 --- a/base/Sources/project.ts +++ b/base/Sources/project.ts @@ -118,7 +118,7 @@ function project_new_box() { let project_aspect_ratio_combo: string[] = ["1:1", "2:1", "1:2"]; context_raw.project_aspect_ratio = zui_combo(h_project_aspect_ratio, project_aspect_ratio_combo, tr("Aspect Ratio"), true); - zui_end_element(); + _zui_end_element(); zui_row(row); if (zui_button(tr("Cancel"))) { ui_box_hide(); @@ -349,6 +349,17 @@ function project_import_material() { }); } +function project_create_node_link(links: zui_node_link_t[], from_id: i32, from_socket: i32, to_id: i32, to_socket: i32): zui_node_link_t { + let link: zui_node_link_t = { + id: zui_next_link_id(links.buffer, links.length), + from_id: from_id, + from_socket: from_socket, + to_id: to_id, + to_socket: to_socket + }; + return link; +} + function project_import_brush() { let formats: string = string_array_join(path_texture_formats, ","); ui_files_show("arm," + formats, false, true, function (path: string) { @@ -374,13 +385,7 @@ function project_import_brush() { n.y = 340; n.buttons[0].default_value = f32_array_create_x(asset_index); let links: zui_node_link_t[] = context_raw.brush.canvas.links; - let link: zui_node_link_t = { - id: zui_next_link_id(links.buffer, links.length), - from_id: n.id, - from_socket: 0, - to_id: 0, - to_socket: 4 - }; + let link: zui_node_link_t = project_create_node_link(links, n.id, 0, 0, 4); array_push(links, link); // Parse brush diff --git a/base/Sources/tab_brushes.ts b/base/Sources/tab_brushes.ts index afb307a9..4234ec51 100644 --- a/base/Sources/tab_brushes.ts +++ b/base/Sources/tab_brushes.ts @@ -45,8 +45,10 @@ function tab_brushes_draw(htab: zui_handle_t) { let imgw: i32 = math_floor(50 * zui_SCALE(ui)); let i: i32 = j + row * num; if (i >= project_brushes.length) { - zui_end_element(imgw); - if (config_raw.show_asset_names) zui_end_element(0); + _zui_end_element(imgw); + if (config_raw.show_asset_names) { + _zui_end_element(0); + } continue; } let img: image_t = zui_SCALE(ui) > 1 ? project_brushes[i].image : project_brushes[i].image_icon; diff --git a/base/Sources/tab_fonts.ts b/base/Sources/tab_fonts.ts index ed0ab988..bb979e8b 100644 --- a/base/Sources/tab_fonts.ts +++ b/base/Sources/tab_fonts.ts @@ -53,9 +53,9 @@ function tab_fonts_draw(htab: zui_handle_t) { let imgw: i32 = math_floor(50 * zui_SCALE(ui)); let i: i32 = j + row * num; if (i >= project_fonts.length) { - zui_end_element(imgw); + _zui_end_element(imgw); if (config_raw.show_asset_names) { - zui_end_element(0); + _zui_end_element(0); } continue; } diff --git a/base/Sources/tab_materials.ts b/base/Sources/tab_materials.ts index a3856a27..ceb6820b 100644 --- a/base/Sources/tab_materials.ts +++ b/base/Sources/tab_materials.ts @@ -73,9 +73,9 @@ function tab_materials_draw_slots(mini: bool) { let imgw: i32 = math_floor(50 * zui_SCALE(ui)); let i: i32 = j + row * num; if (i >= project_materials.length) { - zui_end_element(imgw); + _zui_end_element(imgw); if (config_raw.show_asset_names) { - zui_end_element(0); + _zui_end_element(0); } continue; } diff --git a/base/Sources/tab_swatches.ts b/base/Sources/tab_swatches.ts index a5248259..21258c81 100644 --- a/base/Sources/tab_swatches.ts +++ b/base/Sources/tab_swatches.ts @@ -102,7 +102,7 @@ function tab_swatches_draw(htab: zui_handle_t) { for (let j: i32 = 0; j < num; ++j) { let i: i32 = j + row * num; if (i >= project_raw.swatches.length) { - zui_end_element(slotw); + _zui_end_element(slotw); continue; } @@ -207,10 +207,7 @@ function tab_swatches_draw(htab: zui_handle_t) { else if (ui_menu_button(ui, tr("Copy Hex Code"))) { let color: i32 = context_raw.swatch.base; color = color_set_ab(color, context_raw.swatch.opacity * 255); - let val: i32 = color; - if (val < 0) { - val += 4294967296; - } + let val: u32 = color; krom_copy_to_clipboard(i32_to_string(val)); } ///end @@ -232,10 +229,7 @@ function tab_swatches_draw(htab: zui_handle_t) { if (ui.is_hovered) { let color: i32 = project_raw.swatches[i].base; color = color_set_ab(color, project_raw.swatches[i].opacity * 255); - let val: i32 = color; - if (val < 0) { - val += 4294967296; - } + let val: u32 = color; zui_tooltip("#" + i32_to_string_hex(val)); } } diff --git a/base/Sources/tab_textures.ts b/base/Sources/tab_textures.ts index ba6a8d7e..0157344e 100644 --- a/base/Sources/tab_textures.ts +++ b/base/Sources/tab_textures.ts @@ -67,9 +67,9 @@ function tab_textures_draw(htab: zui_handle_t) { let imgw: i32 = math_floor(50 * zui_SCALE(ui)); let i: i32 = j + row * num; if (i >= project_assets.length) { - zui_end_element(imgw); + _zui_end_element(imgw); if (config_raw.show_asset_names) { - zui_end_element(0); + _zui_end_element(0); } continue; } diff --git a/base/Sources/translator.ts b/base/Sources/translator.ts index 341fd4d4..2886f7dd 100644 --- a/base/Sources/translator.ts +++ b/base/Sources/translator.ts @@ -157,7 +157,7 @@ function translator_init_font(cjk: bool, font_path: string, font_scale: f32) { let f: g2_font_t = data_get_font(font_path); if (cjk) { - let font_index: i32 = map_get(translator_cjk_font_indices, config_raw.locale) != null ? map_get(translator_cjk_font_indices, config_raw.locale) : 0; + let font_index: i32 = map_get(translator_cjk_font_indices, config_raw.locale) != -1 ? map_get(translator_cjk_font_indices, config_raw.locale) : 0; g2_font_set_font_index(f, font_index); } base_font = f; diff --git a/base/Sources/ui_box.ts b/base/Sources/ui_box.ts index 021d0188..817394ff 100644 --- a/base/Sources/ui_box.ts +++ b/base/Sources/ui_box.ts @@ -79,10 +79,13 @@ function ui_box_render() { if (zui_tab(zui_handle(__ID__), ui_box_title, tab_vertical)) { let htext: zui_handle_t = zui_handle(__ID__); htext.text = ui_box_text; - ui_box_copyable ? - zui_text_area(htext, zui_align_t.LEFT, false) : + if (ui_box_copyable) { + zui_text_area(htext, zui_align_t.LEFT, false); + } + else { zui_text(ui_box_text); - zui_end_element(); + } + _zui_end_element(); ///if (krom_windows || krom_linux || krom_darwin) if (ui_box_copyable) { @@ -98,7 +101,7 @@ function ui_box_render() { zui_row(row); ///end - zui_end_element(); + _zui_end_element(); ///if (krom_windows || krom_linux || krom_darwin) if (ui_box_copyable && zui_button(tr("Copy"))) { diff --git a/base/Sources/ui_files.ts b/base/Sources/ui_files.ts index d3e4bd47..c668d2bd 100644 --- a/base/Sources/ui_files.ts +++ b/base/Sources/ui_files.ts @@ -152,8 +152,8 @@ function ui_files_file_browser(ui: zui_t, handle: zui_handle_t, folders_only: bo for (let j: i32 = 0; j < num; ++j) { let i: i32 = j + row * num; if (i >= ui_files_files.length) { - zui_end_element(slotw); - zui_end_element(slotw); + _zui_end_element(slotw); + _zui_end_element(slotw); continue; } diff --git a/base/Sources/ui_menu.ts b/base/Sources/ui_menu.ts index 5b2d1084..e179e61a 100644 --- a/base/Sources/ui_menu.ts +++ b/base/Sources/ui_menu.ts @@ -593,7 +593,7 @@ function ui_menu_render() { let img: image_t = data_get_image("badge.k"); _zui_image(img); - zui_end_element(); + _zui_end_element(); let h: zui_handle_t = zui_handle(__ID__); if (h.init) { @@ -609,7 +609,7 @@ function ui_menu_render() { krom_copy_to_clipboard(_ui_menu_render_msg); } ///else - zui_end_element(); + _zui_end_element(); ///end if (zui_button(tr("Contributors"))) { @@ -713,7 +713,7 @@ function ui_menu_align(ui: zui_t) { if (!config_raw.touch_ui) { let row: f32[] = [12 / 100, 88 / 100]; zui_row(row); - zui_end_element(); + _zui_end_element(); } } diff --git a/base/Sources/ui_menubar.ts b/base/Sources/ui_menubar.ts index f59d3367..ccf08fa3 100644 --- a/base/Sources/ui_menubar.ts +++ b/base/Sources/ui_menubar.ts @@ -200,11 +200,8 @@ function ui_menubar_show_menu(ui: zui_t, category: i32) { } function ui_menubar_icon_button(ui: zui_t, i: i32, j: i32): bool { - let col: i32 = ui.ops.theme.WINDOW_BG_COL; - if (col < 0) { - col += 4294967296; - } - let light: bool = col > (0xff666666 + 4294967296); + let col: u32 = ui.ops.theme.WINDOW_BG_COL; + let light: bool = col > 0xff666666 ; let icon_accent: i32 = light ? 0xff666666 : 0xffaaaaaa; let img: image_t = resource_get("icons.k"); let rect: rect_t = resource_tile50(img, i, j); diff --git a/base/Sources/ui_nodes.ts b/base/Sources/ui_nodes.ts index b910a77c..817e069f 100644 --- a/base/Sources/ui_nodes.ts +++ b/base/Sources/ui_nodes.ts @@ -943,7 +943,7 @@ function ui_nodes_render() { } if (!found) { zui_remove_node(canvas_node, c); - array_remove(nodes.nodes_selected_id, canvas_node.id); + i32_array_remove(nodes.nodes_selected_id, canvas_node.id); i--; } } diff --git a/base/Sources/ui_toolbar.ts b/base/Sources/ui_toolbar.ts index 57729c85..d4d2ae8f 100644 --- a/base/Sources/ui_toolbar.ts +++ b/base/Sources/ui_toolbar.ts @@ -84,11 +84,8 @@ function ui_toolbar_render_ui() { ui.image_scroll_align = false; let img: image_t = resource_get("icons.k"); - let col: i32 = ui.ops.theme.WINDOW_BG_COL; - if (col < 0) { - col += 4294967296; - } - let light: bool = col > (0xff666666 + 4294967296); + let col: u32 = ui.ops.theme.WINDOW_BG_COL; + let light: bool = col > 0xff666666; let icon_accent: i32 = light ? 0xff666666 : -1; // Properties icon