DavidoTek / ProtonUp-Qt

Install and manage GE-Proton, Luxtorpeda & more for Steam and Wine-GE & more for Lutris with this graphical user interface.
https://davidotek.github.io/protonup-qt
GNU General Public License v3.0
1.18k stars 39 forks source link

Tool marked as unused even if it is the "global" compatibility tool. #254

Closed MithicSpirit closed 7 months ago

MithicSpirit commented 1 year ago

Describe the bug
Compatibility tools are marked as "(unused)" even if the tool is set as the global compatibility tool (under steam settings, steam play, run other titles with)

To Reproduce

  1. Install a compatibility tool like Proton GE
  2. Set it as the global compatibility tool. This requires working directly with the configuration file due to https://github.com/ValveSoftware/steam-for-linux/issues/6043. Steps for doing so are available here, but instead of Proton-stl set it to the Proton GE version that was installed instead.
  3. Re-open protonup-qt to check
  4. Still marked as "(unused)"

Expected behavior
I expect it to not be marked as unused. Ideally there'd also be a way to enable setting it as the global compatibility tool so that it's not necessary to go through all of the hassle of manually editing config file.

Desktop (please complete the following information):

Terminal output

qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
qt.pysideplugin: Environment variable PYSIDE_DESIGNER_PLUGINS is not set, bailing out.
qt.pysideplugin: No instance of QPyDesignerCustomWidgetCollection was found.
Qt WebEngine seems to be initialized from a plugin. Please set Qt::AA_ShareOpenGLContexts using QCoreApplication::setAttribute and QSGRendererInterface::OpenGLRhi using QQuickWindow::setGraphicsApi before constructing QGuiApplication.
ProtonUp-Qt 2.8.0 by DavidoTek. Build Info: built from source.
Python 3.11.3 (main, Apr  5 2023, 15:52:25) [GCC 12.2.1 20230201], PySide 6.5.1
Platform: Arch rolling Linux-6.3.5-zen1-1-zen-x86_64-with-glibc2.37
Loading locale en / en_US
Loaded ctmod GE-Proton
Loaded ctmod Wine-GE
Loaded ctmod Boxtron
Loaded ctmod D8VK (nightly)
Loaded ctmod Kron4ek Wine-Builds Vanilla
Loaded ctmod Lutris-Wine
Loaded ctmod Luxtorpeda
Loaded ctmod NorthStar Proton (TitanFall 2)
Loaded ctmod Proton Tkg
Loaded ctmod Proton Tkg (Wine Master)
Loaded ctmod Roberta
Loaded ctmod Steam-Play-None
Loaded ctmod SteamTinkerLaunch
Loaded ctmod SteamTinkerLaunch-git
Loaded ctmod vkd3d-lutris
Loaded ctmod vkd3d-proton
Loaded ctmod Wine Tkg (Valve Wine)
Loaded ctmod Wine Tkg (Vanilla Wine)
Loaded ctmod DXVK
Loaded ctmod DXVK Async
Loaded ctmod DXVK (nightly)
Gamepad error: No gamepad found.
DavidoTek commented 1 year ago

Good suggestion.

Compatibility tools are marked as "(unused)" even if the tool is set as the global compatibility tool

Yes, currently tools are only marked as used if they are configured for individual games. It should be possible to also detect global compatibility tools and set it as used.

Ideally there'd also be a way to enable setting it as the global compatibility tool so that it's not necessary to go through all of the hassle of manually editing config file.

We could do that too. We need to find some place to put it in the ui.

MithicSpirit commented 1 year ago

It should be possible to also detect global compatibility tools and set it as used.

I'm not sure how protonup-qt works internally, but if you're working directly with the configuration files then it shouldn't be too hard (see the guide I linked before). The global configuration just corresponds to the game with ID 0.

sonic2kk commented 1 year ago

Detecting if a tool is used globally should be straightforward enough, I wonder how we'd handle the game count though? Maybe it won't be a problem, if individual (Windows) games are set to use a tool with ID 0 (might be misunderstanding, not in front of my PC to check the VDF file atm)

We need to find some place to put it in the ui.

Perhaps it could go in the ctinfo dialog? It could go below the compat tool info but above the list of games in use. If memory serves there is a row of buttons on the right, this button could go on the left. It could say something like "Mark Global" or "Mark Default, with an accompanying tooltip. Though it may be worth warning a user beforehand, since we're already in a dialog, that might be a bit cluttered 😄

When a tool is already the global default, we could grey out the button and change the tooltip/show a label if there is room somehow to say something like "This tool is already the default". (or button text, but not sure if this is good from a UIX perspective...)

Instead of a button here, we could also have a context menu when you right click on a tool, but pretty much everything in ProtonUp-Qt can be done currently from a button on the menus and using a context menu would "hide" this option. Not to mention, not showing the context menu for an already global tool, or showing the one-item context but having the option disabled, might not be very neat. Though using a context menu would alleviate the issue of showing a warning dialog, so I'm not sure 😅

To display a tool as being the global one, we could also have some additional text beside a tool in the compat tool list on the main menu. We mark when a tool is unused, perhaps we could visually mark when a tool is selected globally. We could mark the tool name in bold, append (Global) to it, and force it to the top of the tool list, to visually differentiate it from "unused" and regular tools.

Though some tools may not be available to be selected globally, such as anticheat runtimes, so we'll need to remember to exclude these.

DavidoTek commented 1 year ago

If individual (Windows) games are set to use a tool with ID 0 (might be misunderstanding, not in front of my PC to check the VDF file atm)

I think the game id is "0":

"CompatToolMapping"
{
    "0"
    {
        "name"        "proton_experimental"
        "config"      ""
        "priority"    "75"
    }
}

could say something like "Mark Global" or "Mark Default, with an accompanying tooltip. Though it may be worth warning a user beforehand, since we're already in a dialog, that might be a bit cluttered smile

Sounds good

Instead of a button here, we could also have a context menu when you right click on a tool

I think the first solution you described is more touch screen friendly.

To display a tool as being the global one, we could also have some additional text beside a tool in the compat tool list on the main menu

A small badge saying "global" with a tooltip in the main window would be cool. I'm not sure how easy that can be done though. For now, appending (Global) seems reasonable.

mockup1

sonic2kk commented 1 year ago

When investigating, something I noticed is that seemingly, if a game in the CompatToolMapping section doesn't have a name (i.e. "name" "") then it should just be using the default compatibility tool. If it's set to use a tool that is no longer installed, Steam on the UI handles this by showing "Available for [platform icons" and the config.vdf still lists the old version. I did a quick skim and I couldn't find AppIDs for native games here either, so it appears that only Proton games are in this mapping section, and it should be safe to assume that if an entry doesn't have a name, then it's probably using the default.

Though having said that, I'm not sure how that works for games which have a "recommended" version from Valve (on desktop and on Steam Deck). If Valve recommend, say, proton_7 for a game, but the global default is proton_8, I don't know if the mapping lists proton_7 or if it's also still blank. That is something I'll need to check when I have a bit more time (or if someone else wants to check please do).


I did a quick test and on a branch (https://github.com/sonic2kk/ProtonUp-Qt/commit/3b755bd24330722fcd976cf33ce0203cc99982f6) I was able to put together a way to mark a tool as global, but not to stop it being marked as unused. As part of not marking a global tool as unused, there's an implicit expectation that the game count would be accurate too, but at the same time, that game count could easily be hundreds if not thousands, and it's slightly less useful to see. Though thanks to the search feature, it might be a bit more useful, but still this global tool game list would essentially be a catch-all for games that don't have a compatibility tool explicitly set.

So when a name entry in CompatToolMapping is blank, we need a way as marking it as used by the global tool. Maybe we need a global attribute on BasicCompatTool and then we need some way to mark the games as used by this tool. I haven't looked too deeply into how this works but it should be possible, I hope :sweat_smile:

DavidoTek commented 7 months ago

that game count could easily be hundreds if not thousands, and it's slightly less useful to see

I think it is fine to only display the number of compatibility tools which are explicitly overwritten.

when a name entry in CompatToolMapping is blank, we need a way as marking it as used by the global tool. Maybe we need a global attribute on BasicCompatTool

Maybe we can do something like app.compat_tool = ct.get('name') or 'global' in https://github.com/DavidoTek/ProtonUp-Qt/blob/4d6eb493086169a71934903c0400a1f314326097/pupgui2/steamutil.py#L84 hmm

sonic2kk commented 7 months ago

With #314 the core of this feature request has been added; ProtonUp-Qt will now mark when a tool is global.

There are a couple of remaining things that could be done however, which I noted on the PR but will quickly summarize here as well:

There are implementation details to each of these of course but that's a high level list of some further improvements.

MithicSpirit commented 7 months ago

Thank you so much. I'm closing this issue now since it has been addressed, but I would love to see those additional features you listed (especially the last one to allow choosing the global tool through protonup-qt rather than having to go through steam/the config). Feel free to reopen if you'd still like to track those features on this issue.

sonic2kk commented 7 months ago

I got a couple of PRs up to address some of the more "quick win" elements of what remains (#326, #327). This should knock two of the items off the list, I can work on hiding the games list after #319, and the last two will be the trickier ones to implement.

For marking tools as global, I also had a look back at #314, and it seems the ctinfo dialog was decided as the place to put the button to mark a tool as global. There are a couple of things we'll need to consider for that, such as perhaps showing a confirmation dialog and warning if Steam is running (editing config.vdf while Steam is running means the contents will be overwritten when Steam is closed, we warn to close it on the Games List and Batch Update screens too), and also where exactly to put the option to do this on the ctinfo dialog. But, the actual functionality should be straightforward. We already have code to modify the CompatToolMapping section, this should be very easy to set since we can already manipulate config.vdf and since the mapping entry is always the same.

For adding a badge to display that a tool is global, we would probably also want to do the same for unused (see DavidoTek's mockup from earlier in this issue). I have no idea how to implement that with the current way the tool list is implemented, so I don't even see a high level implementation path yet.

sonic2kk commented 7 months ago

Even though this is closed and that's totally fine to me, just in case I caused any misunderstanding, this is not in a release yet just fyi :-) It will be in the next release though unless it needs reverted for some reason.