mirror of
https://github.com/Reuh/ubiquitousse.git
synced 2025-10-27 17:19:31 +00:00
ldtk: identify level in error messages
This commit is contained in:
parent
aa332a0adf
commit
6cf0fa4053
2 changed files with 8 additions and 8 deletions
|
|
@ -534,7 +534,7 @@ let level_mt = {
|
||||||
-- @number[opt=0] y offset Y position to draw the level at
|
-- @number[opt=0] y offset Y position to draw the level at
|
||||||
-- @require love
|
-- @require love
|
||||||
draw = :(x=0, y=0)
|
draw = :(x=0, y=0)
|
||||||
assert(@loaded == true, "level not loaded")
|
assert(@loaded == true, ("level %q not loaded"):format(@identifier))
|
||||||
lg.push()
|
lg.push()
|
||||||
lg.translate(x + @x, y + @y)
|
lg.translate(x + @x, y + @y)
|
||||||
@drawBackground()
|
@drawBackground()
|
||||||
|
|
@ -554,7 +554,7 @@ let level_mt = {
|
||||||
-- @number[opt=0] y offset Y position to draw the backgroud at
|
-- @number[opt=0] y offset Y position to draw the backgroud at
|
||||||
-- @require love
|
-- @require love
|
||||||
drawBackground = :(x=0, y=0)
|
drawBackground = :(x=0, y=0)
|
||||||
assert(@loaded == true, "level not loaded")
|
assert(@loaded == true, ("level %q not loaded"):format(@identifier))
|
||||||
-- background color
|
-- background color
|
||||||
lg.setColor(@background.color)
|
lg.setColor(@background.color)
|
||||||
lg.rectangle("fill", x, y, @width, @height)
|
lg.rectangle("fill", x, y, @width, @height)
|
||||||
|
|
@ -581,7 +581,7 @@ let level_mt = {
|
||||||
--
|
--
|
||||||
-- @tparam[opt] table callbacks
|
-- @tparam[opt] table callbacks
|
||||||
load = :(callbacks={})
|
load = :(callbacks={})
|
||||||
assert(@loaded == false, "level already loaded")
|
assert(@loaded == false, ("level %q already loaded"):format(@identifier))
|
||||||
if @_json.bgRelPath then
|
if @_json.bgRelPath then
|
||||||
let pos = @_json.__bgPos
|
let pos = @_json.__bgPos
|
||||||
let cropRect = pos.cropRect
|
let cropRect = pos.cropRect
|
||||||
|
|
@ -623,7 +623,7 @@ let level_mt = {
|
||||||
--
|
--
|
||||||
-- @tparam[opt] table callbacks
|
-- @tparam[opt] table callbacks
|
||||||
unload = :(callbacks={})
|
unload = :(callbacks={})
|
||||||
assert(@loaded == true, "level not loaded")
|
assert(@loaded == true, ("level %q not loaded"):format(@identifier))
|
||||||
let onRemoveLayer = callbacks.onRemoveLayer
|
let onRemoveLayer = callbacks.onRemoveLayer
|
||||||
for _, l in ipairs(@layers) do
|
for _, l in ipairs(@layers) do
|
||||||
l:_unloadCallbacks(callbacks)
|
l:_unloadCallbacks(callbacks)
|
||||||
|
|
|
||||||
|
|
@ -353,7 +353,7 @@ level_mt = { -- ./ldtk/ldtk.can:525
|
||||||
["draw"] = function(self, x, y) -- ./ldtk/ldtk.can:536
|
["draw"] = function(self, x, y) -- ./ldtk/ldtk.can:536
|
||||||
if x == nil then x = 0 end -- ./ldtk/ldtk.can:536
|
if x == nil then x = 0 end -- ./ldtk/ldtk.can:536
|
||||||
if y == nil then y = 0 end -- ./ldtk/ldtk.can:536
|
if y == nil then y = 0 end -- ./ldtk/ldtk.can:536
|
||||||
assert(self["loaded"] == true, "level not loaded") -- ./ldtk/ldtk.can:537
|
assert(self["loaded"] == true, ("level %q not loaded"):format(self["identifier"])) -- ./ldtk/ldtk.can:537
|
||||||
lg["push"]() -- ./ldtk/ldtk.can:538
|
lg["push"]() -- ./ldtk/ldtk.can:538
|
||||||
lg["translate"](x + self["x"], y + self["y"]) -- ./ldtk/ldtk.can:539
|
lg["translate"](x + self["x"], y + self["y"]) -- ./ldtk/ldtk.can:539
|
||||||
self:drawBackground() -- ./ldtk/ldtk.can:540
|
self:drawBackground() -- ./ldtk/ldtk.can:540
|
||||||
|
|
@ -365,7 +365,7 @@ end, -- ./ldtk/ldtk.can:545
|
||||||
["drawBackground"] = function(self, x, y) -- ./ldtk/ldtk.can:556
|
["drawBackground"] = function(self, x, y) -- ./ldtk/ldtk.can:556
|
||||||
if x == nil then x = 0 end -- ./ldtk/ldtk.can:556
|
if x == nil then x = 0 end -- ./ldtk/ldtk.can:556
|
||||||
if y == nil then y = 0 end -- ./ldtk/ldtk.can:556
|
if y == nil then y = 0 end -- ./ldtk/ldtk.can:556
|
||||||
assert(self["loaded"] == true, "level not loaded") -- ./ldtk/ldtk.can:557
|
assert(self["loaded"] == true, ("level %q not loaded"):format(self["identifier"])) -- ./ldtk/ldtk.can:557
|
||||||
lg["setColor"](self["background"]["color"]) -- ./ldtk/ldtk.can:559
|
lg["setColor"](self["background"]["color"]) -- ./ldtk/ldtk.can:559
|
||||||
lg["rectangle"]("fill", x, y, self["width"], self["height"]) -- ./ldtk/ldtk.can:560
|
lg["rectangle"]("fill", x, y, self["width"], self["height"]) -- ./ldtk/ldtk.can:560
|
||||||
lg["setColor"](white) -- ./ldtk/ldtk.can:562
|
lg["setColor"](white) -- ./ldtk/ldtk.can:562
|
||||||
|
|
@ -377,7 +377,7 @@ end -- ./ldtk/ldtk.can:565
|
||||||
end, -- ./ldtk/ldtk.can:565
|
end, -- ./ldtk/ldtk.can:565
|
||||||
["load"] = function(self, callbacks) -- ./ldtk/ldtk.can:583
|
["load"] = function(self, callbacks) -- ./ldtk/ldtk.can:583
|
||||||
if callbacks == nil then callbacks = {} end -- ./ldtk/ldtk.can:583
|
if callbacks == nil then callbacks = {} end -- ./ldtk/ldtk.can:583
|
||||||
assert(self["loaded"] == false, "level already loaded") -- ./ldtk/ldtk.can:584
|
assert(self["loaded"] == false, ("level %q already loaded"):format(self["identifier"])) -- ./ldtk/ldtk.can:584
|
||||||
if self["_json"]["bgRelPath"] then -- ./ldtk/ldtk.can:585
|
if self["_json"]["bgRelPath"] then -- ./ldtk/ldtk.can:585
|
||||||
local pos -- ./ldtk/ldtk.can:586
|
local pos -- ./ldtk/ldtk.can:586
|
||||||
pos = self["_json"]["__bgPos"] -- ./ldtk/ldtk.can:586
|
pos = self["_json"]["__bgPos"] -- ./ldtk/ldtk.can:586
|
||||||
|
|
@ -415,7 +415,7 @@ self["loaded"] = true -- ./ldtk/ldtk.can:612
|
||||||
end, -- ./ldtk/ldtk.can:612
|
end, -- ./ldtk/ldtk.can:612
|
||||||
["unload"] = function(self, callbacks) -- ./ldtk/ldtk.can:625
|
["unload"] = function(self, callbacks) -- ./ldtk/ldtk.can:625
|
||||||
if callbacks == nil then callbacks = {} end -- ./ldtk/ldtk.can:625
|
if callbacks == nil then callbacks = {} end -- ./ldtk/ldtk.can:625
|
||||||
assert(self["loaded"] == true, "level not loaded") -- ./ldtk/ldtk.can:626
|
assert(self["loaded"] == true, ("level %q not loaded"):format(self["identifier"])) -- ./ldtk/ldtk.can:626
|
||||||
local onRemoveLayer -- ./ldtk/ldtk.can:627
|
local onRemoveLayer -- ./ldtk/ldtk.can:627
|
||||||
onRemoveLayer = callbacks["onRemoveLayer"] -- ./ldtk/ldtk.can:627
|
onRemoveLayer = callbacks["onRemoveLayer"] -- ./ldtk/ldtk.can:627
|
||||||
for _, l in ipairs(self["layers"]) do -- ./ldtk/ldtk.can:628
|
for _, l in ipairs(self["layers"]) do -- ./ldtk/ldtk.can:628
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue