Exemple #1
0
        private void offsetOkay_Click(object sender, EventArgs e)
        {
            MoveDefEventOffsetNode _targetNode = param as MoveDefEventOffsetNode;

            if (_targetNode.action != null)
            {
                _targetNode._value = -1;
                _targetNode.action._actionRefs.Remove(param);
            }

            if (comboBox1.SelectedIndex >= 3)
            {
                if (comboBox1.SelectedIndex == 3 && comboBox2.SelectedIndex >= 0 &&
                    comboBox2.SelectedIndex < param.Root._externalRefs.Count)
                {
                    if (_targetNode._extNode != null)
                    {
                        _targetNode._extNode._refs.Remove(_targetNode);
                        _targetNode._extNode = null;
                    }

                    (param._extNode = param.Root._externalRefs[comboBox2.SelectedIndex] as MoveDefExternalNode)._refs
                    .Add(
                        param);
                }
            }
            else
            {
                if (param._extNode != null)
                {
                    param._extNode._refs.Remove(param);
                    param._extNode = null;
                }
            }

            _targetNode.list   = comboBox1.SelectedIndex;
            _targetNode.type   = comboBox1.SelectedIndex >= 2 ? -1 : comboBox3.SelectedIndex;
            _targetNode.index  = comboBox1.SelectedIndex == 4 ? -1 : comboBox2.SelectedIndex;
            _targetNode.action = param.Root.GetAction(_targetNode.list, _targetNode.type, _targetNode.index);
            if (_targetNode.action != null)
            {
                param._value = _targetNode.action._offset;
                _targetNode.action._actionRefs.Add(param);
            }
            else
            {
                param._value = -1;
            }

            param.SignalPropertyChange();
        }
Exemple #2
0
        private void offsetOkay_Click(object sender, EventArgs e)
        {
            int offset = -1;

            if (comboBox1.SelectedIndex >= 3)
            {
                offset = -1;
            }
            else
            {
                offset = param.Root.GetOffset(comboBox1.SelectedIndex, (comboBox1.SelectedIndex >= 2 ? -1 : comboBox3.SelectedIndex), comboBox2.SelectedIndex);
            }
            param._value = offset;
            (param as MoveDefEventOffsetNode).action = param.Root.GetAction(offset);
            (param as MoveDefEventOffsetNode).list   = comboBox1.SelectedIndex;
            (param as MoveDefEventOffsetNode).type   = (comboBox1.SelectedIndex >= 2 ? -1 : comboBox3.SelectedIndex);
            (param as MoveDefEventOffsetNode).index  = (comboBox1.SelectedIndex == 4 ? -1 : comboBox2.SelectedIndex);
            param.SignalPropertyChange();
        }