From fdb88c3cc989a999a1b02b4509573a7080e65baf Mon Sep 17 00:00:00 2001 From: luboslenco Date: Sun, 15 Mar 2026 11:37:45 +0100 Subject: [PATCH] paint: cleanup --- base/sources/iron_ui_nodes.c | 4 +- base/tests/cube/sources/main.c | 2 +- base/tests/fall/sources/main.c | 2 +- base/tests/triangle/main.c | 2 +- base/tools/pad/main.c | 2 +- paint/sources/args.c | 8 +- paint/sources/base.c | 42 +-- paint/sources/box_export.c | 140 ++++----- paint/sources/box_preferences.c | 234 ++++++++-------- paint/sources/box_projects.c | 30 +- paint/sources/context.c | 10 +- paint/sources/export_arm.c | 2 +- paint/sources/export_texture.c | 10 +- paint/sources/functions.h | 3 +- paint/sources/history.c | 136 ++++----- paint/sources/import_asset.c | 4 +- paint/sources/import_blend_material.c | 10 +- paint/sources/import_blend_mesh.c | 4 +- paint/sources/import_folder.c | 2 +- paint/sources/import_font.c | 2 +- paint/sources/import_keymap.c | 2 +- paint/sources/import_plugin.c | 2 +- paint/sources/import_texture.c | 2 +- paint/sources/import_theme.c | 2 +- .../sources/material_nodes/color_ramp_node.c | 6 +- paint/sources/material_nodes/group_node.c | 12 +- paint/sources/neural_nodes/edit_image_node.c | 4 +- .../neural_nodes/image_to_3d_mesh_node.c | 2 +- .../neural_nodes/image_to_depth_node.c | 2 +- .../neural_nodes/image_to_normal_map_node.c | 2 +- .../sources/neural_nodes/image_to_pbr_node.c | 2 +- .../sources/neural_nodes/inpaint_image_node.c | 4 +- paint/sources/neural_nodes/neural_node.c | 10 +- .../neural_nodes/outpaint_image_node.c | 4 +- .../sources/neural_nodes/text_to_image_node.c | 4 +- paint/sources/neural_nodes/tile_image_node.c | 4 +- .../sources/neural_nodes/upscale_image_node.c | 2 +- paint/sources/neural_nodes/vary_image_node.c | 4 +- paint/sources/physics_sim.c | 2 +- paint/sources/project.c | 48 ++-- paint/sources/slot_layer.c | 2 +- paint/sources/strings.c | 12 +- paint/sources/tab_browser.c | 44 +-- paint/sources/tab_brushes.c | 14 +- paint/sources/tab_console.c | 12 +- paint/sources/tab_fonts.c | 10 +- paint/sources/tab_history.c | 2 +- paint/sources/tab_layers.c | 138 ++++----- paint/sources/tab_materials.c | 42 +-- paint/sources/tab_meshes.c | 58 ++-- paint/sources/tab_plugins.c | 4 +- paint/sources/tab_scene.c | 6 +- paint/sources/tab_scripts.c | 16 +- paint/sources/tab_swatches.c | 34 +-- paint/sources/tab_textures.c | 30 +- paint/sources/tab_timeline.c | 2 +- paint/sources/translator.c | 6 +- paint/sources/ui_box.c | 4 +- paint/sources/ui_header.c | 218 +++++++------- paint/sources/ui_menubar.c | 265 +++++++++--------- paint/sources/ui_nodes.c | 76 ++--- paint/sources/ui_toolbar.c | 10 +- paint/sources/ui_view2d.c | 30 +- 63 files changed, 904 insertions(+), 900 deletions(-) diff --git a/base/sources/iron_ui_nodes.c b/base/sources/iron_ui_nodes.c index e970576e..5bce6b15 100644 --- a/base/sources/iron_ui_nodes.c +++ b/base/sources/iron_ui_nodes.c @@ -49,10 +49,10 @@ void *ui_popup_data2; int ui_popup_handle_node_id = -1; int ui_popup_handle_node_socket_id = -1; -char *tr(char *id, void *map); // translator.c +char *tr(char *id); // translator.c char *ui_tr(char *id) { - return tr(id, NULL); + return tr(id); } void ui_nodes_init(ui_nodes_t *nodes) { diff --git a/base/tests/cube/sources/main.c b/base/tests/cube/sources/main.c index a2282b4d..a74b4467 100644 --- a/base/tests/cube/sources/main.c +++ b/base/tests/cube/sources/main.c @@ -133,7 +133,7 @@ char *strings_check_internet_connection() { } void console_error(char *s) {} void console_info(char *s) {} -char *tr(char *id, any_map_t *vars) { +char *tr(char *id) { return id; } i32 pipes_get_constant_location(char *s) { diff --git a/base/tests/fall/sources/main.c b/base/tests/fall/sources/main.c index 0a5b359d..016670ba 100644 --- a/base/tests/fall/sources/main.c +++ b/base/tests/fall/sources/main.c @@ -160,7 +160,7 @@ char *strings_check_internet_connection() { } void console_error(char *s) {} void console_info(char *s) {} -char *tr(char *id, any_map_t *vars) { +char *tr(char *id) { return id; } i32 pipes_get_constant_location(char *s) { diff --git a/base/tests/triangle/main.c b/base/tests/triangle/main.c index 46ee7600..b980f942 100644 --- a/base/tests/triangle/main.c +++ b/base/tests/triangle/main.c @@ -100,7 +100,7 @@ char *strings_check_internet_connection() { } void console_error(char *s) {} void console_info(char *s) {} -char *tr(char *id, any_map_t *vars) { +char *tr(char *id) { return id; } i32 pipes_get_constant_location(char *s) { diff --git a/base/tools/pad/main.c b/base/tools/pad/main.c index 77d078f0..71073766 100644 --- a/base/tools/pad/main.c +++ b/base/tools/pad/main.c @@ -453,7 +453,7 @@ char *strings_check_internet_connection() { } void console_error(char *s) {} void console_info(char *s) {} -char *tr(char *id, any_map_t *vars) { +char *tr(char *id) { return id; } i32 pipes_get_constant_location(char *s) { diff --git a/paint/sources/args.c b/paint/sources/args.c index a6d59651..1ad73db4 100644 --- a/paint/sources/args.c +++ b/paint/sources/args.c @@ -85,7 +85,7 @@ void args_run_on_next_frame(void *_) { if (args_export_textures) { if (!path_is_folder(args_export_textures_path)) { - iron_log(tr("Invalid export directory", NULL)); + iron_log(tr("Invalid export directory")); } if (string_equals(args_export_textures_type, "png")) { @@ -103,7 +103,7 @@ void args_run_on_next_frame(void *_) { base_bits_handle->i = TEXTURE_BITS_BITS32; } else { - iron_log(tr("Invalid texture type", NULL)); + iron_log(tr("Invalid texture type")); } context_raw->layers_export = EXPORT_MODE_VISIBLE; @@ -136,12 +136,12 @@ void args_run_on_next_frame(void *_) { } else if (args_export_mesh) { if (!path_is_folder(args_export_mesh_path)) { - iron_log(tr("Invalid export directory", NULL)); + iron_log(tr("Invalid export directory")); } char *f = ui_files_filename; if (string_equals(f, "")) { - f = string_copy(tr("untitled", NULL)); + f = string_copy(tr("untitled")); } export_mesh_run(string("%s%s%s", args_export_mesh_path, PATH_SEP, f), NULL, false, true); } diff --git a/paint/sources/base.c b/paint/sources/base.c index a6f0afa9..798cd304 100644 --- a/paint/sources/base.c +++ b/paint/sources/base.c @@ -52,10 +52,10 @@ void base_init() { base_default_font_size = base_theme->FONT_SIZE; translator_load_translations(config_raw->locale); gc_unroot(ui_files_filename); - ui_files_filename = string_copy(tr("untitled", NULL)); + ui_files_filename = string_copy(tr("untitled")); gc_root(ui_files_filename); #if defined(IRON_ANDROID) || defined(IRON_IOS) - sys_title_set(tr("untitled", NULL)); + sys_title_set(tr("untitled")); #endif // Baked font for fast startup @@ -769,7 +769,7 @@ void ui_base_init_on_next_frame(void *_) { void ui_base_init() { ui_toolbar_init(); - context_raw->text_tool_text = string_copy(tr("Text", NULL)); + context_raw->text_tool_text = string_copy(tr("Text")); ui_header_init(); ui_statusbar_init(); ui_menubar_init(); @@ -853,25 +853,25 @@ void ui_base_init() { void ui_base_menu_draw_viewport_mode() { ui_handle_t *mode_handle = ui_handle(__ID__); mode_handle->i = context_raw->viewport_mode; - ui_text(tr("Viewport Mode", NULL), UI_ALIGN_RIGHT, 0x00000000); + ui_text(tr("Viewport Mode"), UI_ALIGN_RIGHT, 0x00000000); string_t_array_t *modes = any_array_create_from_raw( (void *[]){ - tr("Lit", NULL), - tr("Base Color", NULL), - tr("Normal", NULL), - tr("Occlusion", NULL), - tr("Roughness", NULL), - tr("Metallic", NULL), - tr("Opacity", NULL), - tr("Height", NULL), - tr("Emission", NULL), - tr("Subsurface", NULL), - tr("TexCoord", NULL), - tr("Object Normal", NULL), - tr("Material ID", NULL), - tr("Object ID", NULL), - tr("Mask", NULL), + tr("Lit"), + tr("Base Color"), + tr("Normal"), + tr("Occlusion"), + tr("Roughness"), + tr("Metallic"), + tr("Opacity"), + tr("Height"), + tr("Emission"), + tr("Subsurface"), + tr("TexCoord"), + tr("Object Normal"), + tr("Material ID"), + tr("Object ID"), + tr("Mask"), }, 15); string_t_array_t *shortcuts = any_array_create_from_raw( @@ -894,7 +894,7 @@ void ui_base_menu_draw_viewport_mode() { }, 15); if (gpu_raytrace_supported()) { - any_array_push(modes, tr("Path Traced", NULL)); + any_array_push(modes, tr("Path Traced")); any_array_push(shortcuts, "p"); } for (i32 i = 0; i < modes->length; ++i) { @@ -1713,7 +1713,7 @@ void ui_base_render(void *_) { ui->input_enabled = true; ui_begin(ui); if (ui_window(ui_handle(__ID__), 0, 0, 150, math_floor(UI_ELEMENT_H() + UI_ELEMENT_OFFSET() + 1), false)) { - if (ui_button(tr("Close", NULL), UI_ALIGN_CENTER, "")) { + if (ui_button(tr("Close"), UI_ALIGN_CENTER, "")) { ui_base_toggle_distract_free(); } } diff --git a/paint/sources/box_export.c b/paint/sources/box_export.c index 8c7850fd..d0cf3df8 100644 --- a/paint/sources/box_export.c +++ b/paint/sources/box_export.c @@ -11,7 +11,7 @@ void box_export_show_textures_box() { box_export_hpreset->children = NULL; } - box_export_tab_export_textures(tr("Export Textures", NULL), false); + box_export_tab_export_textures(tr("Export Textures"), false); box_export_tab_presets(); box_export_tab_atlases(); @@ -21,7 +21,7 @@ void box_export_show_textures_box() { } void box_export_show_textures() { - ui_box_show_custom(&box_export_show_textures_box, 600, 400, NULL, true, tr("Export", NULL)); + ui_box_show_custom(&box_export_show_textures_box, 600, 400, NULL, true, tr("Export")); } void box_export_show_bake_material_box() { @@ -34,12 +34,12 @@ void box_export_show_bake_material_box() { box_export_hpreset->children = NULL; } - box_export_tab_export_textures(tr("Bake to Textures", NULL), true); + box_export_tab_export_textures(tr("Bake to Textures"), true); box_export_tab_presets(); } void box_export_show_bake_material() { - ui_box_show_custom(&box_export_show_bake_material_box, 600, 400, NULL, true, tr("Export", NULL)); + ui_box_show_custom(&box_export_show_bake_material_box, 600, 400, NULL, true, tr("Export")); } void box_export_tab_export_textures_run(void *_) { @@ -49,7 +49,7 @@ void box_export_tab_export_textures_run(void *_) { void box_export_tab_export_textures_path_picked(char *path) { context_raw->texture_export_path = string_copy(path); #if defined(IRON_ANDROID) || defined(IRON_IOS) - console_toast(tr("Exporting textures", NULL)); + console_toast(tr("Exporting textures")); #endif sys_notify_on_next_frame(&box_export_tab_export_textures_run, NULL); } @@ -90,7 +90,7 @@ void box_export_tab_export_textures(char *title, bool bake_material) { 8); #endif - ui_combo(base_res_handle, base_res_combo, tr("Resolution", NULL), true, UI_ALIGN_LEFT, true); + ui_combo(base_res_handle, base_res_combo, tr("Resolution"), true, UI_ALIGN_LEFT, true); if (base_res_handle->changed) { layers_on_resized(); } @@ -111,7 +111,7 @@ void box_export_tab_export_textures(char *title, bool bake_material) { 3); #endif - ui_combo(base_bits_handle, base_bits_combo, tr("Color", NULL), true, UI_ALIGN_LEFT, true); + ui_combo(base_bits_handle, base_bits_combo, tr("Color"), true, UI_ALIGN_LEFT, true); if (base_bits_handle->changed) { sys_notify_on_next_frame(&box_export_tab_export_textures_on_next_frame, NULL); } @@ -128,7 +128,7 @@ void box_export_tab_export_textures(char *title, bool bake_material) { "jpg", }, 2); - context_raw->format_type = ui_combo(h, format_combo, tr("Format", NULL), true, UI_ALIGN_LEFT, true); + context_raw->format_type = ui_combo(h, format_combo, tr("Format"), true, UI_ALIGN_LEFT, true); } else { ui_handle_t *h = ui_handle(__ID__); @@ -140,7 +140,7 @@ void box_export_tab_export_textures(char *title, bool bake_material) { "exr", }, 1); - context_raw->format_type = ui_combo(h, format_combo, tr("Format", NULL), true, UI_ALIGN_LEFT, true); + context_raw->format_type = ui_combo(h, format_combo, tr("Format"), true, UI_ALIGN_LEFT, true); } ui->enabled = context_raw->format_type == TEXTURE_LDR_FORMAT_JPG && base_bits_handle->i == TEXTURE_BITS_BITS8; @@ -149,7 +149,7 @@ void box_export_tab_export_textures(char *title, bool bake_material) { if (h_quality->init) { h_quality->f = context_raw->format_quality; } - context_raw->format_quality = ui_slider(h_quality, tr("Quality", NULL), 0.0, 100.0, true, 1, true, UI_ALIGN_RIGHT, true); + context_raw->format_quality = ui_slider(h_quality, tr("Quality"), 0.0, 100.0, true, 1, true, UI_ALIGN_RIGHT, true); ui->enabled = true; @@ -159,16 +159,16 @@ void box_export_tab_export_textures(char *title, bool bake_material) { layers_export_handle->i = context_raw->layers_export; string_t_array_t *layers_export_combo = any_array_create_from_raw( (void *[]){ - tr("Visible", NULL), - tr("Selected", NULL), - tr("Per Object", NULL), - tr("Per Udim Tile", NULL), + tr("Visible"), + tr("Selected"), + tr("Per Object"), + tr("Per Udim Tile"), }, 4); - context_raw->layers_export = ui_combo(layers_export_handle, layers_export_combo, tr("Layers", NULL), true, UI_ALIGN_LEFT, true); + context_raw->layers_export = ui_combo(layers_export_handle, layers_export_combo, tr("Layers"), true, UI_ALIGN_LEFT, true); ui->enabled = true; - ui_combo(box_export_hpreset, box_export_files, tr("Preset", NULL), true, UI_ALIGN_LEFT, true); + ui_combo(box_export_hpreset, box_export_files, tr("Preset"), true, UI_ALIGN_LEFT, true); if (box_export_hpreset->changed) { gc_unroot(box_export_preset); box_export_preset = NULL; @@ -179,19 +179,19 @@ void box_export_tab_export_textures(char *title, bool bake_material) { string_t_array_t *layers_destination_combo = any_array_create_from_raw( (void *[]){ - tr("Disk", NULL), - tr("Pack into Project", NULL), + tr("Disk"), + tr("Pack into Project"), }, 2); - context_raw->layers_destination = ui_combo(layers_destination_handle, layers_destination_combo, tr("Destination", NULL), true, UI_ALIGN_LEFT, true); + context_raw->layers_destination = ui_combo(layers_destination_handle, layers_destination_combo, tr("Destination"), true, UI_ALIGN_LEFT, true); ui_end_element(); ui_row2(); - if (ui_icon_button(tr("Cancel", NULL), ICON_CLOSE, UI_ALIGN_CENTER)) { + if (ui_icon_button(tr("Cancel"), ICON_CLOSE, UI_ALIGN_CENTER)) { ui_box_hide(); } - if (ui_icon_button(tr("Export", NULL), ICON_CHECK, UI_ALIGN_CENTER)) { + if (ui_icon_button(tr("Export"), ICON_CHECK, UI_ALIGN_CENTER)) { ui_box_hide(); if (context_raw->layers_destination == EXPORT_DESTINATION_PACK_INTO_PROJECT) { _box_export_bake_material = bake_material; @@ -206,14 +206,14 @@ void box_export_tab_export_textures(char *title, bool bake_material) { } if (ui->is_hovered) { char *key = any_map_get(config_keymap, "file_export_textures"); - char *tip = string("%s (%s)", tr("Export texture files", NULL), key); + char *tip = string("%s (%s)", tr("Export texture files"), key); ui_tooltip(tip); } } } void box_export_tab_presets_menu_draw() { - if (ui_menu_button(tr("Delete", NULL), "", ICON_DELETE)) { + if (ui_menu_button(tr("Delete"), "", ICON_DELETE)) { array_remove(box_export_preset->textures, _box_export_t); box_export_save_preset(); } @@ -229,7 +229,7 @@ void box_export_tab_presets_import(char *path) { gc_unroot(box_export_preset); box_export_preset = NULL; box_export_hpreset->i = string_array_index_of(box_export_files, substring(filename, 0, string_length(filename) - 5)); // Strip .json - console_info(string("%s %s", tr("Preset imported:", NULL), filename)); + console_info(string("%s %s", tr("Preset imported:"), filename)); } else { console_error(strings_unknown_asset_format()); @@ -238,14 +238,14 @@ void box_export_tab_presets_import(char *path) { void box_export_tab_presets_new_box() { bool tab_vertical = config_raw->touch_ui; - if (ui_tab(ui_handle(__ID__), tr("New Preset", NULL), tab_vertical, -1, false)) { + if (ui_tab(ui_handle(__ID__), tr("New Preset"), tab_vertical, -1, false)) { ui_row2(); ui_handle_t *h_preset = ui_handle(__ID__); if (h_preset->init) { h_preset->text = "new_preset"; } - char *preset_name = ui_text_input(h_preset, tr("Name", NULL), UI_ALIGN_LEFT, true, false); - if (ui_icon_button(tr("OK", NULL), ICON_CHECK, UI_ALIGN_CENTER) || ui->is_return_down) { + char *preset_name = ui_text_input(h_preset, tr("Name"), UI_ALIGN_LEFT, true, false); + if (ui_icon_button(tr("OK"), ICON_CHECK, UI_ALIGN_CENTER) || ui->is_return_down) { box_export_new_preset(preset_name); box_export_fetch_presets(); gc_unroot(box_export_preset); @@ -260,7 +260,7 @@ void box_export_tab_presets_new_box() { void box_export_tab_presets() { bool tab_vertical = config_raw->touch_ui; - if (ui_tab(box_export_htab, tr("Presets", NULL), tab_vertical, -1, false)) { + if (ui_tab(box_export_htab, tr("Presets"), tab_vertical, -1, false)) { f32_array_t *row = f32_array_create_from_raw( (f32[]){ @@ -271,17 +271,17 @@ void box_export_tab_presets() { 3); ui_row(row); - ui_combo(box_export_hpreset, box_export_files, tr("Preset", NULL), false, UI_ALIGN_LEFT, true); + ui_combo(box_export_hpreset, box_export_files, tr("Preset"), false, UI_ALIGN_LEFT, true); if (box_export_hpreset->changed) { gc_unroot(box_export_preset); box_export_preset = NULL; } - if (ui_icon_button(tr("New", NULL), ICON_PLUS, UI_ALIGN_CENTER)) { + if (ui_icon_button(tr("New"), ICON_PLUS, UI_ALIGN_CENTER)) { ui_box_show_custom(&box_export_tab_presets_new_box, 400, 200, NULL, true, ""); } - if (ui_icon_button(tr("Import", NULL), ICON_IMPORT, UI_ALIGN_CENTER)) { + if (ui_icon_button(tr("Import"), ICON_IMPORT, UI_ALIGN_CENTER)) { ui_files_show("json", false, false, &box_export_tab_presets_import); } @@ -293,12 +293,12 @@ void box_export_tab_presets() { // Texture list ui_separator(10, false); ui_row6(); - ui_text(tr("Texture", NULL), UI_ALIGN_LEFT, 0x00000000); - ui_text(tr("R", NULL), UI_ALIGN_LEFT, 0x00000000); - ui_text(tr("G", NULL), UI_ALIGN_LEFT, 0x00000000); - ui_text(tr("B", NULL), UI_ALIGN_LEFT, 0x00000000); - ui_text(tr("A", NULL), UI_ALIGN_LEFT, 0x00000000); - ui_text(tr("Color Space", NULL), UI_ALIGN_LEFT, 0x00000000); + ui_text(tr("Texture"), UI_ALIGN_LEFT, 0x00000000); + ui_text(tr("R"), UI_ALIGN_LEFT, 0x00000000); + ui_text(tr("G"), UI_ALIGN_LEFT, 0x00000000); + ui_text(tr("B"), UI_ALIGN_LEFT, 0x00000000); + ui_text(tr("A"), UI_ALIGN_LEFT, 0x00000000); + ui_text(tr("Color Space"), UI_ALIGN_LEFT, 0x00000000); ui->changed = false; for (i32 i = 0; i < box_export_preset->textures->length; ++i) { export_preset_texture_t *t = box_export_preset->textures->buffer[i]; @@ -323,26 +323,26 @@ void box_export_tab_presets() { ui_handle_t *ha = ui_nest(htex, 3); ha->i = string_array_index_of(box_export_channels, t->channels->buffer[3]); - ui_combo(hr, box_export_channels, tr("R", NULL), false, UI_ALIGN_LEFT, true); + ui_combo(hr, box_export_channels, tr("R"), false, UI_ALIGN_LEFT, true); if (hr->changed) { t->channels->buffer[0] = box_export_channels->buffer[hr->i]; } - ui_combo(hg, box_export_channels, tr("G", NULL), false, UI_ALIGN_LEFT, true); + ui_combo(hg, box_export_channels, tr("G"), false, UI_ALIGN_LEFT, true); if (hg->changed) { t->channels->buffer[1] = box_export_channels->buffer[hg->i]; } - ui_combo(hb, box_export_channels, tr("B", NULL), false, UI_ALIGN_LEFT, true); + ui_combo(hb, box_export_channels, tr("B"), false, UI_ALIGN_LEFT, true); if (hb->changed) { t->channels->buffer[2] = box_export_channels->buffer[hb->i]; } - ui_combo(ha, box_export_channels, tr("A", NULL), false, UI_ALIGN_LEFT, true); + ui_combo(ha, box_export_channels, tr("A"), false, UI_ALIGN_LEFT, true); if (ha->changed) { t->channels->buffer[3] = box_export_channels->buffer[ha->i]; } ui_handle_t *hspace = ui_nest(htex, 4); hspace->i = string_array_index_of(box_export_color_spaces, t->color_space); - ui_combo(hspace, box_export_color_spaces, tr("Color Space", NULL), false, UI_ALIGN_LEFT, true); + ui_combo(hspace, box_export_color_spaces, tr("Color Space"), false, UI_ALIGN_LEFT, true); if (hspace->changed) { t->color_space = string_copy(box_export_color_spaces->buffer[hspace->i]); } @@ -358,7 +358,7 @@ void box_export_tab_presets() { }, 1); ui_row(row); - if (ui_icon_button(tr("Add", NULL), ICON_PLUS, UI_ALIGN_CENTER)) { + if (ui_icon_button(tr("Add"), ICON_PLUS, UI_ALIGN_CENTER)) { export_preset_texture_t *tex = GC_ALLOC_INIT(export_preset_texture_t, {.name = "base", .channels = any_array_create_from_raw( (void *[]){ @@ -378,7 +378,7 @@ void box_export_tab_presets() { void box_export_tab_atlases() { bool tab_vertical = config_raw->touch_ui; - if (ui_tab(box_export_htab, tr("Atlases", NULL), tab_vertical, -1, false)) { + if (ui_tab(box_export_htab, tr("Atlases"), tab_vertical, -1, false)) { if (project_atlas_objects == NULL || project_atlas_objects->length != project_paint_objects->length) { gc_unroot(project_atlas_objects); project_atlas_objects = i32_array_create_from_raw((i32[]){}, 0); @@ -389,7 +389,7 @@ void box_export_tab_atlases() { for (i32 i = 0; i < project_paint_objects->length; ++i) { i32_array_push(project_atlas_objects, 0); i32 i1 = i + 1; - any_array_push(project_atlas_names, string("%s %s", tr("Atlas", NULL), i32_to_string(i1))); + any_array_push(project_atlas_names, string("%s %s", tr("Atlas"), i32_to_string(i1))); } } for (i32 i = 0; i < project_paint_objects->length; ++i) { @@ -397,7 +397,7 @@ void box_export_tab_atlases() { ui_text(project_paint_objects->buffer[i]->base->name, UI_ALIGN_LEFT, 0x00000000); ui_handle_t *hatlas = ui_nest(ui_handle(__ID__), i); hatlas->i = project_atlas_objects->buffer[i]; - project_atlas_objects->buffer[i] = ui_combo(hatlas, project_atlas_names, tr("Atlas", NULL), false, UI_ALIGN_LEFT, true); + project_atlas_objects->buffer[i] = ui_combo(hatlas, project_atlas_names, tr("Atlas"), false, UI_ALIGN_LEFT, true); } } } @@ -409,7 +409,7 @@ void box_export_show_mesh_box() { void box_export_show_mesh() { box_export_mesh_handle->i = context_raw->export_mesh_index; - ui_box_show_custom(&box_export_show_mesh_box, 420, 260, NULL, true, tr("Export", NULL)); + ui_box_show_custom(&box_export_show_mesh_box, 420, 260, NULL, true, tr("Export")); } void box_export_tab_export_mesh_path_picked(char *path) { @@ -419,10 +419,10 @@ void box_export_tab_export_mesh_path_picked(char *path) { char *f = ui_files_filename; #endif if (string_equals(f, "")) { - f = string_copy(tr("untitled", NULL)); + f = string_copy(tr("untitled")); } #if defined(IRON_ANDROID) || defined(IRON_IOS) - console_toast(tr("Exporting mesh", NULL)); + console_toast(tr("Exporting mesh")); #endif mesh_object_t_array_t *paint_objects; @@ -442,7 +442,7 @@ void box_export_tab_export_mesh_path_picked(char *path) { void box_export_tab_export_mesh(ui_handle_t *htab) { bool tab_vertical = config_raw->touch_ui; - if (ui_tab(htab, tr("Export Mesh", NULL), tab_vertical, -1, false)) { + if (ui_tab(htab, tr("Export Mesh"), tab_vertical, -1, false)) { ui_row2(); @@ -456,26 +456,26 @@ void box_export_tab_export_mesh(ui_handle_t *htab) { "arm", }, 2); - context_raw->export_mesh_format = ui_combo(h_export_mesh_format, export_mesh_format_combo, tr("Format", NULL), true, UI_ALIGN_LEFT, true); + context_raw->export_mesh_format = ui_combo(h_export_mesh_format, export_mesh_format_combo, tr("Format"), true, UI_ALIGN_LEFT, true); string_t_array_t *ar = any_array_create_from_raw( (void *[]){ - tr("All", NULL), + tr("All"), }, 1); for (i32 i = 0; i < project_paint_objects->length; ++i) { mesh_object_t *p = project_paint_objects->buffer[i]; any_array_push(ar, p->base->name); } - ui_combo(box_export_mesh_handle, ar, tr("Meshes", NULL), true, UI_ALIGN_LEFT, true); + ui_combo(box_export_mesh_handle, ar, tr("Meshes"), true, UI_ALIGN_LEFT, true); - bool apply_displacement = ui_check(ui_handle(__ID__), tr("Apply Displacement", NULL), ""); + bool apply_displacement = ui_check(ui_handle(__ID__), tr("Apply Displacement"), ""); ui_handle_t *hmerge = ui_handle(__ID__); if (hmerge->init) { hmerge->b = true; } - bool merge_vertices = ui_check(hmerge, tr("Merge Shared Vertices", NULL), ""); + bool merge_vertices = ui_check(hmerge, tr("Merge Shared Vertices"), ""); i32 tris = 0; i32 pos = box_export_mesh_handle->i; @@ -495,13 +495,13 @@ void box_export_tab_export_mesh(ui_handle_t *htab) { mesh_object_t *po = paint_objects->buffer[i]; tris += math_floor(po->data->index_array->length / (float)3); } - ui_text(string("%s %s", i32_to_string(tris), tr("triangles", NULL)), UI_ALIGN_LEFT, 0x00000000); + ui_text(string("%s %s", i32_to_string(tris), tr("triangles")), UI_ALIGN_LEFT, 0x00000000); ui_row2(); - if (ui_icon_button(tr("Cancel", NULL), ICON_CLOSE, UI_ALIGN_CENTER)) { + if (ui_icon_button(tr("Cancel"), ICON_CLOSE, UI_ALIGN_CENTER)) { ui_box_hide(); } - if (ui_icon_button(tr("Export", NULL), ICON_CHECK, UI_ALIGN_CENTER)) { + if (ui_icon_button(tr("Export"), ICON_CHECK, UI_ALIGN_CENTER)) { ui_box_hide(); _box_export_apply_displacement = apply_displacement; _box_export_merge_vertices = merge_vertices; @@ -517,7 +517,7 @@ void box_export_show_material_export_on_next_frame(char *path) { void box_export_show_material_export(char *path) { char *f = ui_files_filename; if (string_equals(f, "")) { - f = string_copy(tr("untitled", NULL)); + f = string_copy(tr("untitled")); } sys_notify_on_next_frame(&box_export_show_material_export_on_next_frame, string("%s%s%s", path, PATH_SEP, f)); } @@ -525,18 +525,18 @@ void box_export_show_material_export(char *path) { void box_export_show_material_box() { ui_handle_t *htab = ui_handle(__ID__); bool tab_vertical = config_raw->touch_ui; - if (ui_tab(htab, tr("Export Material", NULL), tab_vertical, -1, false)) { + if (ui_tab(htab, tr("Export Material"), tab_vertical, -1, false)) { ui_handle_t *h1 = ui_handle(__ID__); ui_handle_t *h2 = ui_handle(__ID__); h1->b = context_raw->pack_assets_on_export; h2->b = context_raw->write_icon_on_export; - context_raw->pack_assets_on_export = ui_check(h1, tr("Pack Assets", NULL), ""); - context_raw->write_icon_on_export = ui_check(h2, tr("Export Icon", NULL), ""); + context_raw->pack_assets_on_export = ui_check(h1, tr("Pack Assets"), ""); + context_raw->write_icon_on_export = ui_check(h2, tr("Export Icon"), ""); ui_row2(); - if (ui_icon_button(tr("Cancel", NULL), ICON_CLOSE, UI_ALIGN_CENTER)) { + if (ui_icon_button(tr("Cancel"), ICON_CLOSE, UI_ALIGN_CENTER)) { ui_box_hide(); } - if (ui_icon_button(tr("Export", NULL), ICON_CHECK, UI_ALIGN_CENTER)) { + if (ui_icon_button(tr("Export"), ICON_CHECK, UI_ALIGN_CENTER)) { ui_box_hide(); ui_files_show("arm", true, false, &box_export_show_material_export); } @@ -554,25 +554,25 @@ void box_export_show_brush_export_on_next_frame(char *path) { void box_export_show_brush_export(char *path) { char *f = ui_files_filename; if (string_equals(f, "")) - f = string_copy(tr("untitled", NULL)); + f = string_copy(tr("untitled")); sys_notify_on_next_frame(&box_export_show_brush_export_on_next_frame, string("%s%s%s", path, PATH_SEP, f)); } void box_export_show_brush_box() { ui_handle_t *htab = ui_handle(__ID__); bool tab_vertical = config_raw->touch_ui; - if (ui_tab(htab, tr("Export Brush", NULL), tab_vertical, -1, false)) { + if (ui_tab(htab, tr("Export Brush"), tab_vertical, -1, false)) { ui_handle_t *h1 = ui_handle(__ID__); ui_handle_t *h2 = ui_handle(__ID__); h1->b = context_raw->pack_assets_on_export; h2->b = context_raw->write_icon_on_export; - context_raw->pack_assets_on_export = ui_check(h1, tr("Pack Assets", NULL), ""); - context_raw->write_icon_on_export = ui_check(h2, tr("Export Icon", NULL), ""); + context_raw->pack_assets_on_export = ui_check(h1, tr("Pack Assets"), ""); + context_raw->write_icon_on_export = ui_check(h2, tr("Export Icon"), ""); ui_row2(); - if (ui_icon_button(tr("Cancel", NULL), ICON_CLOSE, UI_ALIGN_CENTER)) { + if (ui_icon_button(tr("Cancel"), ICON_CLOSE, UI_ALIGN_CENTER)) { ui_box_hide(); } - if (ui_icon_button(tr("Export", NULL), ICON_CHECK, UI_ALIGN_CENTER)) { + if (ui_icon_button(tr("Export"), ICON_CHECK, UI_ALIGN_CENTER)) { ui_box_hide(); ui_files_show("arm", true, false, &box_export_show_brush_export); } diff --git a/paint/sources/box_preferences.c b/paint/sources/box_preferences.c index 1c570b54..989f3a21 100644 --- a/paint/sources/box_preferences.c +++ b/paint/sources/box_preferences.c @@ -2,7 +2,7 @@ #include "global.h" void box_preferences_interface_tab_reset_layout_menu() { - if (ui_menu_button(tr("Confirm", NULL), "", ICON_CHECK)) { + if (ui_menu_button(tr("Confirm"), "", ICON_CHECK)) { config_init_layout(); config_save(); } @@ -42,10 +42,10 @@ void box_preferences_interface_tab_restore_menu_confirm(void *_) { } void box_preferences_interface_tab_restore_menu() { - if (ui_menu_button(tr("Confirm", NULL), "", ICON_CHECK)) { + if (ui_menu_button(tr("Confirm"), "", ICON_CHECK)) { sys_notify_on_next_frame(&box_preferences_interface_tab_restore_menu_confirm, NULL); } - if (ui_menu_button(tr("Import...", NULL), "", ICON_IMPORT)) { + if (ui_menu_button(tr("Import..."), "", ICON_IMPORT)) { ui_files_show("json", false, false, &box_preferences_interface_tab_restore_menu_import); } } @@ -59,7 +59,7 @@ void box_preferences_interface_tab() { ui_handle_t *h_locale = ui_handle(__ID__); h_locale->i = string_array_index_of(box_preferences_locales, config_raw->locale); - ui_combo(h_locale, box_preferences_locales, tr("Language", NULL), true, UI_ALIGN_LEFT, true); + ui_combo(h_locale, box_preferences_locales, tr("Language"), true, UI_ALIGN_LEFT, true); if (h_locale->changed) { char *locale_code = box_preferences_locales->buffer[h_locale->i]; config_raw->locale = string_copy(locale_code); @@ -71,7 +71,7 @@ void box_preferences_interface_tab() { if (h_scale->init) { h_scale->f = config_raw->window_scale; } - ui_slider(h_scale, tr("UI Scale", NULL), 1.0, 4.0, true, 10, true, UI_ALIGN_RIGHT, true); + ui_slider(h_scale, tr("UI Scale"), 1.0, 4.0, true, 10, true, UI_ALIGN_RIGHT, true); if (context_raw->hscale_was_changed && !ui->input_down) { context_raw->hscale_was_changed = false; if (h_scale->f == 0.0) { @@ -86,7 +86,7 @@ void box_preferences_interface_tab() { ui_handle_t *h_node_previews = ui_handle(__ID__); h_node_previews->b = config_raw->node_previews; - config_raw->node_previews = ui_check(h_node_previews, tr("Node Previews", NULL), ""); + config_raw->node_previews = ui_check(h_node_previews, tr("Node Previews"), ""); if (h_node_previews->changed) { for (i32 i = 0; i < project_materials->length; ++i) { ui_node_canvas_t *c = project_materials->buffer[i]->canvas; @@ -103,20 +103,20 @@ void box_preferences_interface_tab() { ui_nodes_hwnd->redraws = 2; } if (ui->is_hovered) { - ui_tooltip(tr("Show node preview on each node by default", NULL)); + ui_tooltip(tr("Show node preview on each node by default")); } ui_handle_t *h_wrap_mouse = ui_handle(__ID__); h_wrap_mouse->b = config_raw->wrap_mouse; - config_raw->wrap_mouse = ui_check(h_wrap_mouse, tr("Wrap Mouse", NULL), ""); + config_raw->wrap_mouse = ui_check(h_wrap_mouse, tr("Wrap Mouse"), ""); if (ui->is_hovered) { - ui_tooltip(tr("Wrap mouse around view boundaries during camera control", NULL)); + ui_tooltip(tr("Wrap mouse around view boundaries during camera control")); } ui->changed = false; ui_handle_t *h_show_asset_names = ui_handle(__ID__); h_show_asset_names->b = config_raw->show_asset_names; - config_raw->show_asset_names = ui_check(h_show_asset_names, tr("Show Asset Names", NULL), ""); + config_raw->show_asset_names = ui_check(h_show_asset_names, tr("Show Asset Names"), ""); if (ui->changed) { base_redraw_ui(); } @@ -124,7 +124,7 @@ void box_preferences_interface_tab() { ui->changed = false; ui_handle_t *h_touch_ui = ui_handle(__ID__); h_touch_ui->b = config_raw->touch_ui; - config_raw->touch_ui = ui_check(h_touch_ui, tr("Touch UI", NULL), ""); + config_raw->touch_ui = ui_check(h_touch_ui, tr("Touch UI"), ""); if (ui->changed) { ui_touch_control = config_raw->touch_ui; config_load_theme(config_raw->theme, true); @@ -135,24 +135,24 @@ void box_preferences_interface_tab() { ui_handle_t *h_splash_screen = ui_handle(__ID__); h_splash_screen->b = config_raw->splash_screen; - config_raw->splash_screen = ui_check(h_splash_screen, tr("Splash Screen", NULL), ""); + config_raw->splash_screen = ui_check(h_splash_screen, tr("Splash Screen"), ""); ui_handle_t *h_grid_snap = ui_handle(__ID__); h_grid_snap->b = config_raw->grid_snap; - config_raw->grid_snap = ui_check(h_grid_snap, tr("Grid Snap", NULL), ""); + config_raw->grid_snap = ui_check(h_grid_snap, tr("Grid Snap"), ""); ui_nodes_grid_snap = config_raw->grid_snap; ui_handle_t *h_experimental = ui_handle(__ID__); h_experimental->b = config_raw->experimental; - config_raw->experimental = ui_check(h_experimental, tr("Experimental Features", NULL), ""); + config_raw->experimental = ui_check(h_experimental, tr("Experimental Features"), ""); ui_end_element(); ui_row2(); - if (ui_icon_button(tr("Restore", NULL), ICON_REPLAY, UI_ALIGN_CENTER) && !ui_menu_show) { + if (ui_icon_button(tr("Restore"), ICON_REPLAY, UI_ALIGN_CENTER) && !ui_menu_show) { ui_menu_draw(&box_preferences_interface_tab_restore_menu, -1, -1); } - if (ui_button(tr("Reset Layout", NULL), UI_ALIGN_CENTER, "") && !ui_menu_show) { + if (ui_button(tr("Reset Layout"), UI_ALIGN_CENTER, "") && !ui_menu_show) { ui_menu_draw(&box_preferences_interface_tab_reset_layout_menu, -1, -1); } } @@ -185,8 +185,8 @@ void box_preferences_theme_tab_new_box() { if (h->init) { h->text = "new_theme"; } - char *theme_name = ui_text_input(h, tr("Name", NULL), UI_ALIGN_LEFT, true, false); - if (ui_icon_button(tr("OK", NULL), ICON_CHECK, UI_ALIGN_CENTER) || ui->is_return_down) { + char *theme_name = ui_text_input(h, tr("Name"), UI_ALIGN_LEFT, true, false); + if (ui_icon_button(tr("OK"), ICON_CHECK, UI_ALIGN_CENTER) || ui->is_return_down) { char *template = box_preferences_theme_to_json(base_theme); if (!ends_with(theme_name, ".json")) { theme_name = string("%s.json", theme_name); @@ -214,21 +214,21 @@ void box_preferences_theme_tab() { box_preferences_h_theme = ui_handle(__ID__); gc_root(box_preferences_h_theme); box_preferences_h_theme->i = box_preferences_get_theme_index(); - ui_combo(box_preferences_h_theme, box_preferences_themes, tr("Theme", NULL), false, UI_ALIGN_LEFT, true); + ui_combo(box_preferences_h_theme, box_preferences_themes, tr("Theme"), false, UI_ALIGN_LEFT, true); if (box_preferences_h_theme->changed) { config_raw->theme = string("%s.json", box_preferences_themes->buffer[box_preferences_h_theme->i]); config_load_theme(config_raw->theme, true); } - if (ui_icon_button(tr("New", NULL), ICON_PLUS, UI_ALIGN_CENTER)) { - ui_box_show_custom(&box_preferences_theme_tab_new_box, 400, 200, NULL, true, tr("New Theme", NULL)); + if (ui_icon_button(tr("New"), ICON_PLUS, UI_ALIGN_CENTER)) { + ui_box_show_custom(&box_preferences_theme_tab_new_box, 400, 200, NULL, true, tr("New Theme")); } - if (ui_icon_button(tr("Import", NULL), ICON_IMPORT, UI_ALIGN_CENTER)) { + if (ui_icon_button(tr("Import"), ICON_IMPORT, UI_ALIGN_CENTER)) { ui_files_show("json", false, false, &box_preferences_theme_tab_import); } - if (ui_icon_button(tr("Export", NULL), ICON_EXPORT, UI_ALIGN_CENTER)) { + if (ui_icon_button(tr("Export"), ICON_EXPORT, UI_ALIGN_CENTER)) { ui_files_show("json", true, false, &box_preferences_theme_tab_export); } @@ -278,8 +278,8 @@ void box_preferences_theme_tab() { else if (string_equals(key, "LINK_STYLE")) { string_t_array_t *styles = any_array_create_from_raw( (void *[]){ - tr("Straight", NULL), - tr("Curved", NULL), + tr("Straight"), + tr("Curved"), }, 2); h->i = val; @@ -306,7 +306,7 @@ void box_preferences_theme_tab() { void box_preferences_usage_tab() { ui_handle_t *h_undo = ui_handle(__ID__); h_undo->f = config_raw->undo_steps; - config_raw->undo_steps = ui_slider(h_undo, tr("Undo Steps", NULL), 1, 64, false, 1, true, UI_ALIGN_RIGHT, true); + config_raw->undo_steps = ui_slider(h_undo, tr("Undo Steps"), 1, 64, false, 1, true, UI_ALIGN_RIGHT, true); if (config_raw->undo_steps < 1) { config_raw->undo_steps = h_undo->f = 1; } @@ -332,55 +332,55 @@ void box_preferences_usage_tab() { ui_handle_t *h_dilate_radius = ui_handle(__ID__); h_dilate_radius->f = config_raw->dilate_radius; - config_raw->dilate_radius = ui_slider(h_dilate_radius, tr("Dilate Radius", NULL), 0.0, 16.0, true, 1, true, UI_ALIGN_RIGHT, true); + config_raw->dilate_radius = ui_slider(h_dilate_radius, tr("Dilate Radius"), 0.0, 16.0, true, 1, true, UI_ALIGN_RIGHT, true); if (ui->is_hovered) { - ui_tooltip(tr("Dilate painted textures to prevent seams", NULL)); + ui_tooltip(tr("Dilate painted textures to prevent seams")); } ui_handle_t *h_camera_controls = ui_handle(__ID__); h_camera_controls->i = config_raw->camera_controls; string_t_array_t *camera_controls_combo = any_array_create_from_raw( (void *[]){ - tr("Orbit", NULL), - tr("Rotate", NULL), - tr("Fly", NULL), + tr("Orbit"), + tr("Rotate"), + tr("Fly"), }, 3); - config_raw->camera_controls = ui_combo(h_camera_controls, camera_controls_combo, tr("Default Camera Controls", NULL), true, UI_ALIGN_LEFT, true); + config_raw->camera_controls = ui_combo(h_camera_controls, camera_controls_combo, tr("Default Camera Controls"), true, UI_ALIGN_LEFT, true); ui_handle_t *h_fov = ui_handle(__ID__); h_fov->f = config_raw->camera_fov; - config_raw->camera_fov = ui_slider(h_fov, tr("Default Camera FoV", NULL), 0.3, 1.4, true, 100.0, true, UI_ALIGN_RIGHT, true); + config_raw->camera_fov = ui_slider(h_fov, tr("Default Camera FoV"), 0.3, 1.4, true, 100.0, true, UI_ALIGN_RIGHT, true); ui_handle_t *h_speed = ui_handle(__ID__); h_speed->f = config_raw->camera_zoom_speed; - config_raw->camera_zoom_speed = ui_slider(h_speed, tr("Camera Zoom Speed", NULL), 0.1, 4.0, true, 100.0, true, UI_ALIGN_RIGHT, true); + config_raw->camera_zoom_speed = ui_slider(h_speed, tr("Camera Zoom Speed"), 0.1, 4.0, true, 100.0, true, UI_ALIGN_RIGHT, true); h_speed = ui_handle(__ID__); h_speed->f = config_raw->camera_rotation_speed; - config_raw->camera_rotation_speed = ui_slider(h_speed, tr("Camera Rotation Speed", NULL), 0.1, 4.0, true, 100.0, true, UI_ALIGN_RIGHT, true); + config_raw->camera_rotation_speed = ui_slider(h_speed, tr("Camera Rotation Speed"), 0.1, 4.0, true, 100.0, true, UI_ALIGN_RIGHT, true); h_speed = ui_handle(__ID__); h_speed->f = config_raw->camera_pan_speed; - config_raw->camera_pan_speed = ui_slider(h_speed, tr("Camera Pan Speed", NULL), 0.1, 4.0, true, 100.0, true, UI_ALIGN_RIGHT, true); + config_raw->camera_pan_speed = ui_slider(h_speed, tr("Camera Pan Speed"), 0.1, 4.0, true, 100.0, true, UI_ALIGN_RIGHT, true); ui_handle_t *h_upside_down = ui_handle(__ID__); h_upside_down->b = config_raw->camera_upside_down; - config_raw->camera_upside_down = ui_check(h_upside_down, tr("Allow Upside Down Camera", NULL), ""); + config_raw->camera_upside_down = ui_check(h_upside_down, tr("Allow Upside Down Camera"), ""); ui_handle_t *h_zoom_direction = ui_handle(__ID__); h_zoom_direction->i = config_raw->zoom_direction; string_t_array_t *zoom_direction_combo = any_array_create_from_raw( (void *[]){ - tr("Vertical", NULL), - tr("Vertical Inverted", NULL), - tr("Horizontal", NULL), - tr("Horizontal Inverted", NULL), - tr("Vertical and Horizontal", NULL), - tr("Vertical and Horizontal Inverted", NULL), + tr("Vertical"), + tr("Vertical Inverted"), + tr("Horizontal"), + tr("Horizontal Inverted"), + tr("Vertical and Horizontal"), + tr("Vertical and Horizontal Inverted"), }, 6); - config_raw->zoom_direction = ui_combo(h_zoom_direction, zoom_direction_combo, tr("Direction to Zoom", NULL), true, UI_ALIGN_LEFT, true); + config_raw->zoom_direction = ui_combo(h_zoom_direction, zoom_direction_combo, tr("Direction to Zoom"), true, UI_ALIGN_LEFT, true); ui_handle_t *h_layer_res = ui_handle(__ID__); h_layer_res->i = config_raw->layer_res; @@ -409,28 +409,28 @@ void box_preferences_usage_tab() { }, 8); #endif - config_raw->layer_res = ui_combo(h_layer_res, res_combo, tr("Default Layer Resolution", NULL), true, UI_ALIGN_LEFT, true); + config_raw->layer_res = ui_combo(h_layer_res, res_combo, tr("Default Layer Resolution"), true, UI_ALIGN_LEFT, true); ui_handle_t *h_scene_atlas_res = ui_handle(__ID__); h_scene_atlas_res->i = config_raw->scene_atlas_res; - config_raw->scene_atlas_res = ui_combo(h_scene_atlas_res, res_combo, tr("Scene Atlas Resolution", NULL), true, UI_ALIGN_LEFT, true); + config_raw->scene_atlas_res = ui_combo(h_scene_atlas_res, res_combo, tr("Scene Atlas Resolution"), true, UI_ALIGN_LEFT, true); ui_handle_t *h_server = ui_handle(__ID__); h_server->text = string_copy(config_raw->server); - config_raw->server = string_copy(ui_text_input(h_server, tr("Cloud Server", NULL), UI_ALIGN_LEFT, true, false)); + config_raw->server = string_copy(ui_text_input(h_server, tr("Cloud Server"), UI_ALIGN_LEFT, true, false)); ui_handle_t *h_material_live = ui_handle(__ID__); h_material_live->b = config_raw->material_live; - config_raw->material_live = ui_check(h_material_live, tr("Live Material Preview", NULL), ""); + config_raw->material_live = ui_check(h_material_live, tr("Live Material Preview"), ""); if (ui->is_hovered) { - ui_tooltip(tr("Instantly update material preview on node change", NULL)); + ui_tooltip(tr("Instantly update material preview on node change")); } ui_handle_t *h_brush_live = ui_handle(__ID__); h_brush_live->b = config_raw->brush_live; - config_raw->brush_live = ui_check(h_brush_live, tr("Live Brush Preview", NULL), ""); + config_raw->brush_live = ui_check(h_brush_live, tr("Live Brush Preview"), ""); if (ui->is_hovered) { - ui_tooltip(tr("Draw live brush preview in viewport", NULL)); + ui_tooltip(tr("Draw live brush preview in viewport")); } if (h_brush_live->changed) { context_raw->ddirty = 2; @@ -438,7 +438,7 @@ void box_preferences_usage_tab() { ui_handle_t *h_brush_depth_reject = ui_handle(__ID__); h_brush_depth_reject->b = config_raw->brush_depth_reject; - config_raw->brush_depth_reject = ui_check(h_brush_depth_reject, tr("Depth Reject", NULL), ""); + config_raw->brush_depth_reject = ui_check(h_brush_depth_reject, tr("Depth Reject"), ""); if (h_brush_depth_reject->changed) { make_material_parse_paint_material(true); } @@ -447,7 +447,7 @@ void box_preferences_usage_tab() { ui_handle_t *h_brush_angle_reject = ui_handle(__ID__); h_brush_angle_reject->b = config_raw->brush_angle_reject; - config_raw->brush_angle_reject = ui_check(h_brush_angle_reject, tr("Angle Reject", NULL), ""); + config_raw->brush_angle_reject = ui_check(h_brush_angle_reject, tr("Angle Reject"), ""); if (h_brush_angle_reject->changed) { make_material_parse_paint_material(true); } @@ -458,7 +458,7 @@ void box_preferences_usage_tab() { ui_handle_t *h_angle_dot = ui_handle(__ID__); h_angle_dot->f = context_raw->brush_angle_reject_dot; - context_raw->brush_angle_reject_dot = ui_slider(h_angle_dot, tr("Angle", NULL), 0.0, 1.0, true, 100.0, true, UI_ALIGN_RIGHT, true); + context_raw->brush_angle_reject_dot = ui_slider(h_angle_dot, tr("Angle"), 0.0, 1.0, true, 100.0, true, UI_ALIGN_RIGHT, true); if (h_angle_dot->changed) { make_material_parse_paint_material(true); } @@ -467,33 +467,33 @@ void box_preferences_usage_tab() { ui_handle_t *h_alpha_discard = ui_handle(__ID__); h_alpha_discard->f = config_raw->brush_alpha_discard; - config_raw->brush_alpha_discard = ui_slider(h_alpha_discard, tr("Alpha Discard", NULL), 0.0, 1.0, true, 100.0, true, UI_ALIGN_RIGHT, true); + config_raw->brush_alpha_discard = ui_slider(h_alpha_discard, tr("Alpha Discard"), 0.0, 1.0, true, 100.0, true, UI_ALIGN_RIGHT, true); if (h_alpha_discard->changed) { make_material_parse_paint_material(true); } } void box_preferences_pen_tab() { - ui_text(tr("Pressure controls", NULL), UI_ALIGN_LEFT, 0x00000000); + ui_text(tr("Pressure controls"), UI_ALIGN_LEFT, 0x00000000); ui_handle_t *h_pressure_radius = ui_handle(__ID__); h_pressure_radius->b = config_raw->pressure_radius; - config_raw->pressure_radius = ui_check(h_pressure_radius, tr("Brush Radius", NULL), ""); + config_raw->pressure_radius = ui_check(h_pressure_radius, tr("Brush Radius"), ""); ui_handle_t *h_pressure_sensitivity = ui_handle(__ID__); h_pressure_sensitivity->f = config_raw->pressure_sensitivity; - config_raw->pressure_sensitivity = ui_slider(h_pressure_sensitivity, tr("Sensitivity", NULL), 0.0, 10.0, true, 100.0, true, UI_ALIGN_RIGHT, true); + config_raw->pressure_sensitivity = ui_slider(h_pressure_sensitivity, tr("Sensitivity"), 0.0, 10.0, true, 100.0, true, UI_ALIGN_RIGHT, true); ui_handle_t *h_pressure_hardness = ui_handle(__ID__); h_pressure_hardness->b = config_raw->pressure_hardness; - config_raw->pressure_hardness = ui_check(h_pressure_hardness, tr("Brush Hardness", NULL), ""); + config_raw->pressure_hardness = ui_check(h_pressure_hardness, tr("Brush Hardness"), ""); ui_handle_t *h_pressure_opacity = ui_handle(__ID__); h_pressure_opacity->b = config_raw->pressure_opacity; - config_raw->pressure_opacity = ui_check(h_pressure_opacity, tr("Brush Opacity", NULL), ""); + config_raw->pressure_opacity = ui_check(h_pressure_opacity, tr("Brush Opacity"), ""); ui_handle_t *h_pressure_angle = ui_handle(__ID__); h_pressure_angle->b = config_raw->pressure_angle; - config_raw->pressure_angle = ui_check(h_pressure_angle, tr("Brush Angle", NULL), ""); + config_raw->pressure_angle = ui_check(h_pressure_angle, tr("Brush Angle"), ""); ui_end_element(); f32_array_t *row = f32_array_create_from_raw( @@ -502,7 +502,7 @@ void box_preferences_pen_tab() { }, 1); ui_row(row); - if (ui_icon_button(tr("Help", NULL), ICON_LINK, UI_ALIGN_CENTER)) { + if (ui_icon_button(tr("Help"), ICON_LINK, UI_ALIGN_CENTER)) { char *url = "https://github.com/armory3d/"; char *name = to_lower_case(manifest_title); url = string("%s%s_docs#pen", url, name); @@ -515,11 +515,11 @@ void box_preferences_viewport_tab() { h_mode->i = config_raw->viewport_mode; string_t_array_t *mode_combo = any_array_create_from_raw( (void *[]){ - tr("Lit", NULL), - tr("Path Traced", NULL), + tr("Lit"), + tr("Path Traced"), }, 2); - ui_combo(h_mode, mode_combo, tr("Default Mode", NULL), true, UI_ALIGN_LEFT, true); + ui_combo(h_mode, mode_combo, tr("Default Mode"), true, UI_ALIGN_LEFT, true); if (h_mode->changed) { config_raw->viewport_mode = h_mode->i; } @@ -528,11 +528,11 @@ void box_preferences_viewport_tab() { h_pathtrace_mode->i = config_raw->pathtrace_mode; string_t_array_t *pathtrace_mode_combo = any_array_create_from_raw( (void *[]){ - tr("Fast", NULL), - tr("Quality", NULL), + tr("Fast"), + tr("Quality"), }, 2); - config_raw->pathtrace_mode = ui_combo(h_pathtrace_mode, pathtrace_mode_combo, tr("Path Tracer", NULL), true, UI_ALIGN_LEFT, true); + config_raw->pathtrace_mode = ui_combo(h_pathtrace_mode, pathtrace_mode_combo, tr("Path Tracer"), true, UI_ALIGN_LEFT, true); if (h_pathtrace_mode->changed) { render_path_raytrace_ready = false; render_path_raytrace_init_shader = true; @@ -543,11 +543,11 @@ void box_preferences_viewport_tab() { h_render_mode->i = config_raw->render_mode; string_t_array_t *render_mode_combo = any_array_create_from_raw( (void *[]){ - tr("Desktop", NULL), - tr("Mobile", NULL), + tr("Desktop"), + tr("Mobile"), }, 2); - config_raw->render_mode = ui_combo(h_render_mode, render_mode_combo, tr("Renderer", NULL), true, UI_ALIGN_LEFT, true); + config_raw->render_mode = ui_combo(h_render_mode, render_mode_combo, tr("Renderer"), true, UI_ALIGN_LEFT, true); if (h_render_mode->changed) { context_set_render_path(); } @@ -564,7 +564,7 @@ void box_preferences_viewport_tab() { "4.0x", }, 6); - ui_combo(h_supersample, supersample_combo, tr("Super Sample", NULL), true, UI_ALIGN_LEFT, true); + ui_combo(h_supersample, supersample_combo, tr("Super Sample"), true, UI_ALIGN_LEFT, true); if (h_supersample->changed) { config_raw->rp_supersample = config_get_super_sample_size(h_supersample->i); config_apply(); @@ -573,14 +573,14 @@ void box_preferences_viewport_tab() { if (config_raw->render_mode == RENDER_MODE_DEFERRED) { ui_handle_t *h_ssao = ui_handle(__ID__); h_ssao->b = config_raw->rp_ssao; - config_raw->rp_ssao = ui_check(h_ssao, tr("SSAO", NULL), ""); + config_raw->rp_ssao = ui_check(h_ssao, tr("SSAO"), ""); if (h_ssao->changed) { config_apply(); } ui_handle_t *h_bloom = ui_handle(__ID__); h_bloom->b = config_raw->rp_bloom; - config_raw->rp_bloom = ui_check(h_bloom, tr("Bloom", NULL), ""); + config_raw->rp_bloom = ui_check(h_bloom, tr("Bloom"), ""); if (h_bloom->changed) { config_apply(); } @@ -588,14 +588,14 @@ void box_preferences_viewport_tab() { ui_handle_t *h_vignette = ui_handle(__ID__); h_vignette->f = config_raw->rp_vignette; - config_raw->rp_vignette = ui_slider(h_vignette, tr("Vignette", NULL), 0.0, 1.0, true, 100.0, true, UI_ALIGN_RIGHT, true); + config_raw->rp_vignette = ui_slider(h_vignette, tr("Vignette"), 0.0, 1.0, true, 100.0, true, UI_ALIGN_RIGHT, true); if (h_vignette->changed) { context_raw->ddirty = 2; } ui_handle_t *h_noise_grain = ui_handle(__ID__); h_noise_grain->f = config_raw->rp_grain; - config_raw->rp_grain = ui_slider(h_noise_grain, tr("Noise Grain", NULL), 0.0, 1.0, true, 100.0, true, UI_ALIGN_RIGHT, true); + config_raw->rp_grain = ui_slider(h_noise_grain, tr("Noise Grain"), 0.0, 1.0, true, 100.0, true, UI_ALIGN_RIGHT, true); if (h_noise_grain->changed) { context_raw->ddirty = 2; } @@ -606,15 +606,15 @@ void box_preferences_viewport_tab() { ui_handle_t *h_far = ui_handle(__ID__); h_near->f = math_floor(cam_raw->near_plane * 1000) / (float)1000; h_far->f = math_floor(cam_raw->far_plane * 100) / (float)100; - cam_raw->near_plane = ui_slider(h_near, tr("Clip Start", NULL), 0.001, 1.0, true, 100.0, true, UI_ALIGN_RIGHT, true); - cam_raw->far_plane = ui_slider(h_far, tr("Clip End", NULL), 50.0, 100.0, true, 100.0, true, UI_ALIGN_RIGHT, true); + cam_raw->near_plane = ui_slider(h_near, tr("Clip Start"), 0.001, 1.0, true, 100.0, true, UI_ALIGN_RIGHT, true); + cam_raw->far_plane = ui_slider(h_far, tr("Clip End"), 50.0, 100.0, true, 100.0, true, UI_ALIGN_RIGHT, true); if (h_near->changed || h_far->changed) { camera_object_build_proj(cam, -1.0); } ui_handle_t *h_disp = ui_handle(__ID__); h_disp->f = config_raw->displace_strength; - config_raw->displace_strength = ui_slider(h_disp, tr("Displacement Strength", NULL), 0.0, 10.0, true, 100.0, true, UI_ALIGN_RIGHT, true); + config_raw->displace_strength = ui_slider(h_disp, tr("Displacement Strength"), 0.0, 10.0, true, 100.0, true, UI_ALIGN_RIGHT, true); if (h_disp->changed) { context_raw->ddirty = 2; make_material_parse_mesh_material(); @@ -641,8 +641,8 @@ void box_preferences_keymap_tab_new_box() { if (h->init) { h->text = "new_keymap"; } - char *keymap_name = ui_text_input(h, tr("Name", NULL), UI_ALIGN_LEFT, true, false); - if (ui_icon_button(tr("OK", NULL), ICON_CHECK, UI_ALIGN_CENTER) || ui->is_return_down) { + char *keymap_name = ui_text_input(h, tr("Name"), UI_ALIGN_LEFT, true, false); + if (ui_icon_button(tr("OK"), ICON_CHECK, UI_ALIGN_CENTER) || ui->is_return_down) { char *template = keymap_to_json(keymap_get_default()); if (!ends_with(keymap_name, ".json")) { keymap_name = string("%s.json", keymap_name); @@ -670,22 +670,22 @@ void box_preferences_keymap_tab() { box_preferences_h_preset = ui_handle(__ID__); gc_root(box_preferences_h_preset); box_preferences_h_preset->i = box_preferences_get_preset_index(); - ui_combo(box_preferences_h_preset, box_preferences_files_keymap, tr("Preset", NULL), false, UI_ALIGN_LEFT, true); + ui_combo(box_preferences_h_preset, box_preferences_files_keymap, tr("Preset"), false, UI_ALIGN_LEFT, true); if (box_preferences_h_preset->changed) { config_raw->keymap = string("%s.json", box_preferences_files_keymap->buffer[box_preferences_h_preset->i]); config_apply(); keymap_load(); } - if (ui_icon_button(tr("New", NULL), ICON_PLUS, UI_ALIGN_CENTER)) { - ui_box_show_custom(&box_preferences_keymap_tab_new_box, 400, 200, NULL, true, tr("New Keymap", NULL)); + if (ui_icon_button(tr("New"), ICON_PLUS, UI_ALIGN_CENTER)) { + ui_box_show_custom(&box_preferences_keymap_tab_new_box, 400, 200, NULL, true, tr("New Keymap")); } - if (ui_icon_button(tr("Import", NULL), ICON_IMPORT, UI_ALIGN_CENTER)) { + if (ui_icon_button(tr("Import"), ICON_IMPORT, UI_ALIGN_CENTER)) { ui_files_show("json", false, false, &box_preferences_keymap_tab_import); } - if (ui_icon_button(tr("Export", NULL), ICON_EXPORT, UI_ALIGN_CENTER)) { + if (ui_icon_button(tr("Export"), ICON_EXPORT, UI_ALIGN_CENTER)) { ui_files_show("json", true, false, &box_preferences_keymap_tab_export); } @@ -711,7 +711,7 @@ void box_preferences_keymap_tab() { } void box_preferences_neural_tab() { - ui_text(tr("All processing is done locally on device", NULL), UI_ALIGN_LEFT, 0x00000000); + ui_text(tr("All processing is done locally on device"), UI_ALIGN_LEFT, 0x00000000); ui_handle_t *h_inference = ui_handle(__ID__); h_inference->i = config_raw->neural_backend; #ifdef IRON_WINDOWS @@ -730,12 +730,12 @@ void box_preferences_neural_tab() { }, 2); #endif - config_raw->neural_backend = ui_combo(h_inference, inference_combo, tr("Inference Backend", NULL), true, UI_ALIGN_LEFT, true); + config_raw->neural_backend = ui_combo(h_inference, inference_combo, tr("Inference Backend"), true, UI_ALIGN_LEFT, true); if (ui->is_hovered) { - ui_tooltip(tr("Backend for neural node processing", NULL)); + ui_tooltip(tr("Backend for neural node processing")); } - ui_text(tr("Models", NULL), UI_ALIGN_LEFT, 0x00000000); + ui_text(tr("Models"), UI_ALIGN_LEFT, 0x00000000); if (neural_node_models == NULL) { neural_node_models_init(); @@ -751,7 +751,7 @@ void box_preferences_neural_tab() { }, 1); ui_row(row); - if (ui_icon_button(tr("Models Directory...", NULL), ICON_FOLDER, UI_ALIGN_CENTER)) { + if (ui_icon_button(tr("Models Directory..."), ICON_FOLDER, UI_ALIGN_CENTER)) { if (string_equals(file_read_directory(neural_node_dir())->buffer[0], "")) { iron_create_directory(neural_node_dir()); } @@ -782,11 +782,11 @@ char *box_preferneces_model_url_from_name(char *name) { void box_preferences_model_panel(neural_node_model_t *m) { if (ui_panel(ui_handle(m->name), m->name, false, true, false)) { - if (ui_text(string("%s: %s (%s)", tr("source", NULL), m->web, m->license), UI_ALIGN_LEFT, 0x00000000) == UI_STATE_RELEASED) { + if (ui_text(string("%s: %s (%s)", tr("source"), m->web, m->license), UI_ALIGN_LEFT, 0x00000000) == UI_STATE_RELEASED) { iron_load_url(m->web); } - ui_text(string("%s: %s", tr("gpu memory", NULL), m->memory), UI_ALIGN_LEFT, 0x00000000); - ui_text(string("%s: %s", tr("nodes", NULL), m->nodes), UI_ALIGN_LEFT, 0x00000000); + ui_text(string("%s: %s", tr("gpu memory"), m->memory), UI_ALIGN_LEFT, 0x00000000); + ui_text(string("%s: %s", tr("nodes"), m->nodes), UI_ALIGN_LEFT, 0x00000000); char *url = m->urls->buffer[0]; char *file_name = box_preferences_file_name_from_url(url); @@ -814,11 +814,11 @@ void box_preferences_model_panel(neural_node_model_t *m) { ui->enabled = true; } - else if (!found && ui_icon_button(string("%s (%s)", tr("Download", NULL), m->size), ICON_ARROW_DOWN, UI_ALIGN_CENTER)) { + else if (!found && ui_icon_button(string("%s (%s)", tr("Download"), m->size), ICON_ARROW_DOWN, UI_ALIGN_CENTER)) { neural_node_download_models(m->urls); - console_info(tr("Downloading", NULL)); + console_info(tr("Downloading")); } - else if (found && ui_icon_button(string("%s (%s)", tr("Remove", NULL), m->size), ICON_DELETE, UI_ALIGN_CENTER)) { + else if (found && ui_icon_button(string("%s (%s)", tr("Remove"), m->size), ICON_DELETE, UI_ALIGN_CENTER)) { for (i32 i = 0; i < m->urls->length; ++i) { char *url = m->urls->buffer[i]; char *file_name = box_preferences_file_name_from_url(url); @@ -840,19 +840,19 @@ void box_preferences_plugins_tab_plugin_menu_export(char *dest) { void box_preferences_plugins_tab_plugin_menu() { char *path = string("%s%splugins%s%s", path_data(), PATH_SEP, PATH_SEP, _box_preferences_f); - if (ui_menu_button(tr("Edit in Text Editor", NULL), "", ICON_NONE)) { + if (ui_menu_button(tr("Edit in Text Editor"), "", ICON_NONE)) { file_start(path); } - if (ui_menu_button(tr("Edit in Script Tab", NULL), "", ICON_NONE)) { + if (ui_menu_button(tr("Edit in Script Tab"), "", ICON_NONE)) { buffer_t *blob = data_get_blob(string("plugins/%s", _box_preferences_f)); tab_scripts_hscript->text = string_copy(sys_buffer_to_string(blob)); data_delete_blob(string("plugins/%s", _box_preferences_f)); - console_info(tr("Script opened", NULL)); + console_info(tr("Script opened")); } - if (ui_menu_button(tr("Export", NULL), "", ICON_EXPORT)) { + if (ui_menu_button(tr("Export"), "", ICON_EXPORT)) { ui_files_show("js", true, false, &box_preferences_plugins_tab_plugin_menu_export); } - if (ui_menu_button(tr("Delete", NULL), "", ICON_DELETE)) { + if (ui_menu_button(tr("Delete"), "", ICON_DELETE)) { if (string_array_index_of(config_raw->plugins, _box_preferences_f) >= 0) { string_array_remove(config_raw->plugins, _box_preferences_f); plugin_stop(_box_preferences_f); @@ -872,8 +872,8 @@ void box_preferences_plugins_tab_new_box() { if (h->init) { h->text = "new_plugin"; } - char *plugin_name = ui_text_input(h, tr("Name", NULL), UI_ALIGN_LEFT, true, false); - if (ui_icon_button(tr("OK", NULL), ICON_CHECK, UI_ALIGN_CENTER) || ui->is_return_down) { + char *plugin_name = ui_text_input(h, tr("Name"), UI_ALIGN_LEFT, true, false); + if (ui_icon_button(tr("OK"), ICON_CHECK, UI_ALIGN_CENTER) || ui->is_return_down) { char *template = "let plugin = plugin_create();\ let h1 = ui_handle_create();\ plugin_notify_on_ui(plugin, function() {\ @@ -906,10 +906,10 @@ void box_preferences_plugins_tab() { }, 2); ui_row(row); - if (ui_icon_button(tr("New", NULL), ICON_PLUS, UI_ALIGN_CENTER)) { - ui_box_show_custom(&box_preferences_plugins_tab_new_box, 400, 200, NULL, true, tr("New Plugin", NULL)); + if (ui_icon_button(tr("New"), ICON_PLUS, UI_ALIGN_CENTER)) { + ui_box_show_custom(&box_preferences_plugins_tab_new_box, 400, 200, NULL, true, tr("New Plugin")); } - if (ui_icon_button(tr("Import", NULL), ICON_IMPORT, UI_ALIGN_CENTER)) { + if (ui_icon_button(tr("Import"), ICON_IMPORT, UI_ALIGN_CENTER)) { ui_files_show("js,zip", false, false, &box_preferences_plugins_tab_import); } ui_end_sticky(); @@ -953,43 +953,43 @@ void box_preferences_show_on_hide() { } void box_preferences_show_box() { - if (ui_tab(box_preferences_htab, tr("Interface", NULL), true, -1, false)) { + if (ui_tab(box_preferences_htab, tr("Interface"), true, -1, false)) { box_preferences_interface_tab(); } - if (ui_tab(box_preferences_htab, tr("Theme", NULL), true, -1, false)) { + if (ui_tab(box_preferences_htab, tr("Theme"), true, -1, false)) { box_preferences_theme_tab(); } - if (ui_tab(box_preferences_htab, tr("Usage", NULL), true, -1, false)) { + if (ui_tab(box_preferences_htab, tr("Usage"), true, -1, false)) { box_preferences_usage_tab(); } #ifdef IRON_IOS - char *pen_name = tr("Pencil", NULL); + char *pen_name = tr("Pencil"); #else - char *pen_name = tr("Pen", NULL); + char *pen_name = tr("Pen"); #endif if (ui_tab(box_preferences_htab, pen_name, true, -1, false)) { box_preferences_pen_tab(); } - if (ui_tab(box_preferences_htab, tr("Viewport", NULL), true, -1, false)) { + if (ui_tab(box_preferences_htab, tr("Viewport"), true, -1, false)) { box_preferences_viewport_tab(); } - if (ui_tab(box_preferences_htab, tr("Keymap", NULL), true, -1, false)) { + if (ui_tab(box_preferences_htab, tr("Keymap"), true, -1, false)) { box_preferences_keymap_tab(); } #if defined(IRON_WINDOWS) || defined(IRON_LINUX) || defined(IRON_MACOS) - if (ui_tab(box_preferences_htab, tr("Neural", NULL), true, -1, false)) { + if (ui_tab(box_preferences_htab, tr("Neural"), true, -1, false)) { box_preferences_neural_tab(); } #endif - if (ui_tab(box_preferences_htab, tr("Plugins", NULL), true, -1, false)) { + if (ui_tab(box_preferences_htab, tr("Plugins"), true, -1, false)) { box_preferences_plugins_tab(); } } void box_preferences_show() { - ui_box_show_custom(&box_preferences_show_box, 720, 520, &box_preferences_show_on_hide, true, tr("Preferences", NULL)); + ui_box_show_custom(&box_preferences_show_box, 720, 520, &box_preferences_show_on_hide, true, tr("Preferences")); } void box_preferences_fetch_themes() { diff --git a/paint/sources/box_projects.c b/paint/sources/box_projects.c index b858ca97..d6e6b1f9 100644 --- a/paint/sources/box_projects.c +++ b/paint/sources/box_projects.c @@ -46,7 +46,7 @@ void box_projects_tab_menu_on_next_frame(void *_) { void box_projects_tab_menu() { // if (ui_menu_button(tr("Duplicate"), "", icon_t.DUPLICATE)) {} - if (ui_menu_button(tr("Delete", NULL), "", ICON_DELETE)) { + if (ui_menu_button(tr("Delete"), "", ICON_DELETE)) { sys_notify_on_next_frame(&box_projects_tab_menu_on_next_frame, NULL); } } @@ -57,27 +57,27 @@ void box_projects_tab_on_next_frame(char *path) { } void box_projects_tab() { - if (ui_tab(box_projects_htab, tr("Projects", NULL), true, -1, false)) { + if (ui_tab(box_projects_htab, tr("Projects"), true, -1, false)) { ui_begin_sticky(); ui_separator(UI_ELEMENT_H(), false); box_projects_draw_badge(); - if (ui_icon_button(tr("New", NULL), ICON_PLUS, UI_ALIGN_CENTER)) { + if (ui_icon_button(tr("New"), ICON_PLUS, UI_ALIGN_CENTER)) { project_new(true); ui_box_hide(); // Pick unique name i32 i = 0; i32 j = 0; - char *title = string("%s%s", tr("untitled", NULL), i32_to_string(i)); + char *title = string("%s%s", tr("untitled"), i32_to_string(i)); while (j < config_raw->recent_projects->length) { char *base = config_raw->recent_projects->buffer[j]; base = string_copy(substring(base, string_last_index_of(base, PATH_SEP) + 1, string_last_index_of(base, "."))); j++; if (string_equals(title, base)) { i++; - title = string("%s%s", tr("untitled", NULL), i32_to_string(i)); + title = string("%s%s", tr("untitled"), i32_to_string(i)); j = 0; } } @@ -151,7 +151,7 @@ void box_projects_tab() { ui_fill(0, 0, 128, 128, 0x66000000); ui->_x = _uix; #if defined(IRON_ANDROID) || defined(IRON_IOS) - console_toast(tr("Opening project", NULL)); + console_toast(tr("Opening project")); #endif sys_notify_on_next_frame(&box_projects_tab_on_next_frame, path); } @@ -196,12 +196,12 @@ void box_projects_tab() { } void box_projects_recent_tab() { - if (ui_tab(box_projects_htab, tr("Recent", NULL), true, -1, false)) { + if (ui_tab(box_projects_htab, tr("Recent"), true, -1, false)) { box_projects_draw_badge(); ui->enabled = config_raw->recent_projects->length > 0; - box_projects_hsearch->text = string_copy(ui_text_input(box_projects_hsearch, tr("Search", NULL), UI_ALIGN_LEFT, true, true)); + box_projects_hsearch->text = string_copy(ui_text_input(box_projects_hsearch, tr("Search"), UI_ALIGN_LEFT, true, true)); ui->enabled = true; for (i32 i = 0; i < config_raw->recent_projects->length; ++i) { char *path = config_raw->recent_projects->buffer[i]; @@ -233,17 +233,17 @@ void box_projects_recent_tab() { } ui->enabled = config_raw->recent_projects->length > 0; - if (ui_icon_button(tr("Clear", NULL), ICON_ERASE, UI_ALIGN_LEFT)) { + if (ui_icon_button(tr("Clear"), ICON_ERASE, UI_ALIGN_LEFT)) { config_raw->recent_projects = any_array_create_from_raw((void *[]){}, 0); config_save(); } ui->enabled = true; ui_end_element(); - if (ui_icon_button(tr("New Project...", NULL), ICON_FILE_NEW, UI_ALIGN_LEFT)) { + if (ui_icon_button(tr("New Project..."), ICON_FILE_NEW, UI_ALIGN_LEFT)) { project_new_box(); } - if (ui_icon_button(tr("Open...", NULL), ICON_FOLDER_OPEN, UI_ALIGN_LEFT)) { + if (ui_icon_button(tr("Open..."), ICON_FOLDER_OPEN, UI_ALIGN_LEFT)) { project_open(); } } @@ -256,17 +256,17 @@ void box_projects_draw_badge() { } void box_projects_get_started_tab() { - if (ui_tab(box_projects_htab, tr("Get Started", NULL), true, -1, false)) { + if (ui_tab(box_projects_htab, tr("Get Started"), true, -1, false)) { ui_separator(UI_ELEMENT_H(), false); - if (ui_icon_button(tr("Manual", NULL), ICON_HELP, UI_ALIGN_CENTER)) { + if (ui_icon_button(tr("Manual"), ICON_HELP, UI_ALIGN_CENTER)) { iron_load_url(string("%s/manual", manifest_url)); } - if (ui_icon_button(tr("How To", NULL), ICON_HELP, UI_ALIGN_CENTER)) { + if (ui_icon_button(tr("How To"), ICON_HELP, UI_ALIGN_CENTER)) { iron_load_url(string("%s/howto", manifest_url)); } - if (ui_icon_button(tr("What's New", NULL), ICON_LINK, UI_ALIGN_CENTER)) { + if (ui_icon_button(tr("What's New"), ICON_LINK, UI_ALIGN_CENTER)) { iron_load_url(string("%s/notes", manifest_url)); } } diff --git a/paint/sources/context.c b/paint/sources/context.c index b45449fd..c00a2a9f 100644 --- a/paint/sources/context.c +++ b/paint/sources/context.c @@ -370,12 +370,12 @@ bool context_in_paint_area() { bool context_in_layers() { char *tab = ui_hovered_tab_name(); - return string_equals(tab, tr("Layers", NULL)); + return string_equals(tab, tr("Layers")); } bool context_in_materials() { char *tab = ui_hovered_tab_name(); - return string_equals(tab, tr("Materials", NULL)); + return string_equals(tab, tr("Materials")); } bool context_in_2d_view(view_2d_type_t type) { @@ -389,12 +389,12 @@ bool context_in_nodes() { bool context_in_swatches() { char *tab = ui_hovered_tab_name(); - return string_equals(tab, tr("Swatches", NULL)); + return string_equals(tab, tr("Swatches")); } bool context_in_browser() { char *tab = ui_hovered_tab_name(); - return string_equals(tab, tr("Browser", NULL)); + return string_equals(tab, tr("Browser")); } bool context_is_picker() { @@ -525,7 +525,7 @@ bool context_enable_import_plugin(char *file) { char *f = box_preferences_files_plugin->buffer[i]; if (starts_with(f, "import_") && string_index_of(f, ext) >= 0) { config_enable_plugin(f); - console_info(string("%s %s", f, tr("plugin enabled", NULL))); + console_info(string("%s %s", f, tr("plugin enabled"))); return true; } } diff --git a/paint/sources/export_arm.c b/paint/sources/export_arm.c index efc9b958..5ac06b1f 100644 --- a/paint/sources/export_arm.c +++ b/paint/sources/export_arm.c @@ -188,7 +188,7 @@ void export_arm_run_project() { array_insert(recent, 0, recent_path); config_save(); - console_info(tr("Project saved", NULL)); + console_info(tr("Project saved")); } void export_arm_export_node(ui_node_t *n, asset_t_array_t *assets) { diff --git a/paint/sources/export_texture.c b/paint/sources/export_texture.c index 41d4bc04..62b93897 100644 --- a/paint/sources/export_texture.c +++ b/paint/sources/export_texture.c @@ -100,15 +100,15 @@ void export_texture_run(char *path, bool bake_material) { #ifdef IRON_IOS if (config_is_iphone()) { - console_info(string("%s (\"Files/On My iPhone/%s\")", tr("Textures exported", NULL), manifest_title)); + console_info(string("%s (\"Files/On My iPhone/%s\")", tr("Textures exported"), manifest_title)); } else { - console_info(string("%s (\"Files/On My iPad/%s\")", tr("Textures exported", NULL), manifest_title)); + console_info(string("%s (\"Files/On My iPad/%s\")", tr("Textures exported"), manifest_title)); } #elif defined(IRON_ANDROID) - console_info(string("%s (\"Files/Internal storage/Pictures/%s\")", tr("Textures exported", NULL), manifest_title)); + console_info(string("%s (\"Files/Internal storage/Pictures/%s\")", tr("Textures exported"), manifest_title)); #else - console_info(tr("Textures exported", NULL)); + console_info(tr("Textures exported")); #endif gc_unroot(ui_files_last_path); ui_files_last_path = ""; @@ -170,7 +170,7 @@ void export_texture_run_layers(char *path, slot_layer_t_array_t *layers, char *o char *f = ui_files_filename; #endif if (string_equals(f, "")) { - f = string_copy(tr("untitled", NULL)); + f = string_copy(tr("untitled")); } texture_ldr_format_t format_type = context_raw->format_type; i32 bits = base_bits_handle->i == TEXTURE_BITS_BITS8 ? 8 : 16; diff --git a/paint/sources/functions.h b/paint/sources/functions.h index deac056f..eb678228 100644 --- a/paint/sources/functions.h +++ b/paint/sources/functions.h @@ -388,7 +388,8 @@ void ui_menubar_draw_category_items(); void ui_menubar_show_menu(i32 category); bool ui_menubar_icon_button(i32 i); char *_tr(char *s); -char *tr(char *id, any_map_t *vars); +char *vtr(char *id, any_map_t *vars); +char *tr(char *id); void translator_load_translations(char *new_locale); void translator_init_font(bool cjk, char *font_path, f32 font_scale); void translator_extended_glyphs(); diff --git a/paint/sources/history.c b/paint/sources/history.c index 6843f662..d6ff3b58 100644 --- a/paint/sources/history.c +++ b/paint/sources/history.c @@ -23,23 +23,23 @@ void history_undo() { i32 active = history_steps->length - 1 - history_redos; history_step_t *step = history_steps->buffer[active]; - if (string_equals(step->name, tr("Edit Nodes", NULL))) { + if (string_equals(step->name, tr("Edit Nodes"))) { history_swap_canvas(step); } - else if (string_equals(step->name, tr("New Layer", NULL)) || string_equals(step->name, tr("New Black Mask", NULL)) || - string_equals(step->name, tr("New White Mask", NULL)) || string_equals(step->name, tr("New Fill Mask", NULL))) { + else if (string_equals(step->name, tr("New Layer")) || string_equals(step->name, tr("New Black Mask")) || + string_equals(step->name, tr("New White Mask")) || string_equals(step->name, tr("New Fill Mask"))) { context_raw->layer = project_layers->buffer[step->layer]; slot_layer_delete(context_raw->layer); context_raw->layer = project_layers->buffer[step->layer > 0 ? step->layer - 1 : 0]; } - else if (string_equals(step->name, tr("New Group", NULL))) { + else if (string_equals(step->name, tr("New Group"))) { context_raw->layer = project_layers->buffer[step->layer]; // The layer below is the only layer in the group. Its layer masks are automatically unparented, too. project_layers->buffer[step->layer - 1]->parent = NULL; slot_layer_delete(context_raw->layer); context_raw->layer = project_layers->buffer[step->layer > 0 ? step->layer - 1 : 0]; } - else if (string_equals(step->name, tr("Delete Layer", NULL))) { + else if (string_equals(step->name, tr("Delete Layer"))) { slot_layer_t *parent = step->layer_parent > 0 ? project_layers->buffer[step->layer_parent - 1] : NULL; slot_layer_t *l = slot_layer_create("", step->layer_type, parent); array_insert(project_layers, step->layer, l); @@ -57,13 +57,13 @@ void history_undo() { sys_notify_on_next_frame(&history_undo_delete_layer_group, NULL); } } - else if (string_equals(step->name, tr("Clear Layer", NULL))) { + else if (string_equals(step->name, tr("Clear Layer"))) { history_undo_i = history_undo_i - 1 < 0 ? config_raw->undo_steps - 1 : history_undo_i - 1; slot_layer_t *lay = history_undo_layers->buffer[history_undo_i]; slot_layer_swap(context_raw->layer, lay); context_raw->layer_preview_dirty = true; } - else if (string_equals(step->name, tr("Duplicate Layer", NULL))) { + else if (string_equals(step->name, tr("Duplicate Layer"))) { slot_layer_t_array_t *children = slot_layer_get_recursive_children(project_layers->buffer[step->layer]); i32 position = step->layer + 1; if (children != NULL) { @@ -73,12 +73,12 @@ void history_undo() { context_raw->layer = project_layers->buffer[position]; slot_layer_delete(context_raw->layer); } - else if (string_equals(step->name, tr("Order Layers", NULL))) { + else if (string_equals(step->name, tr("Order Layers"))) { slot_layer_t *target = project_layers->buffer[step->prev_order]; project_layers->buffer[step->prev_order] = project_layers->buffer[step->layer]; project_layers->buffer[step->layer] = target; } - else if (string_equals(step->name, tr("Merge Layers", NULL))) { + else if (string_equals(step->name, tr("Merge Layers"))) { context_raw->layer = project_layers->buffer[step->layer]; slot_layer_delete(context_raw->layer); @@ -105,7 +105,7 @@ void history_undo() { context_raw->layers_preview_dirty = true; make_material_parse_mesh_material(); } - else if (string_equals(step->name, tr("Apply Mask", NULL))) { + else if (string_equals(step->name, tr("Apply Mask"))) { // First restore the layer(s) i32 mask_pos = step->layer; slot_layer_t *current_layer = NULL; @@ -147,7 +147,7 @@ void history_undo() { context_raw->layers_preview_dirty = true; context_set_layer(context_raw->layer); } - else if (string_equals(step->name, tr("Invert Mask", NULL))) { + else if (string_equals(step->name, tr("Invert Mask"))) { sys_notify_on_next_frame(&history_undo_invert_mask, step); } else if (string_equals(step->name, "Apply Filter")) { @@ -159,50 +159,50 @@ void history_undo() { slot_layer_swap(context_raw->layer, lay); context_raw->layer_preview_dirty = true; } - else if (string_equals(step->name, tr("To Fill Layer", NULL)) || string_equals(step->name, tr("To Fill Mask", NULL))) { + else if (string_equals(step->name, tr("To Fill Layer")) || string_equals(step->name, tr("To Fill Mask"))) { slot_layer_to_paint_layer(context_raw->layer); history_undo_i = history_undo_i - 1 < 0 ? config_raw->undo_steps - 1 : history_undo_i - 1; slot_layer_t *lay = history_undo_layers->buffer[history_undo_i]; slot_layer_swap(context_raw->layer, lay); } - else if (string_equals(step->name, tr("To Paint Layer", NULL)) || string_equals(step->name, tr("To Paint Mask", NULL))) { + else if (string_equals(step->name, tr("To Paint Layer")) || string_equals(step->name, tr("To Paint Mask"))) { history_undo_i = history_undo_i - 1 < 0 ? config_raw->undo_steps - 1 : history_undo_i - 1; slot_layer_t *lay = history_undo_layers->buffer[history_undo_i]; slot_layer_swap(context_raw->layer, lay); context_raw->layer->fill_layer = project_materials->buffer[step->material]; } - else if (string_equals(step->name, tr("Layer Opacity", NULL))) { + else if (string_equals(step->name, tr("Layer Opacity"))) { context_set_layer(project_layers->buffer[step->layer]); f32 t = context_raw->layer->mask_opacity; context_raw->layer->mask_opacity = step->layer_opacity; step->layer_opacity = t; make_material_parse_mesh_material(); } - else if (string_equals(step->name, tr("Layer Blending", NULL))) { + else if (string_equals(step->name, tr("Layer Blending"))) { context_set_layer(project_layers->buffer[step->layer]); blend_type_t t = context_raw->layer->blending; context_raw->layer->blending = step->layer_blending; step->layer_blending = t; make_material_parse_mesh_material(); } - else if (string_equals(step->name, tr("Delete Node Group", NULL))) { + else if (string_equals(step->name, tr("Delete Node Group"))) { node_group_t *ng = GC_ALLOC_INIT(node_group_t, {.canvas = NULL, .nodes = ui_nodes_create()}); array_insert(project_material_groups, step->canvas_group, ng); history_swap_canvas(step); } - else if (string_equals(step->name, tr("New Material", NULL))) { + else if (string_equals(step->name, tr("New Material"))) { context_raw->material = project_materials->buffer[step->material]; step->canvas = context_raw->material->canvas; slot_material_delete(context_raw->material); } - else if (string_equals(step->name, tr("Delete Material", NULL))) { + else if (string_equals(step->name, tr("Delete Material"))) { context_raw->material = slot_material_create(project_materials->buffer[0]->data, NULL); array_insert(project_materials, step->material, context_raw->material); context_raw->material->canvas = step->canvas; ui_nodes_canvas_changed(); ui_nodes_hwnd->redraws = 2; } - else if (string_equals(step->name, tr("Duplicate Material", NULL))) { + else if (string_equals(step->name, tr("Duplicate Material"))) { context_raw->material = project_materials->buffer[step->material]; step->canvas = context_raw->material->canvas; slot_material_delete(context_raw->material); @@ -284,28 +284,28 @@ void history_redo() { i32 active = history_steps->length - history_redos; history_step_t *step = history_steps->buffer[active]; - if (string_equals(step->name, tr("Edit Nodes", NULL))) { + if (string_equals(step->name, tr("Edit Nodes"))) { history_swap_canvas(step); } - else if (string_equals(step->name, tr("New Layer", NULL)) || string_equals(step->name, tr("New Black Mask", NULL)) || - string_equals(step->name, tr("New White Mask", NULL)) || string_equals(step->name, tr("New Fill Mask", NULL))) { + else if (string_equals(step->name, tr("New Layer")) || string_equals(step->name, tr("New Black Mask")) || + string_equals(step->name, tr("New White Mask")) || string_equals(step->name, tr("New Fill Mask"))) { slot_layer_t *parent = step->layer_parent > 0 ? project_layers->buffer[step->layer_parent - 1] : NULL; slot_layer_t *l = slot_layer_create("", step->layer_type, parent); array_insert(project_layers, step->layer, l); - if (string_equals(step->name, tr("New Black Mask", NULL))) { + if (string_equals(step->name, tr("New Black Mask"))) { sys_notify_on_next_frame(&history_redo_new_black_mask, l); } - else if (string_equals(step->name, tr("New White Mask", NULL))) { + else if (string_equals(step->name, tr("New White Mask"))) { sys_notify_on_next_frame(&history_redo_new_white_mask, l); } - else if (string_equals(step->name, tr("New Fill Mask", NULL))) { + else if (string_equals(step->name, tr("New Fill Mask"))) { context_raw->material = project_materials->buffer[step->material]; sys_notify_on_next_frame(&history_redo_new_fill_mask, l); } context_raw->layer_preview_dirty = true; context_set_layer(l); } - else if (string_equals(step->name, tr("New Group", NULL))) { + else if (string_equals(step->name, tr("New Group"))) { slot_layer_t *l = project_layers->buffer[step->layer - 1]; slot_layer_t *group = layers_new_group(); array_remove(project_layers, group); @@ -313,7 +313,7 @@ void history_redo() { l->parent = group; context_set_layer(group); } - else if (string_equals(step->name, tr("Delete Layer", NULL))) { + else if (string_equals(step->name, tr("Delete Layer"))) { context_raw->layer = project_layers->buffer[step->layer]; history_swap_active(); slot_layer_delete(context_raw->layer); @@ -326,27 +326,27 @@ void history_redo() { sys_notify_on_next_frame(&history_redo_delete_layer, NULL); } } - else if (string_equals(step->name, tr("Clear Layer", NULL))) { + else if (string_equals(step->name, tr("Clear Layer"))) { context_raw->layer = project_layers->buffer[step->layer]; history_swap_active(); slot_layer_clear(context_raw->layer, 0x00000000, NULL, 1.0, layers_default_rough, 0.0); context_raw->layer_preview_dirty = true; } - else if (string_equals(step->name, tr("Duplicate Layer", NULL))) { + else if (string_equals(step->name, tr("Duplicate Layer"))) { context_raw->layer = project_layers->buffer[step->layer]; sys_notify_on_next_frame(&history_redo_duplicate_layer, NULL); } - else if (string_equals(step->name, tr("Order Layers", NULL))) { + else if (string_equals(step->name, tr("Order Layers"))) { slot_layer_t *target = project_layers->buffer[step->prev_order]; project_layers->buffer[step->prev_order] = project_layers->buffer[step->layer]; project_layers->buffer[step->layer] = target; } - else if (string_equals(step->name, tr("Merge Layers", NULL))) { + else if (string_equals(step->name, tr("Merge Layers"))) { context_raw->layer = project_layers->buffer[step->layer + 1]; sys_notify_on_next_frame(&history_redo_merge_layers, NULL); sys_notify_on_next_frame(&history_redo_merge_layers2, NULL); } - else if (string_equals(step->name, tr("Apply Mask", NULL))) { + else if (string_equals(step->name, tr("Apply Mask"))) { context_raw->layer = project_layers->buffer[step->layer]; if (slot_layer_is_group_mask(context_raw->layer)) { slot_layer_t *group = context_raw->layer->parent; @@ -366,10 +366,10 @@ void history_redo() { sys_notify_on_next_frame(&history_redo_apply_mask, NULL); } - else if (string_equals(step->name, tr("Invert Mask", NULL))) { + else if (string_equals(step->name, tr("Invert Mask"))) { sys_notify_on_next_frame(&history_redo_invert_mask, step); } - else if (string_equals(step->name, tr("Apply Filter", NULL))) { + else if (string_equals(step->name, tr("Apply Filter"))) { slot_layer_t *lay = history_undo_layers->buffer[history_undo_i]; context_set_layer(project_layers->buffer[step->layer]); slot_layer_swap(context_raw->layer, lay); @@ -378,49 +378,49 @@ void history_redo() { context_raw->layer_preview_dirty = true; history_undo_i = (history_undo_i + 1) % config_raw->undo_steps; } - else if (string_equals(step->name, tr("To Fill Layer", NULL)) || string_equals(step->name, tr("To Fill Mask", NULL))) { + else if (string_equals(step->name, tr("To Fill Layer")) || string_equals(step->name, tr("To Fill Mask"))) { slot_layer_t *lay = history_undo_layers->buffer[history_undo_i]; slot_layer_swap(context_raw->layer, lay); context_raw->layer->fill_layer = project_materials->buffer[step->material]; history_undo_i = (history_undo_i + 1) % config_raw->undo_steps; } - else if (string_equals(step->name, tr("To Paint Layer", NULL)) || string_equals(step->name, tr("To Paint Mask", NULL))) { + else if (string_equals(step->name, tr("To Paint Layer")) || string_equals(step->name, tr("To Paint Mask"))) { slot_layer_to_paint_layer(context_raw->layer); slot_layer_t *lay = history_undo_layers->buffer[history_undo_i]; slot_layer_swap(context_raw->layer, lay); history_undo_i = (history_undo_i + 1) % config_raw->undo_steps; } - else if (string_equals(step->name, tr("Layer Opacity", NULL))) { + else if (string_equals(step->name, tr("Layer Opacity"))) { context_set_layer(project_layers->buffer[step->layer]); f32 t = context_raw->layer->mask_opacity; context_raw->layer->mask_opacity = step->layer_opacity; step->layer_opacity = t; make_material_parse_mesh_material(); } - else if (string_equals(step->name, tr("Layer Blending", NULL))) { + else if (string_equals(step->name, tr("Layer Blending"))) { context_set_layer(project_layers->buffer[step->layer]); blend_type_t t = context_raw->layer->blending; context_raw->layer->blending = step->layer_blending; step->layer_blending = t; make_material_parse_mesh_material(); } - else if (string_equals(step->name, tr("Delete Node Group", NULL))) { + else if (string_equals(step->name, tr("Delete Node Group"))) { history_swap_canvas(step); array_remove(project_material_groups, project_material_groups->buffer[step->canvas_group]); } - else if (string_equals(step->name, tr("New Material", NULL))) { + else if (string_equals(step->name, tr("New Material"))) { context_raw->material = slot_material_create(project_materials->buffer[0]->data, NULL); array_insert(project_materials, step->material, context_raw->material); context_raw->material->canvas = step->canvas; ui_nodes_canvas_changed(); ui_nodes_hwnd->redraws = 2; } - else if (string_equals(step->name, tr("Delete Material", NULL))) { + else if (string_equals(step->name, tr("Delete Material"))) { context_raw->material = project_materials->buffer[step->material]; step->canvas = context_raw->material->canvas; slot_material_delete(context_raw->material); } - else if (string_equals(step->name, tr("Duplicate Material", NULL))) { + else if (string_equals(step->name, tr("Duplicate Material"))) { context_raw->material = slot_material_create(project_materials->buffer[0]->data, NULL); array_insert(project_materials, step->material, context_raw->material); context_raw->material->canvas = step->canvas; @@ -459,7 +459,7 @@ void history_reset() { (void *[]){ GC_ALLOC_INIT( history_step_t, - {.name = tr("New", NULL), .layer = 0, .layer_type = LAYER_SLOT_TYPE_LAYER, .layer_parent = -1, .object = 0, .material = 0, .brush = 0}), + {.name = tr("New"), .layer = 0, .layer_type = LAYER_SLOT_TYPE_LAYER, .layer_parent = -1, .object = 0, .material = 0, .brush = 0}), }, 1); gc_root(history_steps); @@ -469,7 +469,7 @@ void history_reset() { } void history_edit_nodes(ui_node_canvas_t *canvas, i32 canvas_type, i32 canvas_group) { - history_step_t *step = history_push(tr("Edit Nodes", NULL)); + history_step_t *step = history_push(tr("Edit Nodes")); step->canvas_group = canvas_group; step->canvas_type = canvas_type; step->canvas = util_clone_canvas(canvas); @@ -480,52 +480,52 @@ void history_paint() { history_copy_to_undo(context_raw->layer->id, history_undo_i, is_mask); history_push_undo = false; - history_push(tr(ui_toolbar_tool_names->buffer[context_raw->tool], NULL)); + history_push(tr(ui_toolbar_tool_names->buffer[context_raw->tool])); } void history_new_layer() { - history_push(tr("New Layer", NULL)); + history_push(tr("New Layer")); } void history_new_black_mask() { - history_push(tr("New Black Mask", NULL)); + history_push(tr("New Black Mask")); } void history_new_white_mask() { - history_push(tr("New White Mask", NULL)); + history_push(tr("New White Mask")); } void history_new_fill_mask() { - history_push(tr("New Fill Mask", NULL)); + history_push(tr("New Fill Mask")); } void history_new_group() { - history_push(tr("New Group", NULL)); + history_push(tr("New Group")); } void history_duplicate_layer() { - history_push(tr("Duplicate Layer", NULL)); + history_push(tr("Duplicate Layer")); } void history_delete_layer() { history_swap_active(); - history_push(tr("Delete Layer", NULL)); + history_push(tr("Delete Layer")); } void history_clear_layer() { history_swap_active(); - history_push(tr("Clear Layer", NULL)); + history_push(tr("Clear Layer")); } void history_order_layers(i32 prev_order) { - history_step_t *step = history_push(tr("Order Layers", NULL)); + history_step_t *step = history_push(tr("Order Layers")); step->prev_order = prev_order; } void history_merge_layers() { history_copy_merging_layers(); - history_step_t *step = history_push(tr("Merge Layers", NULL)); + history_step_t *step = history_push(tr("Merge Layers")); step->layer -= 1; // Merge down if (slot_layer_has_masks(context_raw->layer, true)) { step->layer -= slot_layer_get_masks(context_raw->layer, true)->length; @@ -551,40 +551,40 @@ void history_apply_mask() { 2); history_copy_merging_layers2(layers); } - history_push(tr("Apply Mask", NULL)); + history_push(tr("Apply Mask")); } void history_invert_mask() { - history_push(tr("Invert Mask", NULL)); + history_push(tr("Invert Mask")); } void history_apply_filter() { history_copy_to_undo(context_raw->layer->id, history_undo_i, true); - history_push(tr("Apply Filter", NULL)); + history_push(tr("Apply Filter")); } void history_to_fill_layer() { history_copy_to_undo(context_raw->layer->id, history_undo_i, false); - history_push(tr("To Fill Layer", NULL)); + history_push(tr("To Fill Layer")); } void history_to_fill_mask() { history_copy_to_undo(context_raw->layer->id, history_undo_i, true); - history_push(tr("To Fill Mask", NULL)); + history_push(tr("To Fill Mask")); } void history_to_paint_layer() { history_copy_to_undo(context_raw->layer->id, history_undo_i, false); - history_push(tr("To Paint Layer", NULL)); + history_push(tr("To Paint Layer")); } void history_to_paint_mask() { history_copy_to_undo(context_raw->layer->id, history_undo_i, true); - history_push(tr("To Paint Mask", NULL)); + history_push(tr("To Paint Mask")); } void history_layer_opacity() { - history_push(tr("Layer Opacity", NULL)); + history_push(tr("Layer Opacity")); } // void history_layer_object() { @@ -592,29 +592,29 @@ void history_layer_opacity() { // } void history_layer_blending() { - history_push(tr("Layer Blending", NULL)); + history_push(tr("Layer Blending")); } void history_new_material() { - history_step_t *step = history_push(tr("New Material", NULL)); + history_step_t *step = history_push(tr("New Material")); step->canvas_type = 0; step->canvas = util_clone_canvas(context_raw->material->canvas); } void history_delete_material() { - history_step_t *step = history_push(tr("Delete Material", NULL)); + history_step_t *step = history_push(tr("Delete Material")); step->canvas_type = 0; step->canvas = util_clone_canvas(context_raw->material->canvas); } void history_duplicate_material() { - history_step_t *step = history_push(tr("Duplicate Material", NULL)); + history_step_t *step = history_push(tr("Duplicate Material")); step->canvas_type = 0; step->canvas = util_clone_canvas(context_raw->material->canvas); } void history_delete_material_group(node_group_t *group) { - history_step_t *step = history_push(tr("Delete Node Group", NULL)); + history_step_t *step = history_push(tr("Delete Node Group")); step->canvas_type = CANVAS_TYPE_MATERIAL; step->canvas_group = array_index_of(project_material_groups, group); step->canvas = util_clone_canvas(group->canvas); diff --git a/paint/sources/import_asset.c b/paint/sources/import_asset.c index f72ce02a..ce5cc46c 100644 --- a/paint/sources/import_asset.c +++ b/paint/sources/import_asset.c @@ -11,9 +11,9 @@ void import_asset_run_cache_cloud_done(char *abs) { void import_asset_run(char *path, f32 drop_x, f32 drop_y, bool show_box, bool hdr_as_envmap, void (*done)(void)) { if (starts_with(path, "cloud")) { #ifdef IRON_ANDROID - console_toast(tr("Downloading", NULL)); + console_toast(tr("Downloading")); #else - console_info(tr("Downloading", NULL)); + console_info(tr("Downloading")); #endif _import_asset_drop_x = drop_x; diff --git a/paint/sources/import_blend_material.c b/paint/sources/import_blend_material.c index c06b3e76..b0d87df7 100644 --- a/paint/sources/import_blend_material.c +++ b/paint/sources/import_blend_material.c @@ -2,19 +2,19 @@ #include "global.h" void import_blend_material_run_box() { - if (ui_tab(ui_handle(__ID__), tr("Import Material", NULL), false, -1, false)) { + if (ui_tab(ui_handle(__ID__), tr("Import Material"), false, -1, false)) { import_blend_mesh_ui(); ui_row2(); - if (ui_icon_button(tr("Cancel", NULL), ICON_CLOSE, UI_ALIGN_CENTER)) { + if (ui_icon_button(tr("Cancel"), ICON_CLOSE, UI_ALIGN_CENTER)) { ui_box_hide(); } - if (ui_icon_button(tr("Import", NULL), ICON_CHECK, UI_ALIGN_CENTER) || ui->is_return_down) { + if (ui_icon_button(tr("Import"), ICON_CHECK, UI_ALIGN_CENTER) || ui->is_return_down) { ui_box_hide(); if (config_raw->blender == NULL || string_equals(config_raw->blender, "")) { - console_error(tr("Blender executable path not set", NULL)); + console_error(tr("Blender executable path not set")); return; } _import_blend_material(); @@ -74,6 +74,6 @@ for mat in bpy.data.materials:\n\ } void _import_blend_material() { - console_toast(tr("Baking material", NULL)); + console_toast(tr("Baking material")); sys_notify_on_next_frame(&_import_blend_material_on_next_frame, NULL); } diff --git a/paint/sources/import_blend_mesh.c b/paint/sources/import_blend_mesh.c index 78720b89..3c5472b6 100644 --- a/paint/sources/import_blend_mesh.c +++ b/paint/sources/import_blend_mesh.c @@ -14,7 +14,7 @@ void import_blend_mesh_ui() { config_raw->blender = ""; } - ui_text(tr("Blender Executable", NULL), UI_ALIGN_LEFT, 0x00000000); + ui_text(tr("Blender Executable"), UI_ALIGN_LEFT, 0x00000000); f32_array_t *ar = f32_array_create_from_raw( (f32[]){ @@ -34,7 +34,7 @@ void import_blend_mesh_ui() { void import_blend_mesh_run(char *path, bool replace_existing) { if (config_raw->blender == NULL || string_equals(config_raw->blender, "")) { - console_error(tr("Blender executable path not set", NULL)); + console_error(tr("Blender executable path not set")); return; } diff --git a/paint/sources/import_folder.c b/paint/sources/import_folder.c index 6ee79894..a86fe760 100644 --- a/paint/sources/import_folder.c +++ b/paint/sources/import_folder.c @@ -59,7 +59,7 @@ void import_folder_run(char *path) { } if (!found_texture) { - console_info(tr("Folder does not contain textures", NULL)); + console_info(tr("Folder does not contain textures")); return; } diff --git a/paint/sources/import_font.c b/paint/sources/import_font.c index 97028c13..075e6ba1 100644 --- a/paint/sources/import_font.c +++ b/paint/sources/import_font.c @@ -30,7 +30,7 @@ void import_font_run(char *path) { draw_font_t *f = GC_ALLOC_INIT(draw_font_t, {.buf = font->buf, .index = font->index}); draw_font_init(f); if (!draw_set_font(f, util_render_font_preview_size)) { - console_error(tr("Error: Failed to read font data", NULL)); + console_error(tr("Error: Failed to read font data")); continue; } diff --git a/paint/sources/import_keymap.c b/paint/sources/import_keymap.c index f59d3307..c2e319c2 100644 --- a/paint/sources/import_keymap.c +++ b/paint/sources/import_keymap.c @@ -12,5 +12,5 @@ void import_keymap_run(char *path) { file_copy(path, dst_path); // Copy to preset folder box_preferences_fetch_keymaps(); // Refresh file list box_preferences_h_preset->i = box_preferences_get_preset_index(); - console_info(string("%s %s", tr("Keymap imported:", NULL), filename)); + console_info(string("%s %s", tr("Keymap imported:"), filename)); } diff --git a/paint/sources/import_plugin.c b/paint/sources/import_plugin.c index acbe9645..2747d169 100644 --- a/paint/sources/import_plugin.c +++ b/paint/sources/import_plugin.c @@ -12,5 +12,5 @@ void import_plugin_run(char *path) { file_copy(path, dst_path); // Copy to plugin folder gc_unroot(box_preferences_files_plugin); box_preferences_files_plugin = NULL; // Refresh file list - console_info(string("%s %s", tr("Plugin imported:", NULL), filename)); + console_info(string("%s %s", tr("Plugin imported:"), filename)); } diff --git a/paint/sources/import_texture.c b/paint/sources/import_texture.c index c5cc0713..4746dff7 100644 --- a/paint/sources/import_texture.c +++ b/paint/sources/import_texture.c @@ -54,7 +54,7 @@ void import_texture_run(char *path, bool hdr_as_envmap) { any_array_push(project_asset_names, name); any_imap_set(project_asset_map, asset->id, image); ui_base_hwnds->buffer[TAB_AREA_STATUS]->redraws = 2; - console_info(string("%s %s", tr("Texture imported:", NULL), name)); + console_info(string("%s %s", tr("Texture imported:"), name)); // Set as envmap if (hdr_as_envmap && ends_with(to_lower_case(path), ".hdr")) { diff --git a/paint/sources/import_theme.c b/paint/sources/import_theme.c index 5d47279f..f5bfbf89 100644 --- a/paint/sources/import_theme.c +++ b/paint/sources/import_theme.c @@ -14,5 +14,5 @@ void import_theme_run(char *path) { config_raw->theme = string_copy(filename); box_preferences_h_theme->i = box_preferences_get_theme_index(); config_load_theme(config_raw->theme, true); - console_info(string("%s %s", tr("Theme imported:", NULL), filename)); + console_info(string("%s %s", tr("Theme imported:"), filename)); } diff --git a/paint/sources/material_nodes/color_ramp_node.c b/paint/sources/material_nodes/color_ramp_node.c index 24137901..89632de1 100644 --- a/paint/sources/material_nodes/color_ramp_node.c +++ b/paint/sources/material_nodes/color_ramp_node.c @@ -105,11 +105,11 @@ void nodes_material_color_ramp_button(i32 node_id) { } string_t_array_t *interpolate_combo = any_array_create_from_raw( (void *[]){ - tr("Linear", NULL), - tr("Constant", NULL), + tr("Linear"), + tr("Constant"), }, 2); - but->data->buffer[0] = ui_combo(h, interpolate_combo, tr("Interpolate", NULL), false, UI_ALIGN_LEFT, true); + but->data->buffer[0] = ui_combo(h, interpolate_combo, tr("Interpolate"), false, UI_ALIGN_LEFT, true); ui_row2(); i32 i = math_floor(ui_slider(ihandle, "Index", 0, (vals->length / (float)5) - 1, false, 1, true, UI_ALIGN_LEFT, true)); if (i >= (vals->length * 5) || i < 0) { diff --git a/paint/sources/material_nodes/group_node.c b/paint/sources/material_nodes/group_node.c index 685a108b..5048620d 100644 --- a/paint/sources/material_nodes/group_node.c +++ b/paint/sources/material_nodes/group_node.c @@ -22,7 +22,7 @@ void nodes_material_new_group_button(i32 node_id) { ui_node_t *node = ui_get_node(ui_nodes_get_canvas(true)->nodes, node_id); if (string_equals(node->name, "New Group")) { for (i32 i = 1; i < 999; ++i) { - node->name = string("%s %s", tr("Group", NULL), i32_to_string(i)); + node->name = string("%s %s", tr("Group"), i32_to_string(i)); bool found = false; for (i32 i = 0; i < project_material_groups->length; ++i) { node_group_t *g = project_material_groups->buffer[i]; @@ -88,7 +88,7 @@ void nodes_material_new_group_button(i32 node_id) { break; } } - if (ui_button(tr("Nodes", NULL), UI_ALIGN_CENTER, "")) { + if (ui_button(tr("Nodes"), UI_ALIGN_CENTER, "")) { any_array_push(ui_nodes_group_stack, group); } } @@ -111,22 +111,22 @@ void nodes_material_add_socket_menu_draw() { ui_node_socket_t_array_t *sockets = _nodes_material_sockets; node_group_t_array_t *group_stack = ui_nodes_group_stack; ui_node_canvas_t *c = group_stack->buffer[group_stack->length - 1]->canvas; - if (ui_menu_button(tr("RGBA", NULL), "", ICON_NONE)) { + if (ui_menu_button(tr("RGBA"), "", ICON_NONE)) { any_array_push(sockets, nodes_material_create_socket(nodes, node, NULL, "RGBA", c, 0.0, 1.0, NULL)); nodes_material_sync_sockets(node); } - if (ui_menu_button(tr("Vector", NULL), "", ICON_NONE)) { + if (ui_menu_button(tr("Vector"), "", ICON_NONE)) { any_array_push(sockets, nodes_material_create_socket(nodes, node, NULL, "VECTOR", c, 0.0, 1.0, NULL)); nodes_material_sync_sockets(node); } - if (ui_menu_button(tr("Value", NULL), "", ICON_NONE)) { + if (ui_menu_button(tr("Value"), "", ICON_NONE)) { any_array_push(sockets, nodes_material_create_socket(nodes, node, NULL, "VALUE", c, 0.0, 1.0, NULL)); nodes_material_sync_sockets(node); } } void nodes_material_add_socket_button(ui_nodes_t *nodes, ui_node_t *node, ui_node_socket_t_array_t *sockets) { - if (ui_button(tr("Add", NULL), UI_ALIGN_CENTER, "")) { + if (ui_button(tr("Add"), UI_ALIGN_CENTER, "")) { gc_unroot(_nodes_material_nodes); _nodes_material_nodes = nodes; gc_root(_nodes_material_nodes); diff --git a/paint/sources/neural_nodes/edit_image_node.c b/paint/sources/neural_nodes/edit_image_node.c index 887d4eba..87262c57 100644 --- a/paint/sources/neural_nodes/edit_image_node.c +++ b/paint/sources/neural_nodes/edit_image_node.c @@ -18,8 +18,8 @@ void edit_image_node_button(i32 node_id) { "Qwen Image Edit", }, 1); - i32 model = ui_combo(ui_nest(h, 0), models, tr("Model", NULL), false, UI_ALIGN_LEFT, true); - char *prompt = ui_text_area(ui_nest(h, 1), UI_ALIGN_LEFT, true, tr("prompt", NULL), true); + i32 model = ui_combo(ui_nest(h, 0), models, tr("Model"), false, UI_ALIGN_LEFT, true); + char *prompt = ui_text_area(ui_nest(h, 1), UI_ALIGN_LEFT, true, tr("prompt"), true); node->buttons->buffer[0]->height = string_split(prompt, "\n")->length + 2; if (neural_node_button(node, models->buffer[model])) { diff --git a/paint/sources/neural_nodes/image_to_3d_mesh_node.c b/paint/sources/neural_nodes/image_to_3d_mesh_node.c index 59d8a4cb..1d1ba566 100644 --- a/paint/sources/neural_nodes/image_to_3d_mesh_node.c +++ b/paint/sources/neural_nodes/image_to_3d_mesh_node.c @@ -26,7 +26,7 @@ void image_to_3d_mesh_node_button(i32 node_id) { "Hunyuan3D", }, 1); - i32 model = ui_combo(ui_nest(h, 0), models, tr("Model", NULL), false, UI_ALIGN_LEFT, true); + i32 model = ui_combo(ui_nest(h, 0), models, tr("Model"), false, UI_ALIGN_LEFT, true); if (neural_node_button(node, models->buffer[model])) { ui_node_t *from_node = neural_from_node(node->inputs->buffer[0], 0); gpu_texture_t *input = ui_nodes_get_node_preview_image(from_node); diff --git a/paint/sources/neural_nodes/image_to_depth_node.c b/paint/sources/neural_nodes/image_to_depth_node.c index df46cef6..6a0f64d0 100644 --- a/paint/sources/neural_nodes/image_to_depth_node.c +++ b/paint/sources/neural_nodes/image_to_depth_node.c @@ -17,7 +17,7 @@ void image_to_depth_node_button(i32 node_id) { "Marigold", }, 1); - i32 model = ui_combo(ui_nest(h, 0), models, tr("Model", NULL), false, UI_ALIGN_LEFT, true); + i32 model = ui_combo(ui_nest(h, 0), models, tr("Model"), false, UI_ALIGN_LEFT, true); if (neural_node_button(node, models->buffer[model])) { ui_node_t *from_node = neural_from_node(node->inputs->buffer[0], 0); gpu_texture_t *input = ui_nodes_get_node_preview_image(from_node); diff --git a/paint/sources/neural_nodes/image_to_normal_map_node.c b/paint/sources/neural_nodes/image_to_normal_map_node.c index 4803323f..d15c9456 100644 --- a/paint/sources/neural_nodes/image_to_normal_map_node.c +++ b/paint/sources/neural_nodes/image_to_normal_map_node.c @@ -17,7 +17,7 @@ void image_to_normal_map_node_button(i32 node_id) { "Marigold", }, 1); - i32 model = ui_combo(ui_nest(h, 0), models, tr("Model", NULL), false, UI_ALIGN_LEFT, true); + i32 model = ui_combo(ui_nest(h, 0), models, tr("Model"), false, UI_ALIGN_LEFT, true); if (neural_node_button(node, models->buffer[model])) { ui_node_t *from_node = neural_from_node(node->inputs->buffer[0], 0); gpu_texture_t *input = ui_nodes_get_node_preview_image(from_node); diff --git a/paint/sources/neural_nodes/image_to_pbr_node.c b/paint/sources/neural_nodes/image_to_pbr_node.c index c92ae4f5..dbdc0e6e 100644 --- a/paint/sources/neural_nodes/image_to_pbr_node.c +++ b/paint/sources/neural_nodes/image_to_pbr_node.c @@ -164,7 +164,7 @@ void image_to_pbr_node_button(i32 node_id) { "Marigold", }, 1); - i32 model = ui_combo(ui_nest(h, 0), models, tr("Model", NULL), false, UI_ALIGN_LEFT, true); + i32 model = ui_combo(ui_nest(h, 0), models, tr("Model"), false, UI_ALIGN_LEFT, true); if (neural_node_button(node, models->buffer[model])) { ui_node_t *from_node = neural_from_node(node->inputs->buffer[0], 0); gpu_texture_t *input = ui_nodes_get_node_preview_image(from_node); diff --git a/paint/sources/neural_nodes/inpaint_image_node.c b/paint/sources/neural_nodes/inpaint_image_node.c index 31cf1a8f..63410a7b 100644 --- a/paint/sources/neural_nodes/inpaint_image_node.c +++ b/paint/sources/neural_nodes/inpaint_image_node.c @@ -126,8 +126,8 @@ void inpaint_image_node_button(i32 node_id) { "Qwen Image Edit", }, 2); - i32 model = ui_combo(ui_nest(h, 0), models, tr("Model", NULL), false, UI_ALIGN_LEFT, true); - char *prompt = ui_text_area(ui_nest(h, 1), UI_ALIGN_LEFT, true, tr("prompt", NULL), true); + i32 model = ui_combo(ui_nest(h, 0), models, tr("Model"), false, UI_ALIGN_LEFT, true); + char *prompt = ui_text_area(ui_nest(h, 1), UI_ALIGN_LEFT, true, tr("prompt"), true); node->buttons->buffer[0]->height = string_split(prompt, "\n")->length + 2; if (neural_node_button(node, models->buffer[model])) { diff --git a/paint/sources/neural_nodes/neural_node.c b/paint/sources/neural_nodes/neural_node.c index 4ed524c2..b4b7203b 100644 --- a/paint/sources/neural_nodes/neural_node.c +++ b/paint/sources/neural_nodes/neural_node.c @@ -51,15 +51,15 @@ bool neural_node_button(ui_node_t *node, char *model) { if (node != neural_node_current) { ui->enabled = false; } - ui_button(tr("Processing...", NULL), UI_ALIGN_CENTER, ""); + ui_button(tr("Processing..."), UI_ALIGN_CENTER, ""); if (node != neural_node_current) { ui->enabled = true; } } - else if (!found && ui_button(tr("Setup", NULL), UI_ALIGN_CENTER, "")) { + else if (!found && ui_button(tr("Setup"), UI_ALIGN_CENTER, "")) { sys_notify_on_next_frame(&neural_node_button_on_next_frame, NULL); } - else if (found && ui_button(tr("Run", NULL), UI_ALIGN_CENTER, "")) { + else if (found && ui_button(tr("Run"), UI_ALIGN_CENTER, "")) { return true; } return false; @@ -122,7 +122,7 @@ void neural_node_download_done_untar(void *_) { void neural_node_download_done(char *url) { neural_node_downloading--; - console_log(string("%s %s", tr("Downloaded file from", NULL), url)); + console_log(string("%s %s", tr("Downloaded file from"), url)); #ifdef IRON_LINUX // todo @@ -138,7 +138,7 @@ void neural_node_download_done(char *url) { #ifdef WITH_COMPRESS if (ends_with(url, "Hunyuan3D_win64.tar")) { - console_toast(tr("Unpacking Hunyuan3D_win64.tar", NULL)); + console_toast(tr("Unpacking Hunyuan3D_win64.tar")); sys_notify_on_next_frame(&neural_node_download_done_untar, NULL); } #endif diff --git a/paint/sources/neural_nodes/outpaint_image_node.c b/paint/sources/neural_nodes/outpaint_image_node.c index 1eef2f06..118d7d41 100644 --- a/paint/sources/neural_nodes/outpaint_image_node.c +++ b/paint/sources/neural_nodes/outpaint_image_node.c @@ -124,8 +124,8 @@ void outpaint_image_node_button(i32 node_id) { "Qwen Image Edit", }, 2); - i32 model = ui_combo(ui_nest(h, 0), models, tr("Model", NULL), false, UI_ALIGN_LEFT, true); - char *prompt = ui_text_area(ui_nest(h, 1), UI_ALIGN_LEFT, true, tr("prompt", NULL), true); + i32 model = ui_combo(ui_nest(h, 0), models, tr("Model"), false, UI_ALIGN_LEFT, true); + char *prompt = ui_text_area(ui_nest(h, 1), UI_ALIGN_LEFT, true, tr("prompt"), true); node->buttons->buffer[0]->height = string_split(prompt, "\n")->length + 2; if (neural_node_button(node, models->buffer[model])) { diff --git a/paint/sources/neural_nodes/text_to_image_node.c b/paint/sources/neural_nodes/text_to_image_node.c index f4813279..dbe03d77 100644 --- a/paint/sources/neural_nodes/text_to_image_node.c +++ b/paint/sources/neural_nodes/text_to_image_node.c @@ -148,8 +148,8 @@ void text_to_image_node_button(i32 node_id) { "Wan", }, 4); - i32 model = ui_combo(ui_nest(h, 0), models, tr("Model", NULL), false, UI_ALIGN_LEFT, true); - char *prompt = ui_text_area(ui_nest(h, 1), UI_ALIGN_LEFT, true, tr("prompt", NULL), true); + i32 model = ui_combo(ui_nest(h, 0), models, tr("Model"), false, UI_ALIGN_LEFT, true); + char *prompt = ui_text_area(ui_nest(h, 1), UI_ALIGN_LEFT, true, tr("prompt"), true); node->buttons->buffer[0]->height = string_split(prompt, "\n")->length + 2; if (neural_node_button(node, models->buffer[model])) { diff --git a/paint/sources/neural_nodes/tile_image_node.c b/paint/sources/neural_nodes/tile_image_node.c index 82e1cbf5..21020a35 100644 --- a/paint/sources/neural_nodes/tile_image_node.c +++ b/paint/sources/neural_nodes/tile_image_node.c @@ -124,8 +124,8 @@ void tile_image_node_button(i32 node_id) { "Qwen Image Edit", }, 2); - i32 model = ui_combo(ui_nest(h, 0), models, tr("Model", NULL), false, UI_ALIGN_LEFT, true); - char *prompt = ui_text_area(ui_nest(h, 1), UI_ALIGN_LEFT, true, tr("prompt", NULL), true); + i32 model = ui_combo(ui_nest(h, 0), models, tr("Model"), false, UI_ALIGN_LEFT, true); + char *prompt = ui_text_area(ui_nest(h, 1), UI_ALIGN_LEFT, true, tr("prompt"), true); node->buttons->buffer[0]->height = string_split(prompt, "\n")->length + 2; if (neural_node_button(node, models->buffer[model])) { diff --git a/paint/sources/neural_nodes/upscale_image_node.c b/paint/sources/neural_nodes/upscale_image_node.c index 78359d61..046d630e 100644 --- a/paint/sources/neural_nodes/upscale_image_node.c +++ b/paint/sources/neural_nodes/upscale_image_node.c @@ -17,7 +17,7 @@ void upscale_image_node_button(i32 node_id) { "Real-ESRGAN", }, 1); - i32 model = ui_combo(ui_nest(h, 0), models, tr("Model", NULL), false, UI_ALIGN_LEFT, true); + i32 model = ui_combo(ui_nest(h, 0), models, tr("Model"), false, UI_ALIGN_LEFT, true); if (neural_node_button(node, models->buffer[model])) { ui_node_t *from_node = neural_from_node(node->inputs->buffer[0], 0); gpu_texture_t *input = ui_nodes_get_node_preview_image(from_node); diff --git a/paint/sources/neural_nodes/vary_image_node.c b/paint/sources/neural_nodes/vary_image_node.c index 6ace63d1..4642601f 100644 --- a/paint/sources/neural_nodes/vary_image_node.c +++ b/paint/sources/neural_nodes/vary_image_node.c @@ -122,8 +122,8 @@ void vary_image_node_button(i32 node_id) { "Qwen Image Edit", }, 2); - i32 model = ui_combo(ui_nest(h, 0), models, tr("Model", NULL), false, UI_ALIGN_LEFT, true); - char *prompt = ui_text_area(ui_nest(h, 1), UI_ALIGN_LEFT, true, tr("prompt", NULL), true); + i32 model = ui_combo(ui_nest(h, 0), models, tr("Model"), false, UI_ALIGN_LEFT, true); + char *prompt = ui_text_area(ui_nest(h, 1), UI_ALIGN_LEFT, true, tr("prompt"), true); node->buttons->buffer[0]->height = string_split(prompt, "\n")->length + 2; if (neural_node_button(node, models->buffer[model])) { diff --git a/paint/sources/physics_sim.c b/paint/sources/physics_sim.c index fc35bbc0..d67c8e58 100644 --- a/paint/sources/physics_sim.c +++ b/paint/sources/physics_sim.c @@ -48,7 +48,7 @@ void sim_play() { if (sim_record) { if (string_equals(project_filepath, "")) { - console_error(tr("Save project first", NULL)); + console_error(tr("Save project first")); sim_record = false; return; } diff --git a/paint/sources/project.c b/paint/sources/project.c index 2d142da2..098bf861 100644 --- a/paint/sources/project.c +++ b/paint/sources/project.c @@ -59,7 +59,7 @@ void project_save(bool save_and_quit) { void project_save_as_on_file_picked(char *path) { char *f = ui_files_filename; if (string_equals(f, "")) { - f = string_copy(tr("untitled", NULL)); + f = string_copy(tr("untitled")); } gc_unroot(project_filepath); project_filepath = string("%s%s%s", path, PATH_SEP, f); @@ -98,7 +98,7 @@ void project_new_box_draw() { if (h_project_type->init) { h_project_type->i = context_raw->project_type; } - context_raw->project_type = ui_combo(h_project_type, project_mesh_list, tr("Template", NULL), true, UI_ALIGN_LEFT, true); + context_raw->project_type = ui_combo(h_project_type, project_mesh_list, tr("Template"), true, UI_ALIGN_LEFT, true); ui_handle_t *h_project_aspect_ratio = ui_handle(__ID__); if (h_project_aspect_ratio->init) { h_project_aspect_ratio->i = context_raw->project_aspect_ratio; @@ -110,20 +110,20 @@ void project_new_box_draw() { "1:2", }, 3); - context_raw->project_aspect_ratio = ui_combo(h_project_aspect_ratio, project_aspect_ratio_combo, tr("Aspect Ratio", NULL), true, UI_ALIGN_LEFT, true); + context_raw->project_aspect_ratio = ui_combo(h_project_aspect_ratio, project_aspect_ratio_combo, tr("Aspect Ratio"), true, UI_ALIGN_LEFT, true); ui_end_element(); ui_row2(); - if (ui_icon_button(tr("Cancel", NULL), ICON_CLOSE, UI_ALIGN_CENTER)) { + if (ui_icon_button(tr("Cancel"), ICON_CLOSE, UI_ALIGN_CENTER)) { ui_box_hide(); } - if (ui_icon_button(tr("OK", NULL), ICON_CHECK, UI_ALIGN_CENTER) || ui->is_return_down) { + if (ui_icon_button(tr("OK"), ICON_CHECK, UI_ALIGN_CENTER) || ui->is_return_down) { project_new(true); ui_box_hide(); } } void project_new_box() { - ui_box_show_custom(&project_new_box_draw, 400, 200, NULL, true, tr("New Project", NULL)); + ui_box_show_custom(&project_new_box_draw, 400, 200, NULL, true, tr("New Project")); } void project_cleanup() { @@ -445,15 +445,15 @@ void project_import_mesh_box_draw() { if (ends_with(to_lower_case(path), ".obj")) { string_t_array_t *split_by_combo = any_array_create_from_raw( (void *[]){ - tr("Object", NULL), - tr("Group", NULL), - tr("Material", NULL), - tr("UDIM Tile", NULL), + tr("Object"), + tr("Group"), + tr("Material"), + tr("UDIM Tile"), }, 4); - context_raw->split_by = ui_combo(ui_handle(__ID__), split_by_combo, tr("Split By", NULL), true, UI_ALIGN_LEFT, true); + context_raw->split_by = ui_combo(ui_handle(__ID__), split_by_combo, tr("Split By"), true, UI_ALIGN_LEFT, true); if (ui->is_hovered) { - ui_tooltip(tr("Split .obj mesh into objects", NULL)); + ui_tooltip(tr("Split .obj mesh into objects")); } } @@ -470,14 +470,14 @@ void project_import_mesh_box_draw() { 3); ui_row(row); - if (ui_icon_button(tr("Cancel", NULL), ICON_CLOSE, UI_ALIGN_CENTER)) { + if (ui_icon_button(tr("Cancel"), ICON_CLOSE, UI_ALIGN_CENTER)) { ui_box_hide(); } - if (ui_icon_button(tr("Import", NULL), ICON_CHECK, UI_ALIGN_CENTER) || ui->is_return_down) { + if (ui_icon_button(tr("Import"), ICON_CHECK, UI_ALIGN_CENTER) || ui->is_return_down) { ui_box_hide(); #if defined(IRON_ANDROID) || defined(IRON_IOS) - console_toast(tr("Importing mesh", NULL)); + console_toast(tr("Importing mesh")); #endif import_mesh_run(path, clear_layers, replace_existing); @@ -485,7 +485,7 @@ void project_import_mesh_box_draw() { done(); } } - if (ui_button(tr("?", NULL), UI_ALIGN_CENTER, "")) { + if (ui_button(tr("?"), UI_ALIGN_CENTER, "")) { iron_load_url("https://github.com/armory3d/armorpaint_web/blob/main/manual.md#faq"); } } @@ -499,7 +499,7 @@ void project_import_mesh_box(char *path, bool replace_existing, bool clear_layer gc_unroot(_project_import_mesh_box_done); _project_import_mesh_box_done = done; gc_root(_project_import_mesh_box_done); - ui_box_show_custom(&project_import_mesh_box_draw, 400, 200, NULL, true, tr("Import Mesh", NULL)); + ui_box_show_custom(&project_import_mesh_box_draw, 400, 200, NULL, true, tr("Import Mesh")); ui_box_click_to_hide = false; // Prevent closing when going back to window from file browser } @@ -532,17 +532,17 @@ void project_unwrap_mesh_box_draw() { void (*done)(raw_mesh_t *) = _project_unwrap_mesh_box_done; string_t_array_t *unwrap_plugins = project_get_unwrap_plugins(); - _project_unwrap_by = ui_combo(ui_handle(__ID__), unwrap_plugins, tr("Plugin", NULL), true, UI_ALIGN_LEFT, true); + _project_unwrap_by = ui_combo(ui_handle(__ID__), unwrap_plugins, tr("Plugin"), true, UI_ALIGN_LEFT, true); ui_row2(); - if (ui_icon_button(tr("Cancel", NULL), ICON_CLOSE, UI_ALIGN_CENTER)) { + if (ui_icon_button(tr("Cancel"), ICON_CLOSE, UI_ALIGN_CENTER)) { ui_box_hide(); } - if (ui_icon_button(tr("Unwrap", NULL), ICON_CHECK, UI_ALIGN_CENTER) || ui->is_return_down) { + if (ui_icon_button(tr("Unwrap"), ICON_CHECK, UI_ALIGN_CENTER) || ui->is_return_down) { ui_box_hide(); #if defined(IRON_ANDROID) || defined(IRON_IOS) - console_toast(tr("Unwrapping mesh", NULL)); + console_toast(tr("Unwrapping mesh")); #endif project_unwrap_mesh(mesh, done); @@ -562,7 +562,7 @@ void project_unwrap_mesh_box(raw_mesh_t *mesh, void (*done)(raw_mesh_t *), bool return; } - ui_box_show_custom(&project_unwrap_mesh_box_draw, 400, 200, NULL, true, tr("Unwrap Mesh", NULL)); + ui_box_show_custom(&project_unwrap_mesh_box_draw, 400, 200, NULL, true, tr("Unwrap Mesh")); } void project_unwrap_mesh(raw_mesh_t *mesh, void (*done)(raw_mesh_t *)) { @@ -575,7 +575,7 @@ void project_unwrap_mesh(raw_mesh_t *mesh, void (*done)(raw_mesh_t *)) { char *f = unwrap_plugins->buffer[_project_unwrap_by]; if (string_array_index_of(config_raw->plugins, f) == -1) { config_enable_plugin(f); - console_info(string("%s %s", f, tr("plugin enabled", NULL))); + console_info(string("%s %s", f, tr("plugin enabled"))); } void *cb = any_map_get(util_mesh_unwrappers, f); // JSValue * -> (a: raw_mesh_t)=>void js_call_ptr(cb, mesh); @@ -726,7 +726,7 @@ bool project_packed_asset_exists(packed_asset_t_array_t *packed_assets, char *na void project_export_swatches_on_file_picked(char *path) { char *f = ui_files_filename; if (string_equals(f, "")) { - f = string_copy(tr("untitled", NULL)); + f = string_copy(tr("untitled")); } if (path_is_gimp_color_palette(f)) { // export_gpl_run(path + PATH_SEP + f, substring(f, 0, string_last_index_of(f, ".")), project_raw.swatches); diff --git a/paint/sources/slot_layer.c b/paint/sources/slot_layer.c index 3247ce49..81e83678 100644 --- a/paint/sources/slot_layer.c +++ b/paint/sources/slot_layer.c @@ -1101,7 +1101,7 @@ void layers_update_fill_layer(bool parse_paint) { void layers_set_object_mask() { string_t_array_t *ar = any_array_create_from_raw( (void *[]){ - tr("None", NULL), + tr("None"), }, 1); for (i32 i = 0; i < project_paint_objects->length; ++i) { diff --git a/paint/sources/strings.c b/paint/sources/strings.c index bd66b239..3360db31 100644 --- a/paint/sources/strings.c +++ b/paint/sources/strings.c @@ -2,27 +2,27 @@ #include "global.h" char *strings_arm_file_expected() { - return tr("Error: .arm file expected", NULL); + return tr("Error: .arm file expected"); } char *strings_unknown_asset_format() { - return tr("Error: Unknown asset format", NULL); + return tr("Error: Unknown asset format"); } char *strings_could_not_locate_texture() { - return tr("Error: Could not locate texture", NULL); + return tr("Error: Could not locate texture"); } char *strings_failed_to_read_mesh_data() { - return tr("Error: Failed to read mesh data", NULL); + return tr("Error: Failed to read mesh data"); } char *strings_check_internet_connection() { - return tr("Error: Check internet connection to access the cloud", NULL); + return tr("Error: Check internet connection to access the cloud"); } char *strings_asset_already_imported() { - return tr("Info: Asset already imported", NULL); + return tr("Info: Asset already imported"); } char *strings_graphics_api() { diff --git a/paint/sources/tab_browser.c b/paint/sources/tab_browser.c index 765817bf..189c9cc7 100644 --- a/paint/sources/tab_browser.c +++ b/paint/sources/tab_browser.c @@ -9,7 +9,7 @@ void tab_browser_show_directory(char *directory) { } void tab_browser_draw_bookmark_menu() { - if (ui_menu_button(tr("Delete", NULL), "", ICON_DELETE)) { + if (ui_menu_button(tr("Delete"), "", ICON_DELETE)) { string_array_remove(config_raw->bookmarks, _tab_browser_draw_b); config_save(); } @@ -83,21 +83,21 @@ void tab_browser_draw_set_as_envmap() { void tab_browser_draw_context_menu_draw() { char *file = _tab_browser_draw_file; - if (ui_menu_button(tr("Import", NULL), "", ICON_IMPORT)) { + if (ui_menu_button(tr("Import"), "", ICON_IMPORT)) { import_asset_run(file, -1.0, -1.0, true, true, NULL); } if (path_is_texture(file)) { - if (ui_menu_button(tr("Set as Envmap", NULL), "", ICON_LANDSCAPE)) { + if (ui_menu_button(tr("Set as Envmap"), "", ICON_LANDSCAPE)) { import_asset_run(file, -1.0, -1.0, true, true, &tab_browser_draw_set_as_envmap); } - if (ui_menu_button(tr("Set as Mask", NULL), "", ICON_MASK)) { + if (ui_menu_button(tr("Set as Mask"), "", ICON_MASK)) { import_asset_run(file, -1.0, -1.0, true, true, &tab_browser_draw_set_as_mask); } - if (ui_menu_button(tr("Set as Color ID Map", NULL), "", ICON_COLOR_ID)) { + if (ui_menu_button(tr("Set as Color ID Map"), "", ICON_COLOR_ID)) { import_asset_run(file, -1.0, -1.0, true, true, &tab_browser_draw_set_as_color_id_map); } } - if (ui_menu_button(tr("Open Externally", NULL), "", ICON_NONE)) { + if (ui_menu_button(tr("Open Externally"), "", ICON_NONE)) { file_start(file); } } @@ -112,16 +112,16 @@ void tab_browser_draw_context_menu(char *file) { } void tab_browser_draw_side_menu() { - if (ui_menu_button(tr("Cloud", NULL), "", ICON_CLOUD)) { + if (ui_menu_button(tr("Cloud"), "", ICON_CLOUD)) { tab_browser_go_to_cloud(); } - if (ui_menu_button(tr("Disk", NULL), "", ICON_STORAGE)) { + if (ui_menu_button(tr("Disk"), "", ICON_STORAGE)) { tab_browser_go_to_disk(); } } void tab_browser_draw(ui_handle_t *htab) { - char *title = tr("Browser", NULL); + char *title = tr("Browser"); #ifdef IRON_IOS if (config_is_iphone()) { @@ -175,7 +175,7 @@ void tab_browser_draw(ui_handle_t *htab) { } // Bookmark - if (ui_icon_button(tr("Bookmark", NULL), ICON_PLUS, UI_ALIGN_LEFT)) { + if (ui_icon_button(tr("Bookmark"), ICON_PLUS, UI_ALIGN_LEFT)) { char *bookmark = tab_browser_hpath->text; #ifdef IRON_WINDOWS bookmark = string_copy(string_replace_all(bookmark, "\\", "/")); @@ -187,7 +187,7 @@ void tab_browser_draw(ui_handle_t *htab) { // Refresh bool in_focus = ui->input_x > ui->_window_x && ui->input_x < ui->_window_x + ui->_window_w && ui->input_y > ui->_window_y && ui->input_y < ui->_window_y + ui->_window_h; - if (ui_icon_button(tr("Refresh", NULL), ICON_REFRESH, UI_ALIGN_CENTER) || (in_focus && ui->is_key_pressed && ui->key_code == KEY_CODE_F5)) { + if (ui_icon_button(tr("Refresh"), ICON_REFRESH, UI_ALIGN_CENTER) || (in_focus && ui->is_key_pressed && ui->key_code == KEY_CODE_F5)) { tab_browser_refresh = true; } } @@ -221,7 +221,7 @@ void tab_browser_draw(ui_handle_t *htab) { } ui->enabled = true; if (ui->is_hovered) { - ui_tooltip(tr("Previous folder", NULL)); + ui_tooltip(tr("Previous folder")); } #ifdef IRON_ANDROID @@ -233,7 +233,7 @@ void tab_browser_draw(ui_handle_t *htab) { } #endif - tab_browser_hpath->text = string_copy(ui_text_input(tab_browser_hpath, tr("Path", NULL), UI_ALIGN_LEFT, true, false)); + tab_browser_hpath->text = string_copy(ui_text_input(tab_browser_hpath, tr("Path"), UI_ALIGN_LEFT, true, false)); #ifdef IRON_ANDROID if (stripped) { @@ -242,14 +242,14 @@ void tab_browser_draw(ui_handle_t *htab) { #endif if (show_full) { - tab_browser_hsearch->text = string_copy(ui_text_input(tab_browser_hsearch, tr("Search", NULL), UI_ALIGN_LEFT, true, true)); + tab_browser_hsearch->text = string_copy(ui_text_input(tab_browser_hsearch, tr("Search"), UI_ALIGN_LEFT, true, true)); if (ui->is_hovered) { - ui_tooltip(string("%s\n%s", tr("ctrl+f to search", NULL), tr("esc to cancel", NULL))); + ui_tooltip(string("%s\n%s", tr("ctrl+f to search"), tr("esc to cancel"))); } if (ui->is_ctrl_down && ui->is_key_pressed && ui->key_code == KEY_CODE_F) { // Start searching via ctrl+f ui_start_text_edit(tab_browser_hsearch, UI_ALIGN_LEFT); } - if (!string_equals(tab_browser_hsearch->text, "") && (ui_button(tr("X", NULL), UI_ALIGN_CENTER, "") || ui->is_escape_down)) { + if (!string_equals(tab_browser_hsearch->text, "") && (ui_button(tr("X"), UI_ALIGN_CENTER, "") || ui->is_escape_down)) { tab_browser_hsearch->text = ""; } } @@ -296,11 +296,11 @@ void tab_browser_draw(ui_handle_t *htab) { ui->_y = _y; ui->_w = bookmarks_w; - if (ui_icon_button(tr("Cloud", NULL), ICON_CLOUD, UI_ALIGN_LEFT)) { + if (ui_icon_button(tr("Cloud"), ICON_CLOUD, UI_ALIGN_LEFT)) { tab_browser_go_to_cloud(); } - if (ui_icon_button(tr("Disk", NULL), ICON_STORAGE, UI_ALIGN_LEFT)) { + if (ui_icon_button(tr("Disk"), ICON_STORAGE, UI_ALIGN_LEFT)) { tab_browser_go_to_disk(); } @@ -336,16 +336,16 @@ void tab_browser_go_to_cloud() { #ifdef IRON_ANDROID void tab_browser_go_to_disk_android_menu() { - if (ui_menu_button(tr("Download", NULL), "", ICON_FOLDER)) { + if (ui_menu_button(tr("Download"), "", ICON_FOLDER)) { tab_browser_hpath->text = string_copy(ui_files_default_path); } - if (ui_menu_button(tr("Pictures", NULL), "", ICON_FOLDER)) { + if (ui_menu_button(tr("Pictures"), "", ICON_FOLDER)) { tab_browser_hpath->text = "/storage/emulated/0/Pictures"; } - if (ui_menu_button(tr("Camera", NULL), "", ICON_FOLDER)) { + if (ui_menu_button(tr("Camera"), "", ICON_FOLDER)) { tab_browser_hpath->text = "/storage/emulated/0/DCIM/Camera"; } - if (ui_menu_button(tr("Projects", NULL), "", ICON_FOLDER)) { + if (ui_menu_button(tr("Projects"), "", ICON_FOLDER)) { tab_browser_hpath->text = string_copy(iron_internal_save_path()); } } diff --git a/paint/sources/tab_brushes.c b/paint/sources/tab_brushes.c index 3b4e31b3..9d2f9224 100644 --- a/paint/sources/tab_brushes.c +++ b/paint/sources/tab_brushes.c @@ -24,22 +24,22 @@ void tab_brushes_draw_context_menu() { i32 i = _tab_brushes_draw_i; // let b: slot_brush_t = brushes[i]; - if (ui_menu_button(tr("Export", NULL), "", ICON_EXPORT)) { + if (ui_menu_button(tr("Export"), "", ICON_EXPORT)) { context_select_brush(i); box_export_show_brush(); } - if (ui_menu_button(tr("Duplicate", NULL), "", ICON_DUPLICATE)) { + if (ui_menu_button(tr("Duplicate"), "", ICON_DUPLICATE)) { sys_notify_on_next_frame(&tab_brushes_draw_duplicate, NULL); } - if (project_brushes->length > 1 && ui_menu_button(tr("Delete", NULL), "delete", ICON_DELETE)) { + if (project_brushes->length > 1 && ui_menu_button(tr("Delete"), "delete", ICON_DELETE)) { tab_brushes_delete_brush(project_brushes->buffer[i]); } } void tab_brushes_draw(ui_handle_t *htab) { - if (ui_tab(htab, tr("Brushes", NULL), false, -1, false)) { + if (ui_tab(htab, tr("Brushes"), false, -1, false)) { ui_begin_sticky(); f32_array_t *row = f32_array_create_from_raw( (f32[]){ @@ -49,16 +49,16 @@ void tab_brushes_draw(ui_handle_t *htab) { }, 3); ui_row(row); - if (ui_icon_button(tr("New", NULL), ICON_PLUS, UI_ALIGN_CENTER)) { + if (ui_icon_button(tr("New"), ICON_PLUS, UI_ALIGN_CENTER)) { context_raw->brush = slot_brush_create(NULL); any_array_push(project_brushes, context_raw->brush); make_material_parse_brush(); ui_nodes_hwnd->redraws = 2; } - if (ui_icon_button(tr("Import", NULL), ICON_IMPORT, UI_ALIGN_CENTER)) { + if (ui_icon_button(tr("Import"), ICON_IMPORT, UI_ALIGN_CENTER)) { project_import_brush(); } - if (ui_button(tr("Nodes", NULL), UI_ALIGN_CENTER, "")) { + if (ui_button(tr("Nodes"), UI_ALIGN_CENTER, "")) { ui_base_show_brush_nodes(); } ui_end_sticky(); diff --git a/paint/sources/tab_console.c b/paint/sources/tab_console.c index a5835387..4c4bcb96 100644 --- a/paint/sources/tab_console.c +++ b/paint/sources/tab_console.c @@ -5,7 +5,7 @@ void tab_console_draw_export_on_file_picked(char *path) { char *str = string_array_join(console_last_traces, "\n"); char *f = ui_files_filename; if (string_equals(f, "")) { - f = string_copy(tr("untitled", NULL)); + f = string_copy(tr("untitled")); } path = string("%s%s%s", path, PATH_SEP, f); if (!ends_with(path, ".txt")) { @@ -15,7 +15,7 @@ void tab_console_draw_export_on_file_picked(char *path) { } void tab_console_draw(ui_handle_t *htab) { - char *title = console_message_timer > 0 ? string("%s ", console_message) : tr("Console", NULL); + char *title = console_message_timer > 0 ? string("%s ", console_message) : tr("Console"); i32 color = console_message_timer > 0 ? console_message_color : -1; if (ui_tab(htab, title, false, color, false) && ui->_window_h > ui_statusbar_default_h * UI_SCALE()) { @@ -41,17 +41,17 @@ void tab_console_draw(ui_handle_t *htab) { ui_handle_t *h_input = ui_handle(__ID__); - if (ui_icon_button(tr("Clear", NULL), ICON_ERASE, UI_ALIGN_CENTER)) { + if (ui_icon_button(tr("Clear"), ICON_ERASE, UI_ALIGN_CENTER)) { gc_unroot(console_last_traces); console_last_traces = any_array_create_from_raw((void *[]){}, 0); gc_root(console_last_traces); h_input->text = ""; } - if (ui_icon_button(tr("Export", NULL), ICON_EXPORT, UI_ALIGN_CENTER)) { + if (ui_icon_button(tr("Export"), ICON_EXPORT, UI_ALIGN_CENTER)) { ui_files_show("txt", true, false, &tab_console_draw_export_on_file_picked); } #if defined(IRON_WINDOWS) || defined(IRON_LINUX) || defined(IRON_MACOS) - if (ui_icon_button(tr("Copy", NULL), ICON_COPY, UI_ALIGN_CENTER)) { + if (ui_icon_button(tr("Copy"), ICON_COPY, UI_ALIGN_CENTER)) { char *str = string_array_join(console_last_traces, "\n"); iron_copy_to_clipboard(str); } @@ -82,7 +82,7 @@ void tab_console_draw(ui_handle_t *htab) { ui_set_font(ui, _font); ui->font_size = _font_size; - if (ui_icon_button(tr("Run", NULL), ICON_PLAY, UI_ALIGN_CENTER)) { + if (ui_icon_button(tr("Run"), ICON_PLAY, UI_ALIGN_CENTER)) { js_eval(h_input->text); h_input->text = ""; } diff --git a/paint/sources/tab_fonts.c b/paint/sources/tab_fonts.c index 07f08d22..902661d5 100644 --- a/paint/sources/tab_fonts.c +++ b/paint/sources/tab_fonts.c @@ -11,7 +11,7 @@ void tab_fonts_draw_make_font_preview(void * _) { void tab_fonts_draw_context_menu_draw() { i32 i = _tab_fonts_draw_i; - if (project_fonts->length > 1 && ui_menu_button(tr("Delete", NULL), "delete", ICON_DELETE) && !string_equals(project_fonts->buffer[i]->file, "")) { + if (project_fonts->length > 1 && ui_menu_button(tr("Delete"), "delete", ICON_DELETE) && !string_equals(project_fonts->buffer[i]->file, "")) { tab_fonts_delete_font(project_fonts->buffer[i]); } } @@ -27,7 +27,7 @@ void tab_fonts_draw_select_font(void * _) { } void tab_fonts_draw(ui_handle_t *htab) { - if (ui_tab(htab, tr("Fonts", NULL), false, -1, false) && ui->_window_h > ui_statusbar_default_h * UI_SCALE()) { + if (ui_tab(htab, tr("Fonts"), false, -1, false) && ui->_window_h > ui_statusbar_default_h * UI_SCALE()) { ui_begin_sticky(); f32_array_t *row = f32_array_create_from_raw( @@ -38,14 +38,14 @@ void tab_fonts_draw(ui_handle_t *htab) { 2); ui_row(row); - if (ui_icon_button(tr("Import", NULL), ICON_IMPORT, UI_ALIGN_CENTER)) { + if (ui_icon_button(tr("Import"), ICON_IMPORT, UI_ALIGN_CENTER)) { project_import_asset("ttf,ttc,otf", true); } if (ui->is_hovered) { - ui_tooltip(tr("Import font file", NULL)); + ui_tooltip(tr("Import font file")); } - if (ui_icon_button(tr("2D View", NULL), ICON_WINDOW, UI_ALIGN_CENTER)) { + if (ui_icon_button(tr("2D View"), ICON_WINDOW, UI_ALIGN_CENTER)) { ui_base_show_2d_view(VIEW_2D_TYPE_FONT); } ui_end_sticky(); diff --git a/paint/sources/tab_history.c b/paint/sources/tab_history.c index 6f742a50..7e74d633 100644 --- a/paint/sources/tab_history.c +++ b/paint/sources/tab_history.c @@ -2,7 +2,7 @@ #include "global.h" void tab_history_draw(ui_handle_t *htab) { - if (ui_tab(htab, tr("History", NULL), false, -1, false)) { + if (ui_tab(htab, tr("History"), false, -1, false)) { for (i32 i = 0; i < history_steps->length; ++i) { i32 active = history_steps->length - 1 - history_redos; if (i == active) { diff --git a/paint/sources/tab_layers.c b/paint/sources/tab_layers.c index becfd300..7d2a5d4d 100644 --- a/paint/sources/tab_layers.c +++ b/paint/sources/tab_layers.c @@ -7,7 +7,7 @@ void tab_layers_draw(ui_handle_t *htab) { } void tab_layers_draw_mini(ui_handle_t *htab) { - ui_set_hovered_tab_name(tr("Layers", NULL)); + ui_set_hovered_tab_name(tr("Layers")); i32 _ELEMENT_H = ui->ops->theme->ELEMENT_H; ui->ops->theme->ELEMENT_H = math_floor(ui_sidebar_w_mini / (float)2 / (float)UI_SCALE()); @@ -29,7 +29,7 @@ void tab_layers_draw_mini(ui_handle_t *htab) { } void tab_layers_draw_full(ui_handle_t *htab) { - if (ui_tab(htab, tr("Layers", NULL), false, -1, false)) { + if (ui_tab(htab, tr("Layers"), false, -1, false)) { ui_begin_sticky(); f32_array_t *row = f32_array_create_from_raw( (f32[]){ @@ -40,7 +40,7 @@ void tab_layers_draw_full(ui_handle_t *htab) { 3); ui_row(row); - tab_layers_button_new(tr("New", NULL)); + tab_layers_button_new(tr("New")); tab_layers_button_2d_view(); tab_layers_combo_filter(); @@ -53,11 +53,11 @@ void tab_layers_draw_full(ui_handle_t *htab) { } void tab_layers_button_2d_view() { - if (ui_button(tr("2D View", NULL), UI_ALIGN_CENTER, "")) { + if (ui_button(tr("2D View"), UI_ALIGN_CENTER, "")) { ui_base_show_2d_view(VIEW_2D_TYPE_LAYER); } else if (ui->is_hovered) { - ui_tooltip(string("%s (%s)", tr("Show 2D View", NULL), (char *)any_map_get(config_keymap, "toggle_2d_view"))); + ui_tooltip(string("%s (%s)", tr("Show 2D View"), (char *)any_map_get(config_keymap, "toggle_2d_view"))); } } @@ -105,23 +105,23 @@ void tab_layers_button_new_sculpt_layer(void *_) { void tab_layers_button_new_menu() { slot_layer_t *l = context_raw->layer; if (config_raw->workspace == WORKSPACE_SCULPT) { - if (ui_menu_button(tr("Sculpt Layer", NULL), "", ICON_PAINT)) { + if (ui_menu_button(tr("Sculpt Layer"), "", ICON_PAINT)) { sys_notify_on_next_frame(&tab_layers_button_new_sculpt_layer, NULL); } } else { - if (ui_menu_button(tr("Paint Layer", NULL), "", ICON_PAINT)) { + if (ui_menu_button(tr("Paint Layer"), "", ICON_PAINT)) { layers_new_layer(true, -1); history_new_layer(); } } - if (ui_menu_button(tr("Fill Layer", NULL), "", ICON_SPHERE)) { + if (ui_menu_button(tr("Fill Layer"), "", ICON_SPHERE)) { layers_create_fill_layer(UV_TYPE_UVMAP, mat4nan, -1); } - if (ui_menu_button(tr("Decal Layer", NULL), "", ICON_DECAL)) { + if (ui_menu_button(tr("Decal Layer"), "", ICON_DECAL)) { layers_create_fill_layer(UV_TYPE_PROJECT, mat4nan, -1); } - if (ui_menu_button(tr("Black Mask", NULL), "", ICON_MASK)) { + if (ui_menu_button(tr("Black Mask"), "", ICON_MASK)) { if (slot_layer_is_mask(l)) { context_set_layer(l->parent); } @@ -133,7 +133,7 @@ void tab_layers_button_new_menu() { history_new_black_mask(); sys_notify_on_next_frame(&tab_layers_button_new_update_fill_layers, NULL); } - if (ui_menu_button(tr("White Mask", NULL), "", ICON_MASK_WHITE)) { + if (ui_menu_button(tr("White Mask"), "", ICON_MASK_WHITE)) { if (slot_layer_is_mask(l)) { context_set_layer(l->parent); } @@ -145,7 +145,7 @@ void tab_layers_button_new_menu() { history_new_white_mask(); sys_notify_on_next_frame(&tab_layers_button_new_update_fill_layers, NULL); } - if (ui_menu_button(tr("Fill Mask", NULL), "", ICON_MASK_FILL)) { + if (ui_menu_button(tr("Fill Mask"), "", ICON_MASK_FILL)) { if (slot_layer_is_mask(l)) { context_set_layer(l->parent); } @@ -158,7 +158,7 @@ void tab_layers_button_new_menu() { sys_notify_on_next_frame(&tab_layers_button_new_to_fill_layer, NULL); } ui->enabled = !slot_layer_is_group(context_raw->layer) && !slot_layer_is_in_group(context_raw->layer); - if (ui_menu_button(tr("Group", NULL), "", ICON_FOLDER)) { + if (ui_menu_button(tr("Group"), "", ICON_FOLDER)) { if (slot_layer_is_group(l) || slot_layer_is_in_group(l)) { return; } @@ -192,7 +192,7 @@ void tab_layers_button_new(char *text) { void tab_layers_combo_filter() { string_t_array_t *ar = any_array_create_from_raw( (void *[]){ - tr("All", NULL), + tr("All"), }, 1); for (i32 i = 0; i < project_paint_objects->length; ++i) { @@ -208,7 +208,7 @@ void tab_layers_combo_filter() { } ui_handle_t *filter_handle = ui_handle(__ID__); filter_handle->i = context_raw->layer_filter; - context_raw->layer_filter = ui_combo(filter_handle, ar, tr("Filter", NULL), false, UI_ALIGN_LEFT, true); + context_raw->layer_filter = ui_combo(filter_handle, ar, tr("Filter"), false, UI_ALIGN_LEFT, true); if (filter_handle->changed) { for (i32 i = 0; i < project_paint_objects->length; ++i) { mesh_object_t *p = project_paint_objects->buffer[i]; @@ -483,7 +483,7 @@ void tab_layers_combo_object_layer_clear(slot_layer_t *l) { ui_handle_t *tab_layers_combo_object(slot_layer_t *l, bool label) { string_t_array_t *ar = any_array_create_from_raw( (void *[]){ - tr("Shared", NULL), + tr("Shared"), }, 1); for (i32 i = 0; i < project_paint_objects->length; ++i) { @@ -499,7 +499,7 @@ ui_handle_t *tab_layers_combo_object(slot_layer_t *l, bool label) { } ui_handle_t *object_handle = ui_nest(ui_handle(__ID__), l->id); object_handle->i = l->object_mask; - l->object_mask = ui_combo(object_handle, ar, tr("Object", NULL), label, UI_ALIGN_LEFT, true); + l->object_mask = ui_combo(object_handle, ar, tr("Object"), label, UI_ALIGN_LEFT, true); if (object_handle->changed) { context_set_layer(l); make_material_parse_mesh_material(); @@ -518,27 +518,27 @@ ui_handle_t *tab_layers_combo_blending(slot_layer_t *l, bool label) { blending_handle->i = l->blending; string_t_array_t *blending_combo = any_array_create_from_raw( (void *[]){ - tr("Mix", NULL), - tr("Darken", NULL), - tr("Multiply", NULL), - tr("Burn", NULL), - tr("Lighten", NULL), - tr("Screen", NULL), - tr("Dodge", NULL), - tr("Add", NULL), - tr("Overlay", NULL), - tr("Soft Light", NULL), - tr("Linear Light", NULL), - tr("Difference", NULL), - tr("Subtract", NULL), - tr("Divide", NULL), - tr("Hue", NULL), - tr("Saturation", NULL), - tr("Color", NULL), - tr("Value", NULL), + tr("Mix"), + tr("Darken"), + tr("Multiply"), + tr("Burn"), + tr("Lighten"), + tr("Screen"), + tr("Dodge"), + tr("Add"), + tr("Overlay"), + tr("Soft Light"), + tr("Linear Light"), + tr("Difference"), + tr("Subtract"), + tr("Divide"), + tr("Hue"), + tr("Saturation"), + tr("Color"), + tr("Value"), }, 18); - ui_combo(blending_handle, blending_combo, tr("Blending", NULL), label, UI_ALIGN_LEFT, true); + ui_combo(blending_handle, blending_combo, tr("Blending"), label, UI_ALIGN_LEFT, true); if (blending_handle->changed) { context_set_layer(l); history_layer_blending(); @@ -798,7 +798,7 @@ void tab_layers_draw_layer_context_menu_export_on_file_picked(char *path) { slot_layer_t *l = tab_layers_l; char *f = ui_files_filename; if (string_equals(f, "")) { - f = string_copy(tr("untitled", NULL)); + f = string_copy(tr("untitled")); } if (!ends_with(f, ".png")) { f = string("%s.png", f); @@ -813,7 +813,7 @@ void tab_layers_draw_layer_context_menu_draw() { if (mini) { ui_handle_t *visible_handle = ui_handle(__ID__); visible_handle->b = l->visible; - ui_check(visible_handle, tr("Visible", NULL), ""); + ui_check(visible_handle, tr("Visible"), ""); if (visible_handle->changed) { tab_layers_layer_toggle_visible(l); ui_menu_keep_open = true; @@ -831,7 +831,7 @@ void tab_layers_draw_layer_context_menu_draw() { } } - if (ui_menu_button(tr("Export", NULL), "", ICON_EXPORT)) { + if (ui_menu_button(tr("Export"), "", ICON_EXPORT)) { if (slot_layer_is_mask(l)) { ui_files_show("png", true, false, &tab_layers_draw_layer_context_menu_export_on_file_picked); } @@ -842,8 +842,8 @@ void tab_layers_draw_layer_context_menu_draw() { } if (!slot_layer_is_group(l)) { - char *to_fill_string = slot_layer_is_layer(l) ? tr("To Fill Layer", NULL) : tr("To Fill Mask", NULL); - char *to_paint_string = slot_layer_is_layer(l) ? tr("To Paint Layer", NULL) : tr("To Paint Mask", NULL); + char *to_fill_string = slot_layer_is_layer(l) ? tr("To Fill Layer") : tr("To Fill Mask"); + char *to_paint_string = slot_layer_is_layer(l) ? tr("To Paint Layer") : tr("To Paint Mask"); if (l->fill_layer == NULL && ui_menu_button(to_fill_string, "", ICON_SPHERE)) { sys_notify_on_next_frame(&tab_layers_draw_layer_context_menu_to_fill_layer, NULL); @@ -854,39 +854,39 @@ void tab_layers_draw_layer_context_menu_draw() { } ui->enabled = tab_layers_can_delete(l); - if (ui_menu_button(tr("Delete", NULL), "delete", ICON_DELETE)) { + if (ui_menu_button(tr("Delete"), "delete", ICON_DELETE)) { sys_notify_on_next_frame(&tab_layers_draw_layer_context_menu_delete, NULL); } ui->enabled = true; - if (l->fill_layer == NULL && ui_menu_button(tr("Clear", NULL), "", ICON_ERASE)) { + if (l->fill_layer == NULL && ui_menu_button(tr("Clear"), "", ICON_ERASE)) { context_set_layer(l); sys_notify_on_next_frame(&tab_layers_draw_layer_context_menu_clear, NULL); } - if (slot_layer_is_mask(l) && l->fill_layer == NULL && ui_menu_button(tr("Invert", NULL), "", ICON_INVERT)) { + if (slot_layer_is_mask(l) && l->fill_layer == NULL && ui_menu_button(tr("Invert"), "", ICON_INVERT)) { sys_notify_on_next_frame(&tab_layers_draw_layer_context_menu_invert, NULL); } - if (slot_layer_is_mask(l) && ui_menu_button(tr("Apply", NULL), "", ICON_CHECK)) { + if (slot_layer_is_mask(l) && ui_menu_button(tr("Apply"), "", ICON_CHECK)) { sys_notify_on_next_frame(&tab_layers_draw_layer_context_menu_apply, NULL); } - if (slot_layer_is_group(l) && ui_menu_button(tr("Merge Group", NULL), "", ICON_NONE)) { + if (slot_layer_is_group(l) && ui_menu_button(tr("Merge Group"), "", ICON_NONE)) { sys_notify_on_next_frame(&tab_layers_draw_layer_context_menu_merge_group, NULL); } ui->enabled = tab_layers_can_merge_down(l); - if (ui_menu_button(tr("Merge Down", NULL), "", ICON_ARROW_DOWN)) { + if (ui_menu_button(tr("Merge Down"), "", ICON_ARROW_DOWN)) { sys_notify_on_next_frame(&tab_layers_draw_layer_context_menu_merge_down, NULL); } ui->enabled = true; - if (ui_menu_button(tr("Duplicate", NULL), "", ICON_DUPLICATE)) { + if (ui_menu_button(tr("Duplicate"), "", ICON_DUPLICATE)) { sys_notify_on_next_frame(&tab_layers_draw_layer_context_menu_duplicate, NULL); } ui_menu_align(); ui_handle_t *layer_opac_handle = ui_nest(ui_handle(__ID__), l->id); layer_opac_handle->f = l->mask_opacity; - ui_slider(layer_opac_handle, tr("Opacity", NULL), 0.0, 1.0, true, 100.0, true, UI_ALIGN_RIGHT, true); + ui_slider(layer_opac_handle, tr("Opacity"), 0.0, 1.0, true, 100.0, true, UI_ALIGN_RIGHT, true); if (layer_opac_handle->changed) { if (ui->input_started) { history_layer_opacity(); @@ -926,7 +926,7 @@ void tab_layers_draw_layer_context_menu_draw() { ui_handle_t *h = ui_handle(__ID__); bool changed_last = h->changed; h->i = base_res_handle->i; - base_res_handle->i = ui_combo(h, ar, tr("Resolution", NULL), true, UI_ALIGN_LEFT, true); + base_res_handle->i = ui_combo(h, ar, tr("Resolution"), true, UI_ALIGN_LEFT, true); if (h->changed) { ui_menu_keep_open = true; } @@ -945,7 +945,7 @@ void tab_layers_draw_layer_context_menu_draw() { if (mesh_data_get_vertex_array(context_raw->paint_object->data, "tex1") != NULL) { any_array_push(aruv, "uv1"); } - ui_combo(huv, aruv, tr("UV Map", NULL), true, UI_ALIGN_LEFT, true); + ui_combo(huv, aruv, tr("UV Map"), true, UI_ALIGN_LEFT, true); l->uv_map = huv->i; if (huv->changed) { make_material_parse_paint_material(true); @@ -959,7 +959,7 @@ void tab_layers_draw_layer_context_menu_draw() { #else ui_menu_separator(); ui_menu_align(); - ui_menu_label(tr("Bits", NULL), NULL); + ui_menu_label(tr("Bits"), NULL); ui_menu_align(); string_t_array_t *bits_items = any_array_create_from_raw( (void *[]){ @@ -980,7 +980,7 @@ void tab_layers_draw_layer_context_menu_draw() { ui_menu_align(); ui_handle_t *scale_handle = ui_nest(ui_handle(__ID__), l->id); scale_handle->f = l->scale; - l->scale = ui_slider(scale_handle, tr("UV Scale", NULL), 0.0, 5.0, true, 100.0, true, UI_ALIGN_RIGHT, true); + l->scale = ui_slider(scale_handle, tr("UV Scale"), 0.0, 5.0, true, 100.0, true, UI_ALIGN_RIGHT, true); if (scale_handle->changed) { context_set_material(l->fill_layer); context_set_layer(l); @@ -991,7 +991,7 @@ void tab_layers_draw_layer_context_menu_draw() { ui_menu_align(); ui_handle_t *angle_handle = ui_nest(ui_handle(__ID__), l->id); angle_handle->f = l->angle; - l->angle = ui_slider(angle_handle, tr("Angle", NULL), 0.0, 360, true, 1, true, UI_ALIGN_RIGHT, true); + l->angle = ui_slider(angle_handle, tr("Angle"), 0.0, 360, true, 1, true, UI_ALIGN_RIGHT, true); if (angle_handle->changed) { context_set_material(l->fill_layer); context_set_layer(l); @@ -1005,9 +1005,9 @@ void tab_layers_draw_layer_context_menu_draw() { uv_type_handle->i = l->uv_type; string_t_array_t *uv_type_items = any_array_create_from_raw( (void *[]){ - tr("UV Map", NULL), - tr("Triplanar", NULL), - tr("Project", NULL), + tr("UV Map"), + tr("Triplanar"), + tr("Project"), }, 3); l->uv_type = ui_inline_radio(uv_type_handle, uv_type_items, UI_ALIGN_LEFT); @@ -1046,26 +1046,26 @@ void tab_layers_draw_layer_context_menu_draw() { ui_menu_separator(); ui_menu_align(); - ui_menu_label(tr("Channels", NULL), NULL); + ui_menu_label(tr("Channels"), NULL); ui_menu_align(); ui_row2(); - l->paint_base = ui_check(base_handle, tr("Base Color", NULL), ""); - l->paint_opac = ui_check(opac_handle, tr("Opacity", NULL), ""); + l->paint_base = ui_check(base_handle, tr("Base Color"), ""); + l->paint_opac = ui_check(opac_handle, tr("Opacity"), ""); if (config_raw->workflow == WORKFLOW_PBR) { ui_row2(); - l->paint_nor = ui_check(nor_handle, tr("Normal", NULL), ""); - l->paint_nor_blend = ui_check(nor_blend_handle, tr("Normal Blend", NULL), ""); + l->paint_nor = ui_check(nor_handle, tr("Normal"), ""); + l->paint_nor_blend = ui_check(nor_blend_handle, tr("Normal Blend"), ""); ui_row2(); - l->paint_rough = ui_check(rough_handle, tr("Roughness", NULL), ""); - l->paint_met = ui_check(met_handle, tr("Metallic", NULL), ""); + l->paint_rough = ui_check(rough_handle, tr("Roughness"), ""); + l->paint_met = ui_check(met_handle, tr("Metallic"), ""); ui_row2(); - l->paint_height = ui_check(height_handle, tr("Height", NULL), ""); - l->paint_height_blend = ui_check(height_blend_handle, tr("Height Blend", NULL), ""); + l->paint_height = ui_check(height_handle, tr("Height"), ""); + l->paint_height_blend = ui_check(height_blend_handle, tr("Height Blend"), ""); ui_row2(); - l->paint_emis = ui_check(emis_handle, tr("Emission", NULL), ""); - l->paint_subs = ui_check(subs_handle, tr("Subsurface", NULL), ""); - l->paint_occ = ui_check(occ_handle, tr("Occlusion", NULL), ""); + l->paint_emis = ui_check(emis_handle, tr("Emission"), ""); + l->paint_subs = ui_check(subs_handle, tr("Subsurface"), ""); + l->paint_occ = ui_check(occ_handle, tr("Occlusion"), ""); } if (base_handle->changed || opac_handle->changed || nor_handle->changed || nor_blend_handle->changed || occ_handle->changed || rough_handle->changed || diff --git a/paint/sources/tab_materials.c b/paint/sources/tab_materials.c index 47360cb5..150cf3b7 100644 --- a/paint/sources/tab_materials.c +++ b/paint/sources/tab_materials.c @@ -7,7 +7,7 @@ void tab_materials_draw(ui_handle_t *htab) { } void tab_materials_draw_mini(ui_handle_t *htab) { - ui_set_hovered_tab_name(tr("Materials", NULL)); + ui_set_hovered_tab_name(tr("Materials")); ui_begin_sticky(); ui_separator(5, true); @@ -21,7 +21,7 @@ void tab_materials_draw_mini(ui_handle_t *htab) { } void tab_materials_draw_full(ui_handle_t *htab) { - if (ui_tab(htab, tr("Materials", NULL), false, -1, false)) { + if (ui_tab(htab, tr("Materials"), false, -1, false)) { ui_begin_sticky(); f32_array_t *row = f32_array_create_from_raw( (f32[]){ @@ -32,8 +32,8 @@ void tab_materials_draw_full(ui_handle_t *htab) { 3); ui_row(row); - tab_materials_button_new(tr("New", NULL)); - if (ui_icon_button(tr("Import", NULL), ICON_IMPORT, UI_ALIGN_CENTER)) { + tab_materials_button_new(tr("New")); + if (ui_icon_button(tr("Import"), ICON_IMPORT, UI_ALIGN_CENTER)) { project_import_material(); } tab_materials_button_nodes(); @@ -45,11 +45,11 @@ void tab_materials_draw_full(ui_handle_t *htab) { } void tab_materials_button_nodes() { - if (ui_button(tr("Nodes", NULL), UI_ALIGN_CENTER, "")) { + if (ui_button(tr("Nodes"), UI_ALIGN_CENTER, "")) { ui_base_show_material_nodes(); } else if (ui->is_hovered) { - ui_tooltip(string("%s (%s)", tr("Show Node Editor", NULL), (char *)any_map_get(config_keymap, "toggle_node_editor"))); + ui_tooltip(string("%s (%s)", tr("Show Node Editor"), (char *)any_map_get(config_keymap, "toggle_node_editor"))); } } @@ -67,26 +67,26 @@ void tab_materials_draw_slots_menu() { i32 i = _tab_materials_draw_slots; slot_material_t *m = project_materials->buffer[i]; - if (ui_menu_button(tr("To Fill Layer", NULL), "", ICON_SPHERE)) { + if (ui_menu_button(tr("To Fill Layer"), "", ICON_SPHERE)) { context_select_material(i); layers_create_fill_layer(UV_TYPE_UVMAP, mat4nan, -1); } - if (ui_menu_button(tr("Export", NULL), "", ICON_EXPORT)) { + if (ui_menu_button(tr("Export"), "", ICON_EXPORT)) { context_select_material(i); box_export_show_material(); } - if (ui_menu_button(tr("Bake", NULL), "", ICON_BAKE)) { + if (ui_menu_button(tr("Bake"), "", ICON_BAKE)) { context_select_material(i); box_export_show_bake_material(); } - if (ui_menu_button(tr("Duplicate", NULL), "", ICON_DUPLICATE)) { + if (ui_menu_button(tr("Duplicate"), "", ICON_DUPLICATE)) { sys_notify_on_next_frame(&tab_materials_draw_slots_duplicate, NULL); } - if (project_materials->length > 1 && ui_menu_button(tr("Delete", NULL), "delete", ICON_DELETE)) { + if (project_materials->length > 1 && ui_menu_button(tr("Delete"), "delete", ICON_DELETE)) { tab_materials_delete_material(m); } @@ -137,23 +137,23 @@ void tab_materials_draw_slots_menu() { ui_menu_separator(); ui_menu_align(); - ui_menu_label(tr("Channels", NULL), NULL); + ui_menu_label(tr("Channels"), NULL); ui_menu_align(); ui_row2(); - m->paint_base = ui_check(base_handle, tr("Base Color", NULL), ""); - m->paint_opac = ui_check(opac_handle, tr("Opacity", NULL), ""); + m->paint_base = ui_check(base_handle, tr("Base Color"), ""); + m->paint_opac = ui_check(opac_handle, tr("Opacity"), ""); if (config_raw->workflow == WORKFLOW_PBR) { ui_row2(); - m->paint_nor = ui_check(nor_handle, tr("Normal", NULL), ""); - m->paint_height = ui_check(height_handle, tr("Height", NULL), ""); + m->paint_nor = ui_check(nor_handle, tr("Normal"), ""); + m->paint_height = ui_check(height_handle, tr("Height"), ""); ui_row2(); - m->paint_rough = ui_check(rough_handle, tr("Roughness", NULL), ""); - m->paint_met = ui_check(met_handle, tr("Metallic", NULL), ""); + m->paint_rough = ui_check(rough_handle, tr("Roughness"), ""); + m->paint_met = ui_check(met_handle, tr("Metallic"), ""); ui_row2(); - m->paint_emis = ui_check(emis_handle, tr("Emission", NULL), ""); - m->paint_subs = ui_check(subs_handle, tr("Subsurface", NULL), ""); - m->paint_occ = ui_check(occ_handle, tr("Occlusion", NULL), ""); + m->paint_emis = ui_check(emis_handle, tr("Emission"), ""); + m->paint_subs = ui_check(subs_handle, tr("Subsurface"), ""); + m->paint_occ = ui_check(occ_handle, tr("Occlusion"), ""); } if (base_handle->changed || opac_handle->changed || nor_handle->changed || occ_handle->changed || rough_handle->changed || met_handle->changed || diff --git a/paint/sources/tab_meshes.c b/paint/sources/tab_meshes.c index 6c257382..1d2a885a 100644 --- a/paint/sources/tab_meshes.c +++ b/paint/sources/tab_meshes.c @@ -5,11 +5,11 @@ void tab_meshes_draw_context_menu() { i32 i = _tab_meshes_draw_i; mesh_object_t *o = project_paint_objects->buffer[i]; - if (ui_menu_button(tr("Export", NULL), "", ICON_EXPORT)) { + if (ui_menu_button(tr("Export"), "", ICON_EXPORT)) { context_raw->export_mesh_index = i + 1; box_export_show_mesh(); } - if (project_paint_objects->length > 1 && ui_menu_button(tr("Delete", NULL), "", ICON_DELETE)) { + if (project_paint_objects->length > 1 && ui_menu_button(tr("Delete"), "", ICON_DELETE)) { array_remove(project_paint_objects, o); while (o->base->children->length > 0) { object_t *child = o->base->children->buffer[0]; @@ -28,7 +28,7 @@ void tab_meshes_draw_context_menu() { util_mesh_merge(NULL); context_raw->ddirty = 2; } - if (ui_menu_button(tr("Duplicate", NULL), "", ICON_DUPLICATE)) { + if (ui_menu_button(tr("Duplicate"), "", ICON_DUPLICATE)) { sim_duplicate(); } @@ -38,53 +38,53 @@ void tab_meshes_draw_context_menu() { } void tab_meshes_draw_edit() { - if (ui_menu_button(tr("Flip Normals", NULL), "", ICON_NONE)) { + if (ui_menu_button(tr("Flip Normals"), "", ICON_NONE)) { util_mesh_flip_normals(); context_raw->ddirty = 2; } - if (ui_menu_sub_button(ui_handle(__ID__), tr("Calculate Normals", NULL))) { + if (ui_menu_sub_button(ui_handle(__ID__), tr("Calculate Normals"))) { ui_menu_sub_begin(2); - if (ui_menu_button(tr("Smooth", NULL), "", ICON_NONE)) { + if (ui_menu_button(tr("Smooth"), "", ICON_NONE)) { util_mesh_calc_normals(true); context_raw->ddirty = 2; } - if (ui_menu_button(tr("Flat", NULL), "", ICON_NONE)) { + if (ui_menu_button(tr("Flat"), "", ICON_NONE)) { util_mesh_calc_normals(false); context_raw->ddirty = 2; } ui_menu_sub_end(); } - if (ui_menu_button(tr("Geometry to Origin", NULL), "", ICON_NONE)) { + if (ui_menu_button(tr("Geometry to Origin"), "", ICON_NONE)) { util_mesh_to_origin(); context_raw->ddirty = 2; } - if (ui_menu_button(tr("Apply Displacement", NULL), "", ICON_NONE)) { + if (ui_menu_button(tr("Apply Displacement"), "", ICON_NONE)) { util_mesh_apply_displacement(project_layers->buffer[0]->texpaint_pack, 0.1, 1.0); util_mesh_calc_normals(false); context_raw->ddirty = 2; } - if (ui_menu_sub_button(ui_handle(__ID__), tr("Rotate", NULL))) { + if (ui_menu_sub_button(ui_handle(__ID__), tr("Rotate"))) { ui_menu_sub_begin(3); - if (ui_menu_button(tr("X", NULL), "", ICON_NONE)) { + if (ui_menu_button(tr("X"), "", ICON_NONE)) { util_mesh_swap_axis(1, 2); context_raw->ddirty = 2; } - if (ui_menu_button(tr("Y", NULL), "", ICON_NONE)) { + if (ui_menu_button(tr("Y"), "", ICON_NONE)) { util_mesh_swap_axis(2, 0); context_raw->ddirty = 2; } - if (ui_menu_button(tr("Z", NULL), "", ICON_NONE)) { + if (ui_menu_button(tr("Z"), "", ICON_NONE)) { util_mesh_swap_axis(0, 1); context_raw->ddirty = 2; } ui_menu_sub_end(); } - if (ui_menu_button(tr("UV Unwrap", NULL), "", ICON_NONE)) { + if (ui_menu_button(tr("UV Unwrap"), "", ICON_NONE)) { char *f = "uv_unwrap.js"; if (string_array_index_of(config_raw->plugins, f) == -1) { config_enable_plugin(f); @@ -92,7 +92,7 @@ void tab_meshes_draw_edit() { plugin_uv_unwrap_button(); } - if (config_raw->experimental && ui_menu_button(tr("Decimate", NULL), "", ICON_NONE)) { + if (config_raw->experimental && ui_menu_button(tr("Decimate"), "", ICON_NONE)) { util_mesh_decimate(0.5); } } @@ -106,23 +106,23 @@ void tab_meshes_draw_append_shape() { } void tab_meshes_draw_import() { - if (ui_menu_button(tr("Replace Existing", NULL), any_map_get(config_keymap, "file_import_assets"), ICON_NONE)) { + if (ui_menu_button(tr("Replace Existing"), any_map_get(config_keymap, "file_import_assets"), ICON_NONE)) { project_import_mesh(true, NULL); } - if (ui_menu_button(tr("Append File", NULL), "", ICON_NONE)) { + if (ui_menu_button(tr("Append File"), "", ICON_NONE)) { project_append_mesh(); } if (config_raw->experimental) { project_fetch_default_meshes(); - if (ui_menu_button(tr("Append Shape", NULL), "", ICON_NONE)) { + if (ui_menu_button(tr("Append Shape"), "", ICON_NONE)) { ui_menu_draw(&tab_meshes_draw_append_shape, -1, -1); } } } void tab_meshes_draw(ui_handle_t *htab) { - if (ui_tab(htab, tr("Meshes", NULL), false, -1, false) && ui->_window_h > ui_statusbar_default_h * UI_SCALE()) { + if (ui_tab(htab, tr("Meshes"), false, -1, false) && ui->_window_h > ui_statusbar_default_h * UI_SCALE()) { ui_begin_sticky(); f32_array_t *row = f32_array_create_from_raw( @@ -133,13 +133,13 @@ void tab_meshes_draw(ui_handle_t *htab) { 2); ui_row(row); - if (ui_icon_button(tr("Import", NULL), ICON_IMPORT, UI_ALIGN_CENTER)) { + if (ui_icon_button(tr("Import"), ICON_IMPORT, UI_ALIGN_CENTER)) { ui_menu_draw(&tab_meshes_draw_import, -1, -1); } if (ui->is_hovered) - ui_tooltip(tr("Import mesh file", NULL)); + ui_tooltip(tr("Import mesh file")); - if (ui_icon_button(tr("Edit", NULL), ICON_EDIT, UI_ALIGN_CENTER)) { + if (ui_icon_button(tr("Edit"), ICON_EDIT, UI_ALIGN_CENTER)) { ui_menu_draw(&tab_meshes_draw_edit, -1, -1); } @@ -324,16 +324,16 @@ void tab_meshes_draw_properties(mesh_object_t *o) { ui_handle_t *hshape = ui_handle(__ID__); string_t_array_t *shape_combo = any_array_create_from_raw( (void *[]){ - tr("None", NULL), - tr("Box", NULL), - tr("Sphere", NULL), - tr("Convex Hull", NULL), - tr("Terrain", NULL), - tr("Mesh", NULL), + tr("None"), + tr("Box"), + tr("Sphere"), + tr("Convex Hull"), + tr("Terrain"), + tr("Mesh"), }, 6); hshape->i = pb != NULL ? pb->shape + 1 : 0; - ui_combo(hshape, shape_combo, tr("Shape", NULL), true, UI_ALIGN_LEFT, true); + ui_combo(hshape, shape_combo, tr("Shape"), true, UI_ALIGN_LEFT, true); ui_handle_t *hdynamic = ui_handle(__ID__); hdynamic->b = pb != NULL ? pb->mass > 0 : false; diff --git a/paint/sources/tab_plugins.c b/paint/sources/tab_plugins.c index c0bf1453..5aa580f9 100644 --- a/paint/sources/tab_plugins.c +++ b/paint/sources/tab_plugins.c @@ -2,7 +2,7 @@ #include "global.h" void tab_plugins_draw(ui_handle_t *htab) { - if (ui_tab(htab, tr("Plugins", NULL), false, -1, false)) { + if (ui_tab(htab, tr("Plugins"), false, -1, false)) { ui_begin_sticky(); @@ -13,7 +13,7 @@ void tab_plugins_draw(ui_handle_t *htab) { 1); ui_row(row); - if (ui_icon_button(tr("Preferences", NULL), ICON_COG, UI_ALIGN_CENTER)) { + if (ui_icon_button(tr("Preferences"), ICON_COG, UI_ALIGN_CENTER)) { box_preferences_htab->i = PREFERENCE_TAB_PLUGINS; box_preferences_show(); } diff --git a/paint/sources/tab_scene.c b/paint/sources/tab_scene.c index c65209bd..25daa681 100644 --- a/paint/sources/tab_scene.c +++ b/paint/sources/tab_scene.c @@ -50,10 +50,10 @@ void tab_scene_import_mesh_done() { } void tab_scene_draw_list_context_menu() { - if (ui_menu_button(tr("Duplicate", NULL), "", ICON_DUPLICATE)) { + if (ui_menu_button(tr("Duplicate"), "", ICON_DUPLICATE)) { sim_duplicate(); } - if (ui_menu_button(tr("Delete", NULL), "", ICON_DELETE)) { + if (ui_menu_button(tr("Delete"), "", ICON_DELETE)) { sim_delete(); } } @@ -137,7 +137,7 @@ void tab_scene_draw_list(ui_handle_t *list_handle, object_t *current_object) { } void tab_scene_draw(ui_handle_t *htab) { - if (ui_tab(htab, tr("Scene", NULL), false, -1, false)) { + if (ui_tab(htab, tr("Scene"), false, -1, false)) { tab_scene_line_counter = 0; diff --git a/paint/sources/tab_scripts.c b/paint/sources/tab_scripts.c index 6bba12d9..5f2344a8 100644 --- a/paint/sources/tab_scripts.c +++ b/paint/sources/tab_scripts.c @@ -5,7 +5,7 @@ void tab_scripts_draw_export(char *path) { char *str = tab_scripts_hscript->text; char *f = ui_files_filename; if (string_equals(f, "")) { - f = string_copy(tr("untitled", NULL)); + f = string_copy(tr("untitled")); } path = string("%s%s%s", path, PATH_SEP, f); if (!ends_with(path, ".js")) { @@ -21,19 +21,19 @@ void tab_scripts_draw_import(char *path) { } void tab_scripts_draw_edit() { - if (ui_menu_button(tr("Clear", NULL), "", ICON_ERASE)) { + if (ui_menu_button(tr("Clear"), "", ICON_ERASE)) { tab_scripts_hscript->text = ""; } - if (ui_menu_button(tr("Import", NULL), "", ICON_IMPORT)) { + if (ui_menu_button(tr("Import"), "", ICON_IMPORT)) { ui_files_show("js", false, false, &tab_scripts_draw_import); } - if (ui_menu_button(tr("Export", NULL), "", ICON_EXPORT)) { + if (ui_menu_button(tr("Export"), "", ICON_EXPORT)) { ui_files_show("js", true, false, &tab_scripts_draw_export); } } void tab_scripts_draw(ui_handle_t *htab) { - if (ui_tab(htab, tr("Scripts", NULL), false, -1, false)) { + if (ui_tab(htab, tr("Scripts"), false, -1, false)) { ui_begin_sticky(); f32_array_t *row = f32_array_create_from_raw( @@ -45,11 +45,11 @@ void tab_scripts_draw(ui_handle_t *htab) { 3); ui_row(row); - if (ui_icon_button(tr("Run", NULL), ICON_PLAY, UI_ALIGN_CENTER)) { + if (ui_icon_button(tr("Run"), ICON_PLAY, UI_ALIGN_CENTER)) { js_eval(tab_scripts_hscript->text); } - if (ui_icon_button(tr("Edit", NULL), ICON_EDIT, UI_ALIGN_CENTER)) { + if (ui_icon_button(tr("Edit"), ICON_EDIT, UI_ALIGN_CENTER)) { ui_menu_draw(&tab_scripts_draw_edit, -1, -1); } @@ -59,7 +59,7 @@ void tab_scripts_draw(ui_handle_t *htab) { }, 1); ui_handle_t *file_handle = ui_handle(__ID__); - ui_combo(file_handle, ar, tr("File", NULL), false, UI_ALIGN_LEFT, true); + ui_combo(file_handle, ar, tr("File"), false, UI_ALIGN_LEFT, true); ui_end_sticky(); diff --git a/paint/sources/tab_swatches.c b/paint/sources/tab_swatches.c index e33a4b3d..24387f9f 100644 --- a/paint/sources/tab_swatches.c +++ b/paint/sources/tab_swatches.c @@ -24,25 +24,25 @@ gpu_texture_t *tab_swatches_empty_get() { void tab_swatches_draw_16719() { i32 i = _tab_swatches_draw_i; - if (ui_menu_button(tr("Duplicate", NULL), "", ICON_DUPLICATE)) { + if (ui_menu_button(tr("Duplicate"), "", ICON_DUPLICATE)) { context_set_swatch(project_clone_swatch(context_raw->swatch)); any_array_push(project_raw->swatches, context_raw->swatch); } #if defined(IRON_WINDOWS) || defined(IRON_LINUX) || defined(IRON_MACOS) - else if (ui_menu_button(tr("Copy Hex Code", NULL), "", ICON_HASH)) { + else if (ui_menu_button(tr("Copy Hex Code"), "", ICON_HASH)) { i32 color = context_raw->swatch->base; color = color_set_ab(color, context_raw->swatch->opacity * 255); u32 val = color; iron_copy_to_clipboard(i32_to_string(val)); } #endif - else if (project_raw->swatches->length > 1 && ui_menu_button(tr("Delete", NULL), "delete", ICON_DELETE)) { + else if (project_raw->swatches->length > 1 && ui_menu_button(tr("Delete"), "delete", ICON_DELETE)) { tab_swatches_delete_swatch(project_raw->swatches->buffer[i]); } - else if (ui_menu_button(tr("Create Material", NULL), "", ICON_SPHERE)) { + else if (ui_menu_button(tr("Create Material"), "", ICON_SPHERE)) { tab_materials_accept_swatch_drop(project_raw->swatches->buffer[i]); } - else if (ui_menu_button(tr("Create Color Layer", NULL), "", ICON_LAYERS)) { + else if (ui_menu_button(tr("Create Color Layer"), "", ICON_LAYERS)) { i32 color = project_raw->swatches->buffer[i]->base; color = color_set_ab(color, project_raw->swatches->buffer[i]->opacity * 255); layers_create_color_layer(color, project_raw->swatches->buffer[i]->occlusion, project_raw->swatches->buffer[i]->roughness, @@ -98,17 +98,17 @@ void tab_swatches_draw_edit_menu() { } void tab_swatches_draw_import() { - if (ui_menu_button(tr("Replace Existing", NULL), "", ICON_NONE)) { + if (ui_menu_button(tr("Replace Existing"), "", ICON_NONE)) { project_import_swatches(true); context_set_swatch(project_raw->swatches->buffer[0]); } - if (ui_menu_button(tr("Append", NULL), "", ICON_NONE)) { + if (ui_menu_button(tr("Append"), "", ICON_NONE)) { project_import_swatches(false); } } void tab_swatches_draw(ui_handle_t *htab) { - if (ui_tab(htab, tr("Swatches", NULL), false, -1, false) && ui->_window_h > ui_statusbar_default_h * UI_SCALE()) { + if (ui_tab(htab, tr("Swatches"), false, -1, false) && ui->_window_h > ui_statusbar_default_h * UI_SCALE()) { ui_begin_sticky(); f32_array_t *row = f32_array_create_from_raw( @@ -122,29 +122,29 @@ void tab_swatches_draw(ui_handle_t *htab) { 5); ui_row(row); - if (ui_icon_button(tr("New", NULL), ICON_PLUS, UI_ALIGN_CENTER)) { + if (ui_icon_button(tr("New"), ICON_PLUS, UI_ALIGN_CENTER)) { context_set_swatch(project_make_swatch(0xffffffff)); any_array_push(project_raw->swatches, context_raw->swatch); } if (ui->is_hovered) { - ui_tooltip(tr("Add new swatch", NULL)); + ui_tooltip(tr("Add new swatch")); } - if (ui_icon_button(tr("Import", NULL), ICON_IMPORT, UI_ALIGN_CENTER)) { + if (ui_icon_button(tr("Import"), ICON_IMPORT, UI_ALIGN_CENTER)) { ui_menu_draw(&tab_swatches_draw_import, -1, -1); } if (ui->is_hovered) { - ui_tooltip(tr("Import swatches", NULL)); + ui_tooltip(tr("Import swatches")); } - if (ui_icon_button(tr("Export", NULL), ICON_EXPORT, UI_ALIGN_CENTER)) { + if (ui_icon_button(tr("Export"), ICON_EXPORT, UI_ALIGN_CENTER)) { project_export_swatches(); } if (ui->is_hovered) { - ui_tooltip(tr("Export swatches", NULL)); + ui_tooltip(tr("Export swatches")); } - if (ui_icon_button(tr("Clear", NULL), ICON_ERASE, UI_ALIGN_CENTER)) { + if (ui_icon_button(tr("Clear"), ICON_ERASE, UI_ALIGN_CENTER)) { context_set_swatch(project_make_swatch(0xffffffff)); project_raw->swatches = any_array_create_from_raw( (void *[]){ @@ -153,12 +153,12 @@ void tab_swatches_draw(ui_handle_t *htab) { 1); } - if (ui_icon_button(tr("Restore", NULL), ICON_REPLAY, UI_ALIGN_CENTER)) { + if (ui_icon_button(tr("Restore"), ICON_REPLAY, UI_ALIGN_CENTER)) { project_set_default_swatches(); context_set_swatch(project_raw->swatches->buffer[0]); } if (ui->is_hovered) { - ui_tooltip(tr("Restore default swatches", NULL)); + ui_tooltip(tr("Restore default swatches")); } ui_end_sticky(); diff --git a/paint/sources/tab_textures.c b/paint/sources/tab_textures.c index 3c2444ce..c2503132 100644 --- a/paint/sources/tab_textures.c +++ b/paint/sources/tab_textures.c @@ -13,7 +13,7 @@ void tab_textures_draw_export_on_next_frame2(gpu_texture_t *target) { char *path = _tab_textures_draw_path; char *f = ui_files_filename; if (string_equals(f, "")) { - f = string_copy(tr("untitled", NULL)); + f = string_copy(tr("untitled")); } if (!ends_with(f, ".png")) { f = string("%s.png", f); @@ -42,19 +42,19 @@ void tab_textures_draw_export(char *path) { } void tab_textures_draw_context_menu() { - if (ui_menu_button(tr("Export", NULL), "", ICON_EXPORT)) { + if (ui_menu_button(tr("Export"), "", ICON_EXPORT)) { ui_files_show("png", true, false, &tab_textures_draw_export); } - if (ui_menu_button(tr("Reimport", NULL), "", ICON_SYNC)) { + if (ui_menu_button(tr("Reimport"), "", ICON_SYNC)) { project_reimport_texture(_tab_textures_draw_asset); } - if (ui_menu_button(tr("To Mask", NULL), "", ICON_MASK)) { + if (ui_menu_button(tr("To Mask"), "", ICON_MASK)) { sys_notify_on_next_frame(&tab_textures_draw_to_mask, NULL); } - if (ui_menu_button(tr("Set as Envmap", NULL), "", ICON_LANDSCAPE)) { + if (ui_menu_button(tr("Set as Envmap"), "", ICON_LANDSCAPE)) { sys_notify_on_next_frame(&tab_textures_draw_set_as_envmap, NULL); } - if (ui_menu_button(tr("Set as Color ID Map", NULL), "", ICON_COLOR_ID)) { + if (ui_menu_button(tr("Set as Color ID Map"), "", ICON_COLOR_ID)) { context_raw->colorid_handle->i = _tab_textures_draw_i; context_raw->colorid_picked = false; ui_toolbar_handle->redraws = 1; @@ -63,13 +63,13 @@ void tab_textures_draw_context_menu() { context_raw->ddirty = 2; } } - if (ui_menu_button(tr("Delete", NULL), "delete", ICON_DELETE)) { + if (ui_menu_button(tr("Delete"), "delete", ICON_DELETE)) { tab_textures_delete_texture(_tab_textures_draw_asset); } - if (!_tab_textures_draw_is_packed && ui_menu_button(tr("Open Containing Directory...", NULL), "", ICON_FOLDER_OPEN)) { + if (!_tab_textures_draw_is_packed && ui_menu_button(tr("Open Containing Directory..."), "", ICON_FOLDER_OPEN)) { file_start(substring(_tab_textures_draw_asset->file, 0, string_last_index_of(_tab_textures_draw_asset->file, PATH_SEP))); } - if (!_tab_textures_draw_is_packed && ui_menu_button(tr("Open in Browser", NULL), "", ICON_NONE)) { + if (!_tab_textures_draw_is_packed && ui_menu_button(tr("Open in Browser"), "", ICON_NONE)) { tab_browser_show_directory(substring(_tab_textures_draw_asset->file, 0, string_last_index_of(_tab_textures_draw_asset->file, PATH_SEP))); } } @@ -81,7 +81,7 @@ void tab_textures_draw_import(char *path) { void tab_textures_draw(ui_handle_t *htab) { - if (ui_tab(htab, tr("Textures", NULL), false, -1, false) && ui->_window_h > ui_statusbar_default_h * UI_SCALE()) { + if (ui_tab(htab, tr("Textures"), false, -1, false) && ui->_window_h > ui_statusbar_default_h * UI_SCALE()) { ui_begin_sticky(); @@ -93,13 +93,13 @@ void tab_textures_draw(ui_handle_t *htab) { 2); ui_row(row); - if (ui_icon_button(tr("Import", NULL), ICON_IMPORT, UI_ALIGN_CENTER)) { + if (ui_icon_button(tr("Import"), ICON_IMPORT, UI_ALIGN_CENTER)) { ui_files_show(string_array_join(path_texture_formats(), ","), false, true, &tab_textures_draw_import); } if (ui->is_hovered) { - ui_tooltip(string("%s (%s)", tr("Import texture file", NULL), (char *)any_map_get(config_keymap, "file_import_assets"))); + ui_tooltip(string("%s (%s)", tr("Import texture file"), (char *)any_map_get(config_keymap, "file_import_assets"))); } - if (ui_icon_button(tr("2D View", NULL), ICON_WINDOW, UI_ALIGN_CENTER)) { + if (ui_icon_button(tr("2D View"), ICON_WINDOW, UI_ALIGN_CENTER)) { ui_base_show_2d_view(VIEW_2D_TYPE_ASSET); } @@ -181,7 +181,7 @@ void tab_textures_draw(ui_handle_t *htab) { if (ui->is_hovered) { ui_tooltip_image(img, 256); if (is_packed) { - ui_tooltip(string("%s %s", asset->name, tr("(packed)", NULL))); + ui_tooltip(string("%s %s", asset->name, tr("(packed)"))); } else { ui_tooltip(asset->name); @@ -222,7 +222,7 @@ void tab_textures_draw(ui_handle_t *htab) { rect_t *r = resource_tile50(img, ICON_DROP); ui_sub_image(img, ui->ops->theme->BUTTON_COL, r->h, r->x, r->y, r->w, r->h); if (ui->is_hovered) { - ui_tooltip(tr("Drag and drop files here", NULL)); + ui_tooltip(tr("Drag and drop files here")); } } diff --git a/paint/sources/tab_timeline.c b/paint/sources/tab_timeline.c index 7d84a281..80b00d30 100644 --- a/paint/sources/tab_timeline.c +++ b/paint/sources/tab_timeline.c @@ -2,6 +2,6 @@ #include "global.h" void tab_timeline_draw(ui_handle_t *htab) { - if (ui_tab(htab, tr("Timeline", NULL), false, -1, false) && ui->_window_h > ui_statusbar_default_h * UI_SCALE()) { + if (ui_tab(htab, tr("Timeline"), false, -1, false) && ui->_window_h > ui_statusbar_default_h * UI_SCALE()) { } } diff --git a/paint/sources/translator.c b/paint/sources/translator.c index 7b2c291a..b94f214e 100644 --- a/paint/sources/translator.c +++ b/paint/sources/translator.c @@ -9,7 +9,7 @@ char *_tr(char *s) { // Localizes a string with the given placeholders replaced (format is "{placeholder_name}") // If the string isn't available in the translation, this method will return the source English string -char *tr(char *id, any_map_t *vars) { +char *vtr(char *id, any_map_t *vars) { char *translation = string_copy(id); // English is the source language @@ -37,6 +37,10 @@ char *tr(char *id, any_map_t *vars) { return translation; } +char *tr(char *id) { + return vtr(id, NULL); +} + void translator_load_translations_on_cjk_downloaded(char *url) { if (!iron_file_exists(_translator_load_translations_cjk_font_disk_path)) { // Fall back to English diff --git a/paint/sources/ui_box.c b/paint/sources/ui_box.c index b5a1f46d..9cbdb866 100644 --- a/paint/sources/ui_box.c +++ b/paint/sources/ui_box.c @@ -96,11 +96,11 @@ void ui_box_render() { ui_end_element(); #if defined(IRON_WINDOWS) || defined(IRON_LINUX) || defined(IRON_MACOS) - if (ui_box_copyable && ui_icon_button(tr("Copy", NULL), ICON_COPY, UI_ALIGN_CENTER)) { + if (ui_box_copyable && ui_icon_button(tr("Copy"), ICON_COPY, UI_ALIGN_CENTER)) { iron_copy_to_clipboard(ui_box_text); } #endif - if (ui_icon_button(tr("OK", NULL), ICON_CHECK, UI_ALIGN_CENTER)) { + if (ui_icon_button(tr("OK"), ICON_CHECK, UI_ALIGN_CENTER)) { ui_box_hide(); } ui_box_window_border(); diff --git a/paint/sources/ui_header.c b/paint/sources/ui_header.c index 8ee0c30f..2ecd6e47 100644 --- a/paint/sources/ui_header.c +++ b/paint/sources/ui_header.c @@ -92,20 +92,20 @@ void ui_header_draw_tool_properties_import(char *path) { void ui_header_draw_tool_properties() { if (context_raw->tool == TOOL_TYPE_COLORID) { - ui_text(tr("Picked Color", NULL), UI_ALIGN_LEFT, 0x00000000); + ui_text(tr("Picked Color"), UI_ALIGN_LEFT, 0x00000000); if (context_raw->colorid_picked) { render_target_t *rt = any_map_get(render_path_render_targets, "texpaint_colorid"); ui_image(rt->_image, 0xffffffff, 64); } ui->enabled = context_raw->colorid_picked; - if (ui_button(tr("Clear", NULL), UI_ALIGN_CENTER, "")) { + if (ui_button(tr("Clear"), UI_ALIGN_CENTER, "")) { context_raw->colorid_picked = false; ui_toolbar_handle->redraws = 1; } ui->enabled = true; - ui_text(tr("Color ID Map", NULL), UI_ALIGN_LEFT, 0x00000000); + ui_text(tr("Color ID Map"), UI_ALIGN_LEFT, 0x00000000); if (project_asset_names->length > 0) { - i32 cid = ui_combo(context_raw->colorid_handle, base_enum_texts("TEX_IMAGE"), tr("Color ID", NULL), false, UI_ALIGN_LEFT, true); + i32 cid = ui_combo(context_raw->colorid_handle, base_enum_texts("TEX_IMAGE"), tr("Color ID"), false, UI_ALIGN_LEFT, true); if (context_raw->colorid_handle->changed) { context_raw->ddirty = 2; context_raw->colorid_picked = false; @@ -116,11 +116,11 @@ void ui_header_draw_tool_properties() { ui_tooltip_image(project_get_image(project_assets->buffer[cid]), 256); } } - if (ui_button(tr("Import", NULL), UI_ALIGN_CENTER, "")) { + if (ui_button(tr("Import"), UI_ALIGN_CENTER, "")) { ui_files_show(string_array_join(path_texture_formats(), ","), false, true, &ui_header_draw_tool_properties_import); } ui->enabled = context_raw->colorid_picked; - if (ui_button(tr("To Mask", NULL), UI_ALIGN_CENTER, "")) { + if (ui_button(tr("To Mask"), UI_ALIGN_CENTER, "")) { if (slot_layer_is_mask(context_raw->layer)) { context_set_layer(context_raw->layer->parent); } @@ -144,7 +144,7 @@ void ui_header_draw_tool_properties() { gc_root(base_drag_swatch); } if (ui->is_hovered) { - ui_tooltip(tr("Drag and drop picked color to swatches, materials, layers or to the node editor", NULL)); + ui_tooltip(tr("Drag and drop picked color to swatches, materials, layers or to the node editor")); } if (ui->is_hovered && ui->input_released) { gc_unroot(_ui_header_draw_tool_properties_h); @@ -152,14 +152,14 @@ void ui_header_draw_tool_properties() { gc_root(_ui_header_draw_tool_properties_h); ui_menu_draw(&ui_header_draw_tool_properties_color_picker_base, -1, -1); } - if (ui_button(tr("Add Swatch", NULL), UI_ALIGN_CENTER, "")) { + if (ui_button(tr("Add Swatch"), UI_ALIGN_CENTER, "")) { swatch_color_t *new_swatch = project_clone_swatch(context_raw->picked_color); context_set_swatch(new_swatch); any_array_push(project_raw->swatches, new_swatch); ui_base_hwnds->buffer[2]->redraws = 1; } if (ui->is_hovered) { - ui_tooltip(tr("Add picked color to swatches", NULL)); + ui_tooltip(tr("Add picked color to swatches")); } if (config_raw->workflow == WORKFLOW_PBR) { @@ -176,43 +176,43 @@ void ui_header_draw_tool_properties() { gc_root(_ui_header_draw_tool_properties_h); ui_menu_draw(&ui_header_draw_tool_properties_color_picker_normal, -1, -1); } - ui_text(tr("Normal", NULL), UI_ALIGN_LEFT, 0x00000000); + ui_text(tr("Normal"), UI_ALIGN_LEFT, 0x00000000); ui->_w = _w; ui_handle_t *hocc = ui_handle(__ID__); hocc->f = context_raw->picked_color->occlusion; - context_raw->picked_color->occlusion = ui_slider(hocc, tr("Occlusion", NULL), 0.0, 1.0, true, 100.0, true, UI_ALIGN_RIGHT, true); + context_raw->picked_color->occlusion = ui_slider(hocc, tr("Occlusion"), 0.0, 1.0, true, 100.0, true, UI_ALIGN_RIGHT, true); ui_handle_t *hrough = ui_handle(__ID__); hrough->f = context_raw->picked_color->roughness; - context_raw->picked_color->roughness = ui_slider(hrough, tr("Roughness", NULL), 0.0, 1.0, true, 100.0, true, UI_ALIGN_RIGHT, true); + context_raw->picked_color->roughness = ui_slider(hrough, tr("Roughness"), 0.0, 1.0, true, 100.0, true, UI_ALIGN_RIGHT, true); ui_handle_t *hmet = ui_handle(__ID__); hmet->f = context_raw->picked_color->metallic; - context_raw->picked_color->metallic = ui_slider(hmet, tr("Metallic", NULL), 0.0, 1.0, true, 100.0, true, UI_ALIGN_RIGHT, true); + context_raw->picked_color->metallic = ui_slider(hmet, tr("Metallic"), 0.0, 1.0, true, 100.0, true, UI_ALIGN_RIGHT, true); ui_handle_t *hheight = ui_handle(__ID__); hheight->f = context_raw->picked_color->height; - context_raw->picked_color->height = ui_slider(hheight, tr("Height", NULL), 0.0, 1.0, true, 100.0, true, UI_ALIGN_RIGHT, true); + context_raw->picked_color->height = ui_slider(hheight, tr("Height"), 0.0, 1.0, true, 100.0, true, UI_ALIGN_RIGHT, true); } ui_handle_t *hopac = ui_handle(__ID__); hopac->f = context_raw->picked_color->opacity; - context_raw->picked_color->opacity = ui_slider(hopac, tr("Opacity", NULL), 0.0, 1.0, true, 100.0, true, UI_ALIGN_RIGHT, true); + context_raw->picked_color->opacity = ui_slider(hopac, tr("Opacity"), 0.0, 1.0, true, 100.0, true, UI_ALIGN_RIGHT, true); ui_handle_t *h_select_mat = ui_handle(__ID__); if (h_select_mat->init) { h_select_mat->b = context_raw->picker_select_material; } - context_raw->picker_select_material = ui_check(h_select_mat, tr("Select Material", NULL), ""); + context_raw->picker_select_material = ui_check(h_select_mat, tr("Select Material"), ""); string_t_array_t *picker_mask_combo = any_array_create_from_raw( (void *[]){ - tr("None", NULL), - tr("Material", NULL), + tr("None"), + tr("Material"), }, 2); - ui_combo(context_raw->picker_mask_handle, picker_mask_combo, tr("Mask", NULL), true, UI_ALIGN_LEFT, true); + ui_combo(context_raw->picker_mask_handle, picker_mask_combo, tr("Mask"), true, UI_ALIGN_LEFT, true); if (context_raw->picker_mask_handle->changed) { make_material_parse_paint_material(true); } @@ -222,12 +222,12 @@ void ui_header_draw_tool_properties() { bool baking = context_raw->pdirty > 0; bool rt_bake = render_path_paint_is_rt_bake(); - if (baking && ui_button(tr("Stop", NULL), UI_ALIGN_CENTER, "")) { + if (baking && ui_button(tr("Stop"), UI_ALIGN_CENTER, "")) { context_raw->pdirty = 0; context_raw->rdirty = 2; } - if (!baking && ui_button(tr("Bake", NULL), UI_ALIGN_CENTER, "")) { + if (!baking && ui_button(tr("Bake"), UI_ALIGN_CENTER, "")) { context_raw->pdirty = rt_bake ? context_raw->bake_samples : 1; context_raw->rdirty = 3; sys_notify_on_next_frame(&ui_header_draw_tool_properties_layer_preview_dirty, NULL); @@ -242,26 +242,26 @@ void ui_header_draw_tool_properties() { } string_t_array_t *bakes = any_array_create_from_raw( (void *[]){ - tr("Curvature", NULL), - tr("Normal", NULL), - tr("Object Normal", NULL), - tr("Height", NULL), - tr("Derivative", NULL), - tr("Position", NULL), - tr("TexCoord", NULL), - tr("Material ID", NULL), - tr("Object ID", NULL), - tr("Vertex Color", NULL), + tr("Curvature"), + tr("Normal"), + tr("Object Normal"), + tr("Height"), + tr("Derivative"), + tr("Position"), + tr("TexCoord"), + tr("Material ID"), + tr("Object ID"), + tr("Vertex Color"), }, 10); if (gpu_raytrace_supported()) { - any_array_push(bakes, tr("AO", NULL)); - any_array_push(bakes, tr("Lightmap", NULL)); - any_array_push(bakes, tr("Bent Normal", NULL)); - any_array_push(bakes, tr("Thickness", NULL)); + any_array_push(bakes, tr("AO")); + any_array_push(bakes, tr("Lightmap")); + any_array_push(bakes, tr("Bent Normal")); + any_array_push(bakes, tr("Thickness")); } - context_raw->bake_type = ui_combo(bake_handle, bakes, tr("Bake", NULL), false, UI_ALIGN_LEFT, true); + context_raw->bake_type = ui_combo(bake_handle, bakes, tr("Bake"), false, UI_ALIGN_LEFT, true); if (bake_handle->changed && ui_menu_show) { ui_menu_nested = true; // Update menu height @@ -272,7 +272,7 @@ void ui_header_draw_tool_properties() { if (samples_handle->init) { samples_handle->f = context_raw->bake_samples; } - context_raw->bake_samples = math_floor(ui_slider(samples_handle, tr("Samples", NULL), 1, 512, true, 1, true, UI_ALIGN_RIGHT, true)); + context_raw->bake_samples = math_floor(ui_slider(samples_handle, tr("Samples"), 1, 512, true, 1, true, UI_ALIGN_RIGHT, true)); } if (context_raw->bake_type == BAKE_TYPE_NORMAL_OBJECT || context_raw->bake_type == BAKE_TYPE_POSITION || @@ -283,11 +283,11 @@ void ui_header_draw_tool_properties() { } string_t_array_t *bake_up_axis_combo = any_array_create_from_raw( (void *[]){ - tr("Z", NULL), - tr("Y", NULL), + tr("Z"), + tr("Y"), }, 2); - context_raw->bake_up_axis = ui_combo(bake_up_axis_handle, bake_up_axis_combo, tr("Up Axis", NULL), true, UI_ALIGN_LEFT, true); + context_raw->bake_up_axis = ui_combo(bake_up_axis_handle, bake_up_axis_combo, tr("Up Axis"), true, UI_ALIGN_LEFT, true); } if (context_raw->bake_type == BAKE_TYPE_AO || context_raw->bake_type == BAKE_TYPE_CURVATURE) { @@ -297,16 +297,16 @@ void ui_header_draw_tool_properties() { } string_t_array_t *bake_axis_combo = any_array_create_from_raw( (void *[]){ - tr("XYZ", NULL), - tr("X", NULL), - tr("Y", NULL), - tr("Z", NULL), - tr("-X", NULL), - tr("-Y", NULL), - tr("-Z", NULL), + tr("XYZ"), + tr("X"), + tr("Y"), + tr("Z"), + tr("-X"), + tr("-Y"), + tr("-Z"), }, 7); - context_raw->bake_axis = ui_combo(bake_axis_handle, bake_axis_combo, tr("Axis", NULL), true, UI_ALIGN_LEFT, true); + context_raw->bake_axis = ui_combo(bake_axis_handle, bake_axis_combo, tr("Axis"), true, UI_ALIGN_LEFT, true); } if (context_raw->bake_type == BAKE_TYPE_AO) { @@ -314,17 +314,17 @@ void ui_header_draw_tool_properties() { if (strength_handle->init) { strength_handle->f = context_raw->bake_ao_strength; } - context_raw->bake_ao_strength = ui_slider(strength_handle, tr("Strength", NULL), 0.0, 2.0, true, 100.0, true, UI_ALIGN_RIGHT, true); + context_raw->bake_ao_strength = ui_slider(strength_handle, tr("Strength"), 0.0, 2.0, true, 100.0, true, UI_ALIGN_RIGHT, true); ui_handle_t *radius_handle = ui_handle(__ID__); if (radius_handle->init) { radius_handle->f = context_raw->bake_ao_radius; } - context_raw->bake_ao_radius = ui_slider(radius_handle, tr("Radius", NULL), 0.0, 2.0, true, 100.0, true, UI_ALIGN_RIGHT, true); + context_raw->bake_ao_radius = ui_slider(radius_handle, tr("Radius"), 0.0, 2.0, true, 100.0, true, UI_ALIGN_RIGHT, true); ui_handle_t *offset_handle = ui_handle(__ID__); if (offset_handle->init) { offset_handle->f = context_raw->bake_ao_offset; } - context_raw->bake_ao_offset = ui_slider(offset_handle, tr("Offset", NULL), 0.0, 2.0, true, 100.0, true, UI_ALIGN_RIGHT, true); + context_raw->bake_ao_offset = ui_slider(offset_handle, tr("Offset"), 0.0, 2.0, true, 100.0, true, UI_ALIGN_RIGHT, true); } if (rt_bake) { @@ -337,9 +337,9 @@ void ui_header_draw_tool_properties() { draw_set_color(ui->ops->theme->HIGHLIGHT_COL); ui_draw_rect(true, ui->_x + 1, ui->_y, (ui->_w - 2) * progress, UI_ELEMENT_H()); draw_set_color(0xffffffff); - ui_text(string("%s: %d", tr("Samples", NULL), render_path_raytrace_bake_current_sample), UI_ALIGN_LEFT, 0x00000000); - ui_text(string("%s: %d", tr("Rays/pixel", NULL), render_path_raytrace_bake_rays_pix), UI_ALIGN_LEFT, 0x00000000); - ui_text(string("%s: %d", tr("Rays/second", NULL), render_path_raytrace_bake_rays_sec), UI_ALIGN_LEFT, 0x00000000); + ui_text(string("%s: %d", tr("Samples"), render_path_raytrace_bake_current_sample), UI_ALIGN_LEFT, 0x00000000); + ui_text(string("%s: %d", tr("Rays/pixel"), render_path_raytrace_bake_rays_pix), UI_ALIGN_LEFT, 0x00000000); + ui_text(string("%s: %d", tr("Rays/second"), render_path_raytrace_bake_rays_sec), UI_ALIGN_LEFT, 0x00000000); } if (context_raw->bake_type == BAKE_TYPE_CURVATURE) { @@ -347,22 +347,22 @@ void ui_header_draw_tool_properties() { if (strength_handle->init) { strength_handle->f = context_raw->bake_curv_strength; } - context_raw->bake_curv_strength = ui_slider(strength_handle, tr("Strength", NULL), 0.0, 2.0, true, 100.0, true, UI_ALIGN_RIGHT, true); + context_raw->bake_curv_strength = ui_slider(strength_handle, tr("Strength"), 0.0, 2.0, true, 100.0, true, UI_ALIGN_RIGHT, true); ui_handle_t *radius_handle = ui_handle(__ID__); if (radius_handle->init) { radius_handle->f = context_raw->bake_curv_radius; } - context_raw->bake_curv_radius = ui_slider(radius_handle, tr("Radius", NULL), 0.0, 2.0, true, 100.0, true, UI_ALIGN_RIGHT, true); + context_raw->bake_curv_radius = ui_slider(radius_handle, tr("Radius"), 0.0, 2.0, true, 100.0, true, UI_ALIGN_RIGHT, true); ui_handle_t *offset_handle = ui_handle(__ID__); if (offset_handle->init) { offset_handle->f = context_raw->bake_curv_offset; } - context_raw->bake_curv_offset = ui_slider(offset_handle, tr("Offset", NULL), -2.0, 2.0, true, 100.0, true, UI_ALIGN_RIGHT, true); + context_raw->bake_curv_offset = ui_slider(offset_handle, tr("Offset"), -2.0, 2.0, true, 100.0, true, UI_ALIGN_RIGHT, true); ui_handle_t *smooth_handle = ui_handle(__ID__); if (smooth_handle->init) { smooth_handle->f = context_raw->bake_curv_smooth; } - context_raw->bake_curv_smooth = math_floor(ui_slider(smooth_handle, tr("Smooth", NULL), 0, 5, false, 1, true, UI_ALIGN_RIGHT, true)); + context_raw->bake_curv_smooth = math_floor(ui_slider(smooth_handle, tr("Smooth"), 0, 5, false, 1, true, UI_ALIGN_RIGHT, true)); } if (context_raw->bake_type == BAKE_TYPE_NORMAL || context_raw->bake_type == BAKE_TYPE_HEIGHT || context_raw->bake_type == BAKE_TYPE_DERIVATIVE) { @@ -375,7 +375,7 @@ void ui_header_draw_tool_properties() { if (poly_handle->init) { poly_handle->i = context_raw->bake_high_poly; } - context_raw->bake_high_poly = ui_combo(poly_handle, ar, tr("High Poly", NULL), false, UI_ALIGN_LEFT, true); + context_raw->bake_high_poly = ui_combo(poly_handle, ar, tr("High Poly"), false, UI_ALIGN_LEFT, true); } if (ui->changed) { @@ -389,25 +389,25 @@ void ui_header_draw_tool_properties() { if (context_raw->tool != TOOL_TYPE_FILL) { if (decal_mask) { context_raw->brush_decal_mask_radius = - ui_slider(context_raw->brush_decal_mask_radius_handle, tr("Radius", NULL), 0.01, 2.0, true, 100.0, true, UI_ALIGN_RIGHT, true); + ui_slider(context_raw->brush_decal_mask_radius_handle, tr("Radius"), 0.01, 2.0, true, 100.0, true, UI_ALIGN_RIGHT, true); if (ui->is_hovered) { any_map_t *vars = any_map_create(); any_map_set(vars, "brush_radius", any_map_get(config_keymap, "brush_radius")); any_map_set(vars, "brush_radius_decrease", any_map_get(config_keymap, "brush_radius_decrease")); any_map_set(vars, "brush_radius_increase", any_map_get(config_keymap, "brush_radius_increase")); - ui_tooltip(tr("Hold {brush_radius} and move mouse to the left or press {brush_radius_decrease} to decrease the radius\nHold {brush_radius} " + ui_tooltip(vtr("Hold {brush_radius} and move mouse to the left or press {brush_radius_decrease} to decrease the radius\nHold {brush_radius} " "and move mouse to the right or press {brush_radius_increase} to increase the radius", vars)); } } else { - context_raw->brush_radius = ui_slider(context_raw->brush_radius_handle, tr("Radius", NULL), 0.01, 2.0, true, 100.0, true, UI_ALIGN_RIGHT, true); + context_raw->brush_radius = ui_slider(context_raw->brush_radius_handle, tr("Radius"), 0.01, 2.0, true, 100.0, true, UI_ALIGN_RIGHT, true); if (ui->is_hovered) { any_map_t *vars = any_map_create(); any_map_set(vars, "brush_radius", any_map_get(config_keymap, "brush_radius")); any_map_set(vars, "brush_radius_decrease", any_map_get(config_keymap, "brush_radius_decrease")); any_map_set(vars, "brush_radius_increase", any_map_get(config_keymap, "brush_radius_increase")); - ui_tooltip(tr("Hold {brush_radius} and move mouse to the left or press {brush_radius_decrease} to decrease the radius\nHold {brush_radius} " + ui_tooltip(vtr("Hold {brush_radius} and move mouse to the left or press {brush_radius_decrease} to decrease the radius\nHold {brush_radius} " "and move mouse to the right or press {brush_radius_increase} to increase the radius", vars)); } @@ -415,7 +415,7 @@ void ui_header_draw_tool_properties() { } if (context_raw->tool == TOOL_TYPE_DECAL || context_raw->tool == TOOL_TYPE_TEXT) { - context_raw->brush_scale_x = ui_slider(context_raw->brush_scale_x_handle, tr("Scale X", NULL), 0.01, 2.0, true, 100.0, true, UI_ALIGN_RIGHT, true); + context_raw->brush_scale_x = ui_slider(context_raw->brush_scale_x_handle, tr("Scale X"), 0.01, 2.0, true, 100.0, true, UI_ALIGN_RIGHT, true); } if (context_raw->tool == TOOL_TYPE_BRUSH || context_raw->tool == TOOL_TYPE_FILL || context_raw->tool == TOOL_TYPE_DECAL || @@ -424,7 +424,7 @@ void ui_header_draw_tool_properties() { if (brush_scale_handle->init) { brush_scale_handle->f = context_raw->brush_scale; } - context_raw->brush_scale = ui_slider(brush_scale_handle, tr("UV Scale", NULL), 0.01, 5.0, true, 100.0, true, UI_ALIGN_RIGHT, true); + context_raw->brush_scale = ui_slider(brush_scale_handle, tr("UV Scale"), 0.01, 5.0, true, 100.0, true, UI_ALIGN_RIGHT, true); if (brush_scale_handle->changed) { if (context_raw->tool == TOOL_TYPE_DECAL || context_raw->tool == TOOL_TYPE_TEXT) { gpu_texture_t *current = _draw_current; @@ -434,11 +434,11 @@ void ui_header_draw_tool_properties() { } } - context_raw->brush_angle = ui_slider(context_raw->brush_angle_handle, tr("Angle", NULL), 0.0, 360.0, true, 1, true, UI_ALIGN_RIGHT, true); + context_raw->brush_angle = ui_slider(context_raw->brush_angle_handle, tr("Angle"), 0.0, 360.0, true, 1, true, UI_ALIGN_RIGHT, true); if (ui->is_hovered) { any_map_t *vars = any_map_create(); any_map_set(vars, "brush_angle", any_map_get(config_keymap, "brush_angle")); - ui_tooltip(tr( + ui_tooltip(vtr( "Hold {brush_angle} and move mouse to the left to decrease the angle\nHold {brush_angle} and move mouse to the right to increase the angle", vars)); } @@ -448,11 +448,11 @@ void ui_header_draw_tool_properties() { } } - context_raw->brush_opacity = ui_slider(context_raw->brush_opacity_handle, tr("Opacity", NULL), 0.0, 1.0, true, 100.0, true, UI_ALIGN_RIGHT, true); + context_raw->brush_opacity = ui_slider(context_raw->brush_opacity_handle, tr("Opacity"), 0.0, 1.0, true, 100.0, true, UI_ALIGN_RIGHT, true); if (ui->is_hovered) { any_map_t *vars = any_map_create(); any_map_set(vars, "brush_opacity", any_map_get(config_keymap, "brush_opacity")); - ui_tooltip(tr("Hold {brush_opacity} and move mouse to the left to decrease the opacity\nHold {brush_opacity} and move mouse to the right to " + ui_tooltip(vtr("Hold {brush_opacity} and move mouse to the left to decrease the opacity\nHold {brush_opacity} and move mouse to the right to " "increase the opacity", vars)); } @@ -462,7 +462,7 @@ void ui_header_draw_tool_properties() { if (h->init) { h->f = context_raw->brush_hardness; } - context_raw->brush_hardness = ui_slider(h, tr("Hardness", NULL), 0.0, 1.0, true, 100.0, true, UI_ALIGN_RIGHT, true); + context_raw->brush_hardness = ui_slider(h, tr("Hardness"), 0.0, 1.0, true, 100.0, true, UI_ALIGN_RIGHT, true); } if (context_raw->tool != TOOL_TYPE_ERASER) { @@ -472,27 +472,27 @@ void ui_header_draw_tool_properties() { } string_t_array_t *brush_blending_combo = any_array_create_from_raw( (void *[]){ - tr("Mix", NULL), - tr("Darken", NULL), - tr("Multiply", NULL), - tr("Burn", NULL), - tr("Lighten", NULL), - tr("Screen", NULL), - tr("Dodge", NULL), - tr("Add", NULL), - tr("Overlay", NULL), - tr("Soft Light", NULL), - tr("Linear Light", NULL), - tr("Difference", NULL), - tr("Subtract", NULL), - tr("Divide", NULL), - tr("Hue", NULL), - tr("Saturation", NULL), - tr("Color", NULL), - tr("Value", NULL), + tr("Mix"), + tr("Darken"), + tr("Multiply"), + tr("Burn"), + tr("Lighten"), + tr("Screen"), + tr("Dodge"), + tr("Add"), + tr("Overlay"), + tr("Soft Light"), + tr("Linear Light"), + tr("Difference"), + tr("Subtract"), + tr("Divide"), + tr("Hue"), + tr("Saturation"), + tr("Color"), + tr("Value"), }, 18); - context_raw->brush_blending = ui_combo(brush_blending_handle, brush_blending_combo, tr("Blending", NULL), false, UI_ALIGN_LEFT, true); + context_raw->brush_blending = ui_combo(brush_blending_handle, brush_blending_combo, tr("Blending"), false, UI_ALIGN_LEFT, true); if (brush_blending_handle->changed) { make_material_parse_paint_material(true); } @@ -502,12 +502,12 @@ void ui_header_draw_tool_properties() { ui_handle_t *paint_handle = ui_handle(__ID__); string_t_array_t *texcoord_combo = any_array_create_from_raw( (void *[]){ - tr("UV Map", NULL), - tr("Triplanar", NULL), - tr("Project", NULL), + tr("UV Map"), + tr("Triplanar"), + tr("Project"), }, 3); - context_raw->brush_paint = ui_combo(paint_handle, texcoord_combo, tr("TexCoord", NULL), false, UI_ALIGN_LEFT, true); + context_raw->brush_paint = ui_combo(paint_handle, texcoord_combo, tr("TexCoord"), false, UI_ALIGN_LEFT, true); if (paint_handle->changed) { make_material_parse_paint_material(true); } @@ -534,13 +534,13 @@ void ui_header_draw_tool_properties() { if (context_raw->tool == TOOL_TYPE_FILL) { string_t_array_t *fill_mode_combo = any_array_create_from_raw( (void *[]){ - tr("Object", NULL), - tr("Face", NULL), - tr("Angle", NULL), - tr("UV Island", NULL), + tr("Object"), + tr("Face"), + tr("Angle"), + tr("UV Island"), }, 4); - ui_combo(context_raw->fill_type_handle, fill_mode_combo, tr("Fill Mode", NULL), false, UI_ALIGN_LEFT, true); + ui_combo(context_raw->fill_type_handle, fill_mode_combo, tr("Fill Mode"), false, UI_ALIGN_LEFT, true); if (context_raw->fill_type_handle->changed) { if (context_raw->fill_type_handle->i == FILL_TYPE_FACE) { gpu_texture_t *current = _draw_current; @@ -567,7 +567,7 @@ void ui_header_draw_tool_properties() { if (xray_handle->init) { xray_handle->b = context_raw->xray; } - context_raw->xray = ui_check(xray_handle, tr("X-Ray", NULL), ""); + context_raw->xray = ui_check(xray_handle, tr("X-Ray"), ""); if (xray_handle->changed) { make_material_parse_paint_material(true); } @@ -597,27 +597,27 @@ void ui_header_draw_tool_properties() { context_raw->sym_z = ui_check(sym_z_handle, "", ""); ui->_x -= 4 * sc; ui->_w = math_floor(40 * sc); - char *x = tr("X", NULL); - char *y = tr("Y", NULL); - char *z = tr("Z", NULL); + char *x = tr("X"); + char *y = tr("Y"); + char *z = tr("Z"); ui_text(string("%s%s%s", x, y, z), UI_ALIGN_LEFT, 0x00000000); } else { ui->_w = math_floor(56 * sc); - ui_text(tr("Symmetry", NULL), UI_ALIGN_LEFT, 0x00000000); + ui_text(tr("Symmetry"), UI_ALIGN_LEFT, 0x00000000); ui->_w = math_floor(25 * sc); - context_raw->sym_x = ui_check(sym_x_handle, tr("X", NULL), ""); - context_raw->sym_y = ui_check(sym_y_handle, tr("Y", NULL), ""); - context_raw->sym_z = ui_check(sym_z_handle, tr("Z", NULL), ""); + context_raw->sym_x = ui_check(sym_x_handle, tr("X"), ""); + context_raw->sym_y = ui_check(sym_y_handle, tr("Y"), ""); + context_raw->sym_z = ui_check(sym_z_handle, tr("Z"), ""); } ui->_w = _w; } else { // Popup ui->_w = _w; - context_raw->sym_x = ui_check(sym_x_handle, string("%s %s", tr("Symmetry", NULL), tr("X", NULL)), ""); - context_raw->sym_y = ui_check(sym_y_handle, string("%s %s", tr("Symmetry", NULL), tr("Y", NULL)), ""); - context_raw->sym_z = ui_check(sym_z_handle, string("%s %s", tr("Symmetry", NULL), tr("Z", NULL)), ""); + context_raw->sym_x = ui_check(sym_x_handle, string("%s %s", tr("Symmetry"), tr("X")), ""); + context_raw->sym_y = ui_check(sym_y_handle, string("%s %s", tr("Symmetry"), tr("Y")), ""); + context_raw->sym_z = ui_check(sym_z_handle, string("%s %s", tr("Symmetry"), tr("Z")), ""); } if (sym_x_handle->changed || sym_y_handle->changed || sym_z_handle->changed) { diff --git a/paint/sources/ui_menubar.c b/paint/sources/ui_menubar.c index 443375b5..4460d734 100644 --- a/paint/sources/ui_menubar.c +++ b/paint/sources/ui_menubar.c @@ -85,7 +85,7 @@ void ui_menubar_render_ui() { if (ui_menubar_icon_button(ICON_PROJECTS)) { // Save project icon in lit mode context_set_viewport_mode(VIEWPORT_MODE_LIT); - console_toast(tr("Saving project", NULL)); + console_toast(tr("Saving project")); sys_notify_on_next_frame(&ui_menubar_render_ui_save_project, NULL); } if (ui_menubar_icon_button(ICON_IMPORT)) { @@ -144,13 +144,13 @@ void ui_menubar_render_ui() { else { string_t_array_t *categories = any_array_create_from_raw( (void *[]){ - tr("File", NULL), - tr("Edit", NULL), - tr("Viewport", NULL), - tr("Mode", NULL), - tr("Camera", NULL), - tr("Workspace", NULL), - tr("Help", NULL), + tr("File"), + tr("Edit"), + tr("Viewport"), + tr("Mode"), + tr("Camera"), + tr("Workspace"), + tr("Help"), }, 7); @@ -202,7 +202,7 @@ void ui_menubar_draw_tab_header() { ui_fill(0, 0, ui->_window_w, ui->_window_h + 4, ui->ops->theme->SEPARATOR_COL); } else { - bool a = ui_tab(ui_menubar_tab, tr("3D View", NULL), false, -1, false); + bool a = ui_tab(ui_menubar_tab, tr("3D View"), false, -1, false); bool b = ui_tab(ui_menubar_tab, base_view3d_show ? ">" : "<", false, -2, false); if ((a && !base_view3d_show) || b) { base_view3d_show = !base_view3d_show; @@ -227,17 +227,17 @@ void ui_menubar_draw_category_items_about_box() { ui_row3(); #if defined(IRON_WINDOWS) || defined(IRON_LINUX) || defined(IRON_MACOS) - if (ui_icon_button(tr("Copy", NULL), ICON_COPY, UI_ALIGN_CENTER)) { + if (ui_icon_button(tr("Copy"), ICON_COPY, UI_ALIGN_CENTER)) { iron_copy_to_clipboard(_ui_menu_render_msg); } #else ui_end_element(); #endif - if (ui_icon_button(tr("Contributors", NULL), ICON_LINK, UI_ALIGN_CENTER)) { + if (ui_icon_button(tr("Contributors"), ICON_LINK, UI_ALIGN_CENTER)) { iron_load_url("https://github.com/armory3d/armortools/graphs/contributors"); } - if (ui_icon_button(tr("OK", NULL), ICON_CHECK, UI_ALIGN_CENTER)) { + if (ui_icon_button(tr("OK"), ICON_CHECK, UI_ALIGN_CENTER)) { ui_box_hide(); } } @@ -254,17 +254,17 @@ void ui_menubar_draw_category_items_on_check_for_updates_downloaded(char *url, b if (update_version > date_int) { any_map_t *vars = any_map_create(); any_map_set(vars, "url", manifest_url); - ui_box_show_message(tr("Update", NULL), tr("Update is available!\nPlease visit {url}.", vars), false); + ui_box_show_message(tr("Update"), vtr("Update is available!\nPlease visit {url}.", vars), false); } else { - ui_box_show_message(tr("Update", NULL), tr("You are up to date!", NULL), false); + ui_box_show_message(tr("Update"), tr("You are up to date!"), false); } } } else { any_map_t *vars = any_map_create(); any_map_set(vars, "url", manifest_url); - ui_box_show_message(tr("Update", NULL), tr("Unable to check for updates.\nPlease visit {url}.", vars), false); + ui_box_show_message(tr("Update"), vtr("Unable to check for updates.\nPlease visit {url}.", vars), false); } } @@ -274,44 +274,44 @@ void ui_menubar_draw_category_items_capture_screenshot(void *_) { void ui_menubar_draw_category_items_import_envmap(char *path) { if (!ends_with(path, ".hdr")) { - console_error(tr("Error: .hdr file expected", NULL)); + console_error(tr("Error: .hdr file expected")); return; } import_asset_run(path, -1.0, -1.0, true, true, NULL); } viewport_mode_t ui_menubar_string_to_viewport_mode(char *s) { - if (string_equals(s, tr("Lit", NULL))) + if (string_equals(s, tr("Lit"))) return VIEWPORT_MODE_LIT; - if (string_equals(s, tr("Base Color", NULL))) + if (string_equals(s, tr("Base Color"))) return VIEWPORT_MODE_BASE_COLOR; - if (string_equals(s, tr("Normal", NULL))) + if (string_equals(s, tr("Normal"))) return VIEWPORT_MODE_NORMAL_MAP; - if (string_equals(s, tr("Occlusion", NULL))) + if (string_equals(s, tr("Occlusion"))) return VIEWPORT_MODE_OCCLUSION; - if (string_equals(s, tr("Roughness", NULL))) + if (string_equals(s, tr("Roughness"))) return VIEWPORT_MODE_ROUGHNESS; - if (string_equals(s, tr("Metallic", NULL))) + if (string_equals(s, tr("Metallic"))) return VIEWPORT_MODE_METALLIC; - if (string_equals(s, tr("Opacity", NULL))) + if (string_equals(s, tr("Opacity"))) return VIEWPORT_MODE_OPACITY; - if (string_equals(s, tr("Height", NULL))) + if (string_equals(s, tr("Height"))) return VIEWPORT_MODE_HEIGHT; - if (string_equals(s, tr("Emission", NULL))) + if (string_equals(s, tr("Emission"))) return VIEWPORT_MODE_EMISSION; - if (string_equals(s, tr("Subsurface", NULL))) + if (string_equals(s, tr("Subsurface"))) return VIEWPORT_MODE_SUBSURFACE; - if (string_equals(s, tr("TexCoord", NULL))) + if (string_equals(s, tr("TexCoord"))) return VIEWPORT_MODE_TEXCOORD; - if (string_equals(s, tr("Object Normal", NULL))) + if (string_equals(s, tr("Object Normal"))) return VIEWPORT_MODE_OBJECT_NORMAL; - if (string_equals(s, tr("Material ID", NULL))) + if (string_equals(s, tr("Material ID"))) return VIEWPORT_MODE_MATERIAL_ID; - if (string_equals(s, tr("Object ID", NULL))) + if (string_equals(s, tr("Object ID"))) return VIEWPORT_MODE_OBJECT_ID; - if (string_equals(s, tr("Mask", NULL))) + if (string_equals(s, tr("Mask"))) return VIEWPORT_MODE_MASK; - if (string_equals(s, tr("Path Traced", NULL))) + if (string_equals(s, tr("Path Traced"))) return VIEWPORT_MODE_PATH_TRACE; return VIEWPORT_MODE_LIT; } @@ -354,74 +354,74 @@ char *ui_menubar_viewport_mode_to_string(viewport_mode_t m) { void ui_menubar_draw_category_items() { if (ui_menubar_category == MENUBAR_CATEGORY_FILE) { - if (ui_menu_button(tr("New Project...", NULL), any_map_get(config_keymap, "file_new"), ICON_FILE_NEW)) { + if (ui_menu_button(tr("New Project..."), any_map_get(config_keymap, "file_new"), ICON_FILE_NEW)) { project_new_box(); } - if (ui_menu_button(tr("Open...", NULL), any_map_get(config_keymap, "file_open"), ICON_FOLDER_OPEN)) { + if (ui_menu_button(tr("Open..."), any_map_get(config_keymap, "file_open"), ICON_FOLDER_OPEN)) { project_open(); } - if (ui_menu_button(tr("Open Recent...", NULL), any_map_get(config_keymap, "file_open_recent"), ICON_REPLAY)) { + if (ui_menu_button(tr("Open Recent..."), any_map_get(config_keymap, "file_open_recent"), ICON_REPLAY)) { box_projects_show(); } - if (ui_menu_button(tr("Save", NULL), any_map_get(config_keymap, "file_save"), ICON_SAVE)) { + if (ui_menu_button(tr("Save"), any_map_get(config_keymap, "file_save"), ICON_SAVE)) { project_save(false); } - if (ui_menu_button(tr("Save As...", NULL), any_map_get(config_keymap, "file_save_as"), ICON_SAVE_AS)) { + if (ui_menu_button(tr("Save As..."), any_map_get(config_keymap, "file_save_as"), ICON_SAVE_AS)) { project_save_as(false); } ui_menu_separator(); - if (ui_menu_sub_button(ui_handle(__ID__), tr("Import", NULL))) { + if (ui_menu_sub_button(ui_handle(__ID__), tr("Import"))) { ui_menu_sub_begin(7); - if (ui_menu_button(tr("Texture...", NULL), any_map_get(config_keymap, "file_import_assets"), ICON_IMAGE)) { + if (ui_menu_button(tr("Texture..."), any_map_get(config_keymap, "file_import_assets"), ICON_IMAGE)) { project_import_asset(string_array_join(path_texture_formats(), ","), false); } - if (ui_menu_button(tr("Envmap...", NULL), "", ICON_LANDSCAPE)) { + if (ui_menu_button(tr("Envmap..."), "", ICON_LANDSCAPE)) { ui_files_show("hdr", false, false, &ui_menubar_draw_category_items_import_envmap); } - if (ui_menu_button(tr("Font...", NULL), "", ICON_FONT)) { + if (ui_menu_button(tr("Font..."), "", ICON_FONT)) { project_import_asset("ttf,ttc,otf", true); } - if (ui_menu_button(tr("Material...", NULL), "", ICON_SPHERE)) { + if (ui_menu_button(tr("Material..."), "", ICON_SPHERE)) { project_import_material(); } - if (ui_menu_button(tr("Brush...", NULL), "", ICON_PAINT)) { + if (ui_menu_button(tr("Brush..."), "", ICON_PAINT)) { project_import_brush(); } - if (ui_menu_button(tr("Swatches...", NULL), "", ICON_PALETTE)) { + if (ui_menu_button(tr("Swatches..."), "", ICON_PALETTE)) { project_import_swatches(false); } - if (ui_menu_button(tr("Mesh...", NULL), "", ICON_CUBE)) { + if (ui_menu_button(tr("Mesh..."), "", ICON_CUBE)) { project_import_mesh(true, NULL); } ui_menu_sub_end(); } - if (ui_menu_button(tr("Reimport Mesh", NULL), any_map_get(config_keymap, "file_reimport_mesh"), ICON_SYNC)) { + if (ui_menu_button(tr("Reimport Mesh"), any_map_get(config_keymap, "file_reimport_mesh"), ICON_SYNC)) { project_reimport_mesh(); } - if (ui_menu_button(tr("Reimport Textures", NULL), any_map_get(config_keymap, "file_reimport_textures"), ICON_SYNC)) { + if (ui_menu_button(tr("Reimport Textures"), any_map_get(config_keymap, "file_reimport_textures"), ICON_SYNC)) { project_reimport_textures(); } ui_menu_separator(); - if (ui_menu_sub_button(ui_handle(__ID__), tr("Export", NULL))) { + if (ui_menu_sub_button(ui_handle(__ID__), tr("Export"))) { ui_menu_sub_begin(3); - if (ui_menu_button(tr("Textures...", NULL), any_map_get(config_keymap, "file_export_textures_as"), ICON_IMAGE)) { + if (ui_menu_button(tr("Textures..."), any_map_get(config_keymap, "file_export_textures_as"), ICON_IMAGE)) { context_raw->layers_export = EXPORT_MODE_VISIBLE; box_export_show_textures(); } - if (ui_menu_button(tr("Swatches...", NULL), "", ICON_PALETTE)) { + if (ui_menu_button(tr("Swatches..."), "", ICON_PALETTE)) { project_export_swatches(); } - if (ui_menu_button(tr("Mesh...", NULL), "", ICON_CUBE)) { + if (ui_menu_button(tr("Mesh..."), "", ICON_CUBE)) { context_raw->export_mesh_index = 0; // All box_export_show_mesh(); } ui_menu_sub_end(); } - if (ui_menu_button(tr("Bake Material...", NULL), "", ICON_BAKE)) { + if (ui_menu_button(tr("Bake Material..."), "", ICON_BAKE)) { box_export_show_bake_material(); } ui_menu_separator(); - if (ui_menu_button(tr("Exit", NULL), "", ICON_EXIT)) { + if (ui_menu_button(tr("Exit"), "", ICON_EXIT)) { iron_stop(); } } @@ -438,30 +438,30 @@ void ui_menubar_draw_category_items() { ui->enabled = history_undos > 0; any_map_t *vars_undo = any_map_create(); any_map_set(vars_undo, "step", step_undo); - if (ui_menu_button(tr("Undo {step}", vars_undo), any_map_get(config_keymap, "edit_undo"), ICON_UNDO)) { + if (ui_menu_button(vtr("Undo {step}", vars_undo), any_map_get(config_keymap, "edit_undo"), ICON_UNDO)) { history_undo(); } ui->enabled = history_redos > 0; any_map_t *vars_redo = any_map_create(); any_map_set(vars_redo, "step", step_redo); - if (ui_menu_button(tr("Redo {step}", vars_redo), any_map_get(config_keymap, "edit_redo"), ICON_REDO)) { + if (ui_menu_button(vtr("Redo {step}", vars_redo), any_map_get(config_keymap, "edit_redo"), ICON_REDO)) { history_redo(); } ui->enabled = true; ui_menu_separator(); - if (ui_menu_button(tr("Preferences...", NULL), any_map_get(config_keymap, "edit_prefs"), ICON_COG)) { + if (ui_menu_button(tr("Preferences..."), any_map_get(config_keymap, "edit_prefs"), ICON_COG)) { box_preferences_show(); } } else if (ui_menubar_category == MENUBAR_CATEGORY_VIEWPORT) { - if (ui_menu_button(tr("Distract Free", NULL), any_map_get(config_keymap, "view_distract_free"), ICON_NONE)) { + if (ui_menu_button(tr("Distract Free"), any_map_get(config_keymap, "view_distract_free"), ICON_NONE)) { ui_base_toggle_distract_free(); ui->is_hovered = false; } #if defined(IRON_WINDOWS) || defined(IRON_LINUX) || defined(IRON_MACOS) || defined(IRON_WASM) - if (ui_menu_button(tr("Toggle Fullscreen", NULL), "alt+enter", ICON_FULLSCREEN)) { + if (ui_menu_button(tr("Toggle Fullscreen"), "alt+enter", ICON_FULLSCREEN)) { base_toggle_fullscreen(); } #endif @@ -472,7 +472,7 @@ void ui_menubar_draw_category_items() { ui_handle_t *env_handle = ui_handle(__ID__); env_handle->f = p->strength; ui_menu_align(); - p->strength = ui_slider(env_handle, tr("Environment", NULL), 0.0, 6.0, true, 100.0, true, UI_ALIGN_RIGHT, true); + p->strength = ui_slider(env_handle, tr("Environment"), 0.0, 6.0, true, 100.0, true, UI_ALIGN_RIGHT, true); if (env_handle->changed) { context_raw->ddirty = 2; } @@ -487,11 +487,11 @@ void ui_menubar_draw_category_items() { } ui_menu_align(); context_raw->envmap_angle = - ui_slider(enva_handle, tr("Environment Angle", NULL), 0.0, 360.0, true, 1, true, UI_ALIGN_RIGHT, true) / (float)180.0 * math_pi(); + ui_slider(enva_handle, tr("Environment Angle"), 0.0, 360.0, true, 1, true, UI_ALIGN_RIGHT, true) / (float)180.0 * math_pi(); if (ui->is_hovered) { any_map_t *vars = any_map_create(); any_map_set(vars, "shortcut", any_map_get(config_keymap, "rotate_envmap")); - ui_tooltip(tr("{shortcut} and move mouse", vars)); + ui_tooltip(vtr("{shortcut} and move mouse", vars)); } if (enva_handle->changed) { context_raw->ddirty = 2; @@ -501,7 +501,7 @@ void ui_menubar_draw_category_items() { if (split_view_handle->init) { split_view_handle->b = context_raw->split_view; } - context_raw->split_view = ui_check(split_view_handle, string(" %s", tr("Split View", NULL)), ""); + context_raw->split_view = ui_check(split_view_handle, string(" %s", tr("Split View")), ""); if (split_view_handle->changed) { base_resize(); } @@ -510,7 +510,7 @@ void ui_menubar_draw_category_items() { if (cull_handle->init) { cull_handle->b = context_raw->cull_backfaces; } - context_raw->cull_backfaces = ui_check(cull_handle, string(" %s", tr("Cull Backfaces", NULL)), ""); + context_raw->cull_backfaces = ui_check(cull_handle, string(" %s", tr("Cull Backfaces")), ""); if (cull_handle->changed) { make_material_parse_mesh_material(); } @@ -519,12 +519,12 @@ void ui_menubar_draw_category_items() { if (filter_handle->init) { filter_handle->b = context_raw->texture_filter; } - context_raw->texture_filter = ui_check(filter_handle, string(" %s", tr("Filter Textures", NULL)), ""); + context_raw->texture_filter = ui_check(filter_handle, string(" %s", tr("Filter Textures")), ""); if (filter_handle->changed) { gpu_use_linear_sampling(context_raw->texture_filter); } - context_raw->draw_wireframe = ui_check(context_raw->wireframe_handle, string(" %s", tr("Wireframe", NULL)), ""); + context_raw->draw_wireframe = ui_check(context_raw->wireframe_handle, string(" %s", tr("Wireframe")), ""); if (context_raw->wireframe_handle->changed) { gpu_texture_t *current = _draw_current; draw_end(); @@ -533,7 +533,7 @@ void ui_menubar_draw_category_items() { make_material_parse_mesh_material(); } - context_raw->draw_texels = ui_check(context_raw->texels_handle, string(" %s", tr("Texels", NULL)), ""); + context_raw->draw_texels = ui_check(context_raw->texels_handle, string(" %s", tr("Texels")), ""); if (context_raw->texels_handle->changed) { make_material_parse_mesh_material(); } @@ -542,29 +542,29 @@ void ui_menubar_draw_category_items() { if (compass_handle->init) { compass_handle->b = context_raw->show_compass; } - context_raw->show_compass = ui_check(compass_handle, string(" %s", tr("Compass", NULL)), ""); + context_raw->show_compass = ui_check(compass_handle, string(" %s", tr("Compass")), ""); if (compass_handle->changed) { context_raw->ddirty = 2; } context_raw->show_envmap_handle->b = context_raw->show_envmap; - context_raw->show_envmap = ui_check(context_raw->show_envmap_handle, string(" %s", tr("Envmap", NULL)), ""); + context_raw->show_envmap = ui_check(context_raw->show_envmap_handle, string(" %s", tr("Envmap")), ""); if (context_raw->show_envmap_handle->changed) { context_load_envmap(); context_raw->ddirty = 2; } context_raw->show_envmap_blur_handle->b = context_raw->show_envmap_blur; - context_raw->show_envmap_blur = ui_check(context_raw->show_envmap_blur_handle, string(" %s", tr("Blur Envmap", NULL)), ""); + context_raw->show_envmap_blur = ui_check(context_raw->show_envmap_blur_handle, string(" %s", tr("Blur Envmap")), ""); if (context_raw->show_envmap_blur_handle->changed) { context_raw->ddirty = 2; } - if (ui_menu_button(tr("Reset Envmap", NULL), "", ICON_NONE)) { + if (ui_menu_button(tr("Reset Envmap"), "", ICON_NONE)) { project_set_default_envmap(); } - if (ui_menu_button(tr("Capture Screenshot", NULL), "", ICON_PHOTO)) { + if (ui_menu_button(tr("Capture Screenshot"), "", ICON_PHOTO)) { sys_notify_on_next_frame(&ui_menubar_draw_category_items_capture_screenshot, NULL); ui->changed = false; // Close menu } @@ -580,21 +580,21 @@ void ui_menubar_draw_category_items() { mode_handle->i = context_raw->viewport_mode; string_t_array_t *modes = any_array_create_from_raw( (void *[]){ - tr("Lit", NULL), - tr("Base Color", NULL), - tr("Normal", NULL), - tr("Occlusion", NULL), - tr("Roughness", NULL), - tr("Metallic", NULL), - tr("Opacity", NULL), - tr("Height", NULL), - tr("Emission", NULL), - tr("Subsurface", NULL), - tr("TexCoord", NULL), - tr("Object Normal", NULL), - tr("Material ID", NULL), - tr("Object ID", NULL), - tr("Mask", NULL), + tr("Lit"), + tr("Base Color"), + tr("Normal"), + tr("Occlusion"), + tr("Roughness"), + tr("Metallic"), + tr("Opacity"), + tr("Height"), + tr("Emission"), + tr("Subsurface"), + tr("TexCoord"), + tr("Object Normal"), + tr("Material ID"), + tr("Object ID"), + tr("Mask"), }, 15); string_t_array_t *shortcuts = any_array_create_from_raw( @@ -618,7 +618,7 @@ void ui_menubar_draw_category_items() { 15); if (gpu_raytrace_supported()) { - any_array_push(modes, tr("Path Traced", NULL)); + any_array_push(modes, tr("Path Traced")); any_array_push(shortcuts, "p"); } @@ -652,7 +652,7 @@ void ui_menubar_draw_category_items() { } } else if (ui_menubar_category == MENUBAR_CATEGORY_CAMERA) { - if (ui_menu_button(tr("Reset", NULL), any_map_get(config_keymap, "view_reset"), ICON_NONE)) { + if (ui_menu_button(tr("Reset"), any_map_get(config_keymap, "view_reset"), ICON_NONE)) { viewport_reset(); viewport_scale_to_bounds(2.0); } @@ -668,24 +668,24 @@ void ui_menubar_draw_category_items() { if (full) { - if (ui_menu_sub_button(ui_handle(__ID__), tr("View", NULL))) { + if (ui_menu_sub_button(ui_handle(__ID__), tr("View"))) { ui_menu_sub_begin(6); - if (ui_menu_button(tr("Front", NULL), any_map_get(config_keymap, "view_front"), ICON_NONE)) { + if (ui_menu_button(tr("Front"), any_map_get(config_keymap, "view_front"), ICON_NONE)) { viewport_set_view(0, -1, 0, math_pi() / (float)2, 0, 0); } - if (ui_menu_button(tr("Back", NULL), any_map_get(config_keymap, "view_back"), ICON_NONE)) { + if (ui_menu_button(tr("Back"), any_map_get(config_keymap, "view_back"), ICON_NONE)) { viewport_set_view(0, 1, 0, math_pi() / (float)2, 0, math_pi()); } - if (ui_menu_button(tr("Right", NULL), any_map_get(config_keymap, "view_right"), ICON_NONE)) { + if (ui_menu_button(tr("Right"), any_map_get(config_keymap, "view_right"), ICON_NONE)) { viewport_set_view(1, 0, 0, math_pi() / (float)2, 0, math_pi() / (float)2); } - if (ui_menu_button(tr("Left", NULL), any_map_get(config_keymap, "view_left"), ICON_NONE)) { + if (ui_menu_button(tr("Left"), any_map_get(config_keymap, "view_left"), ICON_NONE)) { viewport_set_view(-1, 0, 0, math_pi() / (float)2, 0, -math_pi() / (float)2); } - if (ui_menu_button(tr("Top", NULL), any_map_get(config_keymap, "view_top"), ICON_NONE)) { + if (ui_menu_button(tr("Top"), any_map_get(config_keymap, "view_top"), ICON_NONE)) { viewport_set_view(0, 0, 1, 0, 0, 0); } - if (ui_menu_button(tr("Bottom", NULL), any_map_get(config_keymap, "view_bottom"), ICON_NONE)) { + if (ui_menu_button(tr("Bottom"), any_map_get(config_keymap, "view_bottom"), ICON_NONE)) { viewport_set_view(0, 0, -1, math_pi(), 0, math_pi()); } ui_menu_sub_end(); @@ -693,65 +693,65 @@ void ui_menubar_draw_category_items() { ui->changed = false; - if (ui_menu_sub_button(ui_handle(__ID__), tr("Orbit", NULL))) { + if (ui_menu_sub_button(ui_handle(__ID__), tr("Orbit"))) { ui_menu_sub_begin(5); - if (ui_menu_button(tr("Left", NULL), any_map_get(config_keymap, "view_orbit_left"), ICON_ARROW_LEFT)) { + if (ui_menu_button(tr("Left"), any_map_get(config_keymap, "view_orbit_left"), ICON_ARROW_LEFT)) { viewport_orbit(-math_pi() / (float)12, 0); } - if (ui_menu_button(tr("Right", NULL), any_map_get(config_keymap, "view_orbit_right"), ICON_ARROW_RIGHT)) { + if (ui_menu_button(tr("Right"), any_map_get(config_keymap, "view_orbit_right"), ICON_ARROW_RIGHT)) { viewport_orbit(math_pi() / (float)12, 0); } - if (ui_menu_button(tr("Up", NULL), any_map_get(config_keymap, "view_orbit_up"), ICON_ARROW_UP)) { + if (ui_menu_button(tr("Up"), any_map_get(config_keymap, "view_orbit_up"), ICON_ARROW_UP)) { viewport_orbit(0, -math_pi() / (float)12); } - if (ui_menu_button(tr("Down", NULL), any_map_get(config_keymap, "view_orbit_down"), ICON_ARROW_DOWN)) { + if (ui_menu_button(tr("Down"), any_map_get(config_keymap, "view_orbit_down"), ICON_ARROW_DOWN)) { viewport_orbit(0, math_pi() / (float)12); } - if (ui_menu_button(tr("Opposite", NULL), any_map_get(config_keymap, "view_orbit_opposite"), ICON_NONE)) { + if (ui_menu_button(tr("Opposite"), any_map_get(config_keymap, "view_orbit_opposite"), ICON_NONE)) { viewport_orbit_opposite(); } ui_menu_sub_end(); } } - if (ui_menu_button(tr("Zoom In", NULL), any_map_get(config_keymap, "view_zoom_in"), ICON_ZOOM_IN)) { + if (ui_menu_button(tr("Zoom In"), any_map_get(config_keymap, "view_zoom_in"), ICON_ZOOM_IN)) { viewport_zoom(0.2); } - if (ui_menu_button(tr("Zoom Out", NULL), any_map_get(config_keymap, "view_zoom_out"), ICON_ZOOM_OUT)) { + if (ui_menu_button(tr("Zoom Out"), any_map_get(config_keymap, "view_zoom_out"), ICON_ZOOM_OUT)) { viewport_zoom(-0.2); } camera_object_t *cam = scene_camera; context_raw->fov_handle->f = math_floor(cam->data->fov * 100) / (float)100; ui_menu_align(); - cam->data->fov = ui_slider(context_raw->fov_handle, tr("FoV", NULL), 0.3, 1.4, true, 100.0, true, UI_ALIGN_RIGHT, true); + cam->data->fov = ui_slider(context_raw->fov_handle, tr("FoV"), 0.3, 1.4, true, 100.0, true, UI_ALIGN_RIGHT, true); if (context_raw->fov_handle->changed) { viewport_update_camera_type(context_raw->camera_type); } ui_menu_separator(); ui_menu_align(); - ui_menu_label(tr("Pivot", NULL), any_map_get(config_keymap, "view_pivot_center")); + ui_menu_label(tr("Pivot"), any_map_get(config_keymap, "view_pivot_center")); ui_menu_align(); ui_handle_t *h = ui_handle(__ID__); string_t_array_t *pivot_center_items = any_array_create_from_raw( (void *[]){ - tr("Camera Center", NULL), // tr("Paint Stroke") + tr("Camera Center"), // tr("Paint Stroke") }, 1); ui_inline_radio(h, pivot_center_items, UI_ALIGN_LEFT); ui_menu_separator(); ui_menu_align(); - ui_menu_label(tr("Mode", NULL), NULL); + ui_menu_label(tr("Mode"), NULL); ui_menu_align(); ui_handle_t *camera_controls_handle = ui_handle(__ID__); camera_controls_handle->i = context_raw->camera_controls; string_t_array_t *camera_controls_items = any_array_create_from_raw( (void *[]){ - tr("Orbit", NULL), - tr("Rotate", NULL), - tr("Fly", NULL), + tr("Orbit"), + tr("Rotate"), + tr("Fly"), }, 3); context_raw->camera_controls = ui_inline_radio(camera_controls_handle, camera_controls_items, UI_ALIGN_LEFT); @@ -760,25 +760,24 @@ void ui_menubar_draw_category_items() { any_map_set(vars, "rotate_shortcut", any_map_get(config_keymap, "action_rotate")); any_map_set(vars, "zoom_shortcut", any_map_get(config_keymap, "action_zoom")); any_map_set(vars, "pan_shortcut", any_map_get(config_keymap, "action_pan")); - char *orbit_and_rotate_tooltip = tr("Orbit and Rotate mode:\n{rotate_shortcut} or move right mouse button to rotate.\n{zoom_shortcut} or scroll to " + char *orbit_and_rotate_tooltip = vtr("Orbit and Rotate mode:\n{rotate_shortcut} or move right mouse button to rotate.\n{zoom_shortcut} or scroll to " "zoom.\n{pan_shortcut} or move middle mouse to pan.", vars); char *fly_tooltip = tr("Fly mode:\nHold the right mouse button and one of the following commands:\nmove mouse to rotate.\nw, up or scroll up to " "move forward.\ns, down or scroll down to move backward.\na or left to move left.\nd or right to move right.\ne to move " - "up.\nq to move down.\nHold shift to move faster or alt to move slower.", - NULL); + "up.\nq to move down.\nHold shift to move faster or alt to move slower."); if (ui->is_hovered) { ui_tooltip(string("%s\n\n%s", orbit_and_rotate_tooltip, fly_tooltip)); } ui_menu_separator(); ui_menu_align(); - ui_menu_label(tr("Type", NULL), any_map_get(config_keymap, "view_camera_type")); + ui_menu_label(tr("Type"), any_map_get(config_keymap, "view_camera_type")); ui_menu_align(); string_t_array_t *camera_type_items = any_array_create_from_raw( (void *[]){ - tr("Perspective", NULL), - tr("Orthographic", NULL), + tr("Perspective"), + tr("Orthographic"), }, 2); context_raw->camera_type = ui_inline_radio(context_raw->cam_handle, camera_type_items, UI_ALIGN_LEFT); @@ -791,19 +790,19 @@ void ui_menubar_draw_category_items() { } } else if (ui_menubar_category == MENUBAR_CATEGORY_HELP) { - if (ui_menu_button(tr("Manual", NULL), "", ICON_HELP)) { + if (ui_menu_button(tr("Manual"), "", ICON_HELP)) { iron_load_url(string("%s/manual", manifest_url)); } - if (ui_menu_button(tr("How To", NULL), "", ICON_HELP)) { + if (ui_menu_button(tr("How To"), "", ICON_HELP)) { iron_load_url(string("%s/howto", manifest_url)); } - if (ui_menu_button(tr("What's New", NULL), "", ICON_LINK)) { + if (ui_menu_button(tr("What's New"), "", ICON_LINK)) { iron_load_url(string("%s/notes", manifest_url)); } - if (ui_menu_button(tr("Issue Tracker", NULL), "", ICON_LINK)) { + if (ui_menu_button(tr("Issue Tracker"), "", ICON_LINK)) { iron_load_url("https://github.com/armory3d/armortools/issues"); } - if (ui_menu_button(tr("Report Bug", NULL), "", ICON_LINK)) { + if (ui_menu_button(tr("Report Bug"), "", ICON_LINK)) { #if defined(IRON_MACOS) || defined(IRON_IOS) // Limited url length iron_load_url(string("https://github.com/armory3d/armortools/issues/new?labels=bug&template=bug_report.md&body=*%s%%20%s-%s,%%20%s", manifest_title, manifest_version, config_get_sha(), iron_system_id())); @@ -813,7 +812,7 @@ void ui_menubar_draw_category_items() { manifest_title, manifest_version, config_get_sha(), iron_system_id())); #endif } - if (ui_menu_button(tr("Request Feature", NULL), "", ICON_LINK)) { + if (ui_menu_button(tr("Request Feature"), "", ICON_LINK)) { #if defined(IRON_MACOS) || defined(IRON_IOS) // Limited url length iron_load_url( string("https://github.com/armory3d/armortools/issues/new?labels=feature%%20request&template=feature_request.md&body=*%s%%20%s-%s,%%20%s", @@ -826,7 +825,7 @@ void ui_menubar_draw_category_items() { } ui_menu_separator(); - if (ui_menu_button(tr("Check for Updates...", NULL), "", ICON_NONE)) { + if (ui_menu_button(tr("Check for Updates..."), "", ICON_NONE)) { #ifdef IRON_ANDROID iron_load_url(manifest_url_android); #elif defined(IRON_IOS) @@ -837,7 +836,7 @@ void ui_menubar_draw_category_items() { #endif } - if (ui_menu_button(tr("About...", NULL), "", ICON_INFO)) { + if (ui_menu_button(tr("About..."), "", ICON_INFO)) { char *msg = string("%s.org - v%s (%s) - %s\n", manifest_title, manifest_version, config_get_date(), config_get_sha()); msg = string("%s%s - %s", msg, iron_system_id(), strings_graphics_api()); @@ -848,7 +847,7 @@ void ui_menubar_draw_category_items() { gc_unroot(_ui_menu_render_msg); _ui_menu_render_msg = string_copy(msg); gc_root(_ui_menu_render_msg); - ui_box_show_custom(&ui_menubar_draw_category_items_about_box, 400, 320, NULL, true, tr("About", NULL)); + ui_box_show_custom(&ui_menubar_draw_category_items_about_box, 400, 320, NULL, true, tr("About")); } } else if (ui_menubar_category == MENUBAR_CATEGORY_WORKSPACE) { @@ -856,15 +855,15 @@ void ui_menubar_draw_category_items() { workspace_handle->i = config_raw->workspace; string_t_array_t *modes = any_array_create_from_raw( (void *[]){ - tr("Paint 3D", NULL), - tr("Paint 2D", NULL), - tr("Nodes", NULL), - tr("Script", NULL), + tr("Paint 3D"), + tr("Paint 2D"), + tr("Nodes"), + tr("Script"), }, 4); if (config_raw->experimental) { - any_array_push(modes, tr("Sculpt", NULL)); + any_array_push(modes, tr("Sculpt")); } for (i32 i = 0; i < modes->length; ++i) { @@ -879,14 +878,14 @@ void ui_menubar_draw_category_items() { ui_menu_separator(); ui_menu_align(); - ui_menu_label(tr("Workflow", NULL), NULL); + ui_menu_label(tr("Workflow"), NULL); ui_menu_align(); ui_handle_t *workflow_handle = ui_handle(__ID__); workflow_handle->i = config_raw->workflow; string_t_array_t *workflow_items = any_array_create_from_raw( (void *[]){ - tr("PBR", NULL), - tr("Base", NULL), + tr("PBR"), + tr("Base"), }, 2); config_raw->workflow = ui_inline_radio(workflow_handle, workflow_items, UI_ALIGN_LEFT); diff --git a/paint/sources/ui_nodes.c b/paint/sources/ui_nodes.c index ccac1d6e..72de2a95 100644 --- a/paint/sources/ui_nodes.c +++ b/paint/sources/ui_nodes.c @@ -117,39 +117,39 @@ void ui_viewnodes_on_socket_released_group_edit_box() { ui_node_t *node = _ui_nodes_on_socket_released_node; string_t_array_t *type_combo = any_array_create_from_raw( (void *[]){ - tr("Color", NULL), - tr("Vector", NULL), - tr("Value", NULL), + tr("Color"), + tr("Vector"), + tr("Value"), }, 3); - i32 type = ui_combo(_ui_nodes_htype, type_combo, tr("Type", NULL), true, UI_ALIGN_LEFT, true); + i32 type = ui_combo(_ui_nodes_htype, type_combo, tr("Type"), true, UI_ALIGN_LEFT, true); if (_ui_nodes_htype->changed) { - _ui_nodes_hname->text = type == 0 ? tr("Color", NULL) : type == 1 ? tr("Vector", NULL) : tr("Value", NULL); + _ui_nodes_hname->text = type == 0 ? tr("Color") : type == 1 ? tr("Vector") : tr("Value"); } - char *name = ui_text_input(_ui_nodes_hname, tr("Name", NULL), UI_ALIGN_LEFT, true, false); - f32 min = ui_float_input(_ui_nodes_hmin, tr("Min", NULL), UI_ALIGN_LEFT, 1000.0); - f32 max = ui_float_input(_ui_nodes_hmax, tr("Max", NULL), UI_ALIGN_LEFT, 1000.0); + char *name = ui_text_input(_ui_nodes_hname, tr("Name"), UI_ALIGN_LEFT, true, false); + f32 min = ui_float_input(_ui_nodes_hmin, tr("Min"), UI_ALIGN_LEFT, 1000.0); + f32 max = ui_float_input(_ui_nodes_hmax, tr("Max"), UI_ALIGN_LEFT, 1000.0); f32_array_t *default_value = NULL; if (type == 0) { ui_row4(); - ui_float_input(_ui_nodes_hval0, tr("R", NULL), UI_ALIGN_LEFT, 1000.0); - ui_float_input(_ui_nodes_hval1, tr("G", NULL), UI_ALIGN_LEFT, 1000.0); - ui_float_input(_ui_nodes_hval2, tr("B", NULL), UI_ALIGN_LEFT, 1000.0); - ui_float_input(_ui_nodes_hval3, tr("A", NULL), UI_ALIGN_LEFT, 1000.0); + ui_float_input(_ui_nodes_hval0, tr("R"), UI_ALIGN_LEFT, 1000.0); + ui_float_input(_ui_nodes_hval1, tr("G"), UI_ALIGN_LEFT, 1000.0); + ui_float_input(_ui_nodes_hval2, tr("B"), UI_ALIGN_LEFT, 1000.0); + ui_float_input(_ui_nodes_hval3, tr("A"), UI_ALIGN_LEFT, 1000.0); default_value = f32_array_create_xyzw(_ui_nodes_hval0->f, _ui_nodes_hval1->f, _ui_nodes_hval2->f, _ui_nodes_hval3->f); } else if (type == 1) { ui_row3(); - _ui_nodes_hval0->f = ui_float_input(_ui_nodes_hval0, tr("X", NULL), UI_ALIGN_LEFT, 1000.0); - _ui_nodes_hval1->f = ui_float_input(_ui_nodes_hval1, tr("Y", NULL), UI_ALIGN_LEFT, 1000.0); - _ui_nodes_hval2->f = ui_float_input(_ui_nodes_hval2, tr("Z", NULL), UI_ALIGN_LEFT, 1000.0); + _ui_nodes_hval0->f = ui_float_input(_ui_nodes_hval0, tr("X"), UI_ALIGN_LEFT, 1000.0); + _ui_nodes_hval1->f = ui_float_input(_ui_nodes_hval1, tr("Y"), UI_ALIGN_LEFT, 1000.0); + _ui_nodes_hval2->f = ui_float_input(_ui_nodes_hval2, tr("Z"), UI_ALIGN_LEFT, 1000.0); default_value = f32_array_create_xyz(_ui_nodes_hval0->f, _ui_nodes_hval1->f, _ui_nodes_hval2->f); } else { - f32 f = ui_float_input(_ui_nodes_hval0, tr("default_value", NULL), UI_ALIGN_LEFT, 1000.0); + f32 f = ui_float_input(_ui_nodes_hval0, tr("default_value"), UI_ALIGN_LEFT, 1000.0); default_value = f32_array_create_x(f); } - if (ui_icon_button(tr("OK", NULL), ICON_CHECK, UI_ALIGN_CENTER)) { // || ui.isReturnDown + if (ui_icon_button(tr("OK"), ICON_CHECK, UI_ALIGN_CENTER)) { // || ui.isReturnDown socket->name = string_copy(name); socket->type = type == 0 ? "RGBA" : type == 1 ? "VECTOR" : "VALUE"; socket->color = nodes_material_get_socket_color(socket->type); @@ -164,13 +164,13 @@ void ui_viewnodes_on_socket_released_group_edit_box() { void ui_viewnodes_on_socket_released_group_edit(void *_) { ui_end_input(); - ui_box_show_custom(&ui_viewnodes_on_socket_released_group_edit_box, 400, 250, NULL, true, tr("Socket", NULL)); + ui_box_show_custom(&ui_viewnodes_on_socket_released_group_edit_box, 400, 250, NULL, true, tr("Socket")); } void ui_viewnodes_on_socket_released_group_menu_draw() { ui_node_socket_t *socket = _ui_nodes_on_socket_released_socket; ui_node_t *node = _ui_nodes_on_socket_released_node; - if (ui_menu_button(tr("Edit", NULL), "", ICON_EDIT)) { + if (ui_menu_button(tr("Edit"), "", ICON_EDIT)) { _ui_nodes_htype->i = string_equals(socket->type, "RGBA") ? 0 : string_equals(socket->type, "VECTOR") ? 1 : 2; _ui_nodes_hname->text = string_copy(socket->name); _ui_nodes_hmin->f = socket->min; @@ -188,7 +188,7 @@ void ui_viewnodes_on_socket_released_group_menu_draw() { } sys_notify_on_next_frame(&ui_viewnodes_on_socket_released_group_edit, NULL); } - if (ui_menu_button(tr("Delete", NULL), "", ICON_DELETE)) { + if (ui_menu_button(tr("Delete"), "", ICON_DELETE)) { i32 i = 0; ui_node_canvas_t *canvas = ui_nodes_get_canvas(true); // Remove links connected to the socket @@ -287,25 +287,25 @@ void ui_viewnodes_on_canvas_context_menu() { bool is_protected = selected == NULL || string_equals(selected->type, "OUTPUT_MATERIAL_PBR") || string_equals(selected->type, "GROUP_INPUT") || string_equals(selected->type, "GROUP_OUTPUT") || string_equals(selected->type, "brush_output_node"); ui->enabled = !is_protected; - if (ui_menu_button(tr("Cut", NULL), "ctrl+x", ICON_CUT)) { + if (ui_menu_button(tr("Cut"), "ctrl+x", ICON_CUT)) { sys_notify_on_next_frame(&ui_viewnodes_on_canvas_cut, NULL); } - if (ui_menu_button(tr("Copy", NULL), "ctrl+c", ICON_COPY)) { + if (ui_menu_button(tr("Copy"), "ctrl+c", ICON_COPY)) { sys_notify_on_next_frame(&ui_viewnodes_on_canvas_copy, NULL); } ui->enabled = !string_equals(ui_clipboard, ""); - if (ui_menu_button(tr("Paste", NULL), "ctrl+v", ICON_PASTE)) { + if (ui_menu_button(tr("Paste"), "ctrl+v", ICON_PASTE)) { sys_notify_on_next_frame(&ui_viewnodes_on_canvas_paste, NULL); } ui->enabled = !is_protected; - if (ui_menu_button(tr("Delete", NULL), "delete", ICON_DELETE)) { + if (ui_menu_button(tr("Delete"), "delete", ICON_DELETE)) { sys_notify_on_next_frame(&ui_viewnodes_on_canvas_delete, NULL); } - if (ui_menu_button(tr("Duplicate", NULL), "", ICON_DUPLICATE)) { + if (ui_menu_button(tr("Duplicate"), "", ICON_DUPLICATE)) { sys_notify_on_next_frame(&ui_viewnodes_on_canvas_released_duplicate, NULL); } if (selected != NULL && string_equals(selected->type, "RGB")) { - if (ui_menu_button(tr("Add Swatch", NULL), "", ICON_PALETTE)) { + if (ui_menu_button(tr("Add Swatch"), "", ICON_PALETTE)) { f32_array_t *color = selected->outputs->buffer[0]->default_value; swatch_color_t *new_swatch = project_make_swatch(color_from_floats(color->buffer[0], color->buffer[1], color->buffer[2], color->buffer[3])); context_set_swatch(new_swatch); @@ -313,12 +313,12 @@ void ui_viewnodes_on_canvas_context_menu() { ui_base_hwnds->buffer[TAB_AREA_STATUS]->redraws = 1; } } - if (ui_menu_button(tr("Capture Output", NULL), "", ICON_PHOTO)) { + if (ui_menu_button(tr("Capture Output"), "", ICON_PHOTO)) { sys_notify_on_next_frame(&ui_viewnodes_on_canvas_capture_output, NULL); } if (ui_nodes_canvas_type == CANVAS_TYPE_MATERIAL) { ui_menu_separator(); - if (ui_menu_button(tr("2D View", NULL), "", ICON_NONE)) { + if (ui_menu_button(tr("2D View"), "", ICON_NONE)) { ui_base_show_2d_view(VIEW_2D_TYPE_NODE); } } @@ -610,9 +610,9 @@ void ui_nodes_node_search_menu() { ui_node_t_array_t *list = node_list->buffer[i]; for (i32 i = 0; i < list->length; ++i) { ui_node_t *n = list->buffer[i]; - if (string_index_of(to_lower_case(tr(n->name, NULL)), search) >= 0) { + if (string_index_of(to_lower_case(tr(n->name)), search) >= 0) { ui->ops->theme->BUTTON_COL = count == ui_nodes_node_search_offset ? ui->ops->theme->HIGHLIGHT_COL : ui->ops->theme->SEPARATOR_COL; - if (ui_button(tr(n->name, NULL), UI_ALIGN_LEFT, "") || (enter && count == ui_nodes_node_search_offset)) { + if (ui_button(tr(n->name), UI_ALIGN_LEFT, "") || (enter && count == ui_nodes_node_search_offset)) { ui_nodes_push_undo(NULL); ui_nodes_t *nodes = ui_nodes_get_nodes(); ui_node_canvas_t *canvas = ui_nodes_get_canvas(true); @@ -900,7 +900,7 @@ void ui_nodes_render(void *_) { if (!config_raw->touch_ui) { bool expand = !base_view3d_show && config_raw->layout->buffer[LAYOUT_SIZE_SIDEBAR_W] == 0; - ui_tab(ui_nodes_htab, expand ? string("%s ", tr("Nodes", NULL)) : tr("Nodes", NULL), false, -1, !base_view3d_show); + ui_tab(ui_nodes_htab, expand ? string("%s ", tr("Nodes")) : tr("Nodes"), false, -1, !base_view3d_show); // Additional tabs if (ui_nodes_canvas_type == CANVAS_TYPE_MATERIAL) { @@ -912,13 +912,13 @@ void ui_nodes_render(void *_) { for (i32 i = 0; i < ui_nodes_tabs->length; ++i) { ui_tab(ui_nodes_htab, ui_nodes_tabs->buffer[i]->canvas->name, false, -1, false); - if (ui_tab(ui_nodes_htab, tr("x", NULL), false, -1, false)) { + if (ui_tab(ui_nodes_htab, tr("x"), false, -1, false)) { array_splice(ui_nodes_tabs, i, 1); ui_nodes_htab->i = 0; } } - if (ui_tab(ui_nodes_htab, tr("+", NULL), false, -1, false)) { + if (ui_tab(ui_nodes_htab, tr("+"), false, -1, false)) { any_array_push(ui_nodes_tabs, context_raw->material); } } @@ -1069,7 +1069,7 @@ void ui_nodes_render(void *_) { ui_menu_begin(); for (i32 i = 0; i < category->length; ++i) { ui_node_t *n = category->buffer[i]; - if (ui_menu_button(tr(n->name, NULL), "", ICON_NONE)) { + if (ui_menu_button(tr(n->name), "", ICON_NONE)) { ui_nodes_push_undo(NULL); ui_node_canvas_t *canvas = ui_nodes_get_canvas(true); ui_nodes_t *nodes = ui_nodes_get_nodes(); @@ -1254,7 +1254,7 @@ void ui_nodes_draw_menubar() { ui->ops->theme->SHADOWS = false; string_t_array_t *cats = ui_nodes_canvas_type == CANVAS_TYPE_MATERIAL ? nodes_material_categories : nodes_brush_categories; for (i32 i = 0; i < cats->length; ++i) { - if ((ui_menubar_button(tr(cats->buffer[i], NULL))) || (ui->is_hovered && ui_nodes_show_menu)) { + if ((ui_menubar_button(tr(cats->buffer[i]))) || (ui->is_hovered && ui_nodes_show_menu)) { ui_nodes_show_menu = true; ui_nodes_menu_category = i; ui_nodes_popup_x = ui_nodes_wx + ui->_x; @@ -1279,7 +1279,7 @@ void ui_nodes_draw_menubar() { ui->_w = _w; } else { - if (ui_menubar_button(tr("Search", NULL))) { + if (ui_menubar_button(tr("Search"))) { ui_nodes_node_search_x = ui->_window_x + ui->_x; ui_nodes_node_search_y = ui->_window_y + ui->_y; // Allow for node menu to be closed first @@ -1287,14 +1287,14 @@ void ui_nodes_draw_menubar() { } } if (ui->is_hovered) { - ui_tooltip(string("%s (%s)", tr("Search for nodes", NULL), any_map_get(config_keymap, "node_search"))); + ui_tooltip(string("%s (%s)", tr("Search for nodes"), any_map_get(config_keymap, "node_search"))); } ui->_x += ui->_w + 3; ui->_y = 2 + start_y; ui->ops->theme->BUTTON_COL = _BUTTON_COL; ui->ops->theme->SHADOWS = _SHADOWS; // Close node group - if (ui_nodes_group_stack->length > 0 && ui_menubar_button(tr("Close", NULL))) { + if (ui_nodes_group_stack->length > 0 && ui_menubar_button(tr("Close"))) { array_pop(ui_nodes_group_stack); } } diff --git a/paint/sources/ui_toolbar.c b/paint/sources/ui_toolbar.c index f0a43964..c2296bcc 100644 --- a/paint/sources/ui_toolbar.c +++ b/paint/sources/ui_toolbar.c @@ -43,14 +43,14 @@ void ui_toolbar_draw_tool(i32 tool, gpu_texture_t *img, i32 icon_accent) { } if (ui->is_hovered) { - char *tooltip = tr(ui_toolbar_tool_names->buffer[tool], NULL); + char *tooltip = tr(ui_toolbar_tool_names->buffer[tool]); char *key = any_map_get(config_keymap, string("tool_%s", to_lower_case(ui_toolbar_tool_names->buffer[tool]))); if (!string_equals(key, "")) { tooltip = string("%s (%s)", tooltip, key); } char *extra = ui_toolbar_tooltip_extras->buffer[tool]; if (!string_equals(extra, "")) { - tooltip = string("%s - %s", tooltip, tr(extra, config_keymap)); + tooltip = string("%s - %s", tooltip, vtr(extra, config_keymap)); } ui_tooltip(tooltip); } @@ -189,7 +189,7 @@ void ui_toolbar_render_ui() { ui->font_offset_y = _fontOffsetY; } if (ui->is_hovered) { - ui_tooltip(tr("Toggle header", NULL)); + ui_tooltip(tr("Toggle header")); } ui->_y -= 4 * UI_SCALE(); @@ -219,10 +219,10 @@ void ui_toolbar_tool_properties_menu_draw() { if (ui->changed || ui->is_typing) { ui_menu_keep_open = true; } - if (base_view3d_show && ui_button(tr("Pin to Header", NULL), UI_ALIGN_LEFT, "")) { + if (base_view3d_show && ui_button(tr("Pin to Header"), UI_ALIGN_LEFT, "")) { config_raw->layout->buffer[LAYOUT_SIZE_HEADER] = 1; } - if (base_view3d_show && ui_button(tr("Hide 3D View", NULL), UI_ALIGN_LEFT, "")) { + if (base_view3d_show && ui_button(tr("Hide 3D View"), UI_ALIGN_LEFT, "")) { ui_base_show_3d_view(); } } diff --git a/paint/sources/ui_view2d.c b/paint/sources/ui_view2d.c index cf6fb31e..66e345ab 100644 --- a/paint/sources/ui_view2d.c +++ b/paint/sources/ui_view2d.c @@ -125,8 +125,8 @@ void ui_view2d_render(void *_) { if (!config_raw->touch_ui) { bool expand = !base_view3d_show && !ui_nodes_show && config_raw->layout->buffer[LAYOUT_SIZE_SIDEBAR_W] == 0; - ui_tab(ui_view2d_htab, expand ? string("%s ", tr("2D View", NULL)) : tr("2D View", NULL), false, -1, !base_view3d_show); - if (ui_tab(ui_view2d_htab, tr("+", NULL), false, -1, false)) { + ui_tab(ui_view2d_htab, expand ? string("%s ", tr("2D View")) : tr("2D View"), false, -1, !base_view3d_show); + if (ui_tab(ui_view2d_htab, tr("+"), false, -1, false)) { ui_view2d_htab->i = 0; } } @@ -310,11 +310,11 @@ void ui_view2d_render(void *_) { } string_t_array_t *layer_mode_combo = any_array_create_from_raw( (void *[]){ - tr("Visible", NULL), - tr("Selected", NULL), + tr("Visible"), + tr("Selected"), }, 2); - ui_view2d_layer_mode = ui_combo(h_layer_mode, layer_mode_combo, tr("Layers", NULL), false, UI_ALIGN_LEFT, true); + ui_view2d_layer_mode = ui_combo(h_layer_mode, layer_mode_combo, tr("Layers"), false, UI_ALIGN_LEFT, true); ui->_x += ew + 3; ui->_y = 2 + start_y; @@ -325,13 +325,13 @@ void ui_view2d_render(void *_) { } string_t_array_t *tex_type_combo = any_array_create_from_raw( (void *[]){ - tr("Base Color", NULL), - tr("Opacity", NULL), - tr("Normal Map", NULL), - tr("Occlusion", NULL), - tr("Roughness", NULL), - tr("Metallic", NULL), - tr("Height", NULL), + tr("Base Color"), + tr("Opacity"), + tr("Normal Map"), + tr("Occlusion"), + tr("Roughness"), + tr("Metallic"), + tr("Height"), }, 7); @@ -343,7 +343,7 @@ void ui_view2d_render(void *_) { array_splice(tex_type_combo, 2, 1); } - ui_view2d_tex_type = ui_combo(h_tex_type, tex_type_combo, tr("Texture", NULL), false, UI_ALIGN_LEFT, true); + ui_view2d_tex_type = ui_combo(h_tex_type, tex_type_combo, tr("Texture"), false, UI_ALIGN_LEFT, true); ui->_x += ew + 3; ui->_y = 2 + start_y; } @@ -353,7 +353,7 @@ void ui_view2d_render(void *_) { if (h_uvmap_show->init) { h_uvmap_show->b = ui_view2d_uvmap_show; } - ui_view2d_uvmap_show = ui_check(h_uvmap_show, tr("UV Map", NULL), ""); + ui_view2d_uvmap_show = ui_check(h_uvmap_show, tr("UV Map"), ""); ui->_x += ew * 0.7 + 3; ui->_y = 2 + start_y; } @@ -363,7 +363,7 @@ void ui_view2d_render(void *_) { if (h_tiled_show->init) { h_tiled_show->b = ui_view2d_tiled_show; } - ui_view2d_tiled_show = ui_check(h_tiled_show, tr("Tiled", NULL), ""); + ui_view2d_tiled_show = ui_check(h_tiled_show, tr("Tiled"), ""); ui->_x += ew * 0.6 + 3; ui->_y = 2 + start_y;