Cleanup
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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[] = [];
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
|
||||
@@ -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) { };
|
||||
|
||||
Reference in New Issue
Block a user