Repository navigation
Load .0verpg.json from the current directory first - #11
Merged
Merged
Conversation
Catch nlohmann::json exceptions around the game and tell the player to copy the new .0verpg.json, instead of terminating with an uncaught parse_error/type_error when ~/.0verpg.json predates new keys. Translate the shop's "3. Exit Shop" with the existing "skip" key.
If ./.0verpg.json exists it is used, otherwise the one in HOME as before. The game can now run straight from the repository without copying the config, and existing ~/.0verpg.json setups keep working.
Owner
|
Hi @lasers, Thank you so much mate. Cheers |
Owner
|
You are the man ! Without your help I wouldn't have thought of these problematic areas :) Cheers mate |
Contributor
Author
|
Claude. I don't know a lick of C/C++ 👅 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Feature
The game now looks for the config in the directory you run it from (
$PWD) before$HOME:$PWD/.0verpg.json, if it exists$HOME/.0verpg.json, as before$PWDis where your shell is when you type the command, not where the0verpgbinary is installed.Examples
Assume the repo is cloned to
~/src/0verpg:$PWD/.0verpg.jsonexists?cd ~/src/0verpg && ./0verpg en~/src/0verpg/.0verpg.jsoncd /tmp && 0verpg en~/.0verpg.jsoncd ~ && 0verpg en~/.0verpg.json(same file either way)cd /tmp && 0verpg en, nothing in~eitherError: Could not open /home/you/.0verpg.json(unchanged)Why
make && ./0verpg en) without copying the config to~first..0verpg.jsontake effect right away when you play from the repo.Compatibility
Installed players who run
0verpgfrom anywhere without a.0verpg.jsonkeep using~/.0verpg.json, exactly as before. If both exist, the one in$PWDwins; the README now says so.Code
Fixes #7