Skip to content

Commit

Permalink
🔖 Merge dev into main (v0.1.1)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vysp3r committed Sep 24, 2022
2 parents b2e8e78 + b0dd257 commit b93e389
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 38 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ If you have any questions about ProtonPlus or want to share information with us,

## 💥 Known Issues

- Steam does not create the compatibilitytools.d by default, so ProtonPlus can't find it on a fresh Steam install
- Some items in the list of releases does not have any Label
- None

- - - -

Expand Down
6 changes: 3 additions & 3 deletions src/manager/file.vala
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ namespace ProtonPlus.Manager {
public class File {
public static void Extract (string install_location, string archive_name) {
Archive.Read archive = new Archive.Read ();
archive.support_format_tar ();
archive.support_filter_gzip ();
archive.support_format_all ();
archive.support_filter_all ();

int flags;
flags = Archive.ExtractFlags.ACL;
Expand All @@ -15,7 +15,7 @@ namespace ProtonPlus.Manager {
ext.set_standard_lookup ();
ext.set_options (flags);

if (archive.open_filename (install_location + archive_name, 1536000) != Archive.Result.OK) return;
if (archive.open_filename (install_location + archive_name, 1920000) != Archive.Result.OK) return;

ssize_t r;

Expand Down
30 changes: 17 additions & 13 deletions src/models/compatibilitytool.vala
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace ProtonPlus.Models {
this.AssetPosition = asset_position;
}

public Release[] GetReleases () {
public GLib.List<Release> GetReleases () {
// Get the json from the Tool endpoint
string json = ProtonPlus.Manager.HTTP.GET (Endpoint);

Expand All @@ -24,10 +24,10 @@ namespace ProtonPlus.Models {
Json.Array rootNodeArray = rootNode.get_array ();

// Create an array of Version with the size of the root node array
Release[] releases = new Release[rootNodeArray.get_length ()];
GLib.List<Release> releases = new GLib.List<Release> ();

// Execute a loop with the number of items contained in the Version array and fill it
for (var i = 0; i < releases.length; i++) {
for (var i = 0; i < rootNodeArray.get_length (); i++) {
string label = "";
string download_url = "";
string page_url = "";
Expand All @@ -45,14 +45,12 @@ namespace ProtonPlus.Models {
var tempNodeArray = objRoot.get_array_member ("assets");

// Verify weither the temp node array has values and if so it set the endpoint to the given download url
if (tempNodeArray.get_length () > 0) {
if (tempNodeArray.get_length () >= AssetPosition) {
var test = tempNodeArray.get_element (AssetPosition);
Json.Object objAsset = test.get_object ();
download_url = objAsset.get_string_member ("browser_download_url");
releases.append (new Release (label, download_url, page_url)); // Currently here to prevent showing release with an invalid download_url
}

// Insert in the Version array a new Version with the current node information
releases[i] = new Release (label, download_url, page_url);
}

// Return the Version array
Expand All @@ -71,7 +69,7 @@ namespace ProtonPlus.Models {
return model;
}

public static Gtk.ListStore GetReleasesModel (Release[] releases) {
public static Gtk.ListStore GetReleasesModel (GLib.List<Release> releases) {
Gtk.ListStore model = new Gtk.ListStore (2, typeof (string), typeof (Release));
Gtk.TreeIter iter;

Expand Down Expand Up @@ -118,14 +116,20 @@ namespace ProtonPlus.Models {
}

public static CompatibilityTool[] Lutris () {
CompatibilityTool[] tools = new CompatibilityTool[6];
CompatibilityTool[] tools = new CompatibilityTool[3];

tools[0] = new CompatibilityTool ("Wine-GE", "Compatibility tool \"Wine\" to run Windows games on Linux. Based on Valve Proton Experimental's bleeding-edge Wine, built for Lutris.Use this when you don't know what to choose.", "https://api.github.com/repos/GloriousEggroll/wine-ge-custom/releases", 1);
tools[1] = new CompatibilityTool ("Lutris-Wine", "Compatibility tool \"Wine\" to run Windows games on Linux. Improved by Lutris to offer better compatibility or performance in certain games.", "https://api.github.com/repos/lutris/wine/releases", 0);
tools[2] = new CompatibilityTool ("Kron4ek Wine-Builds Vanilla", "Compatibility tool \"Wine\" to run Windows games on Linux. Official version from the WineHQ sources, compiled by Kron4ek.", "https://api.github.com/repos/Kron4ek/Wine-Builds/releases", 5);
tools[3] = new CompatibilityTool ("DXVK", "Vulkan based implementation of Direct3D 9, 10 and 11 for Linux/Wine.https://github.com/lutris/docs/blob/master/HowToDXVK.md", "https://api.github.com/repos/doitsujin/dxvk/releases", 0);
tools[4] = new CompatibilityTool ("DXVK Async (Sporif)", "Vulkan based implementation of Direct3D 9, 10 and 11 for Linux/Wine with async patch by Sporif.Warning: Use only with singleplayer games!", "https://api.github.com/repos/Sporif/dxvk-async/releases", 0);
tools[5] = new CompatibilityTool ("DXVK Async (gnusenpai)", "Vulkan based implementation of Direct3D 9, 10 and 11 for Linux/Wine with async patch and RTX fix for Star Citizen by gnusenpai.Warning: Use only with singleplayer games!", "https://api.github.com/repos/gnusenpai/dxvk/releases", 0);
return tools;
}

public static CompatibilityTool[] LutrisDXVK () {
CompatibilityTool[] tools = new CompatibilityTool[3];

tools[0] = new CompatibilityTool ("DXVK", "Vulkan based implementation of Direct3D 9, 10 and 11 for Linux/Wine.https://github.com/lutris/docs/blob/master/HowToDXVK.md", "https://api.github.com/repos/doitsujin/dxvk/releases", 0);
tools[1] = new CompatibilityTool ("DXVK Async (Sporif)", "Vulkan based implementation of Direct3D 9, 10 and 11 for Linux/Wine with async patch by Sporif.Warning: Use only with singleplayer games!", "https://api.github.com/repos/Sporif/dxvk-async/releases", 0);
tools[2] = new CompatibilityTool ("DXVK Async (gnusenpai)", "Vulkan based implementation of Direct3D 9, 10 and 11 for Linux/Wine with async patch and RTX fix for Star Citizen by gnusenpai.Warning: Use only with singleplayer games!", "https://api.github.com/repos/gnusenpai/dxvk/releases", 0);

return tools;
}
Expand Down Expand Up @@ -164,7 +168,7 @@ namespace ProtonPlus.Models {
int count = 0;

while ((dirEnt = Posix.readdir (dir)) != null) {
if(count++ > 1) {
if(count++ > 1 && dirEnt.d_type == 4) {
string name = (string) dirEnt.d_name;
installedReleases.append (new Release(name, "", ""));
}
Expand Down
39 changes: 22 additions & 17 deletions src/models/location.vala
Original file line number Diff line number Diff line change
Expand Up @@ -28,32 +28,37 @@ namespace ProtonPlus.Models {
return model;
}

public static Location[] GetInstallLocations () {
Location[] locations = new Location[11];
public static GLib.List<Location> GetInstallLocations () {
GLib.List<Location> locations = new GLib.List<Location> ();

string home_dir = GLib.Environment.get_home_dir ();

string[] steam_locations = new string[] { home_dir + "/.local/share/Steam", home_dir + "/.steam/root", home_dir + "/.steam/steam", home_dir + "/.steam/debian-installation" };
string steam_dir = steam_locations[0];
foreach (var item in steam_locations) {
var dir = Posix.opendir (item);

if (dir != null) {
steam_dir = item;
if (Posix.opendir (item) != null) {
steam_dir = item + "/compatibilitytools.d";
break;
}
}

locations[0] = new Location ("Steam", steam_dir + "/compatibilitytools.d", ProtonPlus.Models.CompatibilityTool.Steam (), new ProtonPlus.Models.Launcher ("Steam"));
locations[1] = new Location ("Steam (Flatpak)", home_dir + "/.var/app/com.valvesoftware.Steam/data/Steam/compatibilitytools.d", ProtonPlus.Models.CompatibilityTool.Steam (), new ProtonPlus.Models.Launcher ("Steam"));
locations[2] = new Location ("Steam (Snap)", home_dir + "/snap/steam/common/.steam/root/compatibilitytools.d", ProtonPlus.Models.CompatibilityTool.Steam (), new ProtonPlus.Models.Launcher ("Steam"));
locations[3] = new Location ("Lutris", home_dir + "/.local/share/lutris/runners/wine", ProtonPlus.Models.CompatibilityTool.Lutris (), new ProtonPlus.Models.Launcher ("Lutris"));
locations[4] = new Location ("Lutris (Flatpak)", home_dir + "/.var/app/net.lutris.Lutris/data/lutris/runners/wine", ProtonPlus.Models.CompatibilityTool.Lutris (), new ProtonPlus.Models.Launcher ("Lutris"));
locations[5] = new Location ("Heroic Wine", home_dir + "/.config/heroic/tools/wine", ProtonPlus.Models.CompatibilityTool.HeroicWine (), new ProtonPlus.Models.Launcher ("Heroic Wine"));
locations[6] = new Location ("Heroic Proton", home_dir + "/.config/heroic/tools/proton", ProtonPlus.Models.CompatibilityTool.HeroicProton (), new ProtonPlus.Models.Launcher ("Heroic Proton"));
locations[7] = new Location ("Heroic Wine (Flatpak)", home_dir + "/.var/app/com.heroicgameslauncher.hgl/config/heroic/tools/wine", ProtonPlus.Models.CompatibilityTool.HeroicWine (), new ProtonPlus.Models.Launcher ("Heroic Wine"));
locations[8] = new Location ("Heroic Proton (Flatpak)", home_dir + "/.var/app/com.heroicgameslauncher.hgl/config/heroic/tools/proton", ProtonPlus.Models.CompatibilityTool.HeroicProton (), new ProtonPlus.Models.Launcher ("Heroic Proton"));
locations[9] = new Location ("Bottles", home_dir + "/.local/share/bottles/runners", ProtonPlus.Models.CompatibilityTool.Bottles (), new ProtonPlus.Models.Launcher ("Bottles"));
locations[10] = new Location ("Bottles (Flatpak)", home_dir + "/.var/app/com.usebottles.bottles/data/bottles/runners", ProtonPlus.Models.CompatibilityTool.Bottles (), new ProtonPlus.Models.Launcher ("Bottles"));
if (Posix.opendir (steam_dir) == null) {
Posix.mkdir (steam_dir, 0777);
}

locations.append (new Location ("Steam", steam_dir, ProtonPlus.Models.CompatibilityTool.Steam (), new ProtonPlus.Models.Launcher ("Steam")));
locations.append (new Location ("Steam (Flatpak)", home_dir + "/.var/app/com.valvesoftware.Steam/data/Steam/compatibilitytools.d", ProtonPlus.Models.CompatibilityTool.Steam (), new ProtonPlus.Models.Launcher ("Steam")));
locations.append (new Location ("Steam (Snap)", home_dir + "/snap/steam/common/.steam/root/compatibilitytools.d", ProtonPlus.Models.CompatibilityTool.Steam (), new ProtonPlus.Models.Launcher ("Steam")));
locations.append (new Location ("Lutris", home_dir + "/.local/share/lutris/runners/wine", ProtonPlus.Models.CompatibilityTool.Lutris (), new ProtonPlus.Models.Launcher ("Lutris")));
locations.append (new Location ("Lutris (Flatpak)", home_dir + "/.var/app/net.lutris.Lutris/data/lutris/runners/wine", ProtonPlus.Models.CompatibilityTool.Lutris (), new ProtonPlus.Models.Launcher ("Lutris")));
locations.append (new Location ("Lutris DXVK", home_dir + "/.local/share/lutris/runtime/dxvk", ProtonPlus.Models.CompatibilityTool.LutrisDXVK (), new ProtonPlus.Models.Launcher ("Lutris")));
locations.append (new Location ("Lutris DXVK (Flatpak)", home_dir + "/.var/app/net.lutris.Lutris/data/lutris/runtime/dxvk", ProtonPlus.Models.CompatibilityTool.LutrisDXVK (), new ProtonPlus.Models.Launcher ("Lutris")));
locations.append (new Location ("Heroic Wine", home_dir + "/.config/heroic/tools/wine", ProtonPlus.Models.CompatibilityTool.HeroicWine (), new ProtonPlus.Models.Launcher ("Heroic Wine")));
locations.append (new Location ("Heroic Proton", home_dir + "/.config/heroic/tools/proton", ProtonPlus.Models.CompatibilityTool.HeroicProton (), new ProtonPlus.Models.Launcher ("Heroic Proton")));
locations.append (new Location ("Heroic Wine (Flatpak)", home_dir + "/.var/app/com.heroicgameslauncher.hgl/config/heroic/tools/wine", ProtonPlus.Models.CompatibilityTool.HeroicWine (), new ProtonPlus.Models.Launcher ("Heroic Wine")));
locations.append (new Location ("Heroic Proton (Flatpak)", home_dir + "/.var/app/com.heroicgameslauncher.hgl/config/heroic/tools/proton", ProtonPlus.Models.CompatibilityTool.HeroicProton (), new ProtonPlus.Models.Launcher ("Heroic Proton")));
locations.append (new Location ("Bottles", home_dir + "/.local/share/bottles/runners", ProtonPlus.Models.CompatibilityTool.Bottles (), new ProtonPlus.Models.Launcher ("Bottles")));
locations.append (new Location ("Bottles (Flatpak)", home_dir + "/.var/app/com.usebottles.bottles/data/bottles/runners", ProtonPlus.Models.CompatibilityTool.Bottles (), new ProtonPlus.Models.Launcher ("Bottles")));

return locations;
}
Expand Down
6 changes: 3 additions & 3 deletions src/windows/home.vala
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,10 @@ namespace ProtonPlus.Windows {
}

private void btnAddVersion_Clicked () {
var dialogShowVersion = new ProtonPlus.Windows.Selector (this, currentLocation);
dialogShowVersion.response.connect ((response_id) => {
var dialogAddVersion = new ProtonPlus.Windows.Selector (this, currentLocation);
dialogAddVersion.response.connect ((response_id) => {
if (response_id == Gtk.ResponseType.APPLY) cbInstallLocation_Changed ();
dialogShowVersion.close ();
if (response_id == Gtk.ResponseType.CANCEL) dialogAddVersion.close ();
});
}

Expand Down

0 comments on commit b93e389

Please sign in to comment.