예제 #1
0
        private static UIDumperTreeNode[] Dumper_GetChildren(DumpUIChildrenArgs args, ref GInterfaceObject gio)
        {
            List <UIDumperTreeNode> nodes = new List <UIDumperTreeNode>();

            if (gio != null && gio.Children != null)
            {
                for (int i = 0, max = gio.Children.Length; i < max; i++)
                {
                    if (gio.Children[i] == null || (args.RootNode.OnlyVisible && !gio.Children[i].IsVisible))
                    {
                        continue;
                    }

                    string           s    = GetGIOString(ref gio.Children[i]);
                    UIDumperTreeNode node = new UIDumperTreeNode(s, ref gio.Children[i]);

                    try
                    {
                        if (!gio.Children[i].IsVisible)
                        {
                            node.ForeColor = Color.DarkGray;
                        }
                    }
                    catch
                    {
                        node.ForeColor = Color.DarkRed;
                    }

                    try
                    {
                        //PPather.WriteLine(String.Format("{0} - Child #{1}/{2}: {3}", rootName, i, max, s));
                        UIDumperTreeNode[] childNodes = Dumper_GetChildren(args, ref gio.Children[i]);

                        if (childNodes != null && childNodes.Length != 0)
                        {
                            node.Nodes.AddRange(childNodes);
                        }
                    }
                    catch (Exception e)
                    {
                        PPather.WriteLine(String.Format("Error reading child object #{1}: {0}", e.Message, i));
                        node.ForeColor = Color.DarkRed;
                    }

                    node.OnlyVisible = args.RootNode.OnlyVisible;

                    nodes.Add(node);

                    node = null;
                    s    = null;
                }
            }

            return(nodes.ToArray());
        }
예제 #2
0
        public static void Dumper_UIGlobals(object param)
        {
            DumpUIGlobalsArgs args = (DumpUIGlobalsArgs)param;

            if (args.FilterText == null)
            {
                PPather.WriteLine("Error: Something is wrong with args, unable to dump object list");
                return;
            }

            if (GContext.Main.Me == null || !GContext.Main.Me.IsValid)
            {
                PPather.WriteLine("Error: IsPreWorldVisible is true, unable to dump object list");
                return;
            }

            // disable the Dump button on the form
            PPather.form.DumpButtonEnabled(false);
            //PPather.WriteLine("Dumping GObjects..");

            List <TreeNode> tnc           = new List <TreeNode>();
            bool            shouldCheck   = (args.FilterText.Trim().Length != 0);
            bool            dumpUiVisible = args.OnlyVisible;

            string[] onames = GInterfaceHelper.GetAllInterfaceObjectNames();

            for (int i = 0, max = onames.Length; i != max; i++)
            {
                if (onames[i] == null || onames[i].Length == 0)
                {
                    continue;
                }
                if (shouldCheck && !onames[i].ToLower().Contains(args.FilterText))
                {
                    continue;
                }

                //PPather.WriteLine(String.Format("#{1}/{2}: {0}", onames[i], i, max));
                UIDumperTreeNode node = new UIDumperTreeNode(onames[i], true);
                node.OnlyVisible = args.OnlyVisible;
                tnc.Add(node);
            }

            // push those new nodes in there nicely
            PPather.form.SetDevTreeNodes(tnc.ToArray());

            tnc.Clear();
            tnc = null;

            // re-enable the Dump button on the form
            PPather.form.DumpButtonEnabled(true);
            //PPather.WriteLine("Dump complete.");
        }
예제 #3
0
 public DumpUIChildrenArgs(UIDumperTreeNode rootNode, string objectName)
 {
     ObjectName = objectName;
     RootNode   = rootNode;
 }
예제 #4
0
파일: UIDumper.cs 프로젝트: iwaitu/babbot
        public static void Dumper_UIGlobals(object param)
        {
            DumpUIGlobalsArgs args = (DumpUIGlobalsArgs)param;

            if (args.FilterText == null)
            {
                PPather.WriteLine("Error: Something is wrong with args, unable to dump object list");
                return;
            }

            if (GContext.Main.Me == null || !GContext.Main.Me.IsValid)
            {
                PPather.WriteLine("Error: IsPreWorldVisible is true, unable to dump object list");
                return;
            }

            // disable the Dump button on the form
            PPather.form.DumpButtonEnabled(false);
            //PPather.WriteLine("Dumping GObjects..");

            List<TreeNode> tnc = new List<TreeNode>();
            bool shouldCheck = (args.FilterText.Trim().Length != 0);
            bool dumpUiVisible = args.OnlyVisible;

            string[] onames = GInterfaceHelper.GetAllInterfaceObjectNames();

            for (int i = 0, max = onames.Length; i != max; i++)
            {
                if (onames[i] == null || onames[i].Length == 0) continue;
                if (shouldCheck && !onames[i].ToLower().Contains(args.FilterText)) continue;

                //PPather.WriteLine(String.Format("#{1}/{2}: {0}", onames[i], i, max));
                UIDumperTreeNode node = new UIDumperTreeNode(onames[i], true);
                node.OnlyVisible = args.OnlyVisible;
                tnc.Add(node);
            }

            // push those new nodes in there nicely
            PPather.form.SetDevTreeNodes(tnc.ToArray());

            tnc.Clear();
            tnc = null;

            // re-enable the Dump button on the form
            PPather.form.DumpButtonEnabled(true);
            //PPather.WriteLine("Dump complete.");
        }
예제 #5
0
파일: UIDumper.cs 프로젝트: iwaitu/babbot
 public DumpUIChildrenArgs(UIDumperTreeNode rootNode, string objectName)
 {
     ObjectName = objectName;
     RootNode = rootNode;
 }
예제 #6
0
파일: UIDumper.cs 프로젝트: iwaitu/babbot
        private static UIDumperTreeNode[] Dumper_GetChildren(DumpUIChildrenArgs args, ref GInterfaceObject gio)
        {
            List<UIDumperTreeNode> nodes = new List<UIDumperTreeNode>();

            if (gio != null && gio.Children != null)
            {
                for (int i = 0, max = gio.Children.Length; i < max; i++)
                {
                    if (gio.Children[i] == null || (args.RootNode.OnlyVisible && !gio.Children[i].IsVisible)) continue;

                    string s = GetGIOString(ref gio.Children[i]);
                    UIDumperTreeNode node = new UIDumperTreeNode(s, ref gio.Children[i]);

                    try
                    {
                        if (!gio.Children[i].IsVisible)
                            node.ForeColor = Color.DarkGray;
                    }
                    catch
                    {
                        node.ForeColor = Color.DarkRed;
                    }

                    try
                    {
                        //PPather.WriteLine(String.Format("{0} - Child #{1}/{2}: {3}", rootName, i, max, s));
                        UIDumperTreeNode[] childNodes = Dumper_GetChildren(args, ref gio.Children[i]);

                        if (childNodes != null && childNodes.Length != 0)
                            node.Nodes.AddRange(childNodes);
                    }
                    catch (Exception e)
                    {
                        PPather.WriteLine(String.Format("Error reading child object #{1}: {0}", e.Message, i));
                        node.ForeColor = Color.DarkRed;
                    }

                    node.OnlyVisible = args.RootNode.OnlyVisible;

                    nodes.Add(node);

                    node = null;
                    s = null;
                }
            }

            return nodes.ToArray();
        }