-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPreferences.cs
More file actions
28 lines (23 loc) · 1.5 KB
/
Preferences.cs
File metadata and controls
28 lines (23 loc) · 1.5 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
// ReSharper disable MemberCanBePrivate.Global, these categories may be used outside of this namespace to create bonemenu options.
using MelonLoader.Utils;
namespace WeatherElectric.VoidSpeaker;
internal static class Preferences
{
public static readonly MelonPreferences_Category OwnCategory = MelonPreferences.CreateCategory("VoidSpeaker");
public static MelonPreferences_Entry<float> Volume { get; set; }
public static MelonPreferences_Entry<bool> SendNotifications { get; set; }
public static MelonPreferences_Entry<bool> UseTagLib { get; set; }
public static MelonPreferences_Entry<float> NotificationDuration { get; set; }
public static void Init()
{
Volume = OwnCategory.CreateEntry("Volume", 1f, "Volume", "The volume the music plays at.");
SendNotifications = OwnCategory.CreateEntry("SendNotifications", true,
"Send Notifications", "Send notifications when a new song starts playing.");
UseTagLib = OwnCategory.CreateEntry("UseTagLib", !HelperMethods.IsAndroid(), "Use TagLib", "Use TagLib to get metadata from music files. If disabled, the mod will use the file name.");
NotificationDuration = OwnCategory.CreateEntry("NotificationDuration", 2f, "Notification Duration",
"The duration of the notification popup in seconds.");
OwnCategory.SetFilePath(MelonPrefs.Preferences.FilePath);
OwnCategory.SaveToFile(false);
Main.Logger.Log("Finished preferences setup for VoidSpeaker", LogLevel.Debug);
}
}