예제 #1
0
파일: Multis.cs 프로젝트: m309/fiddler-plus
        private void OnLoad(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;

            Options.LoadedUltimaClass["TileData"] = true;
            Options.LoadedUltimaClass["Art"]      = true;
            Options.LoadedUltimaClass["Multis"]   = true;
            Options.LoadedUltimaClass["Hues"]     = true;

            TreeViewMulti.BeginUpdate();
            TreeViewMulti.Nodes.Clear();
            List <TreeNode> cache = new List <TreeNode>();

            for (int i = 0; i < 0x2000; ++i)
            {
                MultiComponentList multi = Ultima.Multis.GetComponents(i);
                if (multi != MultiComponentList.Empty)
                {
                    TreeNode node = null;
                    if (xDom == null)
                    {
                        node = new TreeNode(String.Format("{0,5} (0x{0:X})", i));
                    }
                    else
                    {
                        XmlNodeList xMultiNodeList = xMultis.SelectNodes("/Multis/Multi[@id='" + i + "']");
                        string      j = "";
                        foreach (XmlNode xMultiNode in xMultiNodeList)
                        {
                            j = xMultiNode.Attributes["name"].Value;
                        }
                        node = new TreeNode(String.Format("{0,5} (0x{0:X}) {1}", i, j));
                    }
                    node.Tag  = multi;
                    node.Name = i.ToString();
                    cache.Add(node);
                }
            }
            TreeViewMulti.Nodes.AddRange(cache.ToArray());
            TreeViewMulti.EndUpdate();
            if (TreeViewMulti.Nodes.Count > 0)
            {
                TreeViewMulti.SelectedNode = TreeViewMulti.Nodes[0];
            }
            if (!Loaded)
            {
                FiddlerControls.Events.FilePathChangeEvent += new FiddlerControls.Events.FilePathChangeHandler(OnFilePathChangeEvent);
                FiddlerControls.Events.MultiChangeEvent    += new FiddlerControls.Events.MultiChangeHandler(OnMultiChangeEvent);
            }
            Loaded         = true;
            Cursor.Current = Cursors.Default;
        }
예제 #2
0
        private void OnClickFreeSlots(object sender, EventArgs e)
        {
            ShowFreeSlots = !ShowFreeSlots;
            TreeViewMulti.BeginUpdate();
            TreeViewMulti.Nodes.Clear();

            if (ShowFreeSlots)
            {
                for (int i = 0; i < 0x3000; ++i)
                {
                    MultiComponentList multi = Ultima.Multis.GetComponents(i);
                    TreeNode           node  = null;
                    if (xDom == null)
                    {
                        node = new TreeNode(String.Format("{0,5} (0x{1:X})", i, i));
                    }
                    else
                    {
                        XmlNodeList xMultiNodeList = xMultis.SelectNodes("/Multis/Multi[@id='" + i + "']");
                        string      j = "";
                        foreach (XmlNode xMultiNode in xMultiNodeList)
                        {
                            j = xMultiNode.Attributes["name"].Value;
                        }
                        node = new TreeNode(String.Format("{0,5} (0x{0:X}) {1}", i, j));
                    }
                    node.Name = i.ToString();
                    node.Tag  = multi;
                    if (multi == MultiComponentList.Empty)
                    {
                        node.ForeColor = Color.Red;
                    }
                    TreeViewMulti.Nodes.Add(node);
                }
            }
            else
            {
                for (int i = 0; i < 0x3000; ++i)
                {
                    MultiComponentList multi = Ultima.Multis.GetComponents(i);
                    if (multi != MultiComponentList.Empty)
                    {
                        TreeNode node = null;
                        if (xDom == null)
                        {
                            node = new TreeNode(String.Format("{0,5} (0x{1:X})", i, i));
                        }
                        else
                        {
                            XmlNodeList xMultiNodeList = xMultis.SelectNodes("/Multis/Multi[@id='" + i + "']");
                            string      j = "";
                            foreach (XmlNode xMultiNode in xMultiNodeList)
                            {
                                j = xMultiNode.Attributes["name"].Value;
                            }
                            node = new TreeNode(String.Format("{0,5} (0x{0:X}) {1}", i, j));
                        }
                        node.Tag  = multi;
                        node.Name = i.ToString();
                        TreeViewMulti.Nodes.Add(node);
                    }
                }
            }
            TreeViewMulti.EndUpdate();
        }
예제 #3
0
        private void OnLoad(object sender, EventArgs e)
        {
            if (FormsDesignerHelper.IsInDesignMode())
            {
                return;
            }

            Cursor.Current = Cursors.WaitCursor;

            Options.LoadedUltimaClass["TileData"] = true;
            Options.LoadedUltimaClass["Art"]      = true;
            Options.LoadedUltimaClass["Multis"]   = true;
            Options.LoadedUltimaClass["Hues"]     = true;

            TreeViewMulti.BeginUpdate();
            try
            {
                TreeViewMulti.Nodes.Clear();
                var cache = new List <TreeNode>();
                for (int i = 0; i < Multis.MaximumMultiIndex; ++i)
                {
                    MultiComponentList multi = Multis.GetComponents(i);
                    if (multi == MultiComponentList.Empty)
                    {
                        continue;
                    }

                    TreeNode node;
                    if (_xmlDocument == null)
                    {
                        node = new TreeNode(string.Format("{0,5} (0x{0:X})", i));
                    }
                    else
                    {
                        XmlNodeList xMultiNodeList = _xmlElementMultis.SelectNodes("/Multis/Multi[@id='" + i + "']");
                        string      j = "";

                        foreach (XmlNode xMultiNode in xMultiNodeList)
                        {
                            j = xMultiNode.Attributes["name"].Value;
                        }

                        node           = new TreeNode($"{i,5} (0x{i:X}) {j}");
                        xMultiNodeList = _xmlElementMultis.SelectNodes("/Multis/ToolTip[@id='" + i + "']");
                        foreach (XmlNode xMultiNode in xMultiNodeList)
                        {
                            node.ToolTipText = j + "\r\n" + xMultiNode.Attributes["text"].Value;
                        }

                        if (xMultiNodeList.Count == 0)
                        {
                            node.ToolTipText = j;
                        }
                    }

                    node.Tag  = multi;
                    node.Name = i.ToString();
                    cache.Add(node);
                }

                TreeViewMulti.Nodes.AddRange(cache.ToArray());
            }
            finally
            {
                TreeViewMulti.EndUpdate();
            }

            if (TreeViewMulti.Nodes.Count > 0)
            {
                TreeViewMulti.SelectedNode = TreeViewMulti.Nodes[0];
            }

            if (!_loaded)
            {
                ControlEvents.FilePathChangeEvent += OnFilePathChangeEvent;
                ControlEvents.MultiChangeEvent    += OnMultiChangeEvent;
            }

            _loaded        = true;
            Cursor.Current = Cursors.Default;
        }
예제 #4
0
        private void OnClickFreeSlots(object sender, EventArgs e)
        {
            _showFreeSlots = !_showFreeSlots;
            TreeViewMulti.BeginUpdate();
            TreeViewMulti.Nodes.Clear();

            if (_showFreeSlots)
            {
                for (int i = 0; i < Multis.MaximumMultiIndex; ++i)
                {
                    MultiComponentList multi = Multis.GetComponents(i);
                    TreeNode           node;
                    if (_xmlDocument == null)
                    {
                        node = new TreeNode($"{i,5} (0x{i:X})");
                    }
                    else
                    {
                        XmlNodeList xMultiNodeList = _xmlElementMultis.SelectNodes("/Multis/Multi[@id='" + i + "']");
                        string      j = "";
                        foreach (XmlNode xMultiNode in xMultiNodeList)
                        {
                            j = xMultiNode.Attributes["name"].Value;
                        }
                        node = new TreeNode(string.Format("{0,5} (0x{0:X}) {1}", i, j));
                    }
                    node.Name = i.ToString();
                    node.Tag  = multi;
                    if (multi == MultiComponentList.Empty)
                    {
                        node.ForeColor = Color.Red;
                    }

                    TreeViewMulti.Nodes.Add(node);
                }
            }
            else
            {
                for (int i = 0; i < Multis.MaximumMultiIndex; ++i)
                {
                    MultiComponentList multi = Multis.GetComponents(i);
                    if (multi == MultiComponentList.Empty)
                    {
                        continue;
                    }

                    TreeNode node;
                    if (_xmlDocument == null)
                    {
                        node = new TreeNode($"{i,5} (0x{i:X})");
                    }
                    else
                    {
                        XmlNodeList xMultiNodeList = _xmlElementMultis.SelectNodes("/Multis/Multi[@id='" + i + "']");
                        string      j = "";
                        foreach (XmlNode xMultiNode in xMultiNodeList)
                        {
                            j = xMultiNode.Attributes["name"].Value;
                        }
                        node = new TreeNode(string.Format("{0,5} (0x{0:X}) {1}", i, j));
                    }
                    node.Tag  = multi;
                    node.Name = i.ToString();
                    TreeViewMulti.Nodes.Add(node);
                }
            }
            TreeViewMulti.EndUpdate();
        }