Advertisement
Guest User

bettercheck

a guest
Mar 24th, 2017
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.36 KB | None | 0 0
  1. local callbackMod = RegisterMod("CallbackTest", 1)
  2. debugText = "nothing"
  3.  
  4. function callbackMod:gameStarted(isContinued) -- isContinued is a boolean variable that tells us whetever we started the run from a savestate or not
  5.     debugText = "game started" .. tostring(isContinued);
  6. end
  7.  
  8. function callbackMod:gameEnd(isGameOver) -- isGameOver is a boolean variable that tells us whetever we died or ended the game
  9.     debugText = "game end";
  10. end
  11.  
  12. function callbackMod:gameExit(shouldSave) -- shouldSave is a boolean variable that tells us whetever the run should be saved or not (so we can continue it later)
  13.     debugText = "game exit";
  14. end
  15.  
  16. function callbackMod:gameLevel()
  17.     debugText = "level changed";
  18. end
  19.  
  20. function callbackMod:gameRoom()
  21.     debugText = "room changed";
  22. end
  23.  
  24. function callbackMod:debug_text()
  25.     Isaac.RenderText(debugText, 100, 100, 255, 0, 0, 255); -- render debug text
  26. end
  27.  
  28. callbackMod:AddCallback(ModCallbacks.MC_POST_RENDER, callbackMod.debug_text);
  29. callbackMod:AddCallback(ModCallbacks.MC_POST_GAME_STARTED, callbackMod.gameStarted);
  30. callbackMod:AddCallback(ModCallbacks.MC_POST_GAME_END, callbackMod.gameEnd);
  31. callbackMod:AddCallback(ModCallbacks.MC_PRE_GAME_EXIT, callbackMod.gameExit);
  32. callbackMod:AddCallback(ModCallbacks.MC_POST_NEW_LEVEL, callbackMod.gameLevel);
  33. callbackMod:AddCallback(ModCallbacks.MC_POST_NEW_ROOM, callbackMod.gameRoom);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement