예제 #1
0
        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);
        }
예제 #2
0
 public void RemoveNotifierController(UControlSoundNotifyPlayerController controller)
 {
     flowLayoutPanel1.Controls.Remove(controller);
 }
예제 #3
0
 public void AddNotifierController(UControlSoundNotifyPlayerController controller)
 {
     flowLayoutPanel1.Controls.Add(controller);
 }