Beispiel #1
0
        void RefreshWaveCombo()
        {
            object selectedItem = comboBoxWave.SelectedItem;

            SkipFlaggedEventHandlers = true;
            Enabled = false;
            comboBoxWave.DataSource = null;
            CGActionWave.ScanWaveFilesInFolder(Program.ExeFolder);
            comboBoxWave.DataSource = CGActionWave.AvailableWaves;
            Enabled = true;

            if (selectedItem != null && comboBoxWave.Items.Contains(selectedItem))
            {
                comboBoxWave.SelectedItem = selectedItem;
            }
            else if (TheWave.Wave != null && comboBoxWave.Items.Contains(TheWave.Wave))
            {
                comboBoxWave.SelectedItem = TheWave.Wave;
            }
            else if (comboBoxWave.SelectedItem != null)
            {
                TheWave.Wave = comboBoxWave.SelectedItem.ToString();
            }
            SkipFlaggedEventHandlers = false;

            CheckNoWaveState();
        }
Beispiel #2
0
        internal FormSound(CGActionWave waveAction, string infoText = "")
        {
            InitializeComponent();
            waveEditor1.LoadWaveAction(waveAction);
            labelInfo.Text = infoText;

            buttonClose.Click += (s, e) => { Close(); };
            BackColor          = Config.CGBackColor;
        }
Beispiel #3
0
        void AddWaveAction()
        {
            Trigger         t  = new Trigger(FormMain.Tracker);
            CGActionWave    a  = new CGActionWave(FormMain.WaveOutPool);
            TriggeredAction ta = new TriggeredAction(t, a, TheProfile);

            RefreshActionsListbox();
            SkipFlaggedEventHandlers    = true;
            listBoxActions.SelectedItem = ta;
            SkipFlaggedEventHandlers    = false;
            WaveActionCtl.LoadWaveAction(ta);
        }
Beispiel #4
0
        internal FormSound(CGActionWave waveAction, string infoText = "", bool invokesProfileChanged = false)
        {
            InitializeComponent();
            InvokesProfileChanged   = invokesProfileChanged;
            waveEditor1.ChangeMade += OnChangeMade;
            waveEditor1.LoadWaveAction(waveAction);
            labelInfo.Text = infoText;

            buttonClose.Click += (s, e) => { Close(); };
            BackColor          = Config.CGBackColor;

            AddDragEventHandlers(this);
        }
Beispiel #5
0
        public void LoadFromXml(XElement xTriggeredAction)
        {
            if (TheAction != null)
            {
                throw new Exception("Instance has already been initialilzed.");
            }

            if (xTriggeredAction != null)
            {
                TheTrigger.LoadFromXml(xTriggeredAction.Element("Trigger"));

                XElement xWaveFile = xTriggeredAction.Element("CGActionWaveFile");
                if (xWaveFile != null)
                {
                    CGActionWave wav = new CGActionWave(FormMain.WaveOutPool);
                    wav.LoadFromXml(xWaveFile);
                    TheAction = wav;
                }
            }
        }
        public void LoadFromXml(XElement xTriggeredAction, bool initializeAction = true)
        {
            if (TheAction != null)
            {
                throw new Exception("This instance of TriggeredAction has already been loaded.");
            }

            if (xTriggeredAction != null)
            {
                TheTrigger.LoadFromXml(xTriggeredAction.Element("Trigger"));

                XElement xWaveFile = xTriggeredAction.Element("CGActionWaveFile");
                if (xWaveFile != null)
                {
                    CGActionWave wav = new CGActionWave(FormMain.WaveOutPool);
                    wav.LoadFromXml(xWaveFile, initializeAction);
                    TheAction = wav;
                }
            }
        }
Beispiel #7
0
 public void LoadWaveAction(CGActionWave theWave)
 {
     TheWave = theWave;
     LoadValuesToGui();
 }