示例#1
0
        public void ResetSubactionVariables()
        {
            //Reload scripts
            LoadSubactionScripts();

            //Reset model visiblity to its default state
            if (_model != null && _model._objList != null && _article._mdlVis != null)
            {
                ModelVisibility node = _article._mdlVis;
                if (node.Count != 0)
                {
                    ModelVisReference entry = node[0];

                    //First, disable bones
                    foreach (ModelVisBoneSwitch Switch in entry)
                    {
                        int i = 0;
                        foreach (ModelVisGroup Group in Switch)
                        {
                            if (i != Switch._defaultGroup)
                            {
                                foreach (BoneIndexValue b in Group._bones)
                                {
                                    if (b.BoneNode != null)
                                    {
                                        foreach (MDL0ObjectNode p in b.BoneNode._manPolys)
                                        {
                                            p._render = false;
                                        }
                                    }
                                }
                            }
                            i++;
                        }
                    }

                    //Now, enable bones
                    foreach (ModelVisBoneSwitch Switch in entry)
                    {
                        if (Switch._defaultGroup >= 0 && Switch._defaultGroup < Switch.Count)
                        {
                            ModelVisGroup Group = Switch[Switch._defaultGroup];
                            foreach (BoneIndexValue b in Group._bones)
                            {
                                if (b.BoneNode != null)
                                {
                                    foreach (MDL0ObjectNode p in b.BoneNode._manPolys)
                                    {
                                        p._render = true;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
示例#2
0
        public static void ResetSubactionVariables()
        {
            LoadSubactionScripts();

            foreach (MDL0BoneNode bone in Scriptor._boneCollisions)
            {
                bone._nodeColor = bone._boneColor = Color.Transparent;
            }
            Scriptor._boneCollisions = new List <MDL0BoneNode>();
            Scriptor._hurtBoxType    = 0;
            _hitBoxes       = new List <HitBox>();
            _allowInterrupt = false;

            //Reset articles
            if (_articles != null)
            {
                foreach (ArticleInfo i in _articles)
                {
                    if (i == null)
                    {
                        continue;
                    }

                    i.SubactionIndex = -1;
                    if (!i._etcModel)
                    {
                        if (i._model != null)
                        {
                            i._model._visible = true;
                            i._model.ApplyCHR(null, 0);
                        }
                        i.Running = true;
                    }
                    else
                    {
                        if (i._model != null)
                        {
                            i._model._visible = false;
                        }
                        i.Running = false;
                    }
                }
            }

            //Reset model visiblity to its default state
            if (MainWindow.TargetModel != null && MainWindow.TargetModel._objList != null && Manager.Moveset != null)
            {
                ModelVisibility node = Manager.Moveset.Data._modelVis;
                if (node.Count != 0)
                {
                    ModelVisReference entry = node[0] as ModelVisReference;

                    //First, disable bones
                    foreach (ModelVisBoneSwitch Switch in entry)
                    {
                        int i = 0;
                        foreach (ModelVisGroup Group in Switch)
                        {
                            if (i != Switch._defaultGroup)
                            {
                                foreach (BoneIndexValue b in Group._bones)
                                {
                                    if (b.BoneNode != null)
                                    {
                                        foreach (MDL0ObjectNode p in b.BoneNode._manPolys)
                                        {
                                            p._render = false;
                                        }
                                    }
                                }
                            }
                            i++;
                        }
                    }

                    //Now, enable bones
                    foreach (ModelVisBoneSwitch Switch in entry)
                    {
                        if (Switch._defaultGroup >= 0 && Switch._defaultGroup < Switch.Count)
                        {
                            ModelVisGroup Group = Switch[Switch._defaultGroup];
                            foreach (BoneIndexValue b in Group._bones)
                            {
                                if (b.BoneNode != null)
                                {
                                    foreach (MDL0ObjectNode p in b.BoneNode._manPolys)
                                    {
                                        p._render = true;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }