From 60fd968113318eecc218ea46870699592fffd641 Mon Sep 17 00:00:00 2001 From: crgimenes Date: Wed, 6 Mar 2024 05:49:02 -0300 Subject: [PATCH] update go mod and add -quiet parameter (disable sound) --- go.mod | 2 +- go.sum | 4 ++-- main.go | 4 ++++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index f5d47a1..f3ceed4 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( golang.org/x/image v0.15.0 // indirect golang.org/x/mobile v0.0.0-20240213143359-d1f7d3436075 // indirect golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.17.0 // indirect + golang.org/x/sys v0.18.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index a89e151..8510c4a 100644 --- a/go.sum +++ b/go.sum @@ -22,8 +22,8 @@ golang.org/x/mobile v0.0.0-20240213143359-d1f7d3436075 h1:iZzqyDd8gFkJZpsJNzveyS golang.org/x/mobile v0.0.0-20240213143359-d1f7d3436075/go.mod h1:Y8Bnziw2dX69ZhYuqQB8Ihyjks1Q6fMmbg17j9+ISNA= golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= diff --git a/main.go b/main.go index 65c7c2f..7fa540c 100644 --- a/main.go +++ b/main.go @@ -39,6 +39,7 @@ type neko struct { type Config struct { Speed int `ini:"speed" cfg:"speed" cfgDefault:"2" cfgHelper:"The speed of the cat."` Scale float64 `ini:"scale" cfg:"scale" cfgDefault:"2.0" cfgHelper:"The scale of the cat."` + Quiet bool `ini:"quiet" cfg:"quiet" cfgDefault:"false" cfgHelper:"Disable sound."` } var ( @@ -63,6 +64,9 @@ func (m *neko) Layout(outsideWidth, outsideHeight int) (int, int) { } func playSound(sound []byte) { + if cfg.Quiet { + return + } if currentplayer != nil && currentplayer.IsPlaying() { currentplayer.Close() }