Exemplo n.º 1
0
        private void SetBitflagParam()
        {
            XActors actors;

            Int16[] bitDictionary = new Int16[16];
            actors = XActors.LoadFromFile(OcaXmlFileLocation);

            for (int i = 0; i < 16; i++)
            {
                bitDictionary[i] = (Int16)(1 << i);
            }

            foreach (XActor actor in actors.Actor)
            {
                var value = from v in actor.Variables
                            where bitDictionary.Contains(GetCaptureMask(v.Capture))
                            select v;

                foreach (var v in value)
                {
                    if (v.UI.name == UITypes.@default)
                    {
                        v.UI.name = UITypes.bitflag;
                    }
                }
            }
            outRichTextBox.Text = actors.Serialize();
        }
Exemplo n.º 2
0
        private void SetBitflagParam()
        {
            XActors actors;

            short[] bitDictionary = new short[16];
            actors = XActors.LoadFromFile(XActors.OcaXmlPath);

            for (int i = 0; i < 16; i++)
            {
                bitDictionary[i] = (short)(1 << i);
            }

            foreach (XActor actor in actors.Actor)
            {
                var value = from v in actor.Variables
                            where bitDictionary.Contains(GetCaptureMask(v.Capture))
                            select v;

                foreach (var v in value)
                {
                    if (v.UI.Item is UIDefault)
                    {
                        v.UI.Item = new UIBitFlag();
                    }
                }
            }
            outRichTextBox.Text = actors.Serialize();
        }
Exemplo n.º 3
0
        static XActorFactory()
        {
            OcarinaDoc          = XActors.LoadFromFile(XActors.OcaXmlPath);
            OcarinaActorParsers = GetXActorParsers(OcarinaDoc, Game.OcarinaOfTime);

            MaskDoc          = XActors.LoadFromFile(XActors.MaskXmlPath);
            MaskActorParsers = GetXActorParsers(MaskDoc, Game.MajorasMask);
        }
Exemplo n.º 4
0
        static XActorFactory()
        {
            var Document = XActors.LoadFromFile(XActors.OcaXmlPath);

            OcarinaActorParsers = GetXActorParsers(Document, Game.OcarinaOfTime);

            Document         = XActors.LoadFromFile(XActors.MaskXmlPath);
            MaskActorParsers = GetXActorParsers(Document, Game.MajorasMask);
        }
Exemplo n.º 5
0
        private void loadOcaButton_Click(object sender, EventArgs e)
        {
            Document = XActors.LoadFromFile(OcaXmlFileLocation);
            actorControl.Document = Document;
            Game = Game.Oca;

            //foreach (var item in Document.Actor)
            //{
            //    item.name = ActorNameConstants.OcaActorNames[Convert.ToUInt16(item.id, 16)];
            //}
        }
Exemplo n.º 6
0
        private void loadMMButton_Click(object sender, EventArgs e)
        {
            Document = XActors.LoadFromFile(MaskXmlFileLoaction);
            actorControl.Document = Document;
            Game = Game.Mask;

            //foreach(var item in Document.Actor)
            //{
            //    item.name = ActorNameConstants.MaskActorNames[Convert.ToUInt16(item.id, 16)];
            //}
            //ParseMMGbFormat();
        }
Exemplo n.º 7
0
        private void ActorObjectRelationshipsFromXml()
        {
            XActors       actorList;
            StringBuilder sb = new StringBuilder();
            List <Tuple <string, string> > ActorToObjects = new List <Tuple <string, string> >();

            actorList = XActors.LoadFromFile(OcaXmlFileLocation);

            sb.AppendLine("{|class=\"wikitable sortable\"");
            sb.AppendLine("! data-sort-type=\"text\" | Actor");
            sb.AppendLine("! data-sort-type=\"text\" | Object");
            foreach (XActor actor in actorList.Actor)
            {
                foreach (string obj in actor.Objects.Object)
                {
                    if (obj != "????")
                    {
                        ActorToObjects.Add(new Tuple <string, string>(actor.id, obj));
                    }
                    else
                    {
                        //var objList = actor.Variables.SelectMany(v => v.Value)
                        //     .Select(x => x.Data.objectid)
                        //     .Where(y => !String.IsNullOrEmpty(y))
                        //     .Distinct();

                        //foreach (string obj_sub in objList)
                        //{
                        //    ActorToObjects.Add(new Tuple<string, string>(actor.id, obj_sub));
                        //}
                    }
                }
            }
            foreach (Tuple <string, string> a2o in ActorToObjects)
            {
                sb.AppendLine("|-");
                sb.AppendFormat("|{0}||{1}", a2o.Item1, a2o.Item2);
                sb.AppendLine();
            }
            sb.AppendLine("|}");
            dataInRichTextBox.Text = sb.ToString();
        }