Improve optional stuff, add preserve flag

This commit is contained in:
comp500
2019-06-16 23:09:40 +01:00
parent e3bf7afe33
commit dc9fd4689f
2 changed files with 9 additions and 3 deletions

View File

@@ -16,11 +16,16 @@ type Mod struct {
Name string `toml:"name"`
FileName string `toml:"filename"`
Side string `toml:"side,omitempty"`
Optional bool `toml:"optional,omitempty"`
Download ModDownload `toml:"download"`
// Update is a map of map of stuff, so you can store arbitrary values on string keys to define updating
Update map[string]map[string]interface{} `toml:"update"`
updateData map[string]interface{}
Option *struct {
Optional bool `toml:"optional"`
Description string `toml:"description,omitempty"`
Default bool `toml:"default,omitempty"`
} `toml:"option,omitempty"`
}
// ModDownload specifies how to download the mod file
@@ -95,4 +100,4 @@ func (m Mod) GetParsedUpdateData(updaterName string) (interface{}, bool) {
// GetFilePath is a clumsy hack that I made because Mod already stores it's path anyway
func (m Mod) GetFilePath() string {
return m.metaFile
}
}