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

Detect gamepath automatically #53

Merged
merged 17 commits into from
Jan 25, 2022
Merged

Detect gamepath automatically #53

merged 17 commits into from
Jan 25, 2022

Conversation

0neGal
Copy link
Owner

@0neGal 0neGal commented Jan 22, 2022

Combined #51 and #52 into one.

@0neGal 0neGal added the enhancement New feature or request label Jan 22, 2022
@0neGal 0neGal self-assigned this Jan 22, 2022
@0neGal
Copy link
Owner Author

0neGal commented Jan 22, 2022

I've no clue if this actually works on the Windows side of things, but it may or may not function...

src/utils.js Outdated Show resolved Hide resolved
src/utils.js Outdated Show resolved Hide resolved
src/utils.js Outdated Show resolved Hide resolved
@Alystrasz
Copy link
Contributor

Alystrasz commented Jan 23, 2022

I think we should export all find-my-game-folder related code to a given module/method.
The way it is currently done, on first launch, "game path is not set!" message will be displayed to the user, whereas path will be found straight after dialog is closed.

I moved requests.js into extras and made the function for finding the
potentional gamepath into it's own module. I also made the exec() called
Promise based.
@0neGal
Copy link
Owner Author

0neGal commented Jan 23, 2022

If you could test whether it still functions as it should after my last commit that'd be nice, I implemented the Promise exec() as you asked, and moved requests.js into extras/ along with putting the auto game path stuff into it's own file as well.

The way it is currently done, on first launch, "game path is not set!" message will be displayed to the user, whereas path will be found straight after dialog is closed.

I noticed this too, not ideal and it'll confuse the user...

- os nor app was imported
- returned the entire vdf file instead
@3top1a
Copy link
Contributor

3top1a commented Jan 23, 2022

It appears that the VDF reading was broken, so I've made a pull request (#54)

@Alystrasz
Copy link
Contributor

If you could test whether it still functions as it should after my last commit that'd be nice

I made a PR (#55) to fix little typos and make this work on Windows (tested and approved).

@0neGal
Copy link
Owner Author

0neGal commented Jan 23, 2022

It'd be lovely if somebody could verify the VDF part also works just fine...

@Alystrasz
Copy link
Contributor

Unfortunately, I don't have tf2 on Steam.
And it's not on sale right now (30 bucks, seriously ?!)

@0neGal
Copy link
Owner Author

0neGal commented Jan 23, 2022

Unfortunately, I don't have tf2 on Steam.

Perhaps @3top1a does?

And it's not on sale right now (30 bucks, seriously ?!)

Usually get put on sale down to around 5$/€, and there's Lunar sale in like, 4-5 days... But don't buy it if you don't need it :)

@Alystrasz
Copy link
Contributor

If its price goes around 5€, I'll buy it for sure!
It's still useful to have different game versions, to be able to test them all when developing related software, for instance 😄

@3top1a
Copy link
Contributor

3top1a commented Jan 24, 2022

Unfortunately, I don't have tf2 on Steam.

Perhaps @3top1a does?

#34 (comment)

In the original test code you can see it working, and last time I checked (#54 ) it did work (I have the steam version)

* Edge case

* Alert user only when automatic detection failed

* extra info on not found message

* support for [Free/Open]BSD

Co-authored-by: 0neGal <mail@0negal.com>
@0neGal
Copy link
Owner Author

0neGal commented Jan 24, 2022

@Alystrasz, general.missingpath has been reworded to: Game location could not be found automatically! Please select it manually!, if you could update the French translation I'll go ahead and merge this :)

@0neGal 0neGal linked an issue Jan 24, 2022 that may be closed by this pull request
@Alystrasz
Copy link
Contributor

Alystrasz commented Jan 24, 2022

Before you merge, I found some issues:

  • "Game path" link to change folder path does not work anymore;
  • Mods support does not work on first launch (maybe because modpath is loaded before path selection:
    let modpath = path.join(settings.gamepath, "R2Northstar/mods");

@0neGal
Copy link
Owner Author

0neGal commented Jan 24, 2022

"Game path" link to change folder path does not work anymore;

On the topic of this, perhaps we should change the text to Change Gamepath, as just Game path doesn't really say what the button does.

@Alystrasz
Copy link
Contributor

"Game path" link to change folder path does not work anymore;

On the topic of this, perhaps we should change the text to Change Gamepath, as just Game path doesn't really say what the button does.

Agreed, I had several people who thought Viper was not working because it "kept asking them about their game path".

@0neGal
Copy link
Owner Author

0neGal commented Jan 24, 2022

Agreed, I had several people who thought Viper was not working because it "kept asking them about their game path".

Hence why the new alert string (which I just noticed uses alert() a non-existing function instead of winAlert(), fixing it rn :p) makes so much more sense

When changing the game path by clicking the button you shouldn't be told
it can't find the game and you've to select one manually, as you know
that already. More importantly, if it could be found automatically it'll
just not do anything.

With this change I also changed the "gui.setpath" string to be more
logical, and to make it clear what it does.
.vscode/launch.json Outdated Show resolved Hide resolved
@0neGal 0neGal mentioned this pull request Jan 25, 2022
@0neGal
Copy link
Owner Author

0neGal commented Jan 25, 2022

I think everything is working just as intended, that is if the auto detection works, but I trust your words on that, hence I'll be merging this...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Viper
Done
Development

Successfully merging this pull request may close these issues.

Automatically find Titanfall installation folder
3 participants