@@ -18,6 +18,9 @@ local function onPostRender()
1818 font :DrawStringScaledUTF8 (" [IsaacBox] Version:" .. (VERSION ), 216 , 0 , 0.5 ,
1919 0.5 ,
2020 white , 0 , false )
21+ if bridge .UpdateAllCollectibles () then
22+ websocket .emit (" OFFER_ITEMS" , require (" json" ).encode (Items ))
23+ end
2124 end
2225end
2326
2730-- Returning any value will have no effect on later callback executions.
2831local function onPreGameExit (_ , bool )
2932 if IsaacSocket == nil and not IsaacSocket .IsConnected () then return end
30- websocket .emit (" OFFER_ITEMS" ," []" )
33+ websocket .emit (" OFFER_ITEMS" , " []" )
3134end
3235
3336-- This function gets called when you start a game.
4952
5053local function onPostGameEnd (_ , bool )
5154 if IsaacSocket == nil and not IsaacSocket .IsConnected () then return end
52- websocket .emit (" OFFER_ITEMS" ," []" )
55+ websocket .emit (" OFFER_ITEMS" , " []" )
5356end
5457
5558
56- -- Called after every game update.
57- -- Returning any value will have no effect on later callback executions.
58- -- This callback is called 30 times per second.
59- -- It will not be called, when its paused (for example on screentransitions or on the pause menu).
60- local function onPostUpdate ()
61- if IsaacSocket == nil and not IsaacSocket .IsConnected () then return end
62- if bridge .UpdateAllCollectibles () then
63- websocket .emit (" OFFER_ITEMS" ,require (" json" ).encode (Items ))
64- end
65- end
6659
6760local Module = {}
6861Module .onPostRender = onPostRender
6962Module .onPreGameExit = onPreGameExit
7063Module .onPostGameStarted = onPostGameStarted
7164Module .onPostGameEnd = onPostGameEnd
72- Module .onPostUpdate = onPostUpdate
7365return Module
0 commit comments