Bigace360

Full Screen Promt

Mar 6th, 2013
2,134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 5.41 KB | None | 0 0
  1. #+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  2. # ■ Full Screen Promt                                      
  3. # ■ Author: Bigace360  
  4. # ■ Version: 1.0
  5. # ■ Date: August 28, 2012
  6. # ■ Blog: http://bigaceworld.wordpress.com/
  7. #+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  8. #                               VERSION HISTORY                                #
  9. #+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  10. # v 1.0 - 2.28.2012 > Started and Finished Script
  11. #+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  12. #                                INTRODUCTION                                  #
  13. #+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  14. # This script is for those who want to make the option of haveing the player
  15. # decide if they would want to play in full screen with out having to press
  16. # Alt + Enter
  17. #+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  18. #                                INSTRUCTIONS                                  #
  19. #+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  20. # This script is plug and play, just paste it ABOVE main, and BELLOW everything
  21. # else! There is small configurations in the module, which can be left alone,
  22. # if you like whats already there.
  23. #+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  24. #                                  SECTIONS                                    #
  25. #+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  26. #  ■ Game_Objects
  27. # ** ACE Module
  28. # ** SceneManager Module
  29. #
  30. #  ■ Windows
  31. # ** Window_ScreenCommand
  32. #
  33. #  ■ Scenes
  34. # ** Scene_FullPromp
  35. #
  36. #+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  37. #
  38. # Credits/Thanks:
  39. #   - Bigace360, for the script.
  40. #
  41. #+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  42. #                     Script Conflicts and Compatability                       #
  43. #=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
  44. # No Known issues
  45. #
  46. #   module SceneManager
  47. #     overwrites - def self.first_scene_class
  48. #+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  49. #
  50. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  51. # ■ Module ACE::Fullscreen
  52. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  53. module ACE
  54.     module Fullscreen
  55.         #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  56.         # - Fullscreen Command Settings -
  57.         #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  58.         FULL_COMMANDS =[
  59.             [:full,   'Full Screen'],
  60.             [:normal, 'Windowed'],
  61.         ] # Do not remove this.
  62.        
  63.         # Place the following images in the Graphics folder / System if you're
  64.         # planing on have a background, else leave the field blank.
  65.         BACKGROUND = ''
  66.     end
  67. end
  68.  
  69. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  70. # ■ module SceneManager
  71. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  72. module SceneManager
  73.     def self.first_scene_class; $BTEST ? Scene_Battle : Scene_FullPromp; end
  74. end
  75.  
  76. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  77. # ■ Window_ScreenCommand
  78. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  79. class Window_ScreenCommand < Window_Command
  80.     include ACE::Fullscreen
  81.     def initialize
  82.         super(0, 0)
  83.         update_placement
  84.         self.openness = 0
  85.         open
  86.     end
  87.     def window_width; return 160; end
  88.     def update_placement
  89.         self.x = (Graphics.width - width) / 2
  90.         self.y = (Graphics.height * 1.6 - height) / 2
  91.     end
  92.     def make_command_list
  93.         FULL_COMMANDS.each do |command|
  94.             case command[0]
  95.             when :full, :normal then add_command(command[1], command[0])
  96.             end
  97.         end
  98.     end
  99. end
  100.  
  101. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  102. # ■ Scene_FullPromp
  103. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  104. class Scene_FullPromp < Scene_Base
  105.     include ACE::Fullscreen
  106.     $data_system = load_data("Data/System.rvdata2")
  107.     $game_system = Game_System.new 
  108.     def start
  109.         super
  110.         execute_dispose
  111.         create_layout
  112.         create_command_window
  113.     end
  114.     def create_layout
  115.         @background = Plane.new  
  116.         @background.bitmap = Cache.system(BACKGROUND)
  117.         @background.z = 0      
  118.     end
  119.     def execute_dispose
  120.         return if @background.nil?
  121.         Graphics.freeze
  122.         @background.bitmap.dispose
  123.         @background.dispose
  124.         @background = nil
  125.     end
  126.     def create_command_window
  127.         @command_window = Window_ScreenCommand.new
  128.         @command_window.set_handler(:full,   method(:full_mode))
  129.         @command_window.set_handler(:normal, method(:normal_mode))     
  130.     end
  131.     def close_command_window
  132.         @command_window.close
  133.         update until @command_window.close?
  134.     end
  135.     def full_mode
  136.         Sound.play_ok
  137.         keybd = Win32API.new 'user32.dll', 'keybd_event', ['i', 'i', 'l', 'l'], 'v'
  138.         keybd.call(0xA4, 0, 0, 0)
  139.         keybd.call(13, 0, 0, 0)
  140.         keybd.call(13, 0, 2, 0)
  141.         keybd.call(0xA4, 0, 2, 0)
  142.         SceneManager.goto(Scene_Title)
  143.     end
  144.     def normal_mode
  145.         Sound.play_ok
  146.         SceneManager.goto(Scene_Title)
  147.     end
  148.     def update; super; update_slide_window; end
  149.   def update_slide_window; @background.ox += 1; end
  150.     def terminate; super; execute_dispose; end
  151. end
Advertisement
Add Comment
Please, Sign In to add comment