Menu option to edit animations and controllers externally

Closes #1899
This commit is contained in:
JannisX11 2024-10-27 19:32:07 +01:00
parent 5b57ff5951
commit 384f95e9a5
4 changed files with 22 additions and 0 deletions

View File

@ -832,6 +832,15 @@ class Animation extends AnimationItem {
showItemInFolder(animation.path);
}
},
{
name: 'generic.edit_externally',
id: 'edit_externally',
icon: 'edit_document',
condition(animation) {return isApp && Format.animation_files && animation.path && fs.existsSync(animation.path)},
click(animation) {
ipcRenderer.send('open-in-default-app', animation.path);
}
},
'rename',
{
id: 'reload',

View File

@ -1255,6 +1255,15 @@ class AnimationController extends AnimationItem {
showItemInFolder(animation.path);
}
},
{
name: 'generic.edit_externally',
id: 'edit_externally',
icon: 'edit_document',
condition(animation) {return isApp && Format.animation_files && animation.path && fs.existsSync(animation.path)},
click(animation) {
ipcRenderer.send('open-in-default-app', animation.path);
}
},
'rename',
{
id: 'reload',

View File

@ -69,6 +69,7 @@
"generic.select_all": "Select All",
"generic.select_none": "Select None",
"generic.delete_all": "Delete All",
"generic.edit_externally": "Edit Externally",
"generic.on": "On",
"generic.off": "Off",
"generic.left": "Left",

View File

@ -250,6 +250,9 @@ ipcMain.on('request-color-picker', async (event, arg) => {
ipcMain.on('show-item-in-folder', async (event, path) => {
shell.showItemInFolder(path);
})
ipcMain.on('open-in-default-app', async (event, path) => {
shell.openPath(path);
})
app.on('ready', () => {