Determine the Soldiers At War palette

This commit also takes the first step towards making it configurable;
override `internal/palettes.DefaultPaletteName` at build time to choose
one palette over another. It would be nice to set this at runtime!
This commit is contained in:
2020-05-19 21:33:49 +01:00
parent 04bdf3e352
commit eea5dea98a
7 changed files with 353 additions and 12 deletions

View File

@@ -5,7 +5,7 @@ import (
"os"
"strconv"
"code.ur.gs/lupine/ordoor/internal/data"
"code.ur.gs/lupine/ordoor/internal/palettes"
)
func main() {
@@ -13,11 +13,11 @@ func main() {
case "index", "i":
idx, err := strconv.ParseInt(os.Args[2], 16, 64)
if err != nil {
fmt.Println("Usage: palette-idx i <0-255>")
fmt.Println("Usage: palette-idx index <0-255> <name>")
os.Exit(1)
}
fmt.Printf("Palette[%v]: %#v\n", idx, data.ColorPalette[idx])
fmt.Printf("%vPalette[%v]: %#v\n", os.Args[3], idx, palettes.Palettes[os.Args[3]][idx])
case "color", "colour", "c":
fmt.Println("TODO!")
os.Exit(1)