Skip to content
This repository was archived by the owner on May 19, 2024. It is now read-only.

[Maintenance] Improve handling of arguments and environment variables #120

Merged
merged 4 commits into from
Jan 21, 2023
Merged

[Maintenance] Improve handling of arguments and environment variables #120

merged 4 commits into from
Jan 21, 2023

Conversation

afwolfe
Copy link
Contributor

@afwolfe afwolfe commented Jan 8, 2023

This PR supports #112 by:

  • Removing the separate variable per configuration option and replacing it with a list of arguments and a dictionary of environment variables
  • Sharing common lists of arguments between the different types of games.
    • (ex wrapperArgs for the wrapper commands goes first)
  • Assembling the full list and dictionary into strings during createlaunchfile.
    • Arguments and paths no longer need to be suffixed with a space, as this happens automatically during the string " ".join() command in createlaunchfile.
  • Returning the list and dictionary also made it easier to create unit tests by looking at the returned lists and dictionary items.
  • Removes two options that have been deprecated in HeroicGamesLauncher (audioFix and enableResizableBar)

Future arguments and environment variables implemented in the HeroicBashLauncher should now only need to:

  1. Check the appropriate configuration elements and
  2. add the argument(s) or environment variable(s) to the appropriate list or dictionary.

…riables as a list and dictionary

Reduce repetition of arguments in different paths

rename game[appname] to gameSettings

Sort environment variables and additional launch arguments in checkparameters

Replace isPresent with gameSettings.get()

Group options based on HeroicGamesLauncher

Move string building to createlaunchfile

Initial unit tests for checkparameters

Improve wrapperOptions handling

use wineVersion.type to check wine or proton

Implement LD_PRELOAD defaulting

Update preferSystemLibs handling and add unit test
Copy link
Owner

@redromnon redromnon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested a few games here. Works just fine. Although I couldn't test a GOG Windows game it should work.

The refactor makes it more organised now.

@redromnon
Copy link
Owner

Tested. LTGM 👍

@redromnon redromnon merged commit e13c4e7 into redromnon:main Jan 21, 2023
@afwolfe afwolfe deleted the handle-args-as-list-rebase branch January 22, 2023 03:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants