Skip to content

Commit

Permalink
Merge branch 'master' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
leezer3 committed May 18, 2024
2 parents f2b5420 + f38b13b commit 6a72844
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 3 deletions.
7 changes: 7 additions & 0 deletions source/CarXMLConvertor/TabbedList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ internal void Add(string Line)
}
switch (Line[i])
{
case '!':
if (Line[i - 1] == '<')
{
// comment
decreaseTabs = true;
}
break;
case '<':
//If we find a second opening symbol in our line, it's a single-line declaration
found = true;
Expand Down
4 changes: 4 additions & 0 deletions source/OpenBVE/System/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,10 @@ private static void Main(string[] args) {
}
if (System.IO.Directory.Exists(folder)) {
file = Path.CombineFile(folder, "train.dat");
if (!System.IO.File.Exists(file))
{
file = Path.CombineFile(folder, "train.xml");
}
if (System.IO.File.Exists(file)) {
result.TrainFolder = folder;
result.TrainEncoding = System.Text.Encoding.UTF8;
Expand Down
16 changes: 15 additions & 1 deletion source/OpenBVE/UserInterface/formMain.Start.cs
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,8 @@ private bool isInvalidDatName(string fileName)
case "s80_text.dat": //S80 Mechanik routefile sounds
case "s80_snd.dat": //S80 Mechanik routefile textures
case "gensc.dat": //Mechanik route generator (?)
case "scenerio.dat": //Mechanik route generator (?)
case "scenerio.dat": //Mechanik route generator (?)
case "ntuser.dat": //Windows user file
return true;
default:
return false;
Expand Down Expand Up @@ -735,6 +736,10 @@ private void populateTrainList(string Folder, ListView listView, bool packages)
{
string File = Path.CombineFile(Folders[i], "train.dat");
ListViewItem Item = listView.Items.Add(folderName);
if (!System.IO.File.Exists(File))
{
File = Path.CombineFile(Folders[i], "train.xml");
}
Item.ImageKey = System.IO.File.Exists(File) ? "train" : "folder";
Item.Tag = Folders[i];
}
Expand Down Expand Up @@ -781,6 +786,11 @@ private void listviewTrainFolders_SelectedIndexChanged(object sender, EventArgs
try
{
string File = Path.CombineFile(t, "train.dat");
if (!System.IO.File.Exists(File))
{
File = Path.CombineFile(t, "train.xml");
}

if (System.IO.File.Exists(File))
{
Result.TrainFolder = t;
Expand Down Expand Up @@ -942,6 +952,10 @@ private void listViewTrainPackages_SelectedIndexChanged(object sender, EventArgs
try
{
string File = Path.CombineFile(t, "train.dat");
if (!System.IO.File.Exists(File))
{
File = Path.CombineFile(t, "train.xml");
}
if (System.IO.File.Exists(File))
{
Result.TrainFolder = t;
Expand Down
4 changes: 2 additions & 2 deletions source/OpenBveApi/Objects/ObjectTypes/AnimatedObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,7 @@ public void Reverse(bool Interior = false)
{
if (a is null)
{
return !(b is null);
return b is null;
}
return a.Equals(b);
}
Expand All @@ -890,7 +890,7 @@ public void Reverse(bool Interior = false)
{
if (a is null)
{
return b is null;
return !(b is null);
}
return !a.Equals(b);
}
Expand Down

0 comments on commit 6a72844

Please sign in to comment.