Small readability changes
This commit is contained in:
parent
6a68ad64b1
commit
85b7d1be11
2 changed files with 5 additions and 4 deletions
3
main.go
3
main.go
|
@ -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
6
reg.go
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue