Open scripts.inc when scripts.pory doesn't exist
This commit is contained in:
parent
a9bd7b884d
commit
ee7978ea2d
1 changed files with 6 additions and 2 deletions
|
@ -1213,8 +1213,12 @@ void MainWindow::redo() {
|
||||||
|
|
||||||
// Open current map scripts in system default editor for .inc files
|
// Open current map scripts in system default editor for .inc files
|
||||||
void MainWindow::openInTextEditor() {
|
void MainWindow::openInTextEditor() {
|
||||||
QString path = QDir::cleanPath("file://" + editor->project->root + QDir::separator() + "data/maps/" + editor->map->name + "/scripts" + editor->project->getScriptFileExtension(projectConfig.getUsePoryScript()));
|
bool usePoryscript = projectConfig.getUsePoryScript();
|
||||||
QDesktopServices::openUrl(QUrl(path));
|
QString path = QDir::cleanPath("file://" + editor->project->root + QDir::separator() + "data/maps/" + editor->map->name + "/scripts");
|
||||||
|
|
||||||
|
// Try opening scripts file, if opening .pory failed try again with .inc
|
||||||
|
if (!QDesktopServices::openUrl(QUrl(path + editor->project->getScriptFileExtension(usePoryscript))) && usePoryscript)
|
||||||
|
QDesktopServices::openUrl(QUrl(path + editor->project->getScriptFileExtension(false)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_action_Save_triggered() {
|
void MainWindow::on_action_Save_triggered() {
|
||||||
|
|
Loading…
Reference in a new issue