From 3a8ea3cccee06397e90305e1e39a305f8b7c3cb3 Mon Sep 17 00:00:00 2001 From: Jeremy Rimpo Date: Fri, 23 May 2025 14:08:01 -0500 Subject: Oblivion Remastered Meta PR (#2241) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Allow for mod directory maps - Set main data files based on game - Mapped mod directories to VFS - Update overwrite setup * Skip if mod contains no 'data' dir * More mod directory compatibility fixes * Workaround for Obl:Rem save location - SLocalSavePath does nothing yet MO2 wants to use it to override the default save location - This only applies to BGS games anyway, we should move this logic * First pass for overwrite mod directory support * More overwrite move / delete restrictions * Fix issue with moving directories that are not required * Formatting pass * More modDataDirectory updates * Formatting --------- Co-authored-by: Mikaƫl Capelle --- src/overwriteinfodialog.h | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'src/overwriteinfodialog.h') diff --git a/src/overwriteinfodialog.h b/src/overwriteinfodialog.h index e9fa3439..59f6f752 100644 --- a/src/overwriteinfodialog.h +++ b/src/overwriteinfodialog.h @@ -21,6 +21,8 @@ along with Mod Organizer. If not, see . #define OVERWRITEINFODIALOG_H #include "modinfo.h" +#include "modlistdropinfo.h" +#include "organizercore.h" #include #include @@ -34,8 +36,8 @@ class OverwriteFileSystemModel : public QFileSystemModel Q_OBJECT; public: - OverwriteFileSystemModel(QObject* parent) - : QFileSystemModel(parent), m_RegularColumnCount(0) + OverwriteFileSystemModel(QObject* parent, OrganizerCore& organizer) + : QFileSystemModel(parent), m_Organizer(organizer), m_RegularColumnCount(0) {} virtual int columnCount(const QModelIndex& parent) const @@ -70,8 +72,27 @@ public: } } + virtual bool dropMimeData(const QMimeData* data, Qt::DropAction action, int row, + int column, const QModelIndex& parent) + { + ModListDropInfo dropInfo(data, m_Organizer); + if (dropInfo.isLocalFileDrop()) { + for (auto entry : dropInfo.localUrls()) { + QFileInfo sourceInfo(entry.url.toLocalFile()); + if (sourceInfo.isDir() && + m_Organizer.managedGame()->getModMappings().keys().contains( + entry.relativePath, Qt::CaseInsensitive)) { + return false; + } + } + } + return QFileSystemModel::dropMimeData(data, action, row, column, parent); + } + private: mutable int m_RegularColumnCount; + + OrganizerCore& m_Organizer; }; class OverwriteInfoDialog : public QDialog @@ -79,7 +100,8 @@ class OverwriteInfoDialog : public QDialog Q_OBJECT public: - explicit OverwriteInfoDialog(ModInfo::Ptr modInfo, QWidget* parent = 0); + explicit OverwriteInfoDialog(ModInfo::Ptr modInfo, OrganizerCore& organizer, + QWidget* parent = 0); ~OverwriteInfoDialog(); ModInfo::Ptr modInfo() const { return m_ModInfo; } @@ -122,6 +144,7 @@ private: QAction* m_NewFolderAction; ModInfo::Ptr m_ModInfo; + OrganizerCore& m_Organizer; }; #endif // OVERWRITEINFODIALOG_H -- cgit v1.3.1