override public void Core_Update() { Pointer[] pointers = new Pointer[4] { Core.GetPointer("Small World Map Tileset"), Core.GetPointer("Small World Map Palette"), Core.GetPointer("Large World Map Tileset"), Core.GetPointer("Large World Map Palette"), }; try { Core_LoadValues(pointers); } catch (Exception ex) { Program.ShowError("Could not properly load world map pointers.", ex); } try { CurrentSmallMap = new WorldMap_FE6_Small( pointers[SMALLMAP_PALETTE], pointers[SMALLMAP_TILESET]); SmallMap_ImageBox.Load(CurrentSmallMap); SmallMap_PaletteBox.Load(CurrentSmallMap.Colors); } catch (Exception ex) { Program.ShowError("Could not load the small World Map.", ex); SmallMap_ImageBox.Reset(); SmallMap_PaletteBox.Reset(); } try { CurrentLargeMap = new WorldMap_FE6_Large( pointers[LARGEMAP_PALETTE], pointers[LARGEMAP_TILESET]); LargeMap_ImageBox.Load(CurrentLargeMap); LargeMap_PaletteBox.Load(CurrentLargeMap.Graphics[0].Colors); } catch (Exception ex) { Program.ShowError("Could not load the large World Map.", ex); LargeMap_ImageBox.Reset(); LargeMap_PaletteBox.Reset(); } }
void Core_WriteSmallMap(string path) { try { CurrentSmallMap = new WorldMap_FE6_Small(path); } catch (Exception ex) { Program.ShowError("Could not insert the image.", ex); return; } byte[] data_palette = CurrentSmallMap.Colors.ToBytes(true); byte[] data_tileset = LZ77.Compress(CurrentSmallMap.ToBytes()); Core.SuspendUpdate(); bool cancel = Prompt.ShowRepointDialog(this, "Repoint Small World Map", "The different parts of this image may need to be repointed upon insertion.", CurrentEntry(true), new Tuple <string, Pointer, int>[] { Tuple.Create("Palette", Core.GetPointer("Small World Map Palette"), data_palette.Length), Tuple.Create("Tileset", Core.GetPointer("Small World Map Tileset"), data_tileset.Length) }); if (cancel) { return; } Core.WriteData(this, Core.GetPointer("Small World Map Palette"), data_palette, CurrentEntry(true) + "Palette changed"); Core.WriteData(this, Core.GetPointer("Small World Map Tileset"), data_tileset, CurrentEntry(true) + "Tileset changed"); Core.ResumeUpdate(); Core.PerformUpdate(); }