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

Commandline: Add support for Non-Steam Games to getGameDir #971

Merged
merged 2 commits into from
Nov 8, 2023

Conversation

sonic2kk
Copy link
Owner

@sonic2kk sonic2kk commented Nov 8, 2023

Yet another bit of work for #960.

This PR adds support for getting a Non-Steam Game's game folder. We do this by parsing the Exe out of the shortcuts.vdf file and using the dirname of this as the EXE name. It was a little tricky integrating this into the existing getGameDir function, but I did it pretty cleanly, ignoring certain values or returning early if we still have to search on Non-Steam Games.

Initially in #960 I thought about parsing out the StartDir, but I think using the Exe base dir makes more sense. They're usually the same, and if they aren't, the user modified that and can check it from Steam. I don't see a case where a user would need to know the StartDir though, but I can imagine cases where they want to know where their Non-Steam Game was installed quickly from a command.

This function is also compatible with the only option that can be passed to this function.

In testing this works, but we need to make extra sure this doesn't break anything. After that though, a shellcheck and version bump will make this ready for merging.


This PR should complete the function integration work for Non-Steam Games, meaning the remaining work for #970 involves modifying localconfig.vdf using the functions added in #967, and the integration into the list command.

These functions were integrated first because list may make use of these, so I wanted to integrate them first. They're also just useful to have integrated!

@sonic2kk sonic2kk merged commit 58d708b into master Nov 8, 2023
@sonic2kk sonic2kk linked an issue Nov 8, 2023 that may be closed by this pull request
11 tasks
@sonic2kk sonic2kk deleted the nonsteam-getgamedir-fix branch November 8, 2023 23:49
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.

[Feature Request] Non-Steam Game Improvements
1 participant