-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMod.cs
More file actions
35 lines (29 loc) · 1.18 KB
/
Mod.cs
File metadata and controls
35 lines (29 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
namespace MenuMuffler
{
[BepInPlugin(Constants.PluginGuid, Constants.PluginName, "1.0.0")]
public sealed class Mod : BaseUnityPlugin
{
internal new static ManualLogSource Logger { get; private set; }
internal static ConfigEntry<bool> MuteMenuBackground { get; set; }
private void Awake()
{
Logger = BepInEx.Logging.Logger.CreateLogSource(Constants.PluginName);
MuteMenuBackground = Config.Bind(
section: Constants.Config.SectionName,
key: Constants.Config.MuffleBackground,
defaultValue: true,
description: Constants.Config.MuffleBackgroundDescription);
MuteMenuBackground.SettingChanged += (sender, args) => TriggerAudioPrompt();
Harmony harmony = new Harmony(Constants.HarmonyId);
Logger.LogInfo("Loading...");
harmony.PatchAll();
Logger.LogInfo("Loaded!");
}
private void TriggerAudioPrompt() =>
G.Sys.AudioManager_.PromptMusicCue(G.Sys.GameManager_.Level_.Settings_.musicCueID_);
}
}