예제 #1
0
        private void cboType_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cboType.SelectedIndex == -1)
            {
                return;
            }

            if (lstParameters.SelectedIndex == -1)
            {
                return;
            }

            int index = lstParameters.SelectedIndex;

            //Change the type to the type selected and update the view window.

            param = eventData.Children[index] as MoveDefEventParameterNode;

            if (param._type != (ArgVarType)cboType.SelectedIndex)
            {
                int             ind  = param.Index;
                ActionEventInfo info = eventData.EventInfo;
                string          name = ((ArgVarType)cboType.SelectedIndex).ToString();

                int value = 0;

                MoveDefEventParameterNode p = newEvent.Children[ind] as MoveDefEventParameterNode;
                if (p is MoveDefEventValueNode || p is MoveDefEventScalarNode || p is MoveDefEventBoolNode)
                {
                    value = p._value;
                }

                newEvent.Children[ind].Remove();

                ArgVarType t = (ArgVarType)cboType.SelectedIndex;

                newEvent.NewParam(ind, value, (int)t);
            }

            DisplayParameter(index);
        }
예제 #2
0
        private void cboType_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cboType.SelectedIndex == -1)
            {
                return;
            }
            if (lstParameters.SelectedIndex == -1)
            {
                return;
            }
            int index = lstParameters.SelectedIndex;

            //Change the type to the type selected and update the view window.

            param = eventData.Children[index] as MoveDefEventParameterNode;

            if (param._type != (ArgVarType)cboType.SelectedIndex)
            {
                int             ind  = param.Index;
                ActionEventInfo info = eventData.EventInfo;
                string          name = ((ArgVarType)cboType.SelectedIndex).ToString();
                if (info != null)
                {
                    name = info.Params[ind];
                }

                //int value = 0;

                //MoveDefEventParameterNode p = newEvent.Children[ind] as MoveDefEventParameterNode;
                //if (p is MoveDefEventValueNode || p is MoveDefEventScalarNode || p is MoveDefEventBoolNode)
                //    value = p._value;

                newEvent.Children[ind].Remove();

                ArgVarType t = ((ArgVarType)cboType.SelectedIndex);

                if ((newEvent._event == 0x06000D00 || newEvent._event == 0x06150F00 || newEvent._event == 0x062B0D00) && ind == 12)
                {
                    newEvent.InsertChild(new HitboxFlagsNode(name), true, ind);
                }
                else if (((newEvent._event == 0x06000D00 || newEvent._event == 0x06150F00 || newEvent._event == 0x062B0D00) && (ind == 0 || ind == 3 || ind == 4)) ||
                         ((newEvent._event == 0x11010A00 || newEvent._event == 0x11020A00) && ind == 0))
                {
                    newEvent.InsertChild(new MoveDefEventValue2HalfNode(name), true, ind);
                }
                else if (ind == 14 && newEvent._event == 0x06150F00)
                {
                    newEvent.InsertChild(new SpecialHitboxFlagsNode(name), true, ind);
                }
                else if (t == ArgVarType.Value)
                {
                    newEvent.InsertChild(new MoveDefEventValueNode(name), true, ind);
                }
                else if (t == ArgVarType.Scalar)
                {
                    newEvent.InsertChild(new MoveDefEventScalarNode(name), true, ind);
                }
                else if (t == ArgVarType.Boolean)
                {
                    newEvent.InsertChild(new MoveDefEventBoolNode(name), true, ind);
                }
                else if (t == ArgVarType.Unknown)
                {
                    newEvent.InsertChild(new MoveDefEventUnkNode(name), true, ind);
                }
                else if (t == ArgVarType.Requirement)
                {
                    newEvent.InsertChild(new MoveDefEventRequirementNode(name), true, ind);
                }
                else if (t == ArgVarType.Variable)
                {
                    newEvent.InsertChild(new MoveDefEventVariableNode(name), true, ind);
                }
                else if (t == ArgVarType.Offset)
                {
                    newEvent.InsertChild(new MoveDefEventOffsetNode(name), true, ind);
                }
            }

            DisplayParameter(index);
        }