mirror of
https://github.com/Dadido3/noita-mapcap.git
synced 2024-11-18 17:17:31 +00:00
Show any live reload errors in the user interface
This commit is contained in:
parent
3208eed610
commit
5d7f258973
@ -45,6 +45,7 @@ function LiveReload:Reload(modPath, interval)
|
||||
local res, err = dofile(modPath .. "init.lua")
|
||||
if err then
|
||||
print(string.format("Error reloading mod: %s", err))
|
||||
error(string.format("Error reloading mod: %s", err))
|
||||
end
|
||||
end
|
||||
|
||||
|
5
init.lua
5
init.lua
@ -24,7 +24,7 @@ end
|
||||
local CameraAPI = require("noita-api.camera")
|
||||
local Coords = require("coordinates")
|
||||
local DebugAPI = require("noita-api.debug")
|
||||
local LiveReload = require("noita-api.live-reload")
|
||||
--local LiveReload = require("noita-api.live-reload")
|
||||
local Vec2 = require("noita-api.vec2")
|
||||
|
||||
-----------------------
|
||||
@ -105,13 +105,12 @@ end
|
||||
|
||||
---Called *every* time the game has finished updating the world.
|
||||
function OnWorldPostUpdate()
|
||||
Message:CatchException("OnWorldPostUpdate", function ()
|
||||
-- Reload mod every 60 frames.
|
||||
-- This allows live updates to the mod while Noita is running.
|
||||
-- !!! DISABLE THIS LINE AND THE CORRESPONDING REQUIRE BEFORE COMMITTING !!!
|
||||
--LiveReload:Reload("mods/noita-mapcap/", 60)
|
||||
|
||||
Message:CatchException("OnWorldPostUpdate", function ()
|
||||
|
||||
Check:Resolutions(60)
|
||||
|
||||
-- Draw UI after coroutines have been resumed.
|
||||
|
Loading…
Reference in New Issue
Block a user