[+] Config

pull/7/head
Azalea 2024-02-07 02:38:36 -05:00
parent dcdf951ebc
commit b403189afb
7 changed files with 56 additions and 7 deletions

3
AquaMai/.gitignore vendored
View File

@ -372,4 +372,5 @@ MigrationBackup/
Output
.idea
Libs/Assembly-CSharp.dll
Libs/Assembly-CSharp.dll
packages

View File

@ -60,6 +60,9 @@
<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>
@ -260,9 +263,17 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="CutsceneSkipping.cs" />
<Compile Include="Config.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Main.cs" />
<Compile Include="UX\SkipWarningScreen.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Content Include="AquaMai.toml" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

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

15
AquaMai/Config.cs 100644
View File

@ -0,0 +1,15 @@
using System.Diagnostics.CodeAnalysis;
namespace AquaMai
{
[SuppressMessage("ReSharper", "ClassNeverInstantiated.Global")]
public class Config
{
public UXConfig UX { get; set; }
public class UXConfig
{
public bool SkipWarningScreen { get; set; }
}
}
}

View File

@ -1,5 +1,6 @@
using MelonLoader;
using HarmonyLib;
using AquaMai.UX;
using MelonLoader;
using Tomlyn;
namespace AquaMai
{
@ -15,10 +16,20 @@ namespace AquaMai
public class AquaMai : MelonMod
{
public static Config AppConfig { get; private set; }
public override void OnInitializeMelon()
{
MelonLogger.Msg("OnApplicationStart");
HarmonyLib.Harmony.CreateAndPatchAll(typeof(CutsceneSkipping));
// Read AquaMai.toml to load settings
AppConfig = Toml.ToModel<Config>("AquaMai.toml");
if (AppConfig.UX.SkipWarningScreen)
{
MelonLogger.Msg("Patching CutsceneSkipping");
HarmonyLib.Harmony.CreateAndPatchAll(typeof(SkipWarningScreen));
}
}
}
}

View File

@ -1,9 +1,9 @@
using HarmonyLib;
using Monitor;
namespace AquaMai
namespace AquaMai.UX
{
public class CutsceneSkipping
public class SkipWarningScreen
{
/*
* Patch PlayLogo to disable the warning screen

View File

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