aboutsummaryrefslogtreecommitdiff
path: root/libs/game_gamebryo/src/gamebryo/gamebryolocalsavegames.cpp
diff options
context:
space:
mode:
authorSulfurNitride <SulfurNitride@users.noreply.github.com>2026-04-12 02:40:00 -0500
committerSulfurNitride <SulfurNitride@users.noreply.github.com>2026-04-12 02:40:00 -0500
commite0fb66428a9b78b4c326df8d7e30429a5b271d74 (patch)
tree0fd83fe790ecb7d5cd3cfb36535e45d1b7118098 /libs/game_gamebryo/src/gamebryo/gamebryolocalsavegames.cpp
parente985dc340097831d4e5625941bded217abaa57b8 (diff)
Remove dead plugin scaffolds and duplicate lib dirs
The *_native C++ ports were replaced by bundled Python + .py plugins in de4db79, but the source dirs were left behind without any CMake wiring — causing confusion when editing them appears to do nothing. Same story for libs/dds_header (stale duplicate of libs/preview_dds, unrelated to the actively-used libs/dds-header) and libs/game_gamebryo (superseded by libs/game_bethesda/src/gamebryo). Removes: - libs/basic_games_native - libs/form43_checker_native - libs/installer_omod_native - libs/preview_dds_native - libs/rootbuilder_native - libs/script_extender_checker_native - libs/dds_header - libs/game_gamebryo
Diffstat (limited to 'libs/game_gamebryo/src/gamebryo/gamebryolocalsavegames.cpp')
-rw-r--r--libs/game_gamebryo/src/gamebryo/gamebryolocalsavegames.cpp142
1 files changed, 0 insertions, 142 deletions
diff --git a/libs/game_gamebryo/src/gamebryo/gamebryolocalsavegames.cpp b/libs/game_gamebryo/src/gamebryo/gamebryolocalsavegames.cpp
deleted file mode 100644
index d0cc2ef..0000000
--- a/libs/game_gamebryo/src/gamebryo/gamebryolocalsavegames.cpp
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
-Copyright (C) 2015 Sebastian Herbord. All rights reserved.
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 3 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-*/
-
-#include "gamebryolocalsavegames.h"
-#include "registry.h"
-#include <QtDebug>
-#include <iprofile.h>
-#include <stddef.h>
-#include <string>
-#include <windows.h>
-
-#include "gamegamebryo.h"
-
-GamebryoLocalSavegames::GamebryoLocalSavegames(const GameGamebryo* game,
- const QString& iniFileName)
- : m_Game{game}, m_IniFileName(iniFileName)
-{}
-
-MappingType GamebryoLocalSavegames::mappings(const QDir& profileSaveDir) const
-{
- return {{profileSaveDir.absolutePath(), localSavesDirectory().absolutePath(), true,
- true}};
-}
-
-QString GamebryoLocalSavegames::localSavesDummy() const
-{
- return "__MO_Saves\\";
-}
-
-QDir GamebryoLocalSavegames::localSavesDirectory() const
-{
- QString dummy = localSavesDummy();
- dummy.replace("\\", "/");
- return QDir(m_Game->myGamesPath()).absoluteFilePath(dummy);
-}
-
-QDir GamebryoLocalSavegames::localGameDirectory() const
-{
- return QDir(m_Game->myGamesPath()).absolutePath();
-}
-
-bool GamebryoLocalSavegames::prepareProfile(MOBase::IProfile* profile)
-{
- bool enable = profile->localSavesEnabled();
-
- QString basePath = profile->localSettingsEnabled()
- ? profile->absolutePath()
- : localGameDirectory().absolutePath();
- QString iniFilePath = basePath + "/" + m_IniFileName;
- QString saveIni = profile->absolutePath() + "/" + "savepath.ini";
-
- // Get the current sLocalSavePath
- WCHAR currentPath[MAX_PATH];
- GetPrivateProfileStringW(L"General", L"sLocalSavePath", L"SKIP_ME", currentPath,
- MAX_PATH, iniFilePath.toStdWString().c_str());
- bool alreadyEnabled =
- wcscmp(currentPath, localSavesDummy().toStdWString().c_str()) == 0;
-
- // Get the current bUseMyGamesDirectory
- WCHAR currentMyGames[MAX_PATH];
- GetPrivateProfileStringW(L"General", L"bUseMyGamesDirectory", L"SKIP_ME",
- currentMyGames, MAX_PATH,
- iniFilePath.toStdWString().c_str());
-
- // Create the __MO_Saves directory if local saves are enabled and it doesn't exist
- if (enable) {
- QDir saves = localSavesDirectory();
- if (!saves.exists()) {
- saves.mkdir(".");
- }
- }
-
- // Set the path to __MO_Saves if it's not already
- if (enable && !alreadyEnabled) {
- // If the path is not blank, save it to savepath.ini
- if (wcscmp(currentPath, L"SKIP_ME") != 0) {
- MOBase::WriteRegistryValue(L"General", L"sLocalSavePath", currentPath,
- saveIni.toStdWString().c_str());
- }
- if (wcscmp(currentMyGames, L"SKIP_ME") != 0) {
- MOBase::WriteRegistryValue(L"General", L"bUseMyGamesDirectory", currentMyGames,
- saveIni.toStdWString().c_str());
- }
- MOBase::WriteRegistryValue(L"General", L"sLocalSavePath",
- localSavesDummy().toStdWString().c_str(),
- iniFilePath.toStdWString().c_str());
- MOBase::WriteRegistryValue(L"General", L"bUseMyGamesDirectory", L"1",
- iniFilePath.toStdWString().c_str());
- }
-
- // Get rid of the local saves setting if it's still there
- if (!enable && alreadyEnabled) {
- // If savepath.ini exists, use it and delete it
- if (QFile::exists(saveIni)) {
- WCHAR savedPath[MAX_PATH];
- WCHAR savedMyGames[MAX_PATH];
- GetPrivateProfileStringW(L"General", L"sLocalSavePath", L"DELETE_ME", savedPath,
- MAX_PATH, saveIni.toStdWString().c_str());
- GetPrivateProfileStringW(L"General", L"bUseMyGamesDirectory", L"DELETE_ME",
- savedMyGames, MAX_PATH, saveIni.toStdWString().c_str());
- if (wcscmp(savedPath, L"DELETE_ME") != 0) {
- MOBase::WriteRegistryValue(L"General", L"sLocalSavePath", savedPath,
- iniFilePath.toStdWString().c_str());
- } else {
- MOBase::WriteRegistryValue(L"General", L"sLocalSavePath", NULL,
- iniFilePath.toStdWString().c_str());
- }
- if (wcscmp(savedMyGames, L"DELETE_ME") != 0) {
- MOBase::WriteRegistryValue(L"General", L"bUseMyGamesDirectory", savedMyGames,
- iniFilePath.toStdWString().c_str());
- } else {
- MOBase::WriteRegistryValue(L"General", L"bUseMyGamesDirectory", NULL,
- iniFilePath.toStdWString().c_str());
- }
- QFile::remove(saveIni);
- }
- // Otherwise just delete the setting
- else {
- MOBase::WriteRegistryValue(L"General", L"sLocalSavePath", NULL,
- iniFilePath.toStdWString().c_str());
- MOBase::WriteRegistryValue(L"General", L"bUseMyGamesDirectory", NULL,
- iniFilePath.toStdWString().c_str());
- }
- }
-
- return enable != alreadyEnabled;
-}