Handle no DLSS support error #1

Merged
AlexZorzi merged 2 commits from master into master 2022-08-18 14:47:30 +02:00
2 changed files with 5 additions and 4 deletions
Showing only changes of commit 85b7d1be11 - Show all commits

View file

@ -37,10 +37,11 @@ func main() {
Text: "Toggle Indicator",
OnClicked: func() {
// a value of 1024 activates the overlay, a value of 0 deactivates it. Other values seem to deactivate it as well but you never know
if indicatorStatus == 1024 {
setKey(0)
} else {
setKey(1)
setKey(1024)
}
getKey()
indicatorTextLabel.SetText(indicatorStatusString)

6
reg.go
View file

@ -7,7 +7,7 @@ import (
func getKey() {
key, err := registry.OpenKey(registry.LOCAL_MACHINE, `SOFTWARE\NVIDIA Corporation\Global\NGXCore`, registry.QUERY_VALUE)
if err != nil {
indicatorStatusString = "Error: DLSS not supported!"
indicatorStatusString = "Error: DLSS not supported or registry path not accessible"
return
}
value, _, _ := key.GetIntegerValue("ShowDlssIndicator")
@ -26,6 +26,6 @@ func getKey() {
func setKey(value int) {
key, _ := registry.OpenKey(registry.LOCAL_MACHINE, `SOFTWARE\NVIDIA Corporation\Global\NGXCore`, registry.SET_VALUE)
key.SetDWordValue("ShowDlssIndicator", uint32(value * 1024))
key.SetDWordValue("ShowDlssIndicator", uint32(value))
defer key.Close()
}
}