public override void Core_OnOpen()
        {
            Palette_ArrayBox.ValueChanged              -= ArrayBox_ValueChanged;
            Tileset1_ArrayBox.ValueChanged             -= ArrayBox_ValueChanged;
            Tileset2_ArrayBox.ValueChanged             -= ArrayBox_ValueChanged;
            TilesetTSA_ArrayBox.ValueChanged           -= ArrayBox_ValueChanged;
            Terrain_Stat_PointerArrayBox.ValueChanged  -= Terrain_Stat_PointerArrayBox_ValueChanged;
            Terrain_Class_PointerArrayBox.ValueChanged -= Terrain_Class_PointerArrayBox_ValueChanged;
            TileAnim_ArrayBox.ValueChanged             -= TileAnim_ArrayBox_ValueChanged;

            Palette_ArrayBox.SelectFirstItem();
            Tileset1_ArrayBox.SelectFirstItem();
            Tileset2_ArrayBox.SelectFirstItem();
            TilesetTSA_ArrayBox.SelectFirstItem();
            Terrain_Stat_PointerArrayBox.SelectFirstItem();
            Terrain_Class_PointerArrayBox.SelectFirstItem();
            TileAnim_ArrayBox.SelectFirstItem();

            Palette_ArrayBox.ValueChanged              += ArrayBox_ValueChanged;
            Tileset1_ArrayBox.ValueChanged             += ArrayBox_ValueChanged;
            Tileset2_ArrayBox.ValueChanged             += ArrayBox_ValueChanged;
            TilesetTSA_ArrayBox.ValueChanged           += ArrayBox_ValueChanged;
            Terrain_Stat_PointerArrayBox.ValueChanged  += Terrain_Stat_PointerArrayBox_ValueChanged;
            Terrain_Class_PointerArrayBox.ValueChanged += Terrain_Class_PointerArrayBox_ValueChanged;
            TileAnim_ArrayBox.ValueChanged             += TileAnim_ArrayBox_ValueChanged;

            Core_Update();
        }
示例#2
0
        public MapEditor()
        {
            try
            {
                InitializeComponent();

                EntryArrayBox.Load("Chapter List.txt");
                Current         = new StructFile("Chapter Struct.txt");
                Current.Address = Core.GetPointer("Chapter Array");

                ArrayFile map_file = new ArrayFile("Map List.txt");
                MapData_ArrayBox.Load(map_file);
                Changes_ArrayBox.Load(map_file);
                TileAnim1_ArrayBox.Load(map_file);
                TileAnim2_ArrayBox.Load(map_file);
                Palette_ArrayBox.Load(map_file);
                TilesetTSA_ArrayBox.Load(map_file);
                Tileset1_ArrayBox.Load(map_file);
                Tileset2_ArrayBox.Load(map_file);

                Chapter_MagicButton.EditorToOpen = "Module:Chapter Editor";
            }
            catch (Exception ex)
            {
                Program.ShowError("Could not properly open the " + this.Text, ex);

                Core_CloseEditor(this, null);
            }
        }
        public MapTilesetEditor()
        {
            try
            {
                InitializeComponent();

                Terrain_ArrayBox.Load("Terrain List.txt");
                Terrain_Stat_PointerArrayBox.Load("Terrain Stat Pointers.txt");
                Terrain_Class_PointerArrayBox.Load("Terrain Move Cost Pointers.txt");

                string[] file;
                try
                {
                    file = File.ReadAllLines(Core.Path_Arrays + "Map List.txt");
                }
                catch (Exception ex)
                {
                    throw new Exception("Could not open the array file:\n" + Core.Path_Arrays + "Map List.txt", ex);
                }
                List <string> list_palettes  = new List <string>();
                List <string> list_tilesets  = new List <string>();
                List <string> list_tsa_array = new List <string>();
                List <string> list_tile_anim = new List <string>();
                foreach (string entry in file)
                {
                    if (entry == null || entry == "" || entry.Length < 10)
                    {
                        continue;
                    }
                    else
                    {
                        switch (entry.Substring(5, 5))
                        {
                        case "[PAL]": list_palettes.Add(entry); break;

                        case "[IMG]": list_tilesets.Add(entry); break;

                        case "[TSA]": list_tsa_array.Add(entry); break;

                        case "[ANM]": list_tile_anim.Add(entry); break;
                        }
                    }
                }
                ArrayFile palettes  = new ArrayFile(list_palettes.ToArray());
                ArrayFile tilesets  = new ArrayFile(list_tilesets.ToArray());
                ArrayFile tsa_array = new ArrayFile(list_tsa_array.ToArray());
                ArrayFile tile_anim = new ArrayFile(list_tile_anim.ToArray());

                Palette_ArrayBox.Load(palettes);
                Tileset1_ArrayBox.Load(tilesets);
                Tileset2_ArrayBox.Load(tilesets);
                TilesetTSA_ArrayBox.Load(tsa_array);
                TileAnim_ArrayBox.Load(tile_anim);

                Terrain_Name_MagicButton.EditorToOpen = "Text Editor";
            }
            catch (Exception ex)
            {
                Program.ShowError("Could not properly open the " + this.Text, ex);

                Core_CloseEditor(this, null);
            }
        }