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

Fix Proton detection and implement scanning compatibilitytools.d #674

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions src/data/compat/Proton.vala
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,21 @@ namespace GameHub.Data.Compat
else
{
File? proton_dir = null;
if(Steam.find_app_install_dir(appid, out proton_dir))
if(appid.has_prefix("custom")) {
proton_dir = File.new_for_path(Environment.get_home_dir ()).get_child (".steam").get_child ("steam").get_child ("compatibilitytools.d").get_child (appname);
name = appname;
executable = proton_dir.get_child("proton");
installed = executable.query_exists();
wine_binary = proton_dir.get_child("dist").query_exists() ? proton_dir.get_child("dist/bin/wine") : proton_dir.get_child("files/bin/wine");
fyr77 marked this conversation as resolved.
Show resolved Hide resolved
}
else if(Steam.find_app_install_dir(appid, out proton_dir))
{
if(proton_dir != null)
{
name = appname ?? proton_dir.get_basename();
executable = proton_dir.get_child("proton");
installed = executable.query_exists();
wine_binary = proton_dir.get_child("dist/bin/wine");
wine_binary = proton_dir.get_child("dist").query_exists() ? proton_dir.get_child("dist/bin/wine") : proton_dir.get_child("files/bin/wine");
}
}
else
Expand Down Expand Up @@ -358,6 +365,19 @@ namespace GameHub.Data.Compat
}
}

//Scan for custom Proton
var compattools_dir = FSUtils.file(FSUtils.Paths.Steam.Home).get_child ("steam").get_child ("compatibilitytools.d");
if (compattools_dir.query_file_type (0) == FileType.DIRECTORY) {
var enumerator = compattools_dir.enumerate_children (FileAttribute.STANDARD_NAME, 0);
FileInfo file_info;
while ((file_info = enumerator.next_file ()) != null) {
var name = file_info.get_name ();
if (name.down().contains("proton")) {
versions.add(new Proton("custom", name));
}
}
}

if(versions.size > 0)
{
versions.sort((first, second) => {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/BinaryVDF.vala
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ namespace GameHub.Utils
var appid = stream.read_uint32();
if(appid == 0) break;

stream.seek(44, SeekType.CUR);
stream.seek(64, SeekType.CUR);

var app = BinaryVDF.Node.read(stream, appid.to_string());
if(app != null)
Expand Down