From 40919c15203acd106e6451de14bf1cd6c9a162fc Mon Sep 17 00:00:00 2001 From: LostDragonist Date: Tue, 4 Dec 2018 18:08:39 -0600 Subject: Create empty mods above the selected mod --- src/mainwindow.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/mainwindow.cpp') 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() -- cgit v1.3.1