Ejemplo n.º 1
0
        //Display the parameter's value according to its type.
        public void DisplayInType(MoveDefEventParameterNode value)
        {
            if (value is MoveDefEventOffsetNode)
            {
                requirementPanel.Visible = false;
                valueGrid.Visible        = false;
                offsetPanel.Visible      = true;

                MoveDefEventOffsetNode offset = value as MoveDefEventOffsetNode;

                int list, type, index;
                offset.Root.GetLocation(offset.RawOffset, out list, out type, out index);

                _updating = true;
                comboBox1.SelectedIndex = offset.list = list;
                if (offset.type != -1)
                {
                    comboBox3.SelectedIndex = offset.type = type;
                }
                if (offset.index != -1)
                {
                    comboBox2.SelectedIndex = offset.index = index;
                }
                _updating = false;
            }
            else
            {
                requirementPanel.Visible = false;
                valueGrid.Visible        = true;
                offsetPanel.Visible      = false;

                valueGrid.SelectedObject = value;
            }
        }
Ejemplo n.º 2
0
        //Display the selected parameter's value, type and description.
        private void DisplayParameter(int index)
        {
            param = eventData.Children[index] as MoveDefEventParameterNode;

            cboType.Enabled = true;
            try { cboType.SelectedIndex = (int)param._type; }
            catch { cboType.SelectedIndex = -1; cboType.Text = "(" + MParams.Hex((int)param._type) + ")"; }
            DisplayInType(param);

            lblParamDescription.Text = param.Description;
        }
Ejemplo n.º 3
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);
        }
Ejemplo n.º 4
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);
        }