wip 0.0.5
All checks were successful
CloudSave/pipeline/head This commit looks good

This commit is contained in:
2025-09-02 22:32:07 +02:00
parent 8518503d40
commit 0a33d1b68d
15 changed files with 288 additions and 14 deletions

View File

@@ -13,9 +13,15 @@ const defaultDocumentRoot string = "C:\\ProgramData\\CloudSave"
//go:embed res/icon.ico
var icon []byte
var (
updateChan chan struct{}
)
func main() {
updateChan = make(chan struct{})
go systray.Run(onReady, onExit)
run()
run(updateChan)
}
func fatal(message string, exitCode int) {
@@ -28,12 +34,20 @@ func onReady() {
systray.SetTooltip("CloudSave")
systray.SetIcon(icon)
mQuit := systray.AddMenuItem("Quit", "Quit")
mReload := systray.AddMenuItem("Reload", "Reload the server data")
mQuit := systray.AddMenuItem("Quit", "Quit the server")
go func() {
<-mQuit.ClickedCh
os.Exit(0)
}()
go func() {
for {
<-mReload.ClickedCh
updateChan <- struct{}{}
}
}()
}
func onExit() {