Skip to content

Commit

Permalink
SN Vanilla 2.0.5
Browse files Browse the repository at this point in the history
- Added Ukr translation, string updates
- Added setting to reset timer on manual save
  • Loading branch information
DingoDjango committed Feb 10, 2024
1 parent 057d250 commit 6774a81
Show file tree
Hide file tree
Showing 20 changed files with 174 additions and 142 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"AutosaveWarning": "Підготовка до автозбереження через {0} секунд.",
"AutosaveStarting": "Початок послідовності автозбереження...",
"AutosaveEnding": "Успішне Автозбереження. Наступне через {0} хвилин.",
"AutosaveInProgress": "Виконується автозбереження. Зараз неможливо зберегтись."
}
216 changes: 108 additions & 108 deletions Below Zero/SubnauticaAutosave_BZ.csproj
Original file line number Diff line number Diff line change
@@ -1,119 +1,119 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{9F11D600-B09B-4ACD-8DFF-9DFAE00037C4}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SubnauticaAutosave_BZ</RootNamespace>
<AssemblyName>SubnauticaAutosave_BZ</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>embedded</DebugType>
<Optimize>false</Optimize>
<OutputPath>QMods\SubnauticaAutosave_BZ\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<LangVersion>7.1</LangVersion>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>QMods\SubnauticaAutosave_BZ\</OutputPath>
<DefineConstants>
</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<LangVersion>7.1</LangVersion>
<PlatformTarget>AnyCPU</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="0Harmony">
<HintPath>D:\SubnauticaBelowZero\BepInEx\core\0Harmony.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Assembly-CSharp">
<HintPath>D:\SubnauticaBelowZero\SubnauticaZero_Data\Managed\Assembly-CSharp.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Assembly-CSharp-firstpass">
<HintPath>..\..\..\..\SubnauticaBelowZero\SubnauticaZero_Data\Managed\Assembly-CSharp-firstpass.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="BepInEx">
<HintPath>D:\SubnauticaBelowZero\BepInEx\core\BepInEx.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="LitJson">
<HintPath>D:\SubnauticaBelowZero\SubnauticaZero_Data\Managed\LitJson.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="QModInstaller">
<HintPath>..\..\..\..\SubnauticaBelowZero\BepInEx\plugins\QModManager\QModInstaller.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="SMLHelper">
<HintPath>..\..\..\..\SubnauticaBelowZero\QMods\SMLHelper_BZ\SMLHelper.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="Unity.TextMeshPro">
<HintPath>D:\SubnauticaBelowZero\SubnauticaZero_Data\Managed\Unity.TextMeshPro.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine">
<HintPath>D:\SubnauticaBelowZero\SubnauticaZero_Data\Managed\UnityEngine.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.CoreModule">
<HintPath>D:\SubnauticaBelowZero\SubnauticaZero_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>D:\SubnauticaBelowZero\SubnauticaZero_Data\Managed\UnityEngine.UI.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="AutosaveController.cs" />
<Compile Include="HarmonyPatches.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SMLConfig.cs" />
<Compile Include="Translation.cs" />
</ItemGroup>
<ItemGroup>
<None Include="mod.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{9F11D600-B09B-4ACD-8DFF-9DFAE00037C4}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SubnauticaAutosave_BZ</RootNamespace>
<AssemblyName>SubnauticaAutosave_BZ</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>embedded</DebugType>
<Optimize>false</Optimize>
<OutputPath>QMods\SubnauticaAutosave_BZ\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<LangVersion>7.1</LangVersion>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>QMods\SubnauticaAutosave_BZ\</OutputPath>
<DefineConstants>
</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<LangVersion>7.1</LangVersion>
<PlatformTarget>AnyCPU</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="0Harmony">
<HintPath>D:\SubnauticaBelowZero\BepInEx\core\0Harmony.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Assembly-CSharp">
<HintPath>D:\SubnauticaBelowZero\SubnauticaZero_Data\Managed\Assembly-CSharp.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Assembly-CSharp-firstpass">
<HintPath>..\..\..\..\SubnauticaBelowZero\SubnauticaZero_Data\Managed\Assembly-CSharp-firstpass.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="BepInEx">
<HintPath>D:\SubnauticaBelowZero\BepInEx\core\BepInEx.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="LitJson">
<HintPath>D:\SubnauticaBelowZero\SubnauticaZero_Data\Managed\LitJson.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="QModInstaller">
<HintPath>..\..\..\..\SubnauticaBelowZero\BepInEx\plugins\QModManager\QModInstaller.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="SMLHelper">
<HintPath>..\..\..\..\SubnauticaBelowZero\QMods\SMLHelper_BZ\SMLHelper.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="Unity.TextMeshPro">
<HintPath>D:\SubnauticaBelowZero\SubnauticaZero_Data\Managed\Unity.TextMeshPro.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine">
<HintPath>D:\SubnauticaBelowZero\SubnauticaZero_Data\Managed\UnityEngine.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.CoreModule">
<HintPath>D:\SubnauticaBelowZero\SubnauticaZero_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>D:\SubnauticaBelowZero\SubnauticaZero_Data\Managed\UnityEngine.UI.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="AutosaveController.cs" />
<Compile Include="HarmonyPatches.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SMLConfig.cs" />
<Compile Include="Translation.cs" />
</ItemGroup>
<ItemGroup>
<None Include="mod.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target> -->
<PropertyGroup>
<PostBuildEvent>SET MODDIR=D:\SubnauticaBelowZero\QMods\
<PropertyGroup>
<PostBuildEvent>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"
</PostBuildEvent>
</PropertyGroup>
</PostBuildEvent>
</PropertyGroup>
</Project>
26 changes: 14 additions & 12 deletions Subnautica/AutosaveController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"AutosaveWarning": "即将在 {0} 秒后自动保存。",
"AutosaveStarting": "正在自动保存游戏...",
"AutosaveEnding": "自动保存完成。 下一次 {0} 分钟后自动保存。",
"AutosaveEnding": "下一次 {0} 分钟后自动保存。",
"AutosaveInProgress": "正在自动保存游戏。现在无法启动自动保存。"
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"AutosaveWarning": "遊戲在 {0} 秒後自動保存。",
"AutosaveStarting": "正在自動保存遊戲...",
"AutosaveEnding": "自動保存完成。 下一次 {0} 分鐘後自動保存。",
"AutosaveEnding": "下一次 {0} 分鐘後自動保存。",
"AutosaveInProgress": "正在自動保存遊戲。現在無法啟動自動保存。"
}
Original file line number Diff line number Diff line change
@@ -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."
}
Original file line number Diff line number Diff line change
@@ -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."
}
Original file line number Diff line number Diff line change
@@ -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."
}
Original file line number Diff line number Diff line change
@@ -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."
}
Original file line number Diff line number Diff line change
@@ -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."
}
Original file line number Diff line number Diff line change
@@ -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."
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"AutosaveWarning": "Подготовка к автосохранению через {0} секунд.",
"AutosaveStarting": "Запускается процесс автосохранения...",
"AutosaveEnding": "Автосохранение завершено. Следующее автосохранение через {0} минуты.",
"AutosaveEnding": "Следующее автосохранение через {0} минуты.",
"AutosaveInProgress": "Автосохранение уже запущено. Сейчас невозможно запустить автосохранение."
}
Original file line number Diff line number Diff line change
@@ -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."
}
Original file line number Diff line number Diff line change
@@ -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."
}
Original file line number Diff line number Diff line change
@@ -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."
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"AutosaveWarning": "Підготовка до автозбереження через {0} секунд.",
"AutosaveStarting": "Початок послідовності автозбереження...",
"AutosaveEnding": "Наступне автозбереження через {0} хвилин.",
"AutosaveInProgress": "Виконується автозбереження. Зараз неможливо зберегтись."
}
Binary file not shown.
Loading

0 comments on commit 6774a81

Please sign in to comment.