public MapSpriteEditor() { InitializeComponent(); try { Idle_EntryArrayBox.Load("Map Sprite List.txt"); Move_EntryArrayBox.Load("Class List.txt"); CurrentIdle = new StructFile("Map Sprite Idle Struct.txt"); CurrentMove = new StructFile("Map Sprite Move Struct.txt"); CurrentIdle.Address = Core.GetPointer("Map Sprite Idle Array"); CurrentMove.Address = Core.GetPointer("Map Sprite Move Array"); PaletteArrayBox.Load("Map Sprite Palettes.txt"); Idle_Size_ComboBox.DataSource = new KeyValuePair <string, byte>[3] { new KeyValuePair <string, byte>("16x16", 0x00), new KeyValuePair <string, byte>("16x32", 0x01), new KeyValuePair <string, byte>("32x32", 0x02) }; Idle_Size_ComboBox.ValueMember = "Value"; Idle_Size_ComboBox.DisplayMember = "Key"; CurrentPalette = Core.ReadPalette(Core.CurrentROM.Address_MapSpritePalettes(), GBA.Palette.LENGTH); Test_PaletteBox.Load(CurrentPalette); } catch (Exception ex) { Program.ShowError("Could not properly open the " + this.Text, ex); Core_CloseEditor(this, null); } }
void Core_LoadPalette() { try { CurrentPalette = Core.ReadPalette(CurrentPaletteAddress, GBA.Palette.LENGTH); Test_PaletteBox.Load(CurrentPalette); } catch (Exception ex) { Program.ShowError("Could not load the palette.", ex); Test_PaletteBox.Reset(); } }