[M] Migrate to tomlet

pull/7/head
Azalea 2024-02-07 04:06:58 -05:00
parent e6e4782d51
commit 8152b9ab0d
7 changed files with 26 additions and 20 deletions

View File

@ -5,6 +5,10 @@
<assemblyIdentity name="mscorlib" publicKeyToken="b77a5c561934e089" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Xml" publicKeyToken="b77a5c561934e089" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View File

@ -60,6 +60,9 @@
<Reference Include="System.Xml">
<HintPath>Libs\System.Xml.dll</HintPath>
</Reference>
<Reference Include="Tomlet">
<HintPath>Libs\Tomlet.dll</HintPath>
</Reference>
<Reference Include="Unity.Analytics.DataPrivacy">
<HintPath>Libs\Unity.Analytics.DataPrivacy.dll</HintPath>
</Reference>
@ -258,9 +261,6 @@
<Reference Include="UnityEngine.XRModule">
<HintPath>Libs\UnityEngine.XRModule.dll</HintPath>
</Reference>
<Reference Include="YamlDotNet, Version=15.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e, processorArchitecture=MSIL">
<HintPath>packages\YamlDotNet.15.1.1\lib\net47\YamlDotNet.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Config.cs" />
@ -271,10 +271,9 @@
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Content Include="AquaMai.yaml" />
<Content Include="AquaMai.toml" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -0,0 +1,8 @@
# ===================================
# UX: User Experience Improvements
[UX]
# Skip the warning screen and logo shown after the POST sequence
SkipWarningScreen=true
# Single player: Show 1P only, at the center of the screen
SinglePlayer=true

View File

@ -1,8 +0,0 @@
# ===================================
# UX: User Experience Improvements
UX:
# Skip the warning screen and logo shown after the POST sequence
SkipWarningScreen: true
# Single player: Show 1P only, at the center of the screen
SinglePlayer: true

Binary file not shown.

View File

@ -1,5 +1,6 @@
using AquaMai.UX;
using MelonLoader;
using Tomlet;
namespace AquaMai
{
@ -21,9 +22,15 @@ namespace AquaMai
{
MelonLogger.Msg("Loading mod settings...");
// Read AquaMai.yaml to load settings
var yaml = new YamlDotNet.Serialization.Deserializer();
AppConfig = yaml.Deserialize<Config>(System.IO.File.ReadAllText("AquaMai.yaml"));
// Check if AquaMai.toml exists
if (!System.IO.File.Exists("AquaMai.toml"))
{
MelonLogger.Error("AquaMai.toml not found! Please create it.");
return;
}
// Read AquaMai.toml to load settings
AppConfig = TomletMain.To<Config>(System.IO.File.ReadAllText("AquaMai.toml"));
if (AppConfig.UX.SkipWarningScreen)
{

View File

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="YamlDotNet" version="15.1.1" targetFramework="net472" />
</packages>