8000 Fix Proton detection and implement scanning compatibilitytools.d by fyr77 · Pull Request #674 · tkashkin/GameHub · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Apr 19, 2025. It is now read-only.

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");
}
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
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
0