From 6774a8173d973cd6d8358299617f3974ad5f7511 Mon Sep 17 00:00:00 2001 From: Dingo Date: Sat, 10 Feb 2024 16:14:37 +0200 Subject: [PATCH] SN Vanilla 2.0.5 - Added Ukr translation, string updates - Added setting to reset timer on manual save --- .../Languages/Ukrainian.json | 6 + Below Zero/SubnauticaAutosave_BZ.csproj | 216 +++++++++--------- Subnautica/AutosaveController.cs | 26 ++- .../Languages/Chinese (Simplified).json | 2 +- .../Languages/Chinese (Traditional).json | 2 +- .../SubnauticaAutosave/Languages/English.json | 2 +- .../SubnauticaAutosave/Languages/French.json | 2 +- .../SubnauticaAutosave/Languages/German.json | 2 +- .../SubnauticaAutosave/Languages/Italian.json | 2 +- .../SubnauticaAutosave/Languages/Polish.json | 2 +- .../Languages/Portuguese (Brazil).json | 2 +- .../SubnauticaAutosave/Languages/Russian.json | 2 +- .../SubnauticaAutosave/Languages/Spanish.json | 2 +- .../SubnauticaAutosave/Languages/Swedish.json | 2 +- .../SubnauticaAutosave/Languages/Turkish.json | 2 +- .../Languages/Ukrainian.json | 6 + .../SubnauticaAutosave/SubnauticaAutosave.dll | Bin 18944 -> 19456 bytes Subnautica/HarmonyPatches.cs | 18 +- Subnautica/ModPlugin.cs | 14 +- Subnautica/Properties/AssemblyInfo.cs | 6 +- 20 files changed, 174 insertions(+), 142 deletions(-) create mode 100644 Below Zero/QMods/SubnauticaAutosave_BZ/Languages/Ukrainian.json create mode 100644 Subnautica/BepInEx/plugins/SubnauticaAutosave/Languages/Ukrainian.json diff --git a/Below Zero/QMods/SubnauticaAutosave_BZ/Languages/Ukrainian.json b/Below Zero/QMods/SubnauticaAutosave_BZ/Languages/Ukrainian.json new file mode 100644 index 0000000..a0f2ab3 --- /dev/null +++ b/Below Zero/QMods/SubnauticaAutosave_BZ/Languages/Ukrainian.json @@ -0,0 +1,6 @@ +{ + "AutosaveWarning": "Підготовка до автозбереження через {0} секунд.", + "AutosaveStarting": "Початок послідовності автозбереження...", + "AutosaveEnding": "Успішне Автозбереження. Наступне через {0} хвилин.", + "AutosaveInProgress": "Виконується автозбереження. Зараз неможливо зберегтись." +} diff --git a/Below Zero/SubnauticaAutosave_BZ.csproj b/Below Zero/SubnauticaAutosave_BZ.csproj index 14d6c11..190a706 100644 --- a/Below Zero/SubnauticaAutosave_BZ.csproj +++ b/Below Zero/SubnauticaAutosave_BZ.csproj @@ -1,119 +1,119 @@  - - - Debug - AnyCPU - {9F11D600-B09B-4ACD-8DFF-9DFAE00037C4} - Library - Properties - SubnauticaAutosave_BZ - SubnauticaAutosave_BZ - v4.7.2 - 512 - - - - true - embedded - false - QMods\SubnauticaAutosave_BZ\ - DEBUG;TRACE - prompt - 4 - Off - 7.1 - false - - - none - true - QMods\SubnauticaAutosave_BZ\ - - - prompt - 4 - Off - 7.1 - AnyCPU - false - - - - D:\SubnauticaBelowZero\BepInEx\core\0Harmony.dll - False - - - D:\SubnauticaBelowZero\SubnauticaZero_Data\Managed\Assembly-CSharp.dll - False - - - ..\..\..\..\SubnauticaBelowZero\SubnauticaZero_Data\Managed\Assembly-CSharp-firstpass.dll - False - - - D:\SubnauticaBelowZero\BepInEx\core\BepInEx.dll - False - - - D:\SubnauticaBelowZero\SubnauticaZero_Data\Managed\LitJson.dll - False - - - ..\..\..\..\SubnauticaBelowZero\BepInEx\plugins\QModManager\QModInstaller.dll - False - - - ..\..\..\..\SubnauticaBelowZero\QMods\SMLHelper_BZ\SMLHelper.dll - False - - - - - - - - - D:\SubnauticaBelowZero\SubnauticaZero_Data\Managed\Unity.TextMeshPro.dll - False - - - D:\SubnauticaBelowZero\SubnauticaZero_Data\Managed\UnityEngine.dll - False - - - D:\SubnauticaBelowZero\SubnauticaZero_Data\Managed\UnityEngine.CoreModule.dll - False - - - D:\SubnauticaBelowZero\SubnauticaZero_Data\Managed\UnityEngine.UI.dll - False - - - - - - - - - - - - Always - - - - - - SET MODDIR=D:\SubnauticaBelowZero\QMods\ + + SET MODDIR=D:\SubnauticaBelowZero\QMods\ SET ZIPFILE=D:\Downloads\$(ProjectName).zip xcopy "$(ProjectDir)QMods\*" "%25MODDIR%25" /i /e /r /y 7z a -mx9 "%25ZIPFILE%25" "$(ProjectDir)QMods" - - + + \ No newline at end of file diff --git a/Subnautica/AutosaveController.cs b/Subnautica/AutosaveController.cs index f55f26b..3b54121 100644 --- a/Subnautica/AutosaveController.cs +++ b/Subnautica/AutosaveController.cs @@ -252,15 +252,8 @@ private IEnumerator AutosaveCoroutine() { SaveLoadManager.main.SetCurrentSlot(mainSaveSlot); } - - if (ModPlugin.ConfigAutosaveOnTimer.Value) - { - int autosaveMinutesInterval = ModPlugin.ConfigMinutesBetweenAutosaves.Value; - - this.ScheduleAutosave(autosaveMinutesInterval); - - ErrorMessage.AddWarning("AutosaveEnding".FormatTranslate(autosaveMinutesInterval.ToString())); - } + + this.ScheduleAutosave(); this.warningTriggered = false; this.isSaving = false; @@ -322,19 +315,28 @@ public void SetMainSlotIfAutosave() } } - public void ScheduleAutosave(int addedMinutes, bool settingsChanged = false) + public void ScheduleAutosave(bool settingsChanged = false, bool showMessage = true) { + if (ModPlugin.ConfigAutosaveOnTimer.Value) + { + int addedMinutes = ModPlugin.ConfigMinutesBetweenAutosaves.Value; + #if DEBUG ModPlugin.LogMessage($"ScheduleAutosave() - settingsChanged == {settingsChanged}"); ModPlugin.LogMessage($"ScheduleAutosave() - previous trigger time == {this.nextSaveTriggerTime}"); #endif - // Time.time returns a float in terms of seconds - this.nextSaveTriggerTime = Time.time + (60 * addedMinutes); + // Time.time returns a float in terms of seconds + this.nextSaveTriggerTime = Time.time + (60 * addedMinutes); #if DEBUG ModPlugin.LogMessage($"ScheduleAutosave() - new trigger time == {this.nextSaveTriggerTime}"); #endif + if (showMessage) + { + ErrorMessage.AddWarning("AutosaveEnding".FormatTranslate(addedMinutes.ToString())); + } + } } public void DelayAutosave(float addedSeconds = 5f) diff --git a/Subnautica/BepInEx/plugins/SubnauticaAutosave/Languages/Chinese (Simplified).json b/Subnautica/BepInEx/plugins/SubnauticaAutosave/Languages/Chinese (Simplified).json index bceb778..eb812fb 100644 --- a/Subnautica/BepInEx/plugins/SubnauticaAutosave/Languages/Chinese (Simplified).json +++ b/Subnautica/BepInEx/plugins/SubnauticaAutosave/Languages/Chinese (Simplified).json @@ -1,6 +1,6 @@ { "AutosaveWarning": "即将在 {0} 秒后自动保存。", "AutosaveStarting": "正在自动保存游戏...", - "AutosaveEnding": "自动保存完成。 下一次 {0} 分钟后自动保存。", + "AutosaveEnding": "下一次 {0} 分钟后自动保存。", "AutosaveInProgress": "正在自动保存游戏。现在无法启动自动保存。" } diff --git a/Subnautica/BepInEx/plugins/SubnauticaAutosave/Languages/Chinese (Traditional).json b/Subnautica/BepInEx/plugins/SubnauticaAutosave/Languages/Chinese (Traditional).json index 871c333..8f16dde 100644 --- a/Subnautica/BepInEx/plugins/SubnauticaAutosave/Languages/Chinese (Traditional).json +++ b/Subnautica/BepInEx/plugins/SubnauticaAutosave/Languages/Chinese (Traditional).json @@ -1,6 +1,6 @@ { "AutosaveWarning": "遊戲在 {0} 秒後自動保存。", "AutosaveStarting": "正在自動保存遊戲...", - "AutosaveEnding": "自動保存完成。 下一次 {0} 分鐘後自動保存。", + "AutosaveEnding": "下一次 {0} 分鐘後自動保存。", "AutosaveInProgress": "正在自動保存遊戲。現在無法啟動自動保存。" } diff --git a/Subnautica/BepInEx/plugins/SubnauticaAutosave/Languages/English.json b/Subnautica/BepInEx/plugins/SubnauticaAutosave/Languages/English.json index 773cc34..5d88434 100644 --- a/Subnautica/BepInEx/plugins/SubnauticaAutosave/Languages/English.json +++ b/Subnautica/BepInEx/plugins/SubnauticaAutosave/Languages/English.json @@ -1,6 +1,6 @@ { "AutosaveWarning": "Preparing to autosave in {0} seconds.", "AutosaveStarting": "Autosave sequence starting...", - "AutosaveEnding": "Autosave done. Next autosave in {0} minutes.", + "AutosaveEnding": "Next autosave in {0} minutes.", "AutosaveInProgress": "Autosave in progress. Cannot autosave again right now." } diff --git a/Subnautica/BepInEx/plugins/SubnauticaAutosave/Languages/French.json b/Subnautica/BepInEx/plugins/SubnauticaAutosave/Languages/French.json index b7d4de9..d3d0cf2 100644 --- a/Subnautica/BepInEx/plugins/SubnauticaAutosave/Languages/French.json +++ b/Subnautica/BepInEx/plugins/SubnauticaAutosave/Languages/French.json @@ -1,6 +1,6 @@ { "AutosaveWarning": "Préparation de la sauvegarde automatique dans {0} secondes.", "AutosaveStarting": "Début de la séquence de sauvegarde automatique...", - "AutosaveEnding": "Sauvegarde automatique effectuée. Prochaine sauvegarde automatique dans {0} minutes.", + "AutosaveEnding": "Prochaine sauvegarde automatique dans {0} minutes.", "AutosaveInProgress": "Sauvegarde automatique en cours. Impossible de sauvegarder automatiquement à nouveau pour l'instant." } diff --git a/Subnautica/BepInEx/plugins/SubnauticaAutosave/Languages/German.json b/Subnautica/BepInEx/plugins/SubnauticaAutosave/Languages/German.json index f75993c..c505c04 100644 --- a/Subnautica/BepInEx/plugins/SubnauticaAutosave/Languages/German.json +++ b/Subnautica/BepInEx/plugins/SubnauticaAutosave/Languages/German.json @@ -1,6 +1,6 @@ { "AutosaveWarning": "Vorbereitung zum autosave in {0} sekunden.", "AutosaveStarting": "Autosave Sequenz beginnt...", - "AutosaveEnding": "Autosave abgeschlossen. Nächster autosave in {0} minuten.", + "AutosaveEnding": "Nächster autosave in {0} minuten.", "AutosaveInProgress": "Autosave läuft bereits. Erneuter autosave gerade nicht möglich." } diff --git a/Subnautica/BepInEx/plugins/SubnauticaAutosave/Languages/Italian.json b/Subnautica/BepInEx/plugins/SubnauticaAutosave/Languages/Italian.json index bbb5f7a..f478a1a 100644 --- a/Subnautica/BepInEx/plugins/SubnauticaAutosave/Languages/Italian.json +++ b/Subnautica/BepInEx/plugins/SubnauticaAutosave/Languages/Italian.json @@ -1,6 +1,6 @@ { "AutosaveWarning": "Preparazione per autosave in {0} secondi.", "AutosaveStarting": "Sequenza di autosave avviata...", - "AutosaveEnding": "Autosave completato. Prossimo autosave in {0} minuti.", + "AutosaveEnding": "Prossimo autosave in {0} minuti.", "AutosaveInProgress": "Autosave in corso. Operazione non consentita adesso." } diff --git a/Subnautica/BepInEx/plugins/SubnauticaAutosave/Languages/Polish.json b/Subnautica/BepInEx/plugins/SubnauticaAutosave/Languages/Polish.json index ae63418..210b781 100644 --- a/Subnautica/BepInEx/plugins/SubnauticaAutosave/Languages/Polish.json +++ b/Subnautica/BepInEx/plugins/SubnauticaAutosave/Languages/Polish.json @@ -1,6 +1,6 @@ { "AutosaveWarning": "Przygotowywanie do automatycznego zapisu za {0} sekund.", "AutosaveStarting": "Sekwencja automatycznego zapisu rozpoczęta...", - "AutosaveEnding": "Wykonano automatyczny zapis. Następny za {0} minut.", + "AutosaveEnding": "Następny automatyczny zapis za {0} minut.", "AutosaveInProgress": "Automatyczny zapis trwa. Nie można wykonać teraz automatycznego zapisu." } diff --git a/Subnautica/BepInEx/plugins/SubnauticaAutosave/Languages/Portuguese (Brazil).json b/Subnautica/BepInEx/plugins/SubnauticaAutosave/Languages/Portuguese (Brazil).json index 26bde4a..31eb224 100644 --- a/Subnautica/BepInEx/plugins/SubnauticaAutosave/Languages/Portuguese (Brazil).json +++ b/Subnautica/BepInEx/plugins/SubnauticaAutosave/Languages/Portuguese (Brazil).json @@ -1,6 +1,6 @@ { "AutosaveWarning": "Salvamento automático em {0} segundos.", "AutosaveStarting": "Sequência de autosalvamento começando...", - "AutosaveEnding": "Autosalvamento terminado. Próximo autosalvamento em {0} minutos.", + "AutosaveEnding": "Próximo autosalvamento em {0} minutos.", "AutosaveInProgress": "Autosalvamento em andamento. Não é possivel iniciar o autosalvamento novamente neste momento." } diff --git a/Subnautica/BepInEx/plugins/SubnauticaAutosave/Languages/Russian.json b/Subnautica/BepInEx/plugins/SubnauticaAutosave/Languages/Russian.json index 8182104..9edbff9 100644 --- a/Subnautica/BepInEx/plugins/SubnauticaAutosave/Languages/Russian.json +++ b/Subnautica/BepInEx/plugins/SubnauticaAutosave/Languages/Russian.json @@ -1,6 +1,6 @@ { "AutosaveWarning": "Подготовка к автосохранению через {0} секунд.", "AutosaveStarting": "Запускается процесс автосохранения...", - "AutosaveEnding": "Автосохранение завершено. Следующее автосохранение через {0} минуты.", + "AutosaveEnding": "Следующее автосохранение через {0} минуты.", "AutosaveInProgress": "Автосохранение уже запущено. Сейчас невозможно запустить автосохранение." } diff --git a/Subnautica/BepInEx/plugins/SubnauticaAutosave/Languages/Spanish.json b/Subnautica/BepInEx/plugins/SubnauticaAutosave/Languages/Spanish.json index dd40fb6..38e355f 100644 --- a/Subnautica/BepInEx/plugins/SubnauticaAutosave/Languages/Spanish.json +++ b/Subnautica/BepInEx/plugins/SubnauticaAutosave/Languages/Spanish.json @@ -1,6 +1,6 @@ { "AutosaveWarning": "Preparando para guardar automáticamente en {0} segundos.", "AutosaveStarting": "Iniciando secuencia de autoguardado...", - "AutosaveEnding": "Autoguardado terminado. Siguiente autoguardado en {0} minutos.", + "AutosaveEnding": "Siguiente autoguardado en {0} minutos.", "AutosaveInProgress": "Autoguardado en proceso. No se puede guardar automáticamente en este momento." } diff --git a/Subnautica/BepInEx/plugins/SubnauticaAutosave/Languages/Swedish.json b/Subnautica/BepInEx/plugins/SubnauticaAutosave/Languages/Swedish.json index edf51ed..4c761da 100644 --- a/Subnautica/BepInEx/plugins/SubnauticaAutosave/Languages/Swedish.json +++ b/Subnautica/BepInEx/plugins/SubnauticaAutosave/Languages/Swedish.json @@ -1,6 +1,6 @@ { "AutosaveWarning": "Förbereder för att autospara om {0} sekunder.", "AutosaveStarting": "Autosparning påbörjas...", - "AutosaveEnding": "Autosparnig klar. Nästa autosparning sker om {0} minuter.", + "AutosaveEnding": "Nästa autosparning sker om {0} minuter.", "AutosaveInProgress": "Autosparning är pågående. Kan inte autospara igen för tillfället." } diff --git a/Subnautica/BepInEx/plugins/SubnauticaAutosave/Languages/Turkish.json b/Subnautica/BepInEx/plugins/SubnauticaAutosave/Languages/Turkish.json index 601ffd4..4dc7006 100644 --- a/Subnautica/BepInEx/plugins/SubnauticaAutosave/Languages/Turkish.json +++ b/Subnautica/BepInEx/plugins/SubnauticaAutosave/Languages/Turkish.json @@ -1,6 +1,6 @@ { "AutosaveWarning": "{0} saniye içinde otomatik kayıta hazırlanıyor.", "AutosaveStarting": "Otomatik kayıt işlemi başlıyor ...", - "AutosaveEnding": "Otomatik kayıt bitti. Bir sonraki otomatik kayıt {0} dakika içinde gerçekleşecektir.", + "AutosaveEnding": "Bir sonraki otomatik kayıt {0} dakika içinde gerçekleşecektir.", "AutosaveInProgress": "Otomatik kayıt devam ediyor. Şu anda tekrar otomatik kayıt yapılamaz." } diff --git a/Subnautica/BepInEx/plugins/SubnauticaAutosave/Languages/Ukrainian.json b/Subnautica/BepInEx/plugins/SubnauticaAutosave/Languages/Ukrainian.json new file mode 100644 index 0000000..ceeb6ce --- /dev/null +++ b/Subnautica/BepInEx/plugins/SubnauticaAutosave/Languages/Ukrainian.json @@ -0,0 +1,6 @@ +{ + "AutosaveWarning": "Підготовка до автозбереження через {0} секунд.", + "AutosaveStarting": "Початок послідовності автозбереження...", + "AutosaveEnding": "Наступне автозбереження через {0} хвилин.", + "AutosaveInProgress": "Виконується автозбереження. Зараз неможливо зберегтись." +} diff --git a/Subnautica/BepInEx/plugins/SubnauticaAutosave/SubnauticaAutosave.dll b/Subnautica/BepInEx/plugins/SubnauticaAutosave/SubnauticaAutosave.dll index 267a4b000acaf99cf3001966f1c11f5351f184a0..df9c5d85a761f33ae3abf93d8535ed7ad7d543ca 100644 GIT binary patch delta 5277 zcmZu#3wTx4m0o+FbI&>V+;<)~?{Jflfs zCwfm4{WDTTKKr&Ep8-_}cZ0Z><$B-KAjWa)xMz!FteDLc=U9HmN;H>OBW_L((kqC@ zPaLcTLc+^x@H5phQU z$*SZ^on!})HPGiqyRIo{QCidIm2x3un}=_}V_co_t-F@(#E5jgG#EWZv>}PYQ(*~5 z5H?&3DRLv{+ogv#;us-u$Wfks629RyICa%acPX9oMXMOJCE`zx*=(t(HYU|a`_MnT zu#6W)!WjGn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zZ_1Z;WJ}bNo%f`Yg)fp>fq#~a9#}OH{lS|yMqP%)!pIEK7n#GRh*OaWn=<%GWE~%D zjm>rq9xKyy`?j{W)onMfyZh@~29L!{^})YY-OmOeug){Y)*F61c;D1Dx=2<>@bj$c z_d}m_pW8R@g~3_xU0UHiKX~~o1)A+PT~>ybvC40WSnWYJS-e&o7k{bUTxxMW%9z)T za#oO$+Jz!;19xmjs(<9N2MQAp&e=MqfKkre_D!9Mb$71a68+Vo=sf&{X^&204;3Z9d8v_BT+`&$QZp0|w&f89*qwo&EYCYIMtamz|^e0A|p zb+@s%#piX!?1(5_@FpT(T<|sRX37x@>Kj}Wv5QGOUVjPtK*ROGGY!@K)s`FM$jbhr NdN9=Z@2tPt{9gt&Wl#VB diff --git a/Subnautica/HarmonyPatches.cs b/Subnautica/HarmonyPatches.cs index 26e85b2..1cd97ab 100644 --- a/Subnautica/HarmonyPatches.cs +++ b/Subnautica/HarmonyPatches.cs @@ -22,6 +22,19 @@ private static bool Patch_ManualSaveGame_Prefix() return true; } + private static void Patch_ManualSaveGame_Postfix() + { + AutosaveController controller = Player.main?.GetComponent(); + + if (controller != null) + { + if (ModPlugin.ConfigDelaySaveOnManual.Value) + { + controller.ScheduleAutosave(); + } + } + } + private static void Patch_UpdateLoadButtonState_Postfix(MainMenuLoadButton lb) { if (ModPlugin.ConfigShowSaveNames.Value && SaveLoadManager.main.GetGameInfo(lb.saveGame) != null) @@ -48,7 +61,7 @@ private static void Patch_ReportStageDurations_Postfix() ModPlugin.LogMessage("Main scene loading, scheduling first autosave."); #endif - Player.main?.GetComponent()?.ScheduleAutosave(ModPlugin.ConfigMinutesBetweenAutosaves.Value); + Player.main?.GetComponent()?.ScheduleAutosave(showMessage: false); } // Untested // @@ -96,7 +109,8 @@ internal static void InitializeHarmony() /* When saving manually, set to main slot if loaded from autosave */ // Patch: IngameMenu.SaveGame harmony.Patch(original: AccessTools.Method(typeof(IngameMenu), nameof(IngameMenu.SaveGame)), - prefix: new HarmonyMethod(typeof(HarmonyPatches), nameof(HarmonyPatches.Patch_ManualSaveGame_Prefix))); + prefix: new HarmonyMethod(typeof(HarmonyPatches), nameof(HarmonyPatches.Patch_ManualSaveGame_Prefix)), + postfix: new HarmonyMethod(typeof(HarmonyPatches), nameof(HarmonyPatches.Patch_ManualSaveGame_Postfix))); /* Show save names in menu panel */ // Patch: MainMenuLoadPanel.UpdateLoadButtonState(MainMenuLoadButton lb) diff --git a/Subnautica/ModPlugin.cs b/Subnautica/ModPlugin.cs index 2b6d8ff..228dba0 100644 --- a/Subnautica/ModPlugin.cs +++ b/Subnautica/ModPlugin.cs @@ -9,7 +9,7 @@ public class ModPlugin : BaseUnityPlugin { private const string modGUID = "Dingo.SN.SubnauticaAutosave"; internal const string modName = "Subnautica Autosave"; - private const string modVersion = "2.0.4"; + private const string modVersion = "2.0.5"; private const int MaxMinutesBetweenSaves = 9999; private const int MaxSaveFiles = 9999; @@ -26,17 +26,15 @@ public class ModPlugin : BaseUnityPlugin public static ConfigEntry ConfigHardcoreMode; public static ConfigEntry ConfigQuicksaveKey; public static ConfigEntry ConfigComprehensiveSaves; + public static ConfigEntry ConfigDelaySaveOnManual; private void RescheduleOnSettingChanged() { - if (ConfigAutosaveOnTimer.Value) - { #if DEBUG LogMessage("RescheduleOnSettingChanged() - trying to reschedule next save."); #endif - Player.main?.GetComponent()?.ScheduleAutosave(ConfigMinutesBetweenAutosaves.Value, true); - } + Player.main?.GetComponent()?.ScheduleAutosave(settingsChanged: true, showMessage: false); } private void InitializeConfig() @@ -109,6 +107,12 @@ private void InitializeConfig() key: "Save All Files"), defaultValue: true, configDescription: new ConfigDescription(description: "Always save all screenshots, cache and other files.\nMay result in longer save times.")); + + ConfigDelaySaveOnManual = this.Config.Bind( + configDefinition: new ConfigDefinition(section: "General", + key: "Manual Save Resets Timer"), + defaultValue: false, + configDescription: new ConfigDescription(description: "Reset the next autosave timing when the player performs a manual save.")); } internal static void LogMessage(string message) diff --git a/Subnautica/Properties/AssemblyInfo.cs b/Subnautica/Properties/AssemblyInfo.cs index 3f37040..554ca81 100644 --- a/Subnautica/Properties/AssemblyInfo.cs +++ b/Subnautica/Properties/AssemblyInfo.cs @@ -10,7 +10,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("SubnauticaAutosave")] -[assembly: AssemblyCopyright("Copyright © Dingo 2023")] +[assembly: AssemblyCopyright("Copyright © Dingo 2019-2024")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.0.4.0")] -[assembly: AssemblyFileVersion("2.0.4.0")] +[assembly: AssemblyVersion("2.0.5.0")] +[assembly: AssemblyFileVersion("2.0.5.0")]