Ejemplo n.º 1
0
        private void OnLoad(object sender, EventArgs e)
        {
            if (FormsDesignerHelper.IsInDesignMode())
            {
                return;
            }

            Cursor.Current = Cursors.WaitCursor;
            LoadMapOverlays();
            Options.LoadedUltimaClass["Map"]        = true;
            Options.LoadedUltimaClass["RadarColor"] = true;

            _currMap = Map.Felucca;
            feluccaToolStripMenuItem.Checked  = true;
            trammelToolStripMenuItem.Checked  = false;
            ilshenarToolStripMenuItem.Checked = false;
            malasToolStripMenuItem.Checked    = false;
            tokunoToolStripMenuItem.Checked   = false;
            PreloadMap.Visible = true;
            ChangeMapNames();
            ZoomLabel.Text = $"Zoom: {Zoom}";
            SetScrollBarValues();
            Refresh();
            pictureBox.Invalidate();
            Cursor.Current = Cursors.Default;

            if (!_loaded)
            {
                ControlEvents.MapDiffChangeEvent  += OnMapDiffChangeEvent;
                ControlEvents.MapNameChangeEvent  += OnMapNameChangeEvent;
                ControlEvents.MapSizeChangeEvent  += OnMapSizeChangeEvent;
                ControlEvents.FilePathChangeEvent += OnFilePathChangeEvent;
            }
            _loaded = true;
        }
Ejemplo n.º 2
0
        protected override void OnLoad(EventArgs e)
        {
            if (FormsDesignerHelper.IsInDesignMode())
            {
                return;
            }

            if (_loaded)
            {
                return;
            }

            Cursor.Current = Cursors.WaitCursor;
            Options.LoadedUltimaClass["Gumps"] = true;
            _showFreeSlots = false;
            showFreeSlotsToolStripMenuItem.Checked = false;

            PopulateListBox(true);

            if (!_loaded)
            {
                ControlEvents.FilePathChangeEvent += OnFilePathChangeEvent;
                ControlEvents.GumpChangeEvent     += OnGumpChangeEvent;
            }

            _loaded        = true;
            Cursor.Current = Cursors.Default;
        }
Ejemplo n.º 3
0
        private void OnLoad(object sender, EventArgs e)
        {
            if (FormsDesignerHelper.IsInDesignMode())
            {
                return;
            }

            Cursor.Current = Cursors.WaitCursor;
            Options.LoadedUltimaClass["Texture"] = true;

            for (int i = 0; i < 0x1000; ++i)
            {
                if (Textures.TestTexture(i))
                {
                    _textureList.Add(i);
                }
            }

            vScrollBar.Maximum = (_textureList.Count / _col) + 1;
            pictureBox.Invalidate();

            if (!_loaded)
            {
                ControlEvents.FilePathChangeEvent += OnFilePathChangeEvent;
                ControlEvents.TextureChangeEvent  += OnTextureChangeEvent;
            }
            _loaded        = true;
            Cursor.Current = Cursors.Default;
        }
Ejemplo n.º 4
0
        private void OnLoad(object sender, EventArgs e)
        {
            if (FormsDesignerHelper.IsInDesignMode())
            {
                return;
            }

            Options.LoadedUltimaClass["Speech"] = true;
            _sortOrder               = SortOrder.Ascending;
            _sortColumn              = 2;
            _source.DataSource       = SpeechList.Entries;
            dataGridView1.DataSource = _source;
            if (dataGridView1.Columns.Count > 0)
            {
                dataGridView1.Columns[0].Width = 60;
            }

            dataGridView1.Invalidate();
            if (!_loaded)
            {
                ControlEvents.FilePathChangeEvent += OnFilePathChangeEvent;
            }

            _loaded = true;
        }
Ejemplo n.º 5
0
        private void OnLoad(object sender, EventArgs e)
        {
            if (FormsDesignerHelper.IsInDesignMode())
            {
                return;
            }

            Cursor.Current = Cursors.WaitCursor;
            Options.LoadedUltimaClass["SkillGrp"] = true;

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

            foreach (SkillGroup group in SkillGroups.List)
            {
                TreeNode groupNode = new TreeNode
                {
                    Text = group.Name
                };
                if (string.Equals("Misc", group.Name))
                {
                    groupNode.ForeColor = Color.Blue;
                }

                for (int i = 0; i < SkillGroups.SkillList.Count; ++i)
                {
                    if (SkillGroups.SkillList[i] != cache.Count)
                    {
                        continue;
                    }

                    TreeNode skillNode = new TreeNode
                    {
                        Text = Skills.GetSkill(i).Name,
                        Tag  = i
                    };
                    groupNode.Nodes.Add(skillNode);
                }
                cache.Add(groupNode);
            }

            treeView1.Nodes.AddRange(cache.ToArray());
            treeView1.EndUpdate();

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

            _loaded        = true;
            Cursor.Current = Cursors.Default;
        }
Ejemplo n.º 6
0
        private void OnLoad(object sender, EventArgs e)
        {
            if (FormsDesignerHelper.IsInDesignMode())
            {
                return;
            }

            Cursor.Current = Cursors.WaitCursor;
            Options.LoadedUltimaClass["Sound"] = true;

            int?oldItem = null;

            if (treeView.SelectedNode != null)
            {
                oldItem = (int)treeView.SelectedNode.Tag - 1;
            }

            treeView.BeginUpdate();
            try
            {
                treeView.Nodes.Clear();

                var cache = new List <TreeNode>();
                for (int i = 1; i <= 0xFFF; ++i)
                {
                    if (Sounds.IsValidSound(i - 1, out string name, out bool translated))
                    {
                        TreeNode node = new TreeNode($"0x{i:X3} {name}")
                        {
                            Tag = i
                        };

                        if (translated)
                        {
                            node.ForeColor = Color.Blue;
                            node.NodeFont  = new Font(Font, FontStyle.Underline);
                        }

                        cache.Add(node);
                    }
                    else if (showFreeSlotsToolStripMenuItem.Checked)
                    {
                        TreeNode node = new TreeNode($"0x{i:X3} ")
                        {
                            Tag       = i,
                            ForeColor = Color.Red
                        };

                        cache.Add(node);
                    }
                }
Ejemplo n.º 7
0
        /// <summary>
        /// ReLoads if loaded
        /// </summary>
        private void Reload()
        {
            if (FormsDesignerHelper.IsInDesignMode())
            {
                return;
            }

            if (!_loaded)
            {
                return;
            }

            _moving = false;
            ToolStripMenuItem strip;

            if (multiMapToolStripMenuItem.Checked)
            {
                strip = multiMapToolStripMenuItem;
            }
            else if (facet00ToolStripMenuItem.Checked)
            {
                strip = facet00ToolStripMenuItem;
            }
            else if (facet01ToolStripMenuItem.Checked)
            {
                strip = facet01ToolStripMenuItem;
            }
            else if (facet02ToolStripMenuItem.Checked)
            {
                strip = facet02ToolStripMenuItem;
            }
            else if (facet03ToolStripMenuItem.Checked)
            {
                strip = facet03ToolStripMenuItem;
            }
            else if (facet04ToolStripMenuItem.Checked)
            {
                strip = facet04ToolStripMenuItem;
            }
            else if (facet05ToolStripMenuItem.Checked)
            {
                strip = facet05ToolStripMenuItem;
            }
            else
            {
                return;
            }

            strip.Checked = false;
            ShowImage(strip, EventArgs.Empty);
        }
Ejemplo n.º 8
0
        private void OnLoad(object sender, EventArgs e)
        {
            if (FormsDesignerHelper.IsInDesignMode())
            {
                return;
            }

            if (IsLoaded && (!(e is MyEventArgs args) || args.Type != MyEventArgs.Types.ForceReload))
            {
                return;
            }

            Cursor.Current = Cursors.WaitCursor;
            Options.LoadedUltimaClass["TileData"] = true;
            Options.LoadedUltimaClass["Art"]      = true;

            listView1.BeginUpdate();
            try
            {
                listView1.Clear();
                var itemCache = new List <ListViewItem>();
                for (int i = 0; i < 0x4000; ++i)
                {
                    if (!Art.IsValidLand(i))
                    {
                        continue;
                    }

                    ListViewItem item = new ListViewItem(i.ToString(), 0)
                    {
                        Tag = i
                    };
                    itemCache.Add(item);
                }
                listView1.Items.AddRange(itemCache.ToArray());
                listView1.TileSize = new Size(49, 49);
            }
            finally
            {
                listView1.EndUpdate();
            }

            if (!IsLoaded)
            {
                ControlEvents.FilePathChangeEvent += OnFilePathChangeEvent;
                ControlEvents.LandTileChangeEvent += OnLandTileChangeEvent;
                ControlEvents.TileDataChangeEvent += OnTileDataChangeEvent;
            }
            IsLoaded       = true;
            Cursor.Current = Cursors.Default;
        }
Ejemplo n.º 9
0
        /// <summary>
        /// ReLoads if loaded
        /// </summary>
        private void Reload()
        {
            if (FormsDesignerHelper.IsInDesignMode())
            {
                return;
            }

            if (!_loaded)
            {
                return;
            }

            Zoom    = 1;
            _moving = false;
            OnLoad(this, EventArgs.Empty);
        }
Ejemplo n.º 10
0
        private void OnLoad(object sender, EventArgs e)
        {
            if (FormsDesignerHelper.IsInDesignMode())
            {
                return;
            }

            Cursor.Current = Cursors.WaitCursor;
            Options.LoadedUltimaClass["Light"] = true;

            treeView1.BeginUpdate();
            try
            {
                treeView1.Nodes.Clear();
                for (int i = 0; i < Ultima.Light.GetCount(); ++i)
                {
                    if (!Ultima.Light.TestLight(i))
                    {
                        continue;
                    }

                    TreeNode treeNode = new TreeNode(i.ToString())
                    {
                        Tag = i
                    };
                    treeView1.Nodes.Add(treeNode);
                }
            }
            finally
            {
                treeView1.EndUpdate();
            }

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

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

            _loaded        = true;
            Cursor.Current = Cursors.Default;
        }
Ejemplo n.º 11
0
        protected override void OnLoad(EventArgs e)
        {
            if (FormsDesignerHelper.IsInDesignMode())
            {
                return;
            }

            if (_loaded)
            {
                return;
            }

            Cursor.Current = Cursors.WaitCursor;
            Options.LoadedUltimaClass["Gumps"] = true;
            _showFreeSlots = false;
            showFreeSlotsToolStripMenuItem.Checked = false;

            listBox.BeginUpdate();
            listBox.Items.Clear();
            List <object> cache = new List <object>();

            for (int i = 0; i < Gumps.GetCount(); ++i)
            {
                if (Gumps.IsValidIndex(i))
                {
                    cache.Add(i);
                }
            }

            listBox.Items.AddRange(cache.ToArray());
            listBox.EndUpdate();
            if (listBox.Items.Count > 0)
            {
                listBox.SelectedIndex = 0;
            }

            if (!_loaded)
            {
                ControlEvents.FilePathChangeEvent += OnFilePathChangeEvent;
                ControlEvents.GumpChangeEvent     += OnGumpChangeEvent;
            }

            _loaded        = true;
            Cursor.Current = Cursors.Default;
        }
Ejemplo n.º 12
0
        private void OnResize(object sender, EventArgs e)
        {
            if (FormsDesignerHelper.IsInDesignMode())
            {
                return;
            }

            if (PreloadWorker.IsBusy)
            {
                return;
            }

            if (!_loaded)
            {
                return;
            }

            ChangeScrollBar();
            pictureBox.Invalidate();
        }
Ejemplo n.º 13
0
        private void OnLoad(object sender, EventArgs e)
        {
            if (FormsDesignerHelper.IsInDesignMode())
            {
                return;
            }

            if (_loaded)
            {
                return;
            }

            multiMapToolStripMenuItem.Checked = true;
            pictureBox.Image = Ultima.MultiMap.GetMultiMap();
            if (pictureBox.Image != null)
            {
                DisplayScrollBars();
                SetScrollBarValues();
            }
            ControlEvents.FilePathChangeEvent += OnFilePathChangeEvent;
            _loaded = true;
        }
Ejemplo n.º 14
0
        private void OnLoad(object sender, EventArgs e)
        {
            if (FormsDesignerHelper.IsInDesignMode())
            {
                return;
            }

            Cursor.Current = Cursors.WaitCursor;
            Options.LoadedUltimaClass["Texture"] = true;

            listView1.BeginUpdate();
            listView1.Clear();
            var itemCache = new List <ListViewItem>();

            for (int i = 0; i < Textures.GetIdxLength(); ++i)
            {
                if (!Textures.TestTexture(i))
                {
                    continue;
                }

                ListViewItem item = new ListViewItem(i.ToString(), 0)
                {
                    Tag = i
                };
                itemCache.Add(item);
            }
            listView1.Items.AddRange(itemCache.ToArray());
            listView1.TileSize = new Size(64, 64);
            listView1.EndUpdate();
            if (!_loaded)
            {
                ControlEvents.FilePathChangeEvent += OnFilePathChangeEvent;
                ControlEvents.TextureChangeEvent  += OnTextureChangeEvent;
            }
            _loaded        = true;
            Cursor.Current = Cursors.Default;
        }
Ejemplo n.º 15
0
        private void OnLoad(object sender, EventArgs e)
        {
            if (FormsDesignerHelper.IsInDesignMode())
            {
                return;
            }

            Cursor.Current = Cursors.WaitCursor;
            Options.LoadedUltimaClass["Skills"] = true;

            _source.DataSource       = Skills.SkillEntries;
            dataGridView1.DataSource = _source;
            dataGridView1.Invalidate();

            if (dataGridView1.Columns.Count > 0)
            {
                dataGridView1.Columns[0].MinimumWidth = 40;
                dataGridView1.Columns[0].FillWeight   = 10.82822F;
                dataGridView1.Columns[0].ReadOnly     = true;
                dataGridView1.Columns[0].HeaderText   = "ID";
                dataGridView1.Columns[1].MinimumWidth = 60;
                dataGridView1.Columns[1].FillWeight   = 10.80126F;
                dataGridView1.Columns[1].ReadOnly     = false;
                dataGridView1.Columns[1].HeaderText   = "is Action";
                dataGridView1.Columns[2].FillWeight   = 54.86799F;
                dataGridView1.Columns[2].ReadOnly     = false;
                dataGridView1.Columns[3].Visible      = false; // extraFlag
            }

            if (!_loaded)
            {
                ControlEvents.FilePathChangeEvent += OnFilePathChangeEvent;
                _source.ListChanged += Source_ListChanged;
            }

            _loaded        = true;
            Cursor.Current = Cursors.Default;
        }
Ejemplo n.º 16
0
        private void OnLoad(object sender, EventArgs e)
        {
            if (FormsDesignerHelper.IsInDesignMode())
            {
                return;
            }

            Cursor.Current = Cursors.WaitCursor;
            Options.LoadedUltimaClass["Animations"] = true;
            Options.LoadedUltimaClass["Hues"]       = true;
            TreeViewMobs.TreeViewNodeSorter         = new GraphicSorter();
            if (!LoadXml())
            {
                Cursor.Current = Cursors.Default;
                return;
            }

            LoadListView();

            extractAnimationToolStripMenuItem.Visible = false;
            _currentSelect       = 0;
            _currentSelectAction = 0;
            if (TreeViewMobs.Nodes[0].Nodes.Count > 0)
            {
                TreeViewMobs.SelectedNode = TreeViewMobs.Nodes[0].Nodes[0];
            }

            FacingBar.Value = (_facing + 3) & 7;
            if (!_loaded)
            {
                ControlEvents.FilePathChangeEvent += OnFilePathChangeEvent;
            }

            _loaded        = true;
            Cursor.Current = Cursors.Default;
        }
Ejemplo n.º 17
0
        private void OnLoad(object sender, EventArgs e)
        {
            if (FormsDesignerHelper.IsInDesignMode())
            {
                return;
            }

            Cursor.Current = Cursors.WaitCursor;
            Options.LoadedUltimaClass["ASCIIFont"]   = true;
            Options.LoadedUltimaClass["UnicodeFont"] = true;

            treeView.BeginUpdate();
            try
            {
                treeView.Nodes.Clear();

                TreeNode node = new TreeNode("ASCII")
                {
                    Tag = 0
                };
                treeView.Nodes.Add(node);

                for (int i = 0; i < ASCIIText.Fonts.Length; ++i)
                {
                    node = new TreeNode(i.ToString())
                    {
                        Tag = i
                    };
                    treeView.Nodes[0].Nodes.Add(node);
                }

                if (LoadUnicodeFontsCheckBox.Checked)
                {
                    node = new TreeNode("Unicode")
                    {
                        Tag = 1
                    };
                    treeView.Nodes.Add(node);

                    for (int i = 0; i < UnicodeFonts.Fonts.Length; ++i)
                    {
                        if (UnicodeFonts.Fonts[i] == null)
                        {
                            continue;
                        }

                        node = new TreeNode(i.ToString())
                        {
                            Tag = i
                        };
                        treeView.Nodes[1].Nodes.Add(node);
                    }
                }

                treeView.ExpandAll();
            }
            finally
            {
                treeView.EndUpdate();
            }

            treeView.SelectedNode = treeView.Nodes[0].Nodes[0];

            UpdateTileView();

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

            _loaded        = true;
            Cursor.Current = Cursors.Default;
        }
Ejemplo n.º 18
0
        private void OnPaint(object sender, PaintEventArgs e)
        {
            if (FormsDesignerHelper.IsInDesignMode())
            {
                return;
            }

            if (PreloadWorker.IsBusy)
            {
                e.Graphics.DrawString("Preloading map. Please wait...", SystemFonts.DefaultFont, Brushes.Black, 60, 60);
                return;
            }

            _map = _currMap.GetImage(hScrollBar.Value >> 3, vScrollBar.Value >> 3,
                                     (int)((e.ClipRectangle.Width / Zoom) + 8) >> 3, (int)((e.ClipRectangle.Height / Zoom) + 8) >> 3,
                                     showStaticsToolStripMenuItem1.Checked);
            ZoomMap(ref _map);
            e.Graphics.DrawImageUnscaledAndClipped(_map, e.ClipRectangle);

            if (showCenterCrossToolStripMenuItem1.Checked)
            {
                using (Brush brush = new SolidBrush(Color.FromArgb(180, Color.White)))
                    using (Pen pen = new Pen(brush))
                    {
                        int x = Round(pictureBox.Width / 2);
                        int y = Round(pictureBox.Height / 2);

                        e.Graphics.DrawLine(pen, x - 4, y, x + 4, y);
                        e.Graphics.DrawLine(pen, x, y - 4, x, y + 4);
                    }
            }

            if (showClientCrossToolStripMenuItem.Checked && Client.Running)
            {
                if (_clientX > hScrollBar.Value &&
                    _clientX < hScrollBar.Value + (e.ClipRectangle.Width / Zoom) &&
                    _clientY > vScrollBar.Value &&
                    _clientY < vScrollBar.Value + (e.ClipRectangle.Height / Zoom) &&
                    _clientMap == _currMapId)
                {
                    using (Brush brush = new SolidBrush(Color.FromArgb(180, Color.Yellow)))
                        using (Pen pen = new Pen(brush))
                        {
                            int x = (int)((_clientX - Round(hScrollBar.Value)) * Zoom);
                            int y = (int)((_clientY - Round(vScrollBar.Value)) * Zoom);

                            e.Graphics.DrawLine(pen, x - 4, y, x + 4, y);
                            e.Graphics.DrawLine(pen, x, y - 4, x, y + 4);

                            e.Graphics.DrawEllipse(pen, x - 2, y - 2, 2 * 2, 2 * 2);
                        }
                }
            }

            if (OverlayObjectTree.Nodes.Count <= 0 || !showMarkersToolStripMenuItem.Checked)
            {
                return;
            }

            foreach (TreeNode obj in OverlayObjectTree.Nodes[_currMapId].Nodes)
            {
                OverlayObject o = (OverlayObject)obj.Tag;
                if (o.IsVisible(e.ClipRectangle, _currMapId))
                {
                    o.Draw(e.Graphics);
                }
            }
        }
Ejemplo n.º 19
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;
        }
Ejemplo n.º 20
0
        public void OnLoad(object sender, EventArgs e)
        {
            if (FormsDesignerHelper.IsInDesignMode())
            {
                return;
            }

            if (IsLoaded && (!(e is MyEventArgs args) || args.Type != MyEventArgs.Types.ForceReload))
            {
                return;
            }

            Cursor.Current = Cursors.WaitCursor;
            Options.LoadedUltimaClass["TileData"] = true;
            Options.LoadedUltimaClass["Art"]      = true;
            Options.LoadedUltimaClass["Animdata"] = true;
            Options.LoadedUltimaClass["Hues"]     = true;

            if (!IsLoaded) // only once
            {
                Plugin.PluginEvents.FireModifyItemShowContextMenuEvent(contextMenuStrip1);
            }

            _showFreeSlots = false;
            showFreeSlotsToolStripMenuItem.Checked = false;

            listView1.BeginUpdate();
            try
            {
                listView1.Clear();
                List <ListViewItem> itemCache = new List <ListViewItem>();
                if (Files.UseHashFile && Files.CompareHashFile("Art", Options.AppDataPath) && !Art.Modified)
                {
                    string path     = Options.AppDataPath;
                    string fileName = Path.Combine(path, "UOFiddlerArt.hash");
                    if (File.Exists(fileName))
                    {
                        using (FileStream bin = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read))
                        {
                            unsafe
                            {
                                byte[] buffer = new byte[bin.Length];
                                bin.Read(buffer, 0, (int)bin.Length);
                                fixed(byte *bf = buffer)
                                {
                                    int *pOffset = (int *)bf;
                                    int  offset  = *pOffset + 4;
                                    int *dat     = (int *)(bf + offset);
                                    int  i       = offset;

                                    while (i < buffer.Length)
                                    {
                                        int          j    = *dat++;
                                        ListViewItem item = new ListViewItem(j.ToString(), 0)
                                        {
                                            Tag = j
                                        };
                                        itemCache.Add(item);
                                        i += 4;
                                    }
                                }
                            }
                        }
                        listView1.Items.AddRange(itemCache.ToArray());
                    }
                }
                else
                {
                    int staticLength = Art.GetMaxItemID() + 1;
                    for (int i = 0; i < staticLength; ++i)
                    {
                        if (!Art.IsValidStatic(i))
                        {
                            continue;
                        }

                        ListViewItem item = new ListViewItem(i.ToString(), 0)
                        {
                            Tag = i
                        };
                        itemCache.Add(item);
                    }
                    listView1.Items.AddRange(itemCache.ToArray());

                    if (Files.UseHashFile)
                    {
                        MakeHashFile();
                    }
                }

                listView1.TileSize = new Size(Options.ArtItemSizeWidth, Options.ArtItemSizeHeight);
            }
            finally
            {
                listView1.EndUpdate();
            }

            if (!IsLoaded)
            {
                ControlEvents.FilePathChangeEvent += OnFilePathChangeEvent;
                ControlEvents.ItemChangeEvent     += OnItemChangeEvent;
                ControlEvents.TileDataChangeEvent += OnTileDataChangeEvent;
            }
            IsLoaded = true;

            Cursor.Current = Cursors.Default;
        }