Beispiel #1
0
        void Space_OKButton_Click(object sender, EventArgs e)
        {
            string mark = Space_MarkAsComboBox.SelectedItem.ToString();

            GBA.Pointer address = Space_AddressBox.Value;
            GBA.Pointer endbyte = Space_EndByteBox.Value;
            int         length  = (int)Space_LengthBox.Value;

            if ((Space_EndByteLabel.Checked && (endbyte <= address)) || (Space_LengthLabel.Checked && length <= 0))
            {
                Program.ShowMessage("Marked space can't be of null or negative length.");
                Space_AddressBox.ResetText();
                Space_EndByteBox.ResetText();
                Space_LengthBox.ResetText();
                return;
            }

            if (mark == "(unmark)")
            {
                if (Space_EndByteLabel.Checked)
                {
                    Program.Core.FEH.Space.UnmarkSpace(address, endbyte);
                }
                else
                {
                    Program.Core.FEH.Space.UnmarkSpace(address, address + length);
                }
            }
            else
            {
                if (Space_EndByteLabel.Checked)
                {
                    Program.Core.FEH.Space.MarkSpace(mark, address, endbyte);
                }
                else
                {
                    Program.Core.FEH.Space.MarkSpace(mark, address, address + length);
                }
            }
            Space_AddressBox.ResetText();
            Space_EndByteBox.ResetText();
            Space_LengthBox.ResetText();

            Space_AddressBox.Focus();

            Core_Update();
        }
Beispiel #2
0
        void Core_LoadValues()
        {
            MapData_ArrayBox.ValueChanged    -= MapData_ArrayBox_ValueChanged;
            Changes_ArrayBox.ValueChanged    -= Changes_ArrayBox_ValueChanged;
            TileAnim1_ArrayBox.ValueChanged  -= TileAnim1_ArrayBox_ValueChanged;
            TileAnim2_ArrayBox.ValueChanged  -= TileAnim2_ArrayBox_ValueChanged;
            Palette_ArrayBox.ValueChanged    -= Palette_ArrayBox_ValueChanged;
            TilesetTSA_ArrayBox.ValueChanged -= TilesetTSA_ArrayBox_ValueChanged;
            Tileset1_ArrayBox.ValueChanged   -= Tileset1_ArrayBox_ValueChanged;
            Tileset2_ArrayBox.ValueChanged   -= Tileset2_ArrayBox_ValueChanged;

            MapData_PointerBox.ValueChanged    -= MapData_PointerBox_ValueChanged;
            Changes_PointerBox.ValueChanged    -= Changes_PointerBox_ValueChanged;
            TileAnim1_PointerBox.ValueChanged  -= TileAnim1_PointerBox_ValueChanged;
            TileAnim2_PointerBox.ValueChanged  -= TileAnim2_PointerBox_ValueChanged;
            Palette_PointerBox.ValueChanged    -= Palette_PointerBox_ValueChanged;
            TilesetTSA_PointerBox.ValueChanged -= TilesetTSA_PointerBox_ValueChanged;
            Tileset1_PointerBox.ValueChanged   -= Tileset1_PointerBox_ValueChanged;
            Tileset2_PointerBox.ValueChanged   -= Tileset2_PointerBox_ValueChanged;

            try
            {
                MapData_ArrayBox.Value    = (byte)Current["Map"];
                Changes_ArrayBox.Value    = (byte)Current["MapChanges"];
                TileAnim1_ArrayBox.Value  = (byte)Current["TileAnim1"];
                TileAnim2_ArrayBox.Value  = (byte)Current["TileAnim2"];
                Palette_ArrayBox.Value    = (byte)Current["Palette"];
                TilesetTSA_ArrayBox.Value = (byte)Current["TSA"];
                Tileset1_ArrayBox.Value   = (byte)Current["Tileset1"];
                Tileset2_ArrayBox.Value   = (byte)Current["Tileset2"];

                GBA.Pointer address = Core.GetPointer("Map Data Array");
                MapData_PointerBox.Value    = Core.ReadPointer(address + 4 * MapData_ArrayBox.Value);
                Changes_PointerBox.Value    = Core.ReadPointer(address + 4 * Changes_ArrayBox.Value);
                TileAnim1_PointerBox.Value  = Core.ReadPointer(address + 4 * TileAnim1_ArrayBox.Value);
                TileAnim2_PointerBox.Value  = Core.ReadPointer(address + 4 * TileAnim2_ArrayBox.Value);
                Palette_PointerBox.Value    = Core.ReadPointer(address + 4 * Palette_ArrayBox.Value);
                TilesetTSA_PointerBox.Value = Core.ReadPointer(address + 4 * TilesetTSA_ArrayBox.Value);
                Tileset1_PointerBox.Value   = Core.ReadPointer(address + 4 * Tileset1_ArrayBox.Value);
                Tileset2_PointerBox.Value   = Core.ReadPointer(address + 4 * Tileset2_ArrayBox.Value);
            }
            catch (Exception ex)
            {
                Program.ShowError("There has been an error while trying to load the values.", ex);
            }

            MapData_ArrayBox.ValueChanged    += MapData_ArrayBox_ValueChanged;
            Changes_ArrayBox.ValueChanged    += Changes_ArrayBox_ValueChanged;
            TileAnim1_ArrayBox.ValueChanged  += TileAnim1_ArrayBox_ValueChanged;
            TileAnim2_ArrayBox.ValueChanged  += TileAnim2_ArrayBox_ValueChanged;
            Palette_ArrayBox.ValueChanged    += Palette_ArrayBox_ValueChanged;
            TilesetTSA_ArrayBox.ValueChanged += TilesetTSA_ArrayBox_ValueChanged;
            Tileset1_ArrayBox.ValueChanged   += Tileset1_ArrayBox_ValueChanged;
            Tileset2_ArrayBox.ValueChanged   += Tileset2_ArrayBox_ValueChanged;

            MapData_PointerBox.ValueChanged    += MapData_PointerBox_ValueChanged;
            Changes_PointerBox.ValueChanged    += Changes_PointerBox_ValueChanged;
            TileAnim1_PointerBox.ValueChanged  += TileAnim1_PointerBox_ValueChanged;
            TileAnim2_PointerBox.ValueChanged  += TileAnim2_PointerBox_ValueChanged;
            Palette_PointerBox.ValueChanged    += Palette_PointerBox_ValueChanged;
            TilesetTSA_PointerBox.ValueChanged += TilesetTSA_PointerBox_ValueChanged;
            Tileset1_PointerBox.ValueChanged   += Tileset1_PointerBox_ValueChanged;
            Tileset2_PointerBox.ValueChanged   += Tileset2_PointerBox_ValueChanged;

            Chapter_MagicButton.EntryToSelect = EntryArrayBox.Value;
        }