generated from dave/wails-template
Refaator service from *Addon to Addon
This commit is contained in:
15
main.go
15
main.go
@@ -7,7 +7,6 @@ import (
|
||||
"io"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/wailsapp/wails/v2"
|
||||
"github.com/wailsapp/wails/v2/pkg/options"
|
||||
@@ -35,8 +34,8 @@ var gamePath string
|
||||
var addonService *AddonService
|
||||
|
||||
type Settings struct {
|
||||
GamePath string `json:"gamePath"`
|
||||
Addons map[string]*Addon `json:"addons"`
|
||||
GamePath string `json:"gamePath"`
|
||||
Addons map[string]Addon `json:"addons"`
|
||||
}
|
||||
|
||||
func main() {
|
||||
@@ -49,12 +48,14 @@ func main() {
|
||||
settings := Settings{}
|
||||
err = json.NewDecoder(settingsFile).Decode(&settings)
|
||||
if err != nil {
|
||||
Error.Printf("error decoding settings: %s", err)
|
||||
return
|
||||
Warning.Printf("error decoding settings: %s", err)
|
||||
settings = Settings{}
|
||||
}
|
||||
log.Printf("Loaded settings: %+v", settings)
|
||||
|
||||
addonService = NewAddonService()
|
||||
gamePath = filepath.Join("C:\\", "Games", "WoWRuski")
|
||||
addonService = &AddonService{}
|
||||
addonService.Addons = settings.Addons
|
||||
return
|
||||
app := NewApp()
|
||||
|
||||
err = wails.Run(&options.App{
|
||||
|
Reference in New Issue
Block a user