Feature: Add setting to hide non downloaded DLSS versions in selector
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.
Thanks for this PR, I'll take a look at it on the weekend.
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
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.
Seems like my tests weren't that excessive that I thought I covered all cases.
Pushed a fix and now it seems to work.
I will test this when I get to testing the other one again
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)
But also what we have currently is an option saying to download the version that is already installed
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)
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.
- Initial version with what the game was delivered (game was found the first time)
- Swapped version through user
- 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
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, https://github.com/beeradmoore/dlss-swapper/issues/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
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.
Now that's a good looking one. Good job! 🙂 And finally having updated to the latest version, haha. Looked forward to that!
I'll try and gonna check if I can merge main somehow into this branch. The changes are massive and I already got 5 conflicts for it 😄
Yeah sorry about that. Quite a few things have changed. Although I think things will be easier if you branch from development and start again.
You should be able to bring the settings across easy, and in the new DLLPickerControlModel is where you can check settings and remove from the new lists we make here ;)
Yeah sorry about that. Quite a few things have changed. Although I think things will be easier if you branch from development and start again.
You should be able to bring the settings across easy, and in the new
DLLPickerControlModelis where you can check settings and remove from the new lists we make here ;)
Don't worry, I understood the new code pretty fast. 🙂 And I like the new MVVM approach.
I force pushed back to the commit where I branched from main, then merged main and merged my (new) changes back inside.
PR is Ready for Review again.
Thanks for the fast fix! I will re-visit this after v1.1.5 is out (hopefully tonight)
Ever since I had started doing bulk changes to how a lot of pages and code works I keep seeing the "Pull Requests (1)" up the top and thinking oh boy I hope this one can be fixed
Haha no worries! I am honest I actually forgot I still had this open PR here because somehow the project went fully into the back of my head. 😄
Great to see you didn't abandoned the app tho!
Sorry, we got some conflicts in settings after the recent changes
Sorry, we got some conflicts in settings after the recent changes
Conflicts are solved now.
Perfect, I'll have a look after work today
There was something about "hide non downloaded" that just didnt feel right, I don't know what it is. I renamed it to "only show downloaded". Same thing, but removes the negation in the middle. Seems to fit better.
I also found situations where you could just not have any DLLs in the list so I added an info panel
Thanks for refining! 🙂
The info box indeed is a good thing which I probably missed. Thought about it tho but since in my tests there was at least one DLL in each game (which supported any tech) it never happened...