From 2b187ff9e8bb41391d628c4dceaa0627b49022c2 Mon Sep 17 00:00:00 2001 From: Mgamerz Date: Wed, 14 Apr 2021 21:40:25 -0600 Subject: [PATCH] Fix linux build --- .../BuilderUI/BackupRestoreUIController.cs | 1 + .../BuilderUI/SettingsUIController.cs | 1 + .../Helpers/AppSettings/SettingsLinux.cs | 31 +++++-------------- .../ModManager/ME3Tweaks/BackupHandler.cs | 3 +- 4 files changed, 12 insertions(+), 24 deletions(-) diff --git a/ALOTInstallerConsole/BuilderUI/BackupRestoreUIController.cs b/ALOTInstallerConsole/BuilderUI/BackupRestoreUIController.cs index ea14830a..9f426f89 100644 --- a/ALOTInstallerConsole/BuilderUI/BackupRestoreUIController.cs +++ b/ALOTInstallerConsole/BuilderUI/BackupRestoreUIController.cs @@ -9,6 +9,7 @@ using ALOTInstallerCore.ModManager.Objects; using ALOTInstallerCore.ModManager.Services; using ALOTInstallerCore.Objects; +using ME3ExplorerCore.Gammtek.Extensions; using ME3ExplorerCore.Packages; using Terminal.Gui; diff --git a/ALOTInstallerConsole/BuilderUI/SettingsUIController.cs b/ALOTInstallerConsole/BuilderUI/SettingsUIController.cs index 8d1ecdb1..5cddc8e5 100644 --- a/ALOTInstallerConsole/BuilderUI/SettingsUIController.cs +++ b/ALOTInstallerConsole/BuilderUI/SettingsUIController.cs @@ -6,6 +6,7 @@ using ALOTInstallerCore.ModManager.Objects; using ALOTInstallerCore.Objects; using ALOTInstallerCore; +using ME3ExplorerCore.Gammtek.Extensions; using ME3ExplorerCore.Packages; using Terminal.Gui; diff --git a/ALOTInstallerCore/Helpers/AppSettings/SettingsLinux.cs b/ALOTInstallerCore/Helpers/AppSettings/SettingsLinux.cs index 26b09b3f..3772b0ee 100644 --- a/ALOTInstallerCore/Helpers/AppSettings/SettingsLinux.cs +++ b/ALOTInstallerCore/Helpers/AppSettings/SettingsLinux.cs @@ -19,39 +19,24 @@ public partial class Settings private static DuplicatingIni settingsIni; public static readonly string SettingsPath = Path.Combine(Locations.AppDataFolder(), "settings.ini"); - public static void Load() + public static void Load(bool loadSettingsFolders) { settingsIni = new DuplicatingIni(); if (File.Exists(SettingsPath)) { settingsIni = DuplicatingIni.LoadIni(SettingsPath); } - TextureLibraryLocation = LoadDirectorySetting(SettingsKeys.SettingKeys.TextureLibraryDirectory, Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "ALOTInstaller", "Downloaded_Mods"), true, v => TextureLibrarySettingsLocation = v, v => TextureLibraryLocationExistedOnLoad = v); - StagingLocation = LoadDirectorySetting(SettingsKeys.SettingKeys.BuildLocation, Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "ALOTInstaller", "Staging"), true, v => StagingSettingsLocation = v, v => StagingLocationExistedOnLoad = v); + + if (loadSettingsFolders) + { + TextureLibraryLocation = LoadDirectorySetting(SettingsKeys.SettingKeys.TextureLibraryDirectory, Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "ALOTInstaller", "Downloaded_Mods"), true, v => TextureLibrarySettingsLocation = v, v => TextureLibraryLocationExistedOnLoad = v); + StagingLocation = LoadDirectorySetting(SettingsKeys.SettingKeys.BuildLocation, Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "ALOTInstaller", "Staging"), true, v => StagingSettingsLocation = v, v => StagingLocationExistedOnLoad = v); + } + MoveFilesWhenImporting = LoadSettingBool(SettingsKeys.SettingKeys.ImportAsMove, false); Telemetry = LoadSettingBool(SettingsKeys.SettingKeys.Telemetry, true); BetaMode = LoadSettingBool(SettingsKeys.SettingKeys.BetaMode, false); LastContentCheck = LoadSettingDateTime(SettingsKeys.SettingKeys.LastContentCheck, DateTime.MinValue); - //AutoUpdateLODs = LoadSettingBool("ModManager", "AutoUpdateLODs", true); - //WebClientTimeout = LoadSettingInt("ModManager", "WebclientTimeout", 5); - //ModMakerControllerModOption = LoadSettingBool("ModMaker", "AutoAddControllerMixins", false); - //ModMakerAutoInjectCustomKeybindsOption = LoadSettingBool("ModMaker", "AutoInjectCustomKeybinds", false); - - - //UpdaterServiceUsername = LoadSettingString("UpdaterService", "Username", null); - //UpdaterServiceLZMAStoragePath = LoadSettingString("UpdaterService", "LZMAStoragePath", null); - //UpdaterServiceManifestStoragePath = LoadSettingString("UpdaterService", "ManifestStoragePath", null); - - //LogModStartup = LoadSettingBool("Logging", "LogModStartup", false); - //LogMixinStartup = LoadSettingBool("Logging", "LogMixinStartup", false); - //EnableTelemetry = LoadSettingBool("Logging", "EnableTelemetry", true); - //LogModInstallation = LoadSettingBool("Logging", "LogModInstallation", false); - //LogModMakerCompiler = LoadSettingBool("Logging", "LogModMakerCompiler", false); - - //ModLibraryPath = LoadSettingString("ModLibrary", "LibraryPath", null); - - //DeveloperMode = LoadSettingBool("UI", "DeveloperMode", false); - //DarkTheme = LoadSettingBool("UI", "DarkTheme", false); Loaded = true; } diff --git a/ALOTInstallerCore/ModManager/ME3Tweaks/BackupHandler.cs b/ALOTInstallerCore/ModManager/ME3Tweaks/BackupHandler.cs index 2cfef06a..c4edfa41 100644 --- a/ALOTInstallerCore/ModManager/ME3Tweaks/BackupHandler.cs +++ b/ALOTInstallerCore/ModManager/ME3Tweaks/BackupHandler.cs @@ -5,6 +5,7 @@ using System.IO; using System.Linq; using ALOTInstallerCore.Helpers; +using ALOTInstallerCore.Helpers.AppSettings; using ALOTInstallerCore.ModManager.Objects; using ALOTInstallerCore.ModManager.Services; using Serilog; @@ -902,7 +903,7 @@ public static void UnlinkBackup(MEGame meGame) break; } #elif LINUX - + // Remove backup here #endif }