feat: personal fork section 1 - slim fonts, Russian MCM labels, render fault containment
This commit is contained in:
1 parent
276232ef74
commit
88d2ba6154
5 files changed
+279
-506733
No files matched your search
@@ -1296,7 +1296,14 @@ EID.OptionChanged = false
|
||||
EID.bagPlayer = nil
|
||||
|
||||
--- Render function that runs every frame and handles the main EID rendering logic.
|
||||
function EID:OnRender()
|
||||
-- Personal fork: render fault containment. The original OnRender body lives in
|
||||
-- OnRender_Inner; the wrapper below converts a crash into an on-screen notice
|
||||
-- instead of silently killing all EID output for the rest of the session.
|
||||
EID.RenderErrorCount = 0
|
||||
EID.RenderDisabled = false
|
||||
EID.RenderErrorMsg = nil
|
||||
|
||||
function EID:OnRender_Inner()
|
||||
-- Increases by 60 per second, ignores pauses
|
||||
EID.GameRenderCount = EID.GameRenderCount + 1
|
||||
EID.OptionChanged = EID.MCM_OptionChanged
|
||||
@@ -1669,6 +1676,27 @@ function EID:OnRender()
|
||||
EID:printDescriptions()
|
||||
end
|
||||
|
||||
function EID:OnRender(...)
|
||||
if EID.RenderDisabled then
|
||||
pcall(Isaac.RenderText, "EID disabled after repeated render errors; restart the run", 60, 60, 1, 0, 0, 1)
|
||||
return
|
||||
end
|
||||
local ok, err = pcall(EID.OnRender_Inner, ...)
|
||||
if ok then
|
||||
EID.RenderErrorCount = 0
|
||||
EID.RenderErrorMsg = nil
|
||||
else
|
||||
EID.RenderErrorCount = EID.RenderErrorCount + 1
|
||||
EID.RenderErrorMsg = tostring(err)
|
||||
EID:WriteErrorMsg("Render error #" .. EID.RenderErrorCount .. ": " .. EID.RenderErrorMsg)
|
||||
pcall(Isaac.RenderText, "EID render error (see log): " .. string.sub(EID.RenderErrorMsg, 1, 90), 60, 60, 1, 0, 0, 1)
|
||||
if EID.RenderErrorCount >= 5 then
|
||||
EID.RenderDisabled = true
|
||||
EID:WriteErrorMsg("EID rendering disabled after 5 consecutive errors")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
EID:AddCallback(ModCallbacks.MC_POST_RENDER, EID.OnRender)
|
||||
|
||||
--- Add active item progress to the player's transformation progress.
|
||||
|
||||
Reference in new issue
Block a user