49 lines
1.0 KiB
Go
49 lines
1.0 KiB
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
|
|
"conjure-os/lib"
|
|
|
|
"github.com/wailsapp/wails/v2/pkg/runtime"
|
|
)
|
|
|
|
// App struct
|
|
type App struct {
|
|
ctx context.Context
|
|
}
|
|
|
|
type Game struct {
|
|
Title string
|
|
Developper string
|
|
Year int
|
|
Cartridge string
|
|
}
|
|
|
|
// NewApp creates a new App application struct
|
|
func NewApp() *App {
|
|
return &App{}
|
|
}
|
|
|
|
// startup is called when the app starts. The context is saved
|
|
// so we can call the runtime methods
|
|
func (a *App) startup(ctx context.Context) {
|
|
a.ctx = ctx
|
|
lib.Start()
|
|
}
|
|
|
|
// Greet returns a greeting for the given name
|
|
func (a *App) Greet(name string) string {
|
|
runtime.LogInfo(a.ctx, "Test : "+name)
|
|
return fmt.Sprintf("Hello %s, It's show time!", name)
|
|
}
|
|
|
|
func (a *App) SelectGame(id string) {
|
|
}
|
|
|
|
func (a *App) LoadGames() []Game {
|
|
|
|
return []Game{Game{"Soul Shaper", "Conjure", 2024, "https://img.itch.zone/aW1hZ2UvMTkwMzc5MS8xMTgzNzY0Ny5wbmc=/794x1000/Tj3YaD.png"}, Game{"Overdue", "Conjure", 2023, "https://img.itch.zone/aW1hZ2UvMTM2MTI1OS84NjE0MDY4LnBuZw==/794x1000/Y%2B8kqa.png"}}
|
|
}
|