Exemplo n.º 1
0
        override public void Core_Update()
        {
            Pointer[] pointers = new Pointer[6]
            {
                Core.GetPointer("Small World Map Tileset"),
                Core.GetPointer("Small World Map Palette"),
                Core.GetPointer("Small World Map TSA"),
                Core.GetPointer("Large World Map Tileset"),
                Core.GetPointer("Large World Map Palette"),
                Core.GetPointer("Large World Map TSA"),
            };

            try
            {
                Core_LoadValues(pointers);
            }
            catch (Exception ex)
            {
                Program.ShowError("Could not properly load world map pointers.", ex);
            }

            try
            {
                CurrentSmallMap = new WorldMap_FE7_Small(
                    pointers[SMALLMAP_PALETTE],
                    pointers[SMALLMAP_TILESET],
                    pointers[SMALLMAP_TSA]);
                SmallMap_ImageBox.Load(CurrentSmallMap);
                SmallMap_PaletteBox.Load(Palette.Merge(CurrentSmallMap.Palettes));
            }
            catch (Exception ex)
            {
                Program.ShowError("Could not load the small World Map.", ex);
                SmallMap_ImageBox.Reset();
                SmallMap_PaletteBox.Reset();
            }

            try
            {
                CurrentLargeMap = new WorldMap_FE7_Large(
                    pointers[LARGEMAP_PALETTE],
                    pointers[LARGEMAP_TILESET],
                    pointers[LARGEMAP_TSA]);
                LargeMap_ImageBox.Load(CurrentLargeMap);
                LargeMap_PaletteBox.Load(Palette.Merge(CurrentLargeMap.Palettes));
            }
            catch (Exception ex)
            {
                Program.ShowError("Could not load the large World Map.", ex);
                LargeMap_ImageBox.Reset();
                LargeMap_PaletteBox.Reset();
            }
        }
Exemplo n.º 2
0
        void Core_InsertLargeMap(string filepath)
        {
            try
            {
                Palette palette = Core.FindPaletteFile(filepath);

                CurrentLargeMap = new WorldMap_FE7_Large(filepath, palette);
            }
            catch (Exception ex)
            {
                Program.ShowError("Could not insert the Large World Map image.", ex); return;
            }

            Core.SuspendUpdate();

            for (int i = 0; i < 12; i++)
            {
                Core.WriteData(this,
                               Core.ReadPointer(LargeMap_Tileset_PointerBox.Value + i * 4),
                               CurrentLargeMap.Graphics[i].ToBytes(false),
                               CurrentEntry(false) + "Graphics " + i + " changed");

                Core.WriteData(this,
                               Core.ReadPointer(LargeMap_TSA_PointerBox.Value + i * 4),
                               CurrentLargeMap.TSA_Sections[i].ToBytes(false, true),
                               CurrentEntry(false) + "TSA " + i + " changed");
            }

            Core.WriteData(this,
                           LargeMap_Palette_PointerBox.Value,
                           Palette.Merge(CurrentLargeMap.Palettes).ToBytes(false),
                           CurrentEntry(false) + "Palette changed");

            Core.ResumeUpdate();
            Core.PerformUpdate();
        }