Skip to content

Commit

Permalink
[+] Add option
Browse files Browse the repository at this point in the history
  • Loading branch information
hykilpikonna committed Feb 7, 2024
1 parent aa4fe50 commit aa5f4fb
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion AquaMai/AquaMai.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,8 @@
<Compile Include="Config.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Main.cs" />
<Compile Include="UX\SinglePlayer.cs" />
<Compile Include="UX\SkipWarningScreen.cs" />
<Compile Include="SinglePlayer.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
Expand Down
3 changes: 2 additions & 1 deletion AquaMai/AquaMai.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
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
1 change: 1 addition & 0 deletions AquaMai/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public class Config
public class UXConfig
{
public bool SkipWarningScreen { get; set; }
public bool SinglePlayer { get; set; }
}
}
}
12 changes: 10 additions & 2 deletions AquaMai/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,25 @@ public class AquaMai : MelonMod

public override void OnInitializeMelon()
{
MelonLogger.Msg("OnApplicationStart");
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"));

if (AppConfig.UX.SkipWarningScreen)
{
MelonLogger.Msg("Patching CutsceneSkipping");
MelonLogger.Msg("> Patching CutsceneSkipping");
HarmonyLib.Harmony.CreateAndPatchAll(typeof(SkipWarningScreen));
}

if (AppConfig.UX.SinglePlayer)
{
MelonLogger.Msg("> Patching SinglePlayer");
HarmonyLib.Harmony.CreateAndPatchAll(typeof(SinglePlayer));
}

MelonLogger.Msg("Loaded!");
}
}
}
File renamed without changes.

0 comments on commit aa5f4fb

Please sign in to comment.