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 void RemoveNotifierController(UControlSoundNotifyPlayerController controller) { flowLayoutPanel1.Controls.Remove(controller); }
public void AddNotifierController(UControlSoundNotifyPlayerController controller) { flowLayoutPanel1.Controls.Add(controller); }