Skip to content

Commit f24a7ac

Browse files
committed
Warn for wrong levels.xml path
1 parent b12beac commit f24a7ac

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

hw2a000ff/FormMain.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ private void buttonBrowseLevelsXml_Click(object sender, EventArgs e)
123123
{
124124
var ofd = new OpenFileDialog();
125125
ofd.Title = "Locate levels.xml";
126-
ofd.Filter = "Levels file (levels.xml)|levels.xml";
126+
ofd.Filter = "Levels file|levels.xml";
127127
if (ofd.ShowDialog() != DialogResult.OK) {
128128
return;
129129
}
@@ -142,6 +142,11 @@ private void buttonConvert_Click(object sender, EventArgs e)
142142
return;
143143
}
144144

145+
if (textLevelsXmlPath.Text != "" && !textLevelsXmlPath.Text.EndsWith("levels.xml")) {
146+
MessageBox.Show("You picked an invalid path for the levels.xml file.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
147+
return;
148+
}
149+
145150
if (!textSourcePath.Text.EndsWith("\\")) {
146151
textSourcePath.Text += "\\";
147152
}

0 commit comments

Comments
 (0)