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

Allow setting game directory from CLI; add -v flag #85

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

arp242
Copy link

@arp242 arp242 commented Jun 19, 2023

  • Use the directory the binary is in as the default path, so you can use "./games/fallout/fallout-ce" without having to cd to that directory.

  • Also allow setting the game directory from argv.

  • Add -v option for verbose information; this was protected by a _DEBUG preprocessor flag, and not having to recompile is helpful.

  • Output GNWSystemError() to stderr as well. For whatever reason I don't get any popup window (not sure why), so the game would simply exit without any information. It doesn't hurt to print it anyway.

  • Add -h flag to document all of this.

Note: I only tested this on my Linux system, as that's the only machine I have access to. In particular, I'm not entirely sure if my usage of PathRemoveFileSpecA() is correct, but I have no way to test it.

- Use the directory the binary is in as the default path, so you can use
  "./games/fallout/fallout-ce" without having to cd to that directory.

- Also allow setting the game directory from argv.

- Add -v option for verbose information; this was protected by a _DEBUG
  preprocessor flag, and not having to recompile is helpful.

- Output GNWSystemError() to stderr as well. For whatever reason I don't
  get any popup window (not sure why), so the game would simply exit
  without any information. It doesn't hurt to print it anyway.

- Add -h flag to document all of this.

Note: I only tested this on my Linux system, as that's the only machine
I have access to. In particular, I'm not entirely sure if my usage of
PathRemoveFileSpecA() is correct, but I have no way to test it.

Also clarify which values are read from f1_res.ini, as per my reading of
src/plib/gnw/svga.cc (Fixes alexbatalov#84).
@TheBrainScrambler
Copy link

What about reading by default the assets in some standard path like ~/.local/share/fallout1-ce ? This would make packaging easier. I would also keep trying to read assets from the current directory as a last resort, it might be useful to some people. So it would try these paths in order:

  • Argument from CLI
  • ~/.local/share/fallout1-ce
  • Location of the binary
  • Current directory

@dje4321
Copy link

dje4321 commented May 22, 2024

I feel the order should be a little different but I like the idea.

  • Argument from CLI
  • Location of the binary
  • Current directory
  • ~/.local/share/fallout1-ce

Reasoning is

  • Explict location provided
  • Original game behavior
  • Useful for packaging as the location can be choosen for whatever the distro expects (IE /usr/share/games, or something obscure like NixOS)
  • Last ditch fallback attempt to some pre-defined location for convention (Useful for user installs)

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

Successfully merging this pull request may close these issues.

3 participants