Esempio n. 1
0
        //Display the event's name, offset and parameters.
        public void DisplayEvent()
        {
            lstParameters.Items.Clear();
            cboType.SelectedIndex    = -1;
            cboType.Text             = "";
            cboType.Enabled          = false;
            lblParamDescription.Text = "No Description Available.";

            valueGrid.Visible        = false;
            requirementPanel.Visible = false;
            offsetPanel.Visible      = false;

            ActionEventInfo info = null;

            if (eventData.Root.EventDictionary.ContainsKey(eventData._event))
            {
                info = eventData.Root.EventDictionary[eventData._event];
            }

            if (info != null)
            {
                lblEventName.Text = info._name;
            }

            lblEventId.Text = MParams.Hex8(eventData._event);

            foreach (MoveDefEventParameterNode n in eventData.Children)
            {
                if (!String.IsNullOrEmpty(n.Name))
                {
                    lstParameters.Items.Add(n.Name);
                }
            }
        }
Esempio n. 2
0
 private void EventList_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (EventList.SelectedIndex >= 0)
     {
         ActionEventInfo info = (TargetNode.Children[EventList.SelectedIndex] as MoveDefEventNode).EventInfo;
         if (info != null && !String.IsNullOrEmpty(info._description))
         {
             description.Text = info._description;
         }
         else
         {
             description.Text = "No Description Available.";
         }
     }
 }
Esempio n. 3
0
        public void AddRecord(ActionEventInfo actionEventInfo)
        {
            _lastInputLine = inputLine;
            RectTransform rt     = (RectTransform)_lastInputLine.transform;
            GameObject    record = Instantiate(inputLine, container.transform, false) as GameObject;
            var           recordLocalPosition = _nextRecordPosition - new Vector3(0, rt.rect.height, 0);

            Debug.Log(_lastInputLine.transform.localPosition);
            Debug.Log(_nextRecordPosition);
            Debug.Log(recordLocalPosition);
            record.transform.localPosition = recordLocalPosition;
            record.transform.GetChild(0).GetComponent <Text>().text = actionEventInfo.originId.ToString();
            record.transform.GetChild(1).GetComponent <Text>().text = actionEventInfo.targetId.ToString();
            record.transform.GetChild(2).GetComponent <Text>().text = actionEventInfo.action.ToString();
            record.transform.GetChild(3).GetComponent <Text>().text = actionEventInfo.value.ToString();
            _nextRecordPosition = recordLocalPosition;
        }
Esempio 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();

                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);
        }
Esempio n. 5
0
        private void btnChangeEvent_Click(object sender, EventArgs e)
        {
            //Pass in the event Event.
            frmEventList.eventEvent = eventData._event;
            frmEventList.p          = eventData.Root;
            frmEventList.ShowDialog();

            //Retrieve and setup the new event according to the new event Event.
            if (frmEventList.status == DialogResult.OK)
            {
                newEv = new MoveDefEventNode {
                    _parent = origEvent.Parent
                };

                newEvent.EventID = (uint)frmEventList.eventEvent;
                ActionEventInfo info = newEvent.EventInfo;

                newEvent.NewChildren();
            }

            DisplayEvent();
        }
Esempio n. 6
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);
        }
Esempio n. 7
0
        private void btnChangeEvent_Click(object sender, EventArgs e)
        {
            //Pass in the event Event.
            frmEventList.eventEvent = eventData._event;
            frmEventList.p          = eventData.Root;
            frmEventList.ShowDialog();

            //Retrieve and setup the new event according to the new event Event.
            if (frmEventList.status == DialogResult.OK)
            {
                newEv = new MoveDefEventNode()
                {
                    _parent = origEvent.Parent
                };

                newEvent.EventID = (int)frmEventList.eventEvent;
                ActionEventInfo info = newEvent.EventInfo;

                if (info.Params == null)
                {
                    DisplayEvent();
                    return;
                }

                for (int i = 0; i < newEvent.numArguments; i++)
                {
                    long type = info.GetDfltParameter(i);
                    if (i >= info.Params.Length)
                    {
                        continue;
                    }

                    if ((newEvent._event == 0x06000D00 || newEvent._event == 0x06150F00 || newEvent._event == 0x062B0D00) && i == 12)
                    {
                        newEvent.AddChild(new HitboxFlagsNode(info != null ? info.Params[i] : "Value"));
                    }
                    else if (((newEvent._event == 0x06000D00 || newEvent._event == 0x06150F00 || newEvent._event == 0x062B0D00) && (i == 0 || i == 3 || i == 4)) ||
                             ((newEvent._event == 0x11001000 || newEvent._event == 0x11010A00 || newEvent._event == 0x11020A00) && i == 0))
                    {
                        newEvent.AddChild(new MoveDefEventValue2HalfNode(info != null ? info.Params[i] : "Value"));
                    }
                    else if (i == 14 && newEvent._event == 0x06150F00)
                    {
                        newEvent.AddChild(new SpecialHitboxFlagsNode(info != null ? info.Params[i] : "Value"));
                    }
                    else if ((ArgVarType)(int)type == ArgVarType.Value)
                    {
                        newEvent.AddChild(new MoveDefEventValueNode(info != null ? info.Params[i] : "Value"));
                    }
                    else if ((ArgVarType)(int)type == ArgVarType.Scalar)
                    {
                        newEvent.AddChild(new MoveDefEventScalarNode(info != null ? info.Params[i] : "Scalar"));
                    }
                    else if ((ArgVarType)(int)type == ArgVarType.Boolean)
                    {
                        newEvent.AddChild(new MoveDefEventBoolNode(info != null ? info.Params[i] : "Boolean"));
                    }
                    else if ((ArgVarType)(int)type == ArgVarType.Unknown)
                    {
                        newEvent.AddChild(new MoveDefEventUnkNode(info != null ? info.Params[i] : "Unknown"));
                    }
                    else if ((ArgVarType)(int)type == ArgVarType.Requirement)
                    {
                        newEvent.AddChild(new MoveDefEventRequirementNode(info != null ? info.Params[i] : "Requirement"));
                    }
                    else if ((ArgVarType)(int)type == ArgVarType.Variable)
                    {
                        newEvent.AddChild(new MoveDefEventVariableNode(info != null ? info.Params[i] : "Variable"));
                    }
                    else if ((ArgVarType)(int)type == ArgVarType.Offset)
                    {
                        newEvent.AddChild(new MoveDefEventOffsetNode(info != null ? info.Params[i] : "Offset"));
                    }
                }
            }

            DisplayEvent();
        }
 public void SetTarget(ActionEventInfo info, int i)
 {
     index      = i;
     TargetNode = info;
 }