OpenBVE
OpenBVE copied to clipboard
At the main menu, train and folder's icon is not display from 1.8.2.0.
Description
When I run OpenBVE, the train icon and folder icons are not display.
1.8.1.0

1.8.2.0

And it seems that the train's Detail's Description string is not display.
I checked some daily-builds. OpenBVE-2021-07-16.zip can display icon. But, OpenBVE-2021-07-20.zip do not display any icons. So I think that this issue happen from 2021.7.20.
Reproduction
This issue happens at OpenBVE's main program's. so no need any data.
Route
This issue happens at OpenBVE's main program's. so no need any data.
Train
This issue happens at OpenBVE's main program's. so no need any data.
Logs
This issue is not crash so no output any logs.
Related information
My PC's spec: OS:Ubuntu 20.04 LTS 64bit CPU:AMD® Ryzen 7 2700x eight-core processor × 16 Memory:31.3GB Graphic:AMD Radeon RX 590 Series (POLARIS10, DRM 3.40.0, 5.11.0-40-generic, LLVM 12.0.0)
I can't reproduce this directly, but have found a similar issue (train details not always updating) Have made a change to sort this- Please see if it helps.
At the newest daily build, only train icon is not shown.
The another Icons, route and route area's folder icons are display perfect again!
At the train's icon has been not displayed.
At the 'folder' icon has been displayed.

I checked by monodevelop.
At the Ubuntu, I think that from the formMain.cs's line 262, TrainIcon and DiskIcon can't load.
ParentIcon and FolderIcon are can load and set to System.Drawing.Bitmap.
So, I think that we have to find that why the TrainIcon and DiskIcon can't add to 'listViewTrainPackages.SmallImageList.Images.Add' fails.

TrainIcon and DiskIcon are loaded from LoadImage method in formMain.cs https://github.com/leezer3/OpenBVE/blob/4f1b51122f285e804d0586366b8ad6e029480637/source/OpenBVE/UserInterface/formMain.cs#L1617
From the code, it would only return null when:
- The image is not found
- An exception when loading the image file
You can probably check from there on what the exception is (My best guess is probably some sort of permission error, I can't reproduce anything on my end)
Not likely to be either unfortunately.
Unfortunately Mono's WinForms implementation is basically abandoned at this point, and can be temperamental to say the least. I've never been able to reliably reproduce this or any of the other related glitches that pop up from time to time. It's most likely to be a race condition somewhere internal to the Mono WinForms stack (disk access is a good educated guess) as fiddling with the timing of things has helped in the past.
Will try & repro again, but as this is machine specific, whether anything can be done, dunno :/