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

Feature: Add setting to hide non downloaded DLSS versions in selector #224

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

Zagrthos
Copy link
Contributor

Summary

This resolves #208.

Detailed changes

Added a new "Hide Not Downloaded DLSS Versions" toggle switch on the settings page which defaults to false.
This new settings is respected in DLSSPickerControl and filters out the non-downloaded DLSS versions with a Where condition through Linq.
Additionally I added a new dialog confronting the user when the setting is enabled but no DLSS version is locally downloaded through DLSS Swapper.

Additional changes

For the sake of modernity I also re-formatted each of the touched files by me, namely the following:

  • Settings.cs
  • DLSSPickerControl.xaml.cs
  • DLSSPickerControl.xaml
  • SettingsPage.xaml.cs
  • SettingsPage.xaml
  • GameGridPage.xaml.cs
  • GameGridPage.xaml

There I mainly replaced the conditional operators (==, !=) with pattern matching or simplified them. Also I removed all useless using statements at the top of the files to reduce length and make them more readable.

One thing to note, on DLSSPickerControl.xaml.cs I switched the hotpath of detectedVersion. It now checks for not null instead the other way around and out-commented the else which is moved with the TODO: comment a little lower so it's not completely disappearing.

Notes

Everything was tested by myself for functionality.

@beeradmoore
Copy link
Owner

Thanks for this PR, I'll take a look at it on the weekend.

@beeradmoore
Copy link
Owner

I think there is an issue with selecting DLSS verions in the dropdown.

I enabled the feature to hide DLSS versions that are not downloaded

Screenshot 2024-08-25 142922

This says I can install v3.6.0.0, but if I turn the feature off there is no DLSS v3.6.0.0 shown.

Checking the library I do have v3.6.0.0 downloaded.

@Zagrthos
Copy link
Contributor Author

Seems like my tests weren't that excessive that I thought I covered all cases.

Pushed a fix and now it seems to work.

@beeradmoore
Copy link
Owner

I will test this when I get to testing the other one again

@beeradmoore
Copy link
Owner

I just had to do a merge of all those new changes back in to this so this can be merged back in.

The show/hide works great.

The wording in settings may change in the future, but its good enough for now. I think non-downloaded works better than not downloaded. But I am not 100% sure on if its the correct words to use.

The only other thing is I wonder what the use case should be for a game with DLSS versoin not in the downloaded list. I think this looks a little confusing (especially if the panel covers the game)

image

But also what we have currently is an option saying to download the version that is already installed

image

Because the layout of this menu is getting completly changed I think we could probably leave it for now as its already an existing problem and come back to it when I get that new menu in.

Marking the current as "fake downloaded" won't work as when you select a different version the current is now different and you can't see the old version in the list. Maybe based on that other idea of improting DLSS from games into the library, when a user wants to change a DLSS version from one that does not exist it tells them this will be automatically imported or something.

Maybe instead of IsDownloaded it should be IsAvailable where that is true if either of these are true

  • it is downloaded
  • it is the current dlss version
  • it is the backup version

But then it still has the issue of if you go from 3.5.10 (not in library) to 3.6 to 3.7 that now 3.5.10 is gone. The button to reset also won't work as that would only go back to 3.6.

Any thoughts on how that could work? (not required to accept this PR)

@Zagrthos
Copy link
Contributor Author

Zagrthos commented Sep 2, 2024

The wording in settings may change in the future, but its good enough for now. I think non-downloaded works better than not downloaded. But I am not 100% sure on if its the correct words to use.

I choose not downloaded because it implies that this version has not yet been downloaded by the user. Non-downloaded would be something do describe it as something different (from my POV).

The only other thing is I wonder what the use case should be for a game with DLSS versoin not in the downloaded list. I think this looks a little confusing (especially if the panel covers the game)

Here we can solve this by probably copying this one to the DLSS Swapper download directory where the other files lie, then it's get's detected as well and is shown inside the list. Would also fix the follow-up comment

But also what we have currently is an option saying to download the version that is already installed

Maybe based on that other idea of improting DLSS from games into the library, when a user wants to change a DLSS version from one that does not exist it tells them this will be automatically imported or something.

I probably just described this in other words, lol.

But then it still has the issue of if you go from 3.5.10 (not in library) to 3.6 to 3.7 that now 3.5.10 is gone. The button to reset also won't work as that would only go back to 3.6.

We could do 3 fields in the DB for this.

  1. Initial version with what the game was delivered (game was found the first time)
  2. Swapped version through user
  3. Backup version is the last version which was swapped by the user before changing to the new one

Edit: And wasn't there a control in WinUI 3 where you're able to create a button with multiple options to choose from which the user can click? This is how you could solve this.
I though about something like that: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.dropdownbutton

@beeradmoore
Copy link
Owner

beeradmoore commented Sep 2, 2024

Non-downloaded would be something do describe it

Yep, that makes sense. I was also thinking "local" but it also doesn't feel right.

Here we can solve this by probably copying this one to the DLSS Swapper download...

Seems copying to local automatically (without even alerting users) may solve a bunch of problems. Unsure if it introduces new problems of users filling up their downloads list if they don't want all versions there. We could add a hide button in the library. Also only enable delete if the DLSS version is not an initial or current version (see below) for any game.

There is a seperate issue for that here,
#227

We could do 3 fields in the DB for this.

We would also need to handle new version of DLSS detected in game folder and update that as "initial". We could then just do 2, initial and current. On launch if initial is not set we set it to actual from disk. If current is not actual from disk we update initial to be current. Setting initial would also copy initial to be the backed up version on disk.

Detecting of current changing would also be the point we alert for this comment.

EDIT:

And wasn't there a control in WinUI 3 where you're able to create a button with multiple options

I was planning to use a combobox (it may be dropdownbutton). I'll see if I can find screenshot of that

@beeradmoore
Copy link
Owner

I finally got all the code merged into my branch, and updated with WindowsAppSDK 1.6. This is what I was thinking of with the new UI for picking a DLSS version. I did not have version picker added here yet. I will do so soon with that combobox.

image

@Zagrthos
Copy link
Contributor Author

Zagrthos commented Sep 7, 2024

Now that's a good looking one. Good job! 🙂
And finally having updated to the latest version, haha. Looked forward to that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature request] option to hide non-downloaded DLSS versions
2 participants