feat: add realtime vis

This commit is contained in:
Louis Dalibard 2025-02-18 14:56:16 +01:00
parent 615b38d6fa
commit e7fd56c817
2 changed files with 7 additions and 3 deletions

View File

@ -3,6 +3,10 @@ An EEW system for Linux using JMA data provided by the Wolfx Project.
This software comes with zero guarantee. This software could fail at any time. I made this since there were no better free and open source alternatives for Linux. This software comes with zero guarantee. This software could fail at any time. I made this since there were no better free and open source alternatives for Linux.
# Real time vis
**VERY IMPORTANT**:
Because of how the real time visualisation is implemented, you will have to restart the process when you close the realtime visualisation window.
# Installation # Installation
## Linux ## Linux
Install the `ontake-hayai-git` package from the AUR if on Arch. For other distros you can just build `hayai` from source with `go build` (only `go` is required). Install the `ontake-hayai-git` package from the AUR if on Arch. For other distros you can just build `hayai` from source with `go build` (only `go` is required).

View File

@ -9,6 +9,7 @@ import (
"image/color" "image/color"
"log" "log"
"math" "math"
"os"
"time" "time"
"github.com/disintegration/imaging" "github.com/disintegration/imaging"
@ -34,8 +35,7 @@ var Displaying bool
func (g *Game) Update() error { func (g *Game) Update() error {
if ebiten.IsWindowBeingClosed() { if ebiten.IsWindowBeingClosed() {
Displaying = false os.Exit(0)
return ebiten.Termination
} }
return nil // Add kill after timer TODO return nil // Add kill after timer TODO
} }
@ -160,7 +160,7 @@ func Render(event jmaeew.JMAEEW) {
ebiten.SetWindowPosition(screenW/2-config.Config.RealtimeVisRenderSize/2, screenH/2-config.Config.RealtimeVisRenderSize/2) ebiten.SetWindowPosition(screenW/2-config.Config.RealtimeVisRenderSize/2, screenH/2-config.Config.RealtimeVisRenderSize/2)
ebiten.SetVsyncEnabled(true) ebiten.SetVsyncEnabled(true)
ebiten.SetWindowClosingHandled(true) ebiten.SetWindowClosingHandled(true)
if err := ebiten.RunGameWithOptions(gameData, &ebiten.RunGameOptions{ScreenTransparent: true}); err != nil { if err := ebiten.RunGameWithOptions(gameData, &ebiten.RunGameOptions{}); err != nil {
log.Fatal(err) log.Fatal(err)
} }
} }