13
0

Pre-seed scripts: add "List Plugins"

This commit is contained in:
Robin Gareus 2020-08-01 01:16:45 +02:00
parent 0c6d369434
commit c2ffa07e28
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
2 changed files with 11 additions and 3 deletions

View File

@ -1498,10 +1498,9 @@ LuaInstance::set_state (const XMLNode& node)
} }
void void
LuaInstance::pre_seed_scripts () LuaInstance::pre_seed_script (std::string const& name, int& id)
{ {
LuaScriptInfoPtr spi = LuaScripting::instance ().by_name ("Mixer Screenshot", LuaScriptInfo::EditorAction); LuaScriptInfoPtr spi = LuaScripting::instance ().by_name (name, LuaScriptInfo::EditorAction);
int id = 0;
if (spi) { if (spi) {
try { try {
std::string script = Glib::file_get_contents (spi->path); std::string script = Glib::file_get_contents (spi->path);
@ -1515,6 +1514,14 @@ LuaInstance::pre_seed_scripts ()
} }
} }
void
LuaInstance::pre_seed_scripts ()
{
int id = 0;
pre_seed_script ("Mixer Screenshot", id);
pre_seed_script ("List Plugins", id);
}
bool bool
LuaInstance::interactive_add (LuaScriptInfo::ScriptType type, int id) LuaInstance::interactive_add (LuaScriptInfo::ScriptType type, int id)
{ {

View File

@ -156,6 +156,7 @@ private:
void set_dirty (); void set_dirty ();
void session_going_away (); void session_going_away ();
void pre_seed_scripts (); void pre_seed_scripts ();
void pre_seed_script (std::string const&, int&);
LuaState lua; LuaState lua;