mirror of
https://github.com/huderlem/porymap.git
synced 2026-09-16 21:05:47 -05:00
Merge remote-tracking branch 'tustin/path-in-config'
# Conflicts: # docsrc/manual/settings-and-options.rst # include/config.h # src/config.cpp # src/scriptapi/apimap.cpp # src/scriptapi/scripting.cpp
This commit is contained in:
@@ -123,7 +123,7 @@ void ScriptUtility::setMainTab(int index) {
|
||||
if (!window || !window->ui || !window->ui->mainTabBar || index < 0 || index >= window->ui->mainTabBar->count())
|
||||
return;
|
||||
// Can't select Wild Encounters tab if it's disabled
|
||||
if (index == 4 && !projectConfig.getEncounterJsonActive())
|
||||
if (index == 4 && !userConfig.getEncounterJsonActive())
|
||||
return;
|
||||
window->on_mainTabBar_tabBarClicked(index);
|
||||
}
|
||||
@@ -165,7 +165,7 @@ bool ScriptUtility::getSmartPathsEnabled() {
|
||||
}
|
||||
|
||||
QList<QString> ScriptUtility::getCustomScripts() {
|
||||
return projectConfig.getCustomScripts();
|
||||
return userConfig.getCustomScripts();
|
||||
}
|
||||
|
||||
QList<int> ScriptUtility::getMetatileLayerOrder() {
|
||||
|
||||
@@ -35,7 +35,7 @@ void Scripting::init(MainWindow *mainWindow) {
|
||||
Scripting::Scripting(MainWindow *mainWindow) {
|
||||
this->engine = new QJSEngine(mainWindow);
|
||||
this->engine->installExtensions(QJSEngine::ConsoleExtension);
|
||||
for (QString script : projectConfig.getCustomScripts()) {
|
||||
for (QString script : userConfig.getCustomScripts()) {
|
||||
this->filepaths.append(script);
|
||||
}
|
||||
this->loadModules(this->filepaths);
|
||||
@@ -46,7 +46,7 @@ void Scripting::loadModules(QStringList moduleFiles) {
|
||||
for (QString filepath : moduleFiles) {
|
||||
QJSValue module = this->engine->importModule(filepath);
|
||||
if (module.isError()) {
|
||||
QString relativePath = QDir::cleanPath(projectConfig.getProjectDir() + QDir::separator() + filepath);
|
||||
QString relativePath = QDir::cleanPath(userConfig.getProjectDir() + QDir::separator() + filepath);
|
||||
module = this->engine->importModule(relativePath);
|
||||
if (tryErrorJS(module)) continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user