mirror of
https://github.com/huderlem/porymap.git
synced 2026-09-17 05:15:45 -05:00
Add option to turn custom scripts on/off
This commit is contained in:
@@ -184,7 +184,7 @@ bool ScriptUtility::getSmartPathsEnabled() {
|
||||
}
|
||||
|
||||
QList<QString> ScriptUtility::getCustomScripts() {
|
||||
return userConfig.getCustomScripts();
|
||||
return userConfig.getCustomScriptPaths();
|
||||
}
|
||||
|
||||
QList<int> ScriptUtility::getMetatileLayerOrder() {
|
||||
|
||||
@@ -36,8 +36,11 @@ Scripting::Scripting(MainWindow *mainWindow) {
|
||||
this->mainWindow = mainWindow;
|
||||
this->engine = new QJSEngine(mainWindow);
|
||||
this->engine->installExtensions(QJSEngine::ConsoleExtension);
|
||||
for (QString script : userConfig.getCustomScripts()) {
|
||||
this->filepaths.append(script);
|
||||
const QStringList paths = userConfig.getCustomScriptPaths();
|
||||
const QList<bool> enabled = userConfig.getCustomScriptsEnabled();
|
||||
for (int i = 0; i < paths.length(); i++) {
|
||||
if (enabled.at(i))
|
||||
this->filepaths.append(paths.at(i));
|
||||
}
|
||||
this->loadModules(this->filepaths);
|
||||
this->scriptUtility = new ScriptUtility(mainWindow);
|
||||
|
||||
Reference in New Issue
Block a user