Simplify GUI settings and build flags

This commit is contained in:
every_holiday
2026-06-26 09:16:46 +09:00
parent 4d77e67870
commit ae426244e0
22 changed files with 846 additions and 237 deletions

View File

@@ -10,6 +10,7 @@ import (
"vrc_osc_go/internal/config"
"vrc_osc_go/internal/consenttool"
"vrc_osc_go/internal/buildinfo"
"vrc_osc_go/internal/osc"
)
@@ -18,17 +19,25 @@ type discordMuteState struct {
muted bool
buttonPressed bool
lastAction time.Time
lastPressEdge time.Time
}
func Run(configPath string, mode string) error {
if mode != "" {
return consenttool.Run(configPath, mode)
}
log.Printf("app run begin config=%s mode=%s", configPath, mode)
if err := setupRuntimeLogger(); err != nil {
return err
}
log.Printf("runtime logger ready")
cfg, err := config.Load(configPath)
if err != nil {
log.Printf("config load failed: %v", err)
return err
}
log.Printf("app version=%s build=%s", buildinfo.Version, buildinfo.BuildTime)
InitGuestTracker(NewGuestTracker(cfg.VrcLog.GuestNames))
log.Printf("vrc_osc_go starting osc=%s:%d config=%s", cfg.OSC.Host, cfg.OSC.Port, configPath)
@@ -52,14 +61,25 @@ func Run(configPath string, mode string) error {
}
return nil
})
server.Map("translation", func(_ string, args []osc.Value) error {
log.Printf("received translation args=%+v", args)
if err := runPythonTranslationFromLastOCR(); err != nil {
log.Printf("translation failed: %v", err)
return err
}
return nil
})
errCh := make(chan error, 1)
go func() {
log.Printf("osc server listening on %s:%d", cfg.OSC.Host, cfg.OSC.Port)
errCh <- server.Serve()
}()
log.Printf("starting vrchat log watcher")
go watchVrchatLog()
log.Printf("vrchat log watcher goroutine started")
startSelfMonitor(cfg, discordState)
log.Printf("self monitor started")
sigCh := make(chan os.Signal, 1)
signal.Notify(sigCh, os.Interrupt, syscall.SIGTERM)