From ed64e04641f03eddd4724af41f3ebdd01a81d513 Mon Sep 17 00:00:00 2001 From: Julian Xhokaxhiu Date: Mon, 8 Feb 2021 18:59:47 +0100 Subject: [PATCH] FFNx: Add support for the new ambient layer --- 7thHeaven.Code/ConfigSettings.cs | 2 ++ 7thHeaven.Code/Settings.cs | 1 + SeventhHeavenUI/Classes/GameConverter.cs | 1 + SeventhHeavenUI/ViewModels/GeneralSettingsViewModel.cs | 7 ++++++- 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/7thHeaven.Code/ConfigSettings.cs b/7thHeaven.Code/ConfigSettings.cs index fcfbf885..f89af43e 100644 --- a/7thHeaven.Code/ConfigSettings.cs +++ b/7thHeaven.Code/ConfigSettings.cs @@ -137,6 +137,8 @@ private void OverrideKnownInternals() _toml["external_music_ext"] = "ogg"; _toml["external_voice_path"] = "voice"; _toml["external_voice_ext"] = "ogg"; + _toml["external_ambient_path"] = "ambient"; + _toml["external_ambient_ext"] = "ogg"; _toml["ffmpeg_video_ext"] = "avi"; _toml["mod_path"] = "mods/Textures"; _toml["direct_mode_path"] = "direct"; diff --git a/7thHeaven.Code/Settings.cs b/7thHeaven.Code/Settings.cs index fe9e8f3f..940ca721 100644 --- a/7thHeaven.Code/Settings.cs +++ b/7thHeaven.Code/Settings.cs @@ -165,6 +165,7 @@ public static Settings UseDefaultSettings() defaultSettings.ExtraFolders.Add("music"); defaultSettings.ExtraFolders.Add("sfx"); defaultSettings.ExtraFolders.Add("voice"); + defaultSettings.ExtraFolders.Add("ambient"); defaultSettings.FFNxUpdateChannel = FFNxUpdateChannelOptions.Stable; diff --git a/SeventhHeavenUI/Classes/GameConverter.cs b/SeventhHeavenUI/Classes/GameConverter.cs index 49f31060..a0d9e9a8 100644 --- a/SeventhHeavenUI/Classes/GameConverter.cs +++ b/SeventhHeavenUI/Classes/GameConverter.cs @@ -849,6 +849,7 @@ public void CreateMissingDirectories() Path.Combine(InstallPath, "sfx"), Path.Combine(InstallPath, "shaders"), Path.Combine(InstallPath, "voice"), + Path.Combine(InstallPath, "ambient"), }; foreach (string dir in requiredFolders) diff --git a/SeventhHeavenUI/ViewModels/GeneralSettingsViewModel.cs b/SeventhHeavenUI/ViewModels/GeneralSettingsViewModel.cs index 3406e7ff..b86c2059 100644 --- a/SeventhHeavenUI/ViewModels/GeneralSettingsViewModel.cs +++ b/SeventhHeavenUI/ViewModels/GeneralSettingsViewModel.cs @@ -511,7 +511,7 @@ internal bool SaveSettings() Sys.Settings.Subscriptions = GetUpdatedSubscriptions(); Sys.Settings.ExtraFolders = ExtraFolderList.Distinct().ToList(); - // ensure 'direct', 'music', 'sfx' and 'voice' folders are always in ExtraFolders list + // ensure required folders are always in ExtraFolders list if (!Sys.Settings.ExtraFolders.Contains("direct", StringComparer.InvariantCultureIgnoreCase)) { Sys.Settings.ExtraFolders.Add("direct"); @@ -532,6 +532,11 @@ internal bool SaveSettings() Sys.Settings.ExtraFolders.Add("voice"); } + if (!Sys.Settings.ExtraFolders.Contains("ambient", StringComparer.InvariantCultureIgnoreCase)) + { + Sys.Settings.ExtraFolders.Add("ambient"); + } + Sys.Settings.FF7Exe = FF7ExePathInput; Sys.Settings.LibraryLocation = LibraryPathInput; Sys.Settings.MovieFolder = MoviesPathInput;