Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if true
- # This will format the console screen a lottle better since it uses word wrap.
- # Set condition to false abive to disable.
- alias zer0_console_inspect puts
- def puts(*args)
- inspected = args.collect {|arg| arg.inspect.gsub(',') { "\n" } }
- zer0_console_inspect(*inspected)
- end
- end
- if $DEBUG || $TEST
- # Create a console object and redirect standard output to it.
- Win32API.new('kernel32', 'AllocConsole', 'V', 'L').call
- $stdout.reopen('CONOUT$')
- # Find the game title.
- ini = Win32API.new('kernel32','GetPrivateProfileString','PPPPLP', 'L')
- title = "\0" * 256
- ini.call('Game', 'Title', '', title, 256, '.\\Game.ini')
- title.delete!("\0")
- # Set the game window as the top-most window.
- hwnd = Win32API.new('user32', 'FindWindowA', 'PP', 'L').call('RGSS Player', title)
- Win32API.new('user32', 'SetForegroundWindow', 'L', 'L').call(hwnd)
- # Set the title of the console debug window'
- Win32API.new('kernel32','SetConsoleTitleA','P','S').call("#{title} : Debug Console")
- dim = [32, 32, 256, 480]
- console = Win32API.new('kernel32', 'GetConsoleWindow', 'V', 'L').call
- swp = Win32API.new('user32', 'SetWindowPos', 'LLIIIII', 'I')
- swp.call(console, 0, dim[0], dim[1], dim[2] + 6, dim[3] + 26, -1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement