summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLostDragonist <lost.dragonist@gmail.com>2018-12-04 18:08:39 -0600
committerLostDragonist <lost.dragonist@gmail.com>2018-12-04 18:08:39 -0600
commit40919c15203acd106e6451de14bf1cd6c9a162fc (patch)
treeda5b9836fe4ad6f1a8c3ffd3fada201d0f16579d /src
parent79c451bb170c15d19f0d0f71a9e1d86fb843b641 (diff)
Create empty mods above the selected mod
Diffstat (limited to 'src')
-rw-r--r--src/mainwindow.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index f68d9846..3f88f5ad 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -2861,12 +2861,21 @@ void MainWindow::createEmptyMod_clicked()
return;
}
+ int newPriority = -1;
+ if (m_ContextRow >= 0 && m_ModListSortProxy->sortColumn() == ModList::COL_PRIORITY) {
+ newPriority = m_OrganizerCore.currentProfile()->getModPriority(m_ContextRow);
+ }
+
IModInterface *newMod = m_OrganizerCore.createMod(name);
if (newMod == nullptr) {
return;
}
m_OrganizerCore.refreshModList();
+
+ if (newPriority >= 0) {
+ m_OrganizerCore.modList()->changeModPriority(ModInfo::getIndex(name), newPriority);
+ }
}
void MainWindow::createSeparator_clicked()