Update Doodad build-scripts to tag extra data

* The Blue Azulian marks its doodad file as Hidden.
* All Doodads are write locked after generation and tagged with common
  author value.
physics
Noah 2019-07-06 23:50:38 -07:00
parent fd649b7ab1
commit 154fc6c9cb
6 changed files with 26 additions and 5 deletions

View File

@ -17,6 +17,10 @@ func init() {
Usage: "update metadata for a Doodad file",
ArgsUsage: "<filename.doodad>",
Flags: []cli.Flag{
cli.BoolFlag{
Name: "quiet, q",
Usage: "limit output (don't show doodad data at the end)",
},
cli.StringFlag{
Name: "title",
Usage: "set the doodad title",
@ -70,7 +74,7 @@ func editDoodad(c *cli.Context, filename string) error {
return fmt.Errorf("Failed to load %s: %s", filename, err)
}
log.Info("File: %s", filename)
log.Info("Edit Doodad: %s", filename)
/***************************
* Update level properties *
@ -120,5 +124,9 @@ func editDoodad(c *cli.Context, filename string) error {
log.Warn("Note: No changes made to level")
}
if c.Bool("quiet") {
return nil
}
return showDoodad(c, filename)
}

View File

@ -18,6 +18,10 @@ func init() {
Usage: "update metadata for a Level file",
ArgsUsage: "<filename.level>",
Flags: []cli.Flag{
cli.BoolFlag{
Name: "quiet, q",
Usage: "limit output (don't show doodad data at the end)",
},
cli.StringFlag{
Name: "title",
Usage: "set the level title",
@ -152,5 +156,9 @@ func editLevel(c *cli.Context, filename string) error {
log.Warn("Note: No changes made to level")
}
if c.Bool("quiet") {
return nil
}
return showLevel(c, filename)
}

View File

@ -1,6 +1,4 @@
function main() {
Flash("Azulian '%s' initialized!", Self.Doodad.Title);
var playerSpeed = 12;
var gravity = 4;
var Vx = Vy = 0;

View File

@ -98,6 +98,7 @@ azulians() {
doodad convert -t "Blue Azulian" blu-front.png blu-back.png \
blu-wr{1,2,3,4}.png blu-wl{1,2,3,4}.png azu-blu.doodad
doodad edit-doodad -hide azu-blu.doodad
doodad install-script azulian.js azu-blu.doodad
doodad convert -t "Red Azulian" red-front.png red-back.png \
@ -126,3 +127,4 @@ doors
trapdoors
azulians
objects
doodad edit-doodad -quiet -lock -author "Noah" ../../assets/doodads/*.doodad

View File

@ -126,7 +126,7 @@ func (d *Doodad) WriteFile(filename string) error {
// Desktop: write to disk.
filename = userdir.DoodadPath(filename)
log.Info("Write Doodad: %s", filename)
log.Debug("Write Doodad: %s", filename)
err = ioutil.WriteFile(filename, bin, 0644)
if err != nil {
return fmt.Errorf("doodads.WriteFile: %s", err)

View File

@ -175,7 +175,12 @@ func (s *PlayScene) Setup(d *Doodle) error {
log.Error("PlayScene.Setup: failed to drawing.InstallScripts: %s", err)
}
d.Flash("Entered Play Mode. Press 'E' to edit this map.")
if s.CanEdit {
d.Flash("Entered Play Mode. Press 'E' to edit this map.")
} else {
d.Flash("%s", s.Level.Title)
}
s.running = true
return nil