added support for non steam game with cover art support#23
added support for non steam game with cover art support#23oo8dev merged 5 commits intooo8dev:masterfrom
Conversation
|
Decided to use base64 instead of copying the files. I needed to update security policy to allow image load from base64 but it's working as it should in vr and out of vr |
|
As explained, I realised steamgriddb do not give only png but also other kinds of images, so added support of them in the conversion to base 64 |
|
Hello and thanks for the contribution. Make sure that this code will be compatible in non-development scenarios (package managers, Envision plugin) - as a single executable. Could you explain how does this custom cover arts downloader work? Is "grid" directory being created by Steam or it's comething custom? |
| struct Shortcut { | ||
| name: String, | ||
| exe: String, | ||
| run_game_id: u64, |
There was a problem hiding this comment.
Make sure to run cargo fmt across this whole project or setup your IDE to auto-format the code after saving it. This project uses tabs as indentation instead of spaces, you can install "Editorconfig" and "rust-analyzer" extensions in case of VSCode
There was a problem hiding this comment.
I think it's now correctly formatted
libsteamium/src/lib.rs
Outdated
| }; | ||
|
|
||
| let Ok(pid) = pid.parse::<i32>() else { | ||
| let Ok(pid) = pid.parse::<u64>() else { |
There was a problem hiding this comment.
pid is explicitly being used to determine a process ID. In case if you want to add some metadata to this number, you can try using Enum instead if it's something else than a process ID
There was a problem hiding this comment.
i should have reverted the changes
| } | ||
|
|
||
| pub type AppID = u64; | ||
| pub type AppID = String; |
There was a problem hiding this comment.
Maybe it's a good idea to separate Steam's AppID and custom ones using an Enum
There was a problem hiding this comment.
i'm not sure, cause I had to convert it to String because typescript convert u64 to the "number" type which round up the least significant bits. It's not a problem usually with "normal" AppID cause they're shorter but converting it to string fixes the rounding. Switching to bigint every where in typescript did not fix the issue because it's occuring in the ipc.game_list();
I used in my headset and to me it's working. The code works by checking the "~/.steam/steam/userdata/{userid}/config/shortcut.vdf file. here it tells that there is non steam games that have been added. While parsing, the library automatically generates a i32 that correspond to the game id when it's runned, however to run it steam needs a u64 that is corresponding to the app_id at the most significant bits and 0x02000000 at the least. the cover art downloader convert the cover art to base64 and give it directly to the metadata. so in the |
…tring> for the cover_b64
|
I should have fixed all of the issues, i reviewed them one by one and use Option for the cover_b64 |
|
I think this PR is good to go, only one request: could you do a check in |
|
I added a check in the GameCover({ manifest, big, on_click }) function instead. I check for the length of the run_game_id, (32 bits integer for steam games (so maximum 10 char) ) if it's longer than 10 chars, it means it's a non steam game and I bypass the call. (indead of throwing an error in the get_app_details_json() to handle it |
|
Thank you for your contribution! Merging |
This is my first time writing rust and typescript so feel free to ask for modifications if needed, I added support for non steam games inside the game folder so there is a centralized way to run any kind of games