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

DXVK HUD Options not displaying changed options correctly when opened a second time #488

Closed
sonic2kk opened this issue Jun 7, 2022 · 11 comments

Comments

@sonic2kk
Copy link
Owner

sonic2kk commented Jun 7, 2022

The DXVK HUD options menu has a bug where selecting a menu item, closing the menu and opening the menu again will not display the updated menu option. However, DXVK_HUD is seemingly set correctly, as when a game launches it uses the correct options.

Here's a set of steps to reproduce the behaviour, if there are already DXVK HUD variables selected you can skip to Step 4:

  1. Open DXVK HUD options menu
  2. Select a menu option e.g. fps
  3. Press OK Button
  4. Open DXVK HUD options menu again
  5. Select a different menu option, e.g. full
  6. Press OK button
  7. Open DXVK HUD for a final time
  8. The first option, e.g. fps, will still be selected
  9. Press Cancel button
  10. Launch game, DXVK HUD will display with the last selected menu item and not the one displayed in the menu the last time it was opened. In this example, it will use full, even though fps was displayed the last time the menu was open, which is correct behaviour but is a visual bug in the menus

I spent a while debugging this and the behaviour is a bit strange internally too. Basically when the menu is opened in Step 7, the DXVK_HUD variable is actually set to fps, so the logic for setting the selected menu items based on the DXVK_HUD variable is correct. It's the variable itself that's wrong. And it's wrong as far up as before the call to DxvkHudPick. Putting a log of DXVK_HUD before this call reveals that it's set incorrectly before the function is called! But putting a log after this call reveals that when changing the select HUD item, it's set correctly outside of this function. Here's an example:

...
# First open
DXVK_HUD is full before DxvkHudPick call
DxvkHudPick call
DXVK_HUD is fps after DxvkHudPick call

# Second open
DXVK_HUD is full before DxvkHudPick call
...

So basically the variable is set correctly when leaving the menu, but when you open the menu again, before the call to the menu is made the variable is wrong again. Perhaps not much can be done about this (maybe a similar issue to what was discussed in #440?) but it is kind of jarring if you want to go in and edit your DXVK HUD arguments again 😅

@frostworx
Copy link
Collaborator

Thanks for reporting, there is definitely something wrong with that option.
Initially I thought that the variables are simply not updated, because the "in settings" menu button launches a 2nd steamtinkerlaunch instance, so the first instance doesn't get notified about any changes, but this is also reproducible
by directly using the undocumented steamtinkerlaunch dxh command line option. Changes don't seem to have any effect.
Probably easy to fix, but no idea when I find the time to look into it.
Will be away for ~10 days in 3 days and much to do until then.

@sonic2kk
Copy link
Owner Author

sonic2kk commented Jun 7, 2022

Thanks for looking into it! Enjoy the time away 😄

@frostworx
Copy link
Collaborator

frostworx commented Jun 7, 2022

Hah, seems like only the initial loading of the game config file is missing in the DxvkHudPick function.

edit: whoops, sorry, didn't mean to update the comment before writing, that I'll fix it now :)

frostworx pushed a commit that referenced this issue Jun 7, 2022
@frostworx
Copy link
Collaborator

should be fixed :)

@sonic2kk
Copy link
Owner Author

sonic2kk commented Jun 7, 2022

Seems like its fixed! Thank you :)

@sonic2kk sonic2kk closed this as completed Jun 7, 2022
@frostworx
Copy link
Collaborator

Thanks for testing :)

@sonic2kk
Copy link
Owner Author

sonic2kk commented Jun 7, 2022

Hm, so now I'm encountering a problem where the DXVK_HUD=0 change doesn't seem to be working. It also doesn't seem to be working on my branch for it which is slightly worrying, even though I verified it was writing out last night. Though there was some odd behaviour in general, when trying to test your fix I had to restart my computer after installing STL. And to get any extra writelog commands to display in the STL logs I had to restart my machine again.

So I think this is just a weird problem with my computer, but could you test to see if DXVK_HUD=0 is actually writing out to the game config file? Just to be sure, though I don't know why the code wouldn't work since it worked last night and also logically I'm not sure why it wouldn't write out. Putting a log for writelog "INFO" "HUD var is '$DXVK_HUD'" under the updateConfigEntry for nothing selected outputs the variable correctly. I really feel like something weird has happened with my STL installation but just to make completely extra sure :)

@frostworx
Copy link
Collaborator

ah, this is easy to fix. give me a sec. sorry, that I haven't tested this before merging.

frostworx pushed a commit that referenced this issue Jun 7, 2022
@frostworx
Copy link
Collaborator

above commit should do it :)

@sonic2kk
Copy link
Owner Author

sonic2kk commented Jun 7, 2022

Can confirm that fixed it, woohoo! Thank you!! I should've taken more care, though I was pretty sure this was working before I submitted the PR. Either way, it works now 🎉

@frostworx
Copy link
Collaborator

cool, thanks for confirmation :)

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

No branches or pull requests

2 participants