Esempio n. 1
0
        private void listBox1_SelectedIndexChanged_1(object sender, EventArgs e)
        {
            int n = listBox1.SelectedIndex;

            if (n == -1)
            {
                return;
            }
            BF2Level.SelectIndex(n);
            allowEdit = false;
            BF2LevelObject lo = BF2Level.objects[n];

            textBox1.Text   = lo.position.X.ToString();
            textBox2.Text   = lo.position.Y.ToString();
            textBox3.Text   = lo.position.Z.ToString();
            trackBar1.Value = NormRot(lo.rotation.X);
            trackBar2.Value = NormRot(lo.rotation.Y);
            trackBar3.Value = NormRot(lo.rotation.Z);
            bool enabled = true;

            if (lo.type == BF2LevelObject.BF2LOTYPE.Road)
            {
                enabled = false;
            }
            trackBar1.Enabled = trackBar2.Enabled = trackBar3.Enabled = enabled;
            StringBuilder sb = new StringBuilder();

            foreach (string s in lo.properties)
            {
                sb.AppendLine(s);
            }
            rtbProps.Text = sb.ToString();
            allowEdit     = true;
        }
Esempio n. 2
0
 private void pic3_MouseClick_1(object sender, MouseEventArgs e)
 {
     if (!isLoading && e.Button == System.Windows.Forms.MouseButtons.Right)
     {
         int idx = BF2Level.Process3DClick(e.X, e.Y);
         if (idx != -1)
         {
             listBox1.SelectedIndex = idx;
         }
     }
 }
Esempio n. 3
0
        private void cloneToolStripMenuItem_Click(object sender, EventArgs e)
        {
            int n = listBox1.SelectedIndex;

            if (n == -1)
            {
                return;
            }
            BF2Level.CloneEntry(n);
            listBox1.Items.Clear();
            RefreshTrees();
        }
Esempio n. 4
0
 private void RefreshTrees()
 {
     tv1.Nodes.Clear();
     tv1.Nodes.Add(BF2FileSystem.MakeFSTree());
     tv2.Nodes.Clear();
     tv2.Nodes.Add(BF2FileSystem.MakeFSTreeFiltered(new string[] { ".staticmesh", ".bundledmesh", ".skinnedmesh", ".collisionmesh" }));
     tv3.Nodes.Clear();
     tv3.Nodes.Add(BF2HUDLoader.MakeTree());
     listBox1.Items.Clear();
     foreach (string objname in BF2Level.MakeList())
     {
         listBox1.Items.Add(objname);
     }
 }
Esempio n. 5
0
        private void mountLevelToolStripMenuItem_Click(object sender, EventArgs e)
        {
            LevelSelect ls = new LevelSelect();

            ls.basepath = BF2FileSystem.basepath + "Levels\\";
            ls.ShowDialog();
            if (ls._exitOK)
            {
                mountLevelToolStripMenuItem.Enabled = false;
                isLoading       = true;
                consoleBox.Text = "";
                BF2FileSystem.Load();
                BF2FileSystem.LoadLevel(ls.result);
                BF2Level.engine = engineLevelExplorer;
                BF2Level.name   = ls.result;
                BF2Level.Load();
                Log.WriteLine("Done. Loaded " + (BF2FileSystem.clientFS.Count() + BF2FileSystem.serverFS.Count()) + " files");
                RefreshTrees();
                isLoading = false;
                saveChangesToolStripMenuItem.Enabled    =
                    mountLevelToolStripMenuItem.Enabled = true;
            }
        }
Esempio n. 6
0
 private void saveChangesToolStripMenuItem_Click(object sender, EventArgs e)
 {
     BF2Level.Save();
     MessageBox.Show("Done.");
 }