-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMusicManagerModule.cs
More file actions
40 lines (36 loc) · 1.4 KB
/
MusicManagerModule.cs
File metadata and controls
40 lines (36 loc) · 1.4 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
using System.Diagnostics;
using System.IO;
using MBEasyMod;
using MBEasyMod.Helpers;
using MBEasyMod.Managers;
using MBEasyMod.Notification;
using MusicManager.Managers;
using TaleWorlds.CampaignSystem.ViewModelCollection.GameMenu.Overlay;
using TaleWorlds.Library;
using TaleWorlds.MountAndBlade;
namespace MusicManager
{
public class MusicManagerModule : MBSubModuleBase
{
protected override void OnSubModuleLoad()
{
UpdateManager.CheckNewestVersion();
}
protected override void OnBeforeInitialModuleScreenSetAsRoot()
{
MBConsole.ConsoleColor = new Color(0.7f, 1.0f, 0.7f);
MBConsole.Log("Music Manager successdully loaded!");
MBConsole.ConsoleColor = Color.White;
}
public override void OnInitialState()
{
if(UpdateManager.CanUpdate)
MBPopup.ShowSimplePopup("New 'Music Manager' version available!", "A new version of 'Music Manager' is available! Do you wish to update?", "Update", "Ignore", UpdateMusicManager, ()=>{});
}
private void UpdateMusicManager()
{
UpdateManager.Update();
MBPopup.ShowSimpleNotificationPopup("Update installed", "The newest version of 'Music Manager' has been installed! Please restart the application to apply the update.", "Ok", ()=>{});
}
}
}