Files
armorpaint/base/sources/import_keymap.ts
T

15 lines
550 B
TypeScript
Raw Normal View History

2024-03-13 23:50:11 +01:00
function import_keymap_run(path: string) {
if (!path_is_json(path)) {
console_error(strings_error1());
return;
}
2024-03-20 16:13:54 +01:00
let filename: string = substring(path, string_last_index_of(path, path_sep) + 1, path.length);
2024-03-13 23:50:11 +01:00
let dst_path: string = path_data() + path_sep + "keymap_presets" + path_sep + filename;
file_copy(path, dst_path); // Copy to preset folder
box_preferences_fetch_keymaps(); // Refresh file list
box_preferences_preset_handle.position = box_preferences_get_preset_index();
console_info(tr("Keymap imported:") + " " + filename);
}