Advertisement
Zeriab

[RGSS][RGSS2] F12 Reset fix - F12 now restarts the game

Nov 13th, 2011
603
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.57 KB | None | 0 0
  1. # Create a Reset exception class so we can work with it.
  2. # It would otherwise first be declared when F12 is pressed
  3. class Reset < Exception; end
  4.  
  5. # Check if the last exception is a Reset exception
  6. if $!.is_a?(Reset)
  7.   # Name of the game executable (game.exe, game.ini, game.rgssad)
  8.   command = 'Game'
  9.   # Add command line argument so the debug capabilities are kept in Test play
  10.   command += ' debug' if $DEBUG  # XP
  11.   command += ' test'  if $TEST   # VX
  12.   # Opens the game executable in a new thread
  13.   Thread.new{system command}  
  14.   # Exits this thread
  15.   exit
  16. end
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement