Add File > Scripts > Rescan option to rescan the available scripts

https://community.aseprite.org/t/6170/6
This commit is contained in:
David Capello 2020-08-03 13:51:40 -03:00
parent 8b6116911d
commit 5edf30687b
3 changed files with 12 additions and 0 deletions

View File

@ -635,6 +635,7 @@
<separator id="scripts_menu_separator" />
<menu id="scripts_menu" text="@.file_scripts" group="file_scripts">
<item command="OpenScriptFolder" text="@.file_open_script_folder" />
<item command="Refresh" text="@.file_rescan_script_folder" />
</menu>
<separator group="file_app" />
<item command="Exit" text="@.file_exit" />

View File

@ -803,6 +803,7 @@ file_export_sprite_sheet = &Export Sprite Sheet
file_repeat_last_export = Repeat &Last Export
file_scripts = Scri&pts
file_open_script_folder = &Open Scripts Folder
file_rescan_script_folder = &Rescan Scripts Folder
file_exit = E&xit
edit = &Edit
edit_undo = &Undo

View File

@ -10,7 +10,10 @@
#endif
#include "app/app.h"
#include "app/app_menus.h"
#include "app/commands/command.h"
#include "app/ui/main_menu_bar.h"
#include "app/ui/main_window.h"
#include "app/ui/status_bar.h"
#include "fmt/format.h"
#include "ui/scale.h"
@ -40,8 +43,15 @@ RefreshCommand::RefreshCommand()
void RefreshCommand::onExecute(Context* context)
{
// Reload menus (mainly to reload the File > Scripts menu)
//AppMenus::instance()->reload();
App::instance()->mainWindow()->getMenuBar()->reload();
// Reload theme
ui::set_theme(ui::get_theme(),
ui::guiscale());
// Redraw screen
app_refresh_screen();
// Print memory information