void Core_LoadScreen() { try { byte[] tileset = Core.ReadData(Core.GetPointer("Battle Screen Tileset"), 0); byte[] palettes = Core.ReadData(Core.GetPointer("Battle Screen Palettes"), 4 * Palette.LENGTH); TSA_Array tsa = Core.ReadTSA(Core.GetPointer("Battle Screen TSA"), 16, 32, false, false); CurrentScreen = new BattleScreen( palettes, tileset, BattleScreen.GetReadibleTSA(tsa), new Tileset(Core.ReadData(Core.GetPointer("Battle Screen L Name"), 0)), new Tileset(Core.ReadData(Core.GetPointer("Battle Screen L Weapon"), 0)), new Tileset(Core.ReadData(Core.GetPointer("Battle Screen R Name"), 0)), new Tileset(Core.ReadData(Core.GetPointer("Battle Screen R Weapon"), 0))); Screen_GridBox.Load(CurrentScreen); Screen_PaletteBox.Load(new Palette(palettes, 4 * Palette.MAX)); } catch (Exception ex) { Program.ShowError("Could not load the battle platform image.", ex); Screen_GridBox.Reset(); Screen_PaletteBox.Reset(); } }
void Core_LoadScreenValues() { Screen_TileIndex_NumBox.ValueChanged -= Screen_Tile_NumBox_ValueChanged; Screen_Palette_NumBox.ValueChanged -= Screen_Palette_NumBox_ValueChanged; Screen_FlipH_CheckBox.CheckedChanged -= Screen_FlipH_CheckBox_CheckedChanged; Screen_FlipV_CheckBox.CheckedChanged -= Screen_FlipV_CheckBox_CheckedChanged; try { if (Screen_GridBox.SelectionIsEmpty()) { Screen_TileIndex_NumBox.Enabled = false; Screen_Palette_NumBox.Enabled = false; Screen_FlipH_CheckBox.Enabled = false; Screen_FlipV_CheckBox.Enabled = false; Screen_TileIndex_NumBox.Value = 0; Screen_Palette_NumBox.Value = 0; Screen_FlipH_CheckBox.Checked = false; Screen_FlipV_CheckBox.Checked = false; Screen_TileIndex_NumBox.Text = Screen_TileIndex_NumBox.Value.ToString(); Screen_Palette_NumBox.Text = Screen_Palette_NumBox.Value.ToString(); } else { Screen_TileIndex_NumBox.Enabled = true; Screen_Palette_NumBox.Enabled = true; Screen_FlipH_CheckBox.Enabled = true; Screen_FlipV_CheckBox.Enabled = true; if (Screen_GridBox.SelectionIsSingle()) { Point selection = Screen_GridBox.GetSelectionCoords(); TSA tsa = CurrentScreen.Tiling[selection.X, selection.Y]; Screen_TileIndex_NumBox.Value = tsa.TileIndex; Screen_Palette_NumBox.Value = tsa.Palette; Screen_FlipH_CheckBox.Checked = tsa.FlipH; Screen_FlipV_CheckBox.Checked = tsa.FlipV; Screen_TileIndex_NumBox.Text = Screen_TileIndex_NumBox.Value.ToString(); Screen_Palette_NumBox.Text = Screen_Palette_NumBox.Value.ToString(); } else { Screen_TileIndex_NumBox.Text = ""; Screen_Palette_NumBox.Text = ""; Screen_FlipH_CheckBox.Checked = false; Screen_FlipV_CheckBox.Checked = false; } } } catch (Exception ex) { Program.ShowError("There has been an error while trying to load the Battle Screen Frame TSA values.", ex); } Screen_TileIndex_NumBox.ValueChanged += Screen_Tile_NumBox_ValueChanged; Screen_Palette_NumBox.ValueChanged += Screen_Palette_NumBox_ValueChanged; Screen_FlipH_CheckBox.CheckedChanged += Screen_FlipH_CheckBox_CheckedChanged; Screen_FlipV_CheckBox.CheckedChanged += Screen_FlipV_CheckBox_CheckedChanged; }