Show any live reload errors in the user interface

This commit is contained in:
David Vogel 2022-07-28 10:32:23 +02:00
parent 3208eed610
commit 5d7f258973
2 changed files with 6 additions and 6 deletions

View File

@ -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

View File

@ -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,12 +105,11 @@ end
---Called *every* time the game has finished updating the world.
function OnWorldPostUpdate()
-- 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 ()
-- 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)
Check:Resolutions(60)