-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBoneMenu.cs
More file actions
73 lines (59 loc) · 2.55 KB
/
BoneMenu.cs
File metadata and controls
73 lines (59 loc) · 2.55 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
using BoneLib.BoneMenu;
using WeatherElectric.BONELAB.BoneMenu;
using Menu = WeatherElectric.BONELAB.BoneMenu.Menu;
namespace WeatherElectric.VoidSpeaker;
internal static class BoneMenu
{
private static FunctionElement _pauseElement;
public static void Init()
{
var subCat = Menu.MainPage.CreatePage("<color=#bdd9da>Void Speaker</color>", Color.white);
subCat.CreateFloat("Volume", Color.white, Preferences.Volume.Value, 0.05f, 0f, 1f, f =>
{
MusicPlayer.Instance.SetVolume(f);
Preferences.Volume.Value = f;
Preferences.OwnCategory.SaveToFile(false);
});
subCat.CreateFunction("Play", Color.green, () =>
{
MusicPlayer.Instance.Play();
});
subCat.CreateFunction("Stop", Color.red, () =>
{
MusicPlayer.Instance.Stop();
_pauseElement.ElementName = "Pause";
_pauseElement.ElementColor = Color.yellow;
MusicPlayer.Instance.Unpause();
});
_pauseElement = subCat.CreateFunction("Pause", Color.yellow, () =>
{
var paused = MusicPlayer.Instance.PauseUnpause();
_pauseElement.ElementName = paused ? "Unpause" : "Pause";
_pauseElement.ElementColor = paused ? Color.green : Color.yellow;
});
subCat.CreateFunction("Skip", Color.white, () =>
{
MusicPlayer.Instance.Skip();
});
subCat.CreateFunction("Shuffle", Color.white, () =>
{
MusicPlayer.Instance.Shuffle();
});
var settingsPanel = subCat.CreatePage("Settings", Color.gray);
#region Settings
settingsPanel.CreateBoolPreference("Send Notifications", Color.white, Preferences.SendNotifications, Preferences.OwnCategory);
settingsPanel.CreateBoolPreference("Use TagLib", Color.white, Preferences.UseTagLib, Preferences.OwnCategory);
settingsPanel.CreateFloatPreference("Notification Duration", Color.white, 0.5f, 0.5f, 10f, Preferences.NotificationDuration, Preferences.OwnCategory);
settingsPanel.CreateFunction("Refresh Music", Color.white, () =>
{
BoneLib.BoneMenu.Menu.DisplayDialog("Warning!", "This will freeze the game for a while, depending on how many songs you added!", null, RefreshMusic);
});
return;
void RefreshMusic()
{
MusicLoader.RemoveMissingFiles();
MusicLoader.LoadNewFiles();
}
#endregion
}
}