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

[Feature] Option: Add games as Non-Steam Game #1331

Merged
merged 75 commits into from
Jul 15, 2022
Merged

Conversation

Nocccer
Copy link
Collaborator

@Nocccer Nocccer commented May 17, 2022

This PR implements the feature to add epic/gog games as non-steam games to steam.
It uses the --no-gui parameter and the protocol which heroic provides.

To adapt steams shortcuts.vdf steam-shortcut-editor thirdparty library, was used.

  • Create a backend function which adds a game to the shortcuts.vdf, so steam picks it up has non-steam game
  • Create a function to remove a game from the shortcuts.vdf
  • Create a function to download/add/remove extra images for steam
    • uses streamgriddb and as fallback the stored images in gameInfo
  • Handle flatpak and none flatpak
  • Wrote types for steam-shortcut-editor
  • Wrote backend tests
  • Fixed gog games not launching via protocol (@imLinguin )
  • Added option to specify path to steam

Known Issues:

  • Steam uses glibc 2.34, which let's heroic fail on systems with newer glibc library (like glibc 2.35).
    • --no-sandbox flag is added to all shortcuts to get around this. Can be maybe added optional if system and steam glibc does not match
  • Legendary can't get the locale enviroment variable inside steam and defaults to en_US. Launch will fail if the epic username uses special characters like (ö, ü, ä, ...). No Workaround yet.

Use the following Checklist if you have changed something on the Backend or Frontend:

  • Tested the feature and it's working on a current and clean install.
  • Tested the main App features and they are still working on a current and clean install. (Login, Install, Play, Uninstall, Move games, etc.)
  • Created / Updated Tests (If necessary)
  • Created / Updated documentation (If necessary)

first poc of add none steam game function
@Nocccer Nocccer added feature-request New feature needs to be implemented. pr:wip WIP, don't merge. labels May 17, 2022
@CommandMC
Copy link
Collaborator

This is very nitpicky and I'm sorry, but it's "Non-Steam game", not "None-Steam game"

@Nocccer Nocccer changed the title [Feature] Option: Add games as none steam game [Feature] Option: Add games as Non-Steam Game May 18, 2022
@Nocccer Nocccer marked this pull request as ready for review May 27, 2022 17:00
@Nocccer Nocccer changed the base branch from main to beta May 31, 2022 14:56
@Nocccer Nocccer removed the pr:wip WIP, don't merge. label Jun 1, 2022
Copy link
Collaborator

@CommandMC CommandMC left a comment

Choose a reason for hiding this comment

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

Will give it a test on Win and Mac in a bit (provided Steam runs on my VMs)

electron/constants.ts Outdated Show resolved Hide resolved
electron/main.ts Outdated Show resolved Hide resolved
electron/constants.ts Outdated Show resolved Hide resolved
@Nocccer
Copy link
Collaborator Author

Nocccer commented Jul 15, 2022

Okay, got it. I kind of prefer the images from Epic as well, for consistency.

And I agree, if the user had to provide their API keys, it would clutter the UI. We may consider implement this as a feature in the future, if users ask for it.

@arielj got it to work. Images are now blurred at the side.

Copy link
Member

@flavioislima flavioislima left a comment

Choose a reason for hiding this comment

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

Pretty good stuff! ⚔️

@flavioislima flavioislima added the pr:ready-to-merge This PR is fully ready for merge. label Jul 15, 2022
@Nocccer Nocccer merged commit 2617652 into beta Jul 15, 2022
@Nocccer Nocccer deleted the add-none-steam-game branch July 15, 2022 14:27
@felipecrs
Copy link
Contributor

felipecrs commented Jul 19, 2022

The right one is from Steam, the left one is the one from GOG added through Heroic. Astonishing, this is such a nice feature!

image

@felipecrs
Copy link
Contributor

@Nocccer I'm trying this out on Ubuntu 22.04, with Steam installed through .deb (because the Flatpak version warns about lack of steam-devices), and while Heroic says it added to Steam, it does not appear on Steam.

After some investigation, it seems that the correct dir is:

/home/felipecrs/.steam/debian-installation/userdata/<my-id>/config

Which I think Heroic isn't looking on.

@Nocccer
Copy link
Collaborator Author

Nocccer commented Jul 21, 2022

@Nocccer I'm trying this out on Ubuntu 22.04, with Steam installed through .deb (because the Flatpak version warns about lack of steam-devices), and while Heroic says it added to Steam, it does not appear on Steam.

After some investigation, it seems that the correct dir is:

/home/felipecrs/.steam/debian-installation/userdata/<my-id>/config

Which I think Heroic isn't looking on.

You can set the folder in general settings > others if i remember correctly. But add to steam should complain if no game could be added (steam folder is not available). Btw did you restart steam?

@felipecrs
Copy link
Contributor

Ok... I'm just not sure what I should write there. I tried /home/felipecrs/.steam/debian-installation and it didn't work.

@felipecrs
Copy link
Contributor

Ok, the issue is, no matter what I set in the Steam path, it always revert to how it was before (i.e. my setting does not apply).

@felipecrs
Copy link
Contributor

Editing the config.json manually worked for me. I wrote:

/home/felipecrs/.steam/debian-installation

@Nocccer
Copy link
Collaborator Author

Nocccer commented Jul 21, 2022

Ok, the issue is, no matter what I set in the Steam path, it always revert to how it was before (i.e. my setting does not apply).

ok will fix this. But actually i think the default path is correct, because on Pop_OS! it is also this path /home/niklas/.steam/steam/userdata

@felipecrs
Copy link
Contributor

But I would advise you to check this folder as well. It is probably the most common folder where Steam could be found, considering that Ubuntu is one of the main used distros over there.

@felipecrs
Copy link
Contributor

Ok, the issue is, no matter what I set in the Steam path, it always revert to how it was before (i.e. my setting does not apply).

ok will fix this. But actually i think the default path is correct, because on Pop_OS! it is also this path /home/niklas/.steam/steam/userdata

For me this is what was in the config.json:

/home/felipecrs/.var/app/com.valvesoftware.Steam/.steam/steam

Could it be because I previously had the Steam Flatpak installed? Perhaps the Steam install dir should be re-evaluated on every start?

@Nocccer
Copy link
Collaborator Author

Nocccer commented Jul 21, 2022

But I would advise you to check this folder as well. It is probably the most common folder where Steam could be found, considering that Ubuntu is one of the main used distros over there.

POP_OS is based on ubuntu. And if you press on debian-installation it is just a shortcut to /home/niklas/.steam/steam

@Nocccer
Copy link
Collaborator Author

Nocccer commented Jul 21, 2022

Ok, the issue is, no matter what I set in the Steam path, it always revert to how it was before (i.e. my setting does not apply).

ok will fix this. But actually i think the default path is correct, because on Pop_OS! it is also this path /home/niklas/.steam/steam/userdata

For me this is what was in the config.json:

/home/felipecrs/.var/app/com.valvesoftware.Steam/.steam/steam

Could it be because I previously had the Steam Flatpak installed? Perhaps the Steam install dir should be re-evaluated on every start?

delete steam flatpak if you don't want to use it. Else add-to-steam will add it to steam flatpak.

@felipecrs
Copy link
Contributor

For me it does not seem to be a shortcut:

 ls -la .steam
total 24
drwxrwxr-x  3 felipecrs felipecrs 4096 jul 21 13:55 .
drwxr-x--- 33 felipecrs felipecrs 4096 jul 21 13:58 ..
lrwxrwxrwx  1 felipecrs felipecrs   28 jul 21 13:55 bin -> /home/felipecrs/.steam/bin32
lrwxrwxrwx  1 felipecrs felipecrs   54 jul 21 13:55 bin32 -> /home/felipecrs/.steam/debian-installation/ubuntu12_32
lrwxrwxrwx  1 felipecrs felipecrs   54 jul 21 13:55 bin64 -> /home/felipecrs/.steam/debian-installation/ubuntu12_64
drwxrwxr-x 26 felipecrs felipecrs 4096 jul 21 13:57 debian-installation
-rwxrwxr-x  1 felipecrs felipecrs 1149 jul 21 13:55 registry.vdf
lrwxrwxrwx  1 felipecrs felipecrs   42 jul 21 13:55 root -> /home/felipecrs/.steam/debian-installation
lrwxrwxrwx  1 felipecrs felipecrs   50 jul 21 13:55 sdk32 -> /home/felipecrs/.steam/debian-installation/linux32
lrwxrwxrwx  1 felipecrs felipecrs   50 jul 21 13:55 sdk64 -> /home/felipecrs/.steam/debian-installation/linux64
lrwxrwxrwx  1 felipecrs felipecrs   42 jul 21 13:55 steam -> /home/felipecrs/.steam/debian-installation
-rw-rw-r--  1 felipecrs felipecrs    6 jul 21 13:55 steam.pid
prw-------  1 felipecrs felipecrs    0 jul 21 13:54 steam.pipe
-r--------  1 felipecrs felipecrs   16 jul 21 13:55 steam.token

I think PopOS packages their own Steam deb.

@felipecrs
Copy link
Contributor

delete steam flatpak if you don't want to use it. Else add-to-steam will add it to steam flatpak.

Of course I did it... still, Heroic was looking on .var.

@Nocccer
Copy link
Collaborator Author

Nocccer commented Jul 21, 2022

Please first delete steam-flatpak and his folders. There are folders in .var left still for steam flatpak.

@felipecrs
Copy link
Contributor

Got it. I didn't delete the folder indeed.

@Nocccer
Copy link
Collaborator Author

Nocccer commented Jul 21, 2022

Got it. I didn't delete the folder indeed.

Note the default path should work. Because i assume Ubuntu - steam is different then Pop_OS - steam installation

@felipecrs
Copy link
Contributor

Ok, I confirmed that /home/felipecrs/.steam/steam also works.

But I had to write it manually in the config.json, even after deleting the Flatpak folder in .var.

@Nocccer
Copy link
Collaborator Author

Nocccer commented Jul 21, 2022

Ok, I confirmed that /home/felipecrs/.steam/steam also works.

But I had to write it manually in the config.json, even after deleting the Flatpak folder in .var.

Btw better create a github issue instead writing here on a closed pr.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature needs to be implemented. pr:ready-for-review Feature-complete, ready for the grind! :P pr:ready-to-merge This PR is fully ready for merge.
Projects
None yet
6 participants