コード例 #1
0
        public void initVisibilityEditor(bool isShadow, string fileName)
        {
            if (isShadow)
            {
                openVisibilityFile = null;
                byte[] bytes = File.ReadAllBytes(fileName);
                ChunkList           = LoadShadowVisibilityFile(Archive.FromONEFile(ref bytes));
                labelLoadedBLK.Text = "";
            }
            else
            {
                openVisibilityFile  = fileName;
                ChunkList           = loadHeroesVisibilityFile(openVisibilityFile);
                labelLoadedBLK.Text = "Loaded " + fileName;
            }

            numericCurrentChunk.Minimum = 1;
            numericCurrentChunk.Maximum = ChunkList.Count();
            numericCurrentChunk.Value   = ChunkList.Count();
            if (numericCurrentChunk.Maximum != 0)
            {
                numericCurrentChunk.Value = 1;
            }

            labelChunkAmount.Text = "Amount: " + ChunkList.Count();
        }
コード例 #2
0
        private void importToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFile = new OpenFileDialog()
            {
                Filter = "All supported files|*.bin;*.bdt|BIN files|*.bin|BDT files|*.bdt"
            };

            if (openFile.ShowDialog() == DialogResult.OK)
            {
                if (Path.GetExtension(openFile.FileName).ToLower() == ".bdt")
                {
                    ChunkList.AddRange(LoadShadowVisibilityFile(new FileStream(openFile.FileName, FileMode.Open)));
                }
                else if (Path.GetExtension(openFile.FileName).ToLower() == ".bin")
                {
                    ChunkList.AddRange(loadHeroesVisibilityFile(openFile.FileName));
                }

                numericCurrentChunk.Minimum = 1;
                numericCurrentChunk.Maximum = ChunkList.Count();
                numericCurrentChunk.Value   = ChunkList.Count();
                if (numericCurrentChunk.Maximum != 0)
                {
                    numericCurrentChunk.Value = 1;
                }

                labelChunkAmount.Text = "Amount: " + ChunkList.Count();
            }
        }
コード例 #3
0
        // BLK Editor

        private void newToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            openVisibilityFile = null;
            ChunkList.Clear();
            numericCurrentChunk.Maximum = ChunkList.Count();
            labelChunkAmount.Text       = "Amount: " + ChunkList.Count();
            labelLoadedBLK.Text         = "No BLK loaded";
        }
コード例 #4
0
        private void buttonRemoveChunk_Click(object sender, EventArgs e)
        {
            if (ChunkList.Count > 0)
            {
                ChunkList.RemoveAt((int)numericCurrentChunk.Value - 1);
            }

            numericCurrentChunk.Maximum = ChunkList.Count();
            labelChunkAmount.Text       = "Amount: " + ChunkList.Count();
            numericCurrentChunk_ValueChanged(new object(), new EventArgs());
        }
コード例 #5
0
        private void buttonAddChunkClick(object sender, EventArgs e)
        {
            Chunk NewChunk = new Chunk();

            NewChunk.CalculateModel();
            ChunkList.Add(NewChunk);
            numericCurrentChunk.Minimum = 1;
            numericCurrentChunk.Maximum = ChunkList.Count();
            numericCurrentChunk.Value   = ChunkList.Count();
            labelChunkAmount.Text       = "Amount: " + ChunkList.Count();
        }