From 98be679ce2b8fea643a88fb27816fe36c3f63db3 Mon Sep 17 00:00:00 2001 From: Alex Zorzi Date: Thu, 18 Aug 2022 14:47:29 +0200 Subject: [PATCH 1/3] Handle no DLSS support error (#1) * Handle no DLSS support error * Small readability changes Authored-by: AlexZorzi Co-authored-by: Watn3y --- main.go | 5 +++-- reg.go | 22 ++++++++-------------- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/main.go b/main.go index a5dc440..215bb79 100644 --- a/main.go +++ b/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 { - setKeyOff() + setKey(0) } else { - setKeyOn() + setKey(1024) } getKey() indicatorTextLabel.SetText(indicatorStatusString) diff --git a/reg.go b/reg.go index 4a78f00..c8c73df 100644 --- a/reg.go +++ b/reg.go @@ -5,8 +5,11 @@ import ( ) func getKey() { - key, _ := registry.OpenKey(registry.LOCAL_MACHINE, `SOFTWARE\NVIDIA Corporation\Global\NGXCore`, registry.QUERY_VALUE) - + 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 + } value, _, _ := key.GetIntegerValue("ShowDlssIndicator") defer key.Close() @@ -20,18 +23,9 @@ func getKey() { indicatorStatusString = "NOT SET" } } -func setKeyOn() { + +func setKey(value int) { key, _ := registry.OpenKey(registry.LOCAL_MACHINE, `SOFTWARE\NVIDIA Corporation\Global\NGXCore`, registry.SET_VALUE) - - key.SetDWordValue("ShowDlssIndicator", uint32(1024)) + key.SetDWordValue("ShowDlssIndicator", uint32(value)) 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() - } From 799c008c52fa5a6dc3bf241b607b9d3fecef94c2 Mon Sep 17 00:00:00 2001 From: Watn3y Date: Thu, 18 Aug 2022 14:52:23 +0200 Subject: [PATCH 2/3] small text change --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 215bb79..05cc3b2 100644 --- a/main.go +++ b/main.go @@ -24,7 +24,7 @@ func main() { Layout: VBox{}, Children: []Widget{ TextLabel{ - Text: "The DLSS Indicator is currently", + Text: "The DLSS Indicator status:", TextAlignment: AlignHCenterVCenter, }, TextLabel{ From 048bed085f0b7e3754f7af59a803637b6ebc413b Mon Sep 17 00:00:00 2001 From: Noah Theus Date: Sat, 21 Jan 2023 02:51:06 +0100 Subject: [PATCH 3/3] Add Download link --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index a1f2967..592e116 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,12 @@ ### 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