More fixes [overworld sprite finder]

This commit is contained in:
AdAstra-LD
2021-02-09 20:13:02 +01:00
parent f679b9deaa
commit eb4c4da0f7
2 changed files with 5 additions and 2 deletions

View File

@@ -4503,10 +4503,11 @@ namespace DSPRE {
if (index > -1) {
try {
selectedEvent = currentEvFile.overworlds[index];
Overworld selectedOw = (Overworld)selectedEvent;
/* Sprite index and image controls */
owSpriteComboBox.SelectedIndex = ((Overworld)selectedEvent).overlayTableEntry;
owSpritePictureBox.BackgroundImage = GetOverworldImage(currentEvFile.overworlds[index].overlayTableEntry, currentEvFile.overworlds[index].orientation);
owSpriteComboBox.SelectedIndex = Array.IndexOf(RomInfo.overworldTableKeys, selectedOw.overlayTableEntry);
owSpritePictureBox.BackgroundImage = GetOverworldImage(selectedOw.overlayTableEntry, selectedOw.orientation);
} catch (ArgumentOutOfRangeException) {
String errorMsg = "This Overworld's sprite ID couldn't be read correctly.";
MessageBox.Show(errorMsg, "Something went wrong", MessageBoxButtons.OK, MessageBoxIcon.Error);

View File

@@ -60,6 +60,7 @@ namespace DSPRE {
public static Dictionary<ushort, string> ScriptCommandNamesDict { get; private set; }
public static Dictionary<ushort, byte[]> CommandParametersDict { get; private set; }
public static SortedDictionary<uint, (uint spriteID, ushort properties)> OverworldTable { get; private set; }
public static uint[] overworldTableKeys { get; private set; }
#region Constructors (1)
public RomInfo(string id, string workDir) {
@@ -588,6 +589,7 @@ namespace DSPRE {
}
break;
}
overworldTableKeys = OverworldTable.Keys.ToArray();
}
#endregion
}