-
-
Notifications
You must be signed in to change notification settings - Fork 504
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
Editor: --edit-level now also takes an absolute path #1835
base: master
Are you sure you want to change the base?
Conversation
Tested; works as described. I'd recommend it takes only a relative path as argument, to avoid name clashes - if someone wants to test a few levels in a folder and a path for a level happens to clash with one in the data folder, the behavior might seem weird for someone who doesn't read the docs regularly. Giving priority to relative paths would be better, but it could still grab paths that don't exist. Was there a particular reason to make it take a path starting from the data directory in the first place? As a CLI user, I find it more intuitive to enter either an absolute path or a relative path from the current directory. Also, paths from the data directory don't support autocomplete. |
Still need to fix the shadowing issue. |
@Semphriss Can you please specify in what order we should check paths? My suggestion would be: You concur? |
I'd propose only absolute/relative from CWD; testing multiple paths might be confusing for users when paths clash. If we really need to have both options available, it would be wise to let the user specify their preference with a CLI flag, to avoid making certain level files unplayable under certain circumstances. |
38a5bc5
to
e0f5200
Compare
@@ -115,6 +116,7 @@ CommandLineArguments::print_help(const char* arg0) const | |||
<< _("Game Options:") << "\n" | |||
<< _(" --edit-level Open given level in editor") << "\n" | |||
<< _(" --resave Loads given level and saves it") << "\n" | |||
<< _(" --from-datadir Indicates that the LEVELFILE path is relative to the data dir. Only used if --edit-level is specified") << "\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO just --from-datadir
isn't clear enough, it leaves confusion as to whether only the following path is from the datadir or if all of them are. To fix this, I'd suggest --paths-from-datadir
(It also makes it clear in an instant that this is about paths).
I also recommend changing "Indicates that the LEVELFILE path is relative to..." to "Indicates that the paths are relative to..." since all paths on the CLI should be affected by this.
4839715
to
7d7268d
Compare
Better late than never :^) |
Only load from physfs path if --from-datadir is specified
794bfba
to
7f6ec99
Compare
What paths should actually be affected by this? |
Load levels and worldmaps from the filesystem instead of using a PHYSFS local reference.
Fixes #1819
Please test this!