Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Request] Alphabetical sorting for file browsers in OpenBVE and viewer tools #1080

Open
alex-wenzel opened this issue Oct 20, 2024 · 3 comments

Comments

@alex-wenzel
Copy link

Most of the time, files aren't too difficult to find in OpenBVE itself given that most routes ship with a very small number of CSV files. However, using ObjectViewer with large object collections or trying to open some routes like the NWM Open collection, which mixes in a few hundred txt files defining various modular behaviors in the same folder as the route CSV files, can be time consuming because the files are in what appears to be a random order and span several pages of the file browser.

I'm tentatively willing to self-assign this since it's a good first issue for someone who hasn't worked with a C# project since they were first learning to code 15 years ago, but I haven't succeeded in building a working OpenBVE executable from source on my M1 MacBook yet.

@leezer3
Copy link
Owner

leezer3 commented Oct 21, 2024

Now that's a good point.

The order is actually whatever the filesystem is returning under the default sort rules. I suspect it it'll be alphabetically sorting on the string up-to the first space, but that's just a semi-educated guess.

I've just added testing as to whether files are valid to the GL menu (this existed in the 'classic' menu already), which should solve showing most junk files.

Sorting itself shouldn't be too difficult (...) might just require a little more thought from you or me to deal with it, as there's currently no provision in the GL menu system to re-order items at all, although I think it should be simple enough.
A classic invert sort order arrow in the header for file lists I think would be relatively easy to implement, not sure off the top of my head about anything more complex.

@alex-wenzel
Copy link
Author

That makes sense. I noticed that accidentally clicking on one of the non-route txt files in the NWM routes folders causes OpenBVE to freeze with an infinite color wheel that can only be terminated from Activity Monitor (on my M1 Mac), so filtering the files that are un-parsable should both improve navigation and prevent crashes like that.

I think sorting may be worth considering for ObjectViewer since the paradigm there is to have large numbers of relevant files all within the same folder.

@leezer3
Copy link
Owner

leezer3 commented Oct 24, 2024

OK, that's odd.

It doesn't do that on Windows. I'll have to try and test with the Hackintosh and see if that reproduces.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants