feat(app): add character location tracking and display
This commit is contained in:
9
app.go
9
app.go
@@ -5,6 +5,7 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/wailsapp/wails/v2/pkg/runtime"
|
||||
)
|
||||
@@ -126,3 +127,11 @@ func (a *App) ListCharacters() ([]CharacterInfo, error) {
|
||||
}
|
||||
return list, nil
|
||||
}
|
||||
|
||||
// GetCharacterLocations exposes current locations for all characters
|
||||
func (a *App) GetCharacterLocations() ([]CharacterLocation, error) {
|
||||
if a.ssi == nil { return nil, errors.New("ESI not initialised") }
|
||||
ctx, cancel := context.WithTimeout(a.ctx, 6*time.Second)
|
||||
defer cancel()
|
||||
return a.ssi.GetCharacterLocations(ctx)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user