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

lang: Don't create global config in loadLanguage #1178

Merged
merged 2 commits into from
Oct 2, 2024

Conversation

sonic2kk
Copy link
Owner

Fix #1177.

Don't attempt to save and load the global config in loadLanguage unless it exists.

Prevents loadLanguage, which is called very early, from creating the global config before setSteamPaths has a chance to define some paths that are needed to create the global config.

Most notably, this fixes Luxtorpeda and Roberta variables from being incorrect when created too early by loadLanguage, as this function creates the global config before setSteamPaths has a chance to define STEAMCOMPATOOLS which is needed in order to build a valid path for LUXTORPEDACMD and ROBERTACMD. SteamTinkerLaunch tries to auto-detect Luxtorpeda installations and this has not worked for probably the last 2 years or so, since loadLanguage created the global config too soon. However, Luxtorpeda could always be and still can be manually selected by the user, so the only breakage was for the auto-detection.

This may possibly fix other similar cases as well, where Steam paths are needed in the global config but it is created before paths exist.

This fix will not retroactively apply to global configs, as we don't know whether the variables are incorrectly generated by us or the user. Bad global configs will need re-generated.


This PR needs some testing to ensure the -f "$STLDEFGLOBALCFG" check is safe. I think it is, but this will need a bit of further testing.

@sonic2kk
Copy link
Owner Author

sonic2kk commented Oct 2, 2024

This does not appear to introduce any regressions with generating the global.conf file. I tested a few scenarios going back from this branch to master, and with using the --lang option. It seems to work fine. I think this is safe to merge, after a rebase and version bump.

Don't attempt to save and load the global config in `loadLanguage` unless it exists.
Prevents `loadLanguage`, which is called very early, from creating the global config
before `setSteamPaths` has a chance to define some paths that are needed to create
the global config.

Most notably, this fixes Luxtorpeda and Roberta variables from being incorrect when
created too early by `loadLanguage`, as this function creates the global config
before `setSteamPaths` has a chance to define `STEAMCOMPATOOLS` which is needed
in order to build a valid path for `LUXTORPEDACMD` and `ROBERTACMD`.
@sonic2kk sonic2kk force-pushed the dont-create-globalconfig-paths-without-steamvars branch from 5b9aa31 to 10c6393 Compare October 2, 2024 19:33
@sonic2kk sonic2kk merged commit 6e5aba7 into master Oct 2, 2024
2 checks passed
@sonic2kk sonic2kk deleted the dont-create-globalconfig-paths-without-steamvars branch October 2, 2024 19:35
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.

USELUXTORPEDA does not function
1 participant