[F] Use yaml instead

This commit is contained in:
Azalea
2024-02-07 03:49:14 -05:00
parent b403189afb
commit df072f1c40
5 changed files with 15 additions and 15 deletions

View File

@@ -60,9 +60,6 @@
<Reference Include="System.Xml">
<HintPath>Libs\System.Xml.dll</HintPath>
</Reference>
<Reference Include="Tomlyn, Version=0.17.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\Tomlyn.0.17.0\lib\netstandard2.0\Tomlyn.dll</HintPath>
</Reference>
<Reference Include="Unity.Analytics.DataPrivacy">
<HintPath>Libs\Unity.Analytics.DataPrivacy.dll</HintPath>
</Reference>
@@ -261,6 +258,9 @@
<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" />
@@ -273,7 +273,7 @@
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Content Include="AquaMai.toml" />
<Content Include="AquaMai.yaml" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -1,7 +0,0 @@
# ===================================
# UX: User Experience Improvements
[UX]
# Skip the warning screen and logo shown after the POST sequence
SkipWarningScreen=1

7
AquaMai/AquaMai.yaml Normal file
View File

@@ -0,0 +1,7 @@
# ===================================
# UX: User Experience Improvements
UX:
# Skip the warning screen and logo shown after the POST sequence
SkipWarningScreen: true

View File

@@ -1,6 +1,5 @@
using AquaMai.UX;
using MelonLoader;
using Tomlyn;
namespace AquaMai
{
@@ -22,8 +21,9 @@ namespace AquaMai
{
MelonLogger.Msg("OnApplicationStart");
// Read AquaMai.toml to load settings
AppConfig = Toml.ToModel<Config>("AquaMai.toml");
// Read AquaMai.yaml to load settings
var yaml = new YamlDotNet.Serialization.Deserializer();
AppConfig = yaml.Deserialize<Config>(System.IO.File.ReadAllText("AquaMai.yaml"));
if (AppConfig.UX.SkipWarningScreen)
{

View File

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