Minor update

Fixed minor bug with OW IDs [event editor]
added two more movements to dictionary
improved accuracy of error detection [script editor]
This commit is contained in:
AdAstra-LD
2021-02-07 05:05:31 +01:00
parent e997891285
commit 71a52affe4
4 changed files with 23 additions and 7 deletions

View File

@@ -4649,13 +4649,11 @@ namespace DSPRE {
private void owIDNumericUpDown_ValueChanged(object sender, EventArgs e) {
if (disableHandlers || overworldsListBox.SelectedIndex < 0)
return;
if (currentEventFile.overworlds.Any() && overworldsListBox.SelectedIndex > 0)
currentEventFile.overworlds[overworldsListBox.SelectedIndex].owID = (ushort)owIDNumericUpDown.Value;
currentEventFile.overworlds[overworldsListBox.SelectedIndex].owID = (ushort)owIDNumericUpDown.Value;
}
private void owMovementComboBox_SelectedIndexChanged(object sender, EventArgs e) {
if (disableHandlers || overworldsListBox.SelectedIndex < 0)
return;
currentEventFile.overworlds[overworldsListBox.SelectedIndex].movement = (ushort)owMovementComboBox.SelectedIndex;
}
private void owOrientationComboBox_SelectedIndexChanged(object sender, EventArgs e) {
@@ -5933,7 +5931,11 @@ namespace DSPRE {
if (disableHandlers)
return;
if (e.RowIndex > -1)
currentTextArchive.messages[e.RowIndex] = textEditorDataGridView.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString();
try {
currentTextArchive.messages[e.RowIndex] = textEditorDataGridView.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString();
} catch (NullReferenceException) {
currentTextArchive.messages[e.RowIndex] = "";
}
}
private void textSearchResultsListBox_GoToEntryResult(object sender, MouseEventArgs e) {
if (textSearchResultsListBox.SelectedIndex < 0)

View File

@@ -52,9 +52,15 @@ namespace DSPRE.ROMFiles {
try {
id = UInt16.Parse(nameParts[0], NumberStyles.HexNumber, CultureInfo.InvariantCulture);
} catch (FormatException) {
string details;
if (wholeLine.Contains('@')) {
details = "Perhaps you forgot to End the Action above it...?";
} else {
details = "Are you sure it's a proper Action Command?";
}
MessageBox.Show("This Script file could not be saved." +
Environment.NewLine + "Parser failed to interpret line " + lineNumber + ": \"" + wholeLine + "\"." +
Environment.NewLine + "\nAre you sure it's a proper Action Command?", "Parser error", MessageBoxButtons.OK, MessageBoxIcon.Error);
Environment.NewLine + "\n" + details, "Parser error", MessageBoxButtons.OK, MessageBoxIcon.Error);
id = UInt16.MaxValue;
return;
}

View File

@@ -93,9 +93,15 @@ namespace DSPRE.ROMFiles {
try {
id = UInt16.Parse(nameParts[0], NumberStyles.HexNumber, CultureInfo.InvariantCulture);
} catch (FormatException) {
string details;
if (wholeLine.Contains('@')) {
details = "Perhaps you forgot to End the Script or Function above it...?";
} else {
details = "Are you sure it's a proper Script Command?";
}
MessageBox.Show("This Script file could not be saved." +
Environment.NewLine + "Parser failed to interpret line " + lineNumber + ": \"" + wholeLine + "\"." +
Environment.NewLine + "\nAre you sure it's a proper Script Command?", "Parser error", MessageBoxButtons.OK, MessageBoxIcon.Error);
Environment.NewLine + "\n" + details, "Parser error", MessageBoxButtons.OK, MessageBoxIcon.Error);
id = UInt16.MaxValue;
return;
}

View File

@@ -629,10 +629,12 @@ namespace DSPRE.Resources {
[0x003A] = "JumpLeft2",
[0x003B] = "JumpRight2",
[0x0045] = "WaitDisappear",
[0x0047] = "LockDir",
[0x0048] = "ReleaseDir",
[0x004B] = "Exclamation",
[0x004C] = "WaitWalkUpSlow",
[0x004D] = "WaitWalkDownSlow",
[0x004E] = "WaitWalkLeftSlow",
[0x004E] = "WaitWalkLeftSlow",//Seems to make the player run in HGSS?
[0x004F] = "WaitWalkRightSlow",
[0x0050] = "WaitWalkUp",
[0x0051] = "WaitWalkDown",