public SoundNotifier(ModuleSoundNotify parentModule, string player, string moduleDataDir) { this.ParentModule = parentModule; Player = player; thisNotifierDataDir = Path.Combine(moduleDataDir, player); if (!Directory.Exists(thisNotifierDataDir)) Directory.CreateDirectory(thisNotifierDataDir); Settings = new PersistentObject<NotifierSettings>(new NotifierSettings()); Settings.FilePath = Path.Combine(thisNotifierDataDir, "settings.xml"); if (!Settings.Load()) { Settings.Save(); } //create control for Module UI controlUI = new UControlSoundNotifyPlayerController(); //create this notifier UI SoundManagerUI = new FormSoundNotifyConfig(this); UpdateMutedState(); controlUI.label1.Text = player; controlUI.buttonMute.Click += ToggleMute; controlUI.buttonConfigure.Click += Configure; controlUI.buttonRemove.Click += Stop; InitPortedCode(Player); WurmLogs.SubscribeToLogFeed(this.Player, OnNewLogEvents); }
public FormSoundNotifyMain(ModuleSoundNotify parentModule) { this.ParentModule = parentModule; InitializeComponent(); trackBarGlobalVolume.Value = GeneralHelper.Validate<int>((int)(ParentModule.Settings.Value.GlobalVolume * 100), 0, 100); UpdateMuteIcon(); }