Compare commits
No commits in common. "master" and "0.1" have entirely different histories.
3 changed files with 17 additions and 18 deletions
|
@ -2,12 +2,6 @@
|
|||
### This is a basic utility to toggle the DLSS indicator overlay as described in [this arcticle](https://www.pcgamer.com/nvidia-dlss-indicator/)
|
||||
|
||||
|
||||
#### How to use:
|
||||
|
||||
Grab the latest release from [here](https://github.com/Watn3y/DLSS-indicator-toggle/releases/latest/download/DLSS_indicator_toggle.exe) and run it.
|
||||
|
||||
|
||||
|
||||
#### How to build:
|
||||
- Embed the manifest inside your binary
|
||||
|
||||
|
|
7
main.go
7
main.go
|
@ -24,7 +24,7 @@ func main() {
|
|||
Layout: VBox{},
|
||||
Children: []Widget{
|
||||
TextLabel{
|
||||
Text: "The DLSS Indicator status:",
|
||||
Text: "The DLSS Indicator is currently",
|
||||
TextAlignment: AlignHCenterVCenter,
|
||||
},
|
||||
TextLabel{
|
||||
|
@ -37,11 +37,10 @@ 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)
|
||||
setKeyOff()
|
||||
} else {
|
||||
setKey(1024)
|
||||
setKeyOn()
|
||||
}
|
||||
getKey()
|
||||
indicatorTextLabel.SetText(indicatorStatusString)
|
||||
|
|
22
reg.go
22
reg.go
|
@ -5,11 +5,8 @@ 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 or registry path not accessible"
|
||||
return
|
||||
}
|
||||
key, _ := registry.OpenKey(registry.LOCAL_MACHINE, `SOFTWARE\NVIDIA Corporation\Global\NGXCore`, registry.QUERY_VALUE)
|
||||
|
||||
value, _, _ := key.GetIntegerValue("ShowDlssIndicator")
|
||||
defer key.Close()
|
||||
|
||||
|
@ -23,9 +20,18 @@ func getKey() {
|
|||
indicatorStatusString = "NOT SET"
|
||||
}
|
||||
}
|
||||
|
||||
func setKey(value int) {
|
||||
func setKeyOn() {
|
||||
key, _ := registry.OpenKey(registry.LOCAL_MACHINE, `SOFTWARE\NVIDIA Corporation\Global\NGXCore`, registry.SET_VALUE)
|
||||
key.SetDWordValue("ShowDlssIndicator", uint32(value))
|
||||
|
||||
key.SetDWordValue("ShowDlssIndicator", uint32(1024))
|
||||
defer key.Close()
|
||||
|
||||
}
|
||||
|
||||
func setKeyOff() {
|
||||
key, _ := registry.OpenKey(registry.LOCAL_MACHINE, `SOFTWARE\NVIDIA Corporation\Global\NGXCore`, registry.SET_VALUE)
|
||||
|
||||
key.SetDWordValue("ShowDlssIndicator", uint32(0))
|
||||
defer key.Close()
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue