diff --git a/src/images.moon b/src/images.moon index a5d10bf..56374b7 100644 --- a/src/images.moon +++ b/src/images.moon @@ -8,7 +8,7 @@ on "save", => @images = _.map(images, => {path: @path, x: @x, y: @y}) on "restore", => - dispatch "bgload", @background + if @background.path != nil then dispatch "bgload", @background for image in *@images do dispatch "setimg", image first_bg = true diff --git a/src/script.moon b/src/script.moon index 7623c8a..71d0e2e 100644 --- a/src/script.moon +++ b/src/script.moon @@ -5,7 +5,7 @@ load = (base_dir, fs, data = file: "main.scr") -> s = {:base_dir, :fs, locals: {}, globals: {}} s = _.extend(s, read_file(s, data.file)) _.extend(s, data) -save = (s) -> {file: s.file, locals: s.locals, globals: s.globals, n: s.n-2} +save = (s) -> {file: s.file, locals: s.locals, globals: s.globals, n: s.n-1} mem = (s, key) -> s.locals if s.locals[key] ~= nil else s.globals mem_type = (s, type) -> s.locals if type == "setvar" else s.globals choose = (s, val) -> s.locals["selected"] = val diff --git a/src/text.moon b/src/text.moon index 29c67b9..2945531 100644 --- a/src/text.moon +++ b/src/text.moon @@ -10,6 +10,7 @@ on "choose", => focused = false on "text", => focused = true no_input = false + if @text == '' then return if @text\sub(1, 1) == "@" @text = @text\sub(2, -1) no_input = true