Exemplo n.º 1
0
 public void PokeStructure(EndianIO IO, int magic, bool onlyChanged)
 {
     //If the reflexive is enabled...
     if (comboChunks.Enabled)
     {
         //Obtain our offset for our chunk
         int chunkOffset = ReflexiveData.Pointer + (comboChunks.SelectedIndex * ReflexiveData.Size);
         //Save values.
         MetaEditorHandler.PokeValues(IO, pnlValues, chunkOffset, magic, onlyChanged);
     }
 }
Exemplo n.º 2
0
 public void BuildRTHData(RTHData RTH_Data, int magic, bool onlyChanged)
 {
     //If the reflexive is enabled...
     if (comboChunks.Enabled)
     {
         //Obtain our offset for our chunk
         int chunkOffset = ReflexiveData.Pointer + (comboChunks.SelectedIndex * ReflexiveData.Size);
         //Save values.
         MetaEditorHandler.BuildRTHData(RTH_Data, pnlValues, chunkOffset, magic, onlyChanged);
     }
 }
Exemplo n.º 3
0
 public void SaveStructure(HaloMap map, int parentOffset)
 {
     //If the reflexive is enabled...
     if (comboChunks.Enabled)
     {
         //Obtain our offset for our chunk
         int chunkOffset = ReflexiveData.Pointer + (comboChunks.SelectedIndex * ReflexiveData.Size);
         //Save values.
         MetaEditorHandler.SaveChangedValues(map, pnlValues, chunkOffset);
     }
 }
Exemplo n.º 4
0
 private void comboChunks_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (comboChunks.SelectedIndex >= 0)
     {
         //Try to..
         try
         {
             //Obtain our offset for our chunk
             int chunkOffset = ReflexiveData.Pointer + (comboChunks.SelectedIndex * ReflexiveData.Size);
             //Load values
             MetaEditorHandler.LoadPluginValues(Map, pnlValues, chunkOffset);
             //Close the IO
             Map.CloseIO();
         }
         //Incase of an error..
         catch
         {
             //Show our error
             MessageBox.Show("Could not load values for Reflexive/Structure: " + ReflexiveData.Name);
         }
     }
 }
Exemplo n.º 5
0
        private void chunkDataForAllChunksToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //Check our chunk data
            if (ChunkClipboard.Chunk == null)
            {
                MessageBox.Show("There is no copied chunk.");
            }

            //Check our name and size.
            if (ChunkClipboard.Name != ReflexiveData.Name | ChunkClipboard.Size != ReflexiveData.Size)
            {
                MessageBox.Show("This chunk does not belong to this reflexive.");
            }


            //Open our IO
            Map.OpenIO();
            for (int i = 0; i < ReflexiveData.ChunkCount; i++)
            {
                //Go to the chunk offset
                Map.IO.Out.BaseStream.Position = ReflexiveData.Pointer + (i * ReflexiveData.Size);

                //Write our data
                Map.IO.Out.Write(ChunkClipboard.Chunk);
            }

            //Obtain our offset for our chunk
            int chunkOffset = ReflexiveData.Pointer + (comboChunks.SelectedIndex * ReflexiveData.Size);

            //Load values
            MetaEditorHandler.LoadPluginValues(Map, pnlValues, chunkOffset);

            //Set all values as editted.
            MetaEditorHandler.SetAllAsEditted(Map, pnlValues, chunkOffset);

            //Close our IO.
            Map.CloseIO();
        }