Generate content for specific scenes (#672)

* Add UI dialog for scene(s)
* Move preview preset to config
This commit is contained in:
WithoutPants
2020-07-19 11:59:18 +10:00
committed by GitHub
parent 8e4945325d
commit c104c6d075
27 changed files with 552 additions and 148 deletions

View File

@@ -1,5 +1,7 @@
package utils
import "strconv"
// https://gobyexample.com/collection-functions
func StrIndex(vs []string, t string) int {
@@ -32,3 +34,15 @@ func StrMap(vs []string, f func(string) string) []string {
}
return vsm
}
// StringSliceToIntSlice converts a slice of strings to a slice of ints. If any
// values cannot be parsed, then they are inserted into the returned slice as
// 0.
func StringSliceToIntSlice(ss []string) []int {
ret := make([]int, len(ss))
for i, v := range ss {
ret[i], _ = strconv.Atoi(v)
}
return ret
}