Example #1
0
        /// <summary>
        /// The user clicked on an item in the list of floors.
        /// </summary>
        private void LstFloors_MouseClick(object sender, MouseEventArgs e)
        {
            BtnZoomIn.Visible  = true;
            BtnZoomOut.Visible = true;

            HideFloorTextInterface();

            foreach (ListViewItem Item in LstFloors.Items)
            {
                //We only support selecting one item at a time.
                if (Item.Selected)
                {
                    byte[] Hash         = FileUtilities.GenerateHash(Item.Text);
                    int    ArchiveIndex = 0;

                    //This is NOT effective, but it's a tool so it doesn't have to be super fast...
                    foreach (FAR1Archive Archive in m_Archives)
                    {
                        ArchiveIndex++;

                        if (Archive.ContainsEntry(Hash))
                        {
                            m_CurrentIff = new Iff(RndFloors.GraphicsDevice);
                            m_CurrentIff.Init(Archive.GrabEntry(Hash), false);
                            RndFloors.AddSprite(m_CurrentIff.SPR2s[0]);

                            DirectoryInfo DirInfo = new DirectoryInfo(Archive.Path);
                            LblArchive.Text = "Floor is in: " + DirInfo.Parent + "\\" + Path.GetFileName(Archive.Path);
                            PopulateLanguagesAndStrings();
                        }
                    }
                }
            }
        }
Example #2
0
        /// <summary>
        /// User wanted to zoom out a floor.
        /// </summary>
        private void BtnZoomOut_Click(object sender, EventArgs e)
        {
            if (m_ZoomLevel > 0)
            {
                m_ZoomLevel--;
            }

            RndFloors.AddSprite(m_CurrentIff.SPR2s[m_ZoomLevel]);
        }