generated from dave/wails-template
Implement game path manipulation
This commit is contained in:
21
app.go
21
app.go
@@ -37,6 +37,10 @@ type StringResponse struct {
|
||||
Data string `json:"data"`
|
||||
Error string `json:"error,omitempty"`
|
||||
}
|
||||
type BoolResponse struct {
|
||||
Data bool `json:"data"`
|
||||
Error string `json:"error,omitempty"`
|
||||
}
|
||||
|
||||
func (a *App) GetAddons() (res AddonsResponse) {
|
||||
res.Data = addonService.Addons
|
||||
@@ -78,3 +82,20 @@ func (a *App) UpdateAddon(name string) (res AddonResponse) {
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
func (a *App) GetGamePath() (res StringResponse) {
|
||||
res.Data = settings.GamePath
|
||||
return res
|
||||
}
|
||||
|
||||
func (a *App) SetGamePath(path string) (res StringResponse) {
|
||||
settings.GamePath = path
|
||||
SaveSettings(*settings)
|
||||
res.Data = path
|
||||
return res
|
||||
}
|
||||
|
||||
func (a *App) IsGamePathValid() (res BoolResponse) {
|
||||
res.Data = settings.GamePath != ""
|
||||
return res
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user