Make the menu buttons work
This commit is contained in:
@@ -15,7 +15,8 @@ import (
|
||||
|
||||
var (
|
||||
gamePath = flag.String("game-path", "./orig", "Path to a WH40K: Chaos Gate installation")
|
||||
objName = flag.String("obj", "", "Name of an .obj file, e.g. TZEENTCH")
|
||||
objFile = flag.String("obj-file", "", "Path of an .obj file, e.g. ./orig/Obj/TZEENTCH.OBJ")
|
||||
objName = flag.String("obj-name", "", "Name of an .obj file, e.g. TZEENTCH")
|
||||
)
|
||||
|
||||
type env struct {
|
||||
@@ -36,7 +37,7 @@ type state struct {
|
||||
func main() {
|
||||
flag.Parse()
|
||||
|
||||
if *gamePath == "" || *objName == "" {
|
||||
if *gamePath == "" || (*objName == "" && *objFile == "") {
|
||||
flag.Usage()
|
||||
os.Exit(1)
|
||||
}
|
||||
@@ -46,9 +47,14 @@ func main() {
|
||||
log.Fatal("Failed to set up asset store: %v", err)
|
||||
}
|
||||
|
||||
obj, err := assets.Object(*objName)
|
||||
var obj *assetstore.Object
|
||||
if *objName != "" {
|
||||
obj, err = assets.Object(*objName)
|
||||
} else {
|
||||
obj, err = assets.ObjectByPath(*objFile)
|
||||
}
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to load %s: %v", *objName, err)
|
||||
log.Fatalf("Failed to load %s%s: %v", *objName, *objFile, err)
|
||||
}
|
||||
|
||||
state := state{
|
||||
|
Reference in New Issue
Block a user