Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
luboslenco committed Jan 19, 2025
1 parent 25461d9 commit fa9f23b
Show file tree
Hide file tree
Showing 14 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions armorsculpt/sources/import_mesh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ let import_mesh_clear_layers: bool = true;
function import_mesh_run(path: string, _clear_layers: bool = true, replace_existing: bool = true) {
if (!path_is_mesh(path)) {
if (!context_enable_import_plugin(path)) {
console_error(strings_error1());
console_error(strings_unknown_asset_format());
return;
}
}
Expand Down Expand Up @@ -133,7 +133,7 @@ function _import_mesh_make_mesh(mesh: raw_mesh_t) {

function import_mesh_make_mesh(mesh: raw_mesh_t) {
if (mesh == null || mesh.posa == null || mesh.nora == null || mesh.inda == null || mesh.posa.length == 0) {
console_error(strings_error3());
console_error(strings_failed_to_read_mesh_data());
return;
}

Expand Down
2 changes: 1 addition & 1 deletion base/sources/box_export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ function box_export_tab_presets(ui: ui_t) {
console_info(tr("Preset imported:") + " " + filename);
}
else {
console_error(strings_error1());
console_error(strings_unknown_asset_format());
}
});
}
Expand Down
4 changes: 2 additions & 2 deletions base/sources/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ function file_cache_cloud(path: string, done: (s: string)=>void) {
file_download(url, dest, function (url: string) {
let fccd: file_cache_cloud_data_t = map_get(_file_cache_cloud_map, url);
if (!file_exists(fccd.dest)) {
console_error(strings_error5());
console_error(strings_check_internet_connection());
fccd.done(null);
return;
}
Expand All @@ -220,7 +220,7 @@ function file_init_cloud_bytes(done: ()=>void, append: string = "") {
if (buffer == null) {
let empty: string[] = [];
map_set(file_cloud, "cloud", empty);
console_error(strings_error5());
console_error(strings_check_internet_connection());
return;
}
let files: string[] = [];
Expand Down
2 changes: 1 addition & 1 deletion base/sources/import_arm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ function import_arm_run_swatches_from_project(project: project_format_t, path: s
}

function import_arm_make_pink(abs: string) {
console_error(strings_error2() + " " + abs);
console_error(strings_could_not_locate_texture() + " " + abs);
let b: u8_array_t = u8_array_create(4);
b[0] = 255;
b[1] = 0;
Expand Down
2 changes: 1 addition & 1 deletion base/sources/import_asset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function import_asset_run(path: string, drop_x: f32 = -1.0, drop_y: f32 = -1.0,
import_asset_run(path, drop_x, drop_y, show_box);
}
else {
console_error(strings_error1());
console_error(strings_unknown_asset_format());
}
}

Expand Down
2 changes: 1 addition & 1 deletion base/sources/import_font.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ function import_font_run(path: string) {
for (let i: i32 = 0; i < project_fonts.length; ++i) {
let f: slot_font_t = project_fonts[i];
if (f.file == path) {
console_info(strings_info0());
console_info(strings_asset_already_imported());
return;
}
}
Expand Down
2 changes: 1 addition & 1 deletion base/sources/import_keymap.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

function import_keymap_run(path: string) {
if (!path_is_json(path)) {
console_error(strings_error1());
console_error(strings_unknown_asset_format());
return;
}

Expand Down
4 changes: 2 additions & 2 deletions base/sources/import_mesh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function import_mesh_run(path: string, replace_existing: bool = true) {

if (!path_is_mesh(path)) {
if (!context_enable_import_plugin(path)) {
console_error(strings_error1());
console_error(strings_unknown_asset_format());
return;
}
}
Expand Down Expand Up @@ -181,7 +181,7 @@ function import_mesh_first_unwrap_done(mesh: raw_mesh_t) {

function import_mesh_make_mesh(mesh: raw_mesh_t) {
if (mesh == null || mesh.posa == null || mesh.nora == null || mesh.inda == null || mesh.posa.length == 0) {
console_error(strings_error3());
console_error(strings_failed_to_read_mesh_data());
return;
}

Expand Down
2 changes: 1 addition & 1 deletion base/sources/import_plugin.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

function import_plugin_run(path: string) {
if (!path_is_plugin(path)) {
console_error(strings_error1());
console_error(strings_unknown_asset_format());
return;
}

Expand Down
4 changes: 2 additions & 2 deletions base/sources/import_texture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ type import_texture_data_t = {
function import_texture_run(path: string, hdr_as_envmap: bool = true) {
if (!path_is_texture(path)) {
if (!context_enable_import_plugin(path)) {
console_error(strings_error1());
console_error(strings_unknown_asset_format());
return;
}
}
Expand All @@ -24,7 +24,7 @@ function import_texture_run(path: string, hdr_as_envmap: bool = true) {
import_envmap_run(itd.path, itd.image);
}, itd);
}
console_info(strings_info0());
console_info(strings_asset_already_imported());
return;
}
}
Expand Down
2 changes: 1 addition & 1 deletion base/sources/import_theme.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

function import_theme_run(path: string) {
if (!path_is_json(path)) {
console_error(strings_error1());
console_error(strings_unknown_asset_format());
return;
}

Expand Down
2 changes: 1 addition & 1 deletion base/sources/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ let _project_scene_mesh_gc: scene_t;
function project_open() {
ui_files_show("arm", false, false, function (path: string) {
if (!ends_with(path, ".arm")) {
console_error(strings_error0());
console_error(strings_arm_file_expected());
return;
}

Expand Down
12 changes: 6 additions & 6 deletions base/sources/strings.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@

function strings_error0(): string {
function strings_arm_file_expected(): string {
return tr("Error: .arm file expected");
}

function strings_error1(): string {
function strings_unknown_asset_format(): string {
return tr("Error: Unknown asset format");
}

function strings_error2(): string {
function strings_could_not_locate_texture(): string {
return tr("Error: Could not locate texture");
}

function strings_error3(): string {
function strings_failed_to_read_mesh_data(): string {
return tr("Error: Failed to read mesh data");
}

function strings_error5(): string {
function strings_check_internet_connection(): string {
return tr("Error: Check internet connection to access the cloud");
}

function strings_info0(): string {
function strings_asset_already_imported(): string {
return tr("Info: Asset already imported");
}

Expand Down
2 changes: 1 addition & 1 deletion base/tools/pad/sources/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -380,5 +380,5 @@ function on_text_hover() {
////
type config_t = { server: string; };
let config_raw: config_t;
function strings_error5(): string { return ""; };
function strings_check_internet_connection(): string { return ""; };
function console_error(s: string) { };

0 comments on commit fa9f23b

Please sign in to comment.