#==============================================================================
# ** :::Josh::: or Rafael_Drake on RMK - Screen Prompt
# Version 1.0.0
#------------------------------------------------------------------------------
# This script will give the user the option to do full screen or windowed
# mode without having it's players press ALT + ENTER
#==============================================================================
# ** Import Hash
($imported ||= {}) = true
#==============================================================================
# ** Add-Ons
# If you want me to add a feature to this script let me know, I won't
# do the impossible or the unnecessary though. Compatibility patches is
# all on you.
#==============================================================================
# ** Warning
# This script is created and designed for RPG Maker VXA, RPG Maker VX will
# need some heavy modification for it to work. I do not even want to think
# about XP.
#==============================================================================
# ** Usage
# Feel free to use in any kind of project, but with credit given please.
# As with this special permission, please do not share my work across other
# forums or sites. I would like it to stay at the topic page on the Official
# Forums Site. I also want to inform you that you can not sell this script
# itself. It must be part of a finished project. Last but not least, don't
# post up modification version of it. If you have any questions please ask!
#==============================================================================
# ** Tutorial
# None.
#==============================================================================
#==============================================================================
# ** SceneManager
#------------------------------------------------------------------------------
# This module manages scene transitions. For example, it can handle
# hierarchical structures such as calling the item screen from the main menu
# or returning from the item screen to the main menu.
#==============================================================================
module SceneManager
#--------------------------------------------------------------------------
# * Get First Scene Class
#--------------------------------------------------------------------------
def self.first_scene_class ; $BTEST ? Scene_Battle : Scene_Prompt end
end
#==============================================================================
# ** Window_PromptCommand
#------------------------------------------------------------------------------
# This window is for selecting New Game/Continue on the title screen.
#==============================================================================
class Window_PromptCommand < Window_Command
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0)
self.x = (Graphics.width - width) / 2
self.y = (Graphics.height - height) / 2
self.openness = 0
open
end
#--------------------------------------------------------------------------
# * Get Window Width
#--------------------------------------------------------------------------
def window_width ; 272 ; end
#--------------------------------------------------------------------------
# * Get Window Height
#--------------------------------------------------------------------------
def window_height ; 77 end
#--------------------------------------------------------------------------
# * Get Standard Padding Size
#--------------------------------------------------------------------------
def standard_padding ; 0 end
#--------------------------------------------------------------------------
# * Get Rectangle for Drawing Items
#--------------------------------------------------------------------------
def item_rect(index)
rect = super(index)
rect.x = 12 + index % col_max * item_width + 5
rect.y = 37 + index / col_max
rect
end
#--------------------------------------------------------------------------
# * Get Digit Count
#--------------------------------------------------------------------------
def col_max ; 2 end
#--------------------------------------------------------------------------
# * Get Alignment
#--------------------------------------------------------------------------
def alignment ; 1 end
#--------------------------------------------------------------------------
# * Make Commands List
#--------------------------------------------------------------------------
def make_command_list
add_command("Windowed", :window_mode, true)
add_command("Full Screen", :fullscreen, true)
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
super
change_color(crisis_color)
draw_text(0, 12, contents_width, 24, "Choose a screen option:", 1)
end
end
#==============================================================================
# ** Scene_Prompt
#------------------------------------------------------------------------------
# This class performs the title screen processing.
#==============================================================================
class Scene_Prompt < Scene_Base
#--------------------------------------------------------------------------
# * Start Processing
#--------------------------------------------------------------------------
def start ; super ; create_prompt_window end
#--------------------------------------------------------------------------
# * Get Transition Speed
#--------------------------------------------------------------------------
def transition_speed ; 10 end
#--------------------------------------------------------------------------
# * Termination Processing
#--------------------------------------------------------------------------
def terminate ; super end
#--------------------------------------------------------------------------
# * Create Prompt Window
#--------------------------------------------------------------------------
def create_prompt_window
@prompt_window = Window_PromptCommand.new
@prompt_window.set_handler(:window_mode, method(:command_window))
@prompt_window.set_handler(:fullscreen, method(:command_fullscreen))
end
#--------------------------------------------------------------------------
# * Command
#--------------------------------------------------------------------------
def command_window
Sound.play_ok
@prompt_window.close
update until @prompt_window.close?
SceneManager.goto(Scene_Title)
end
#--------------------------------------------------------------------------
# * Command
#--------------------------------------------------------------------------
def command_fullscreen
Sound.play_ok
@prompt_window.close
update until @prompt_window.close?
keybd = Win32API.new 'user32.dll', 'keybd_event', , ""
keybd.call(0xA4, 0, 0, 0) ; keybd.call(13, 0, 0, 0)
keybd.call(13, 0, 2, 0) ; keybd.call(0xA4, 0, 2, 0)
SceneManager.goto(Scene_Title)
end
end
#==============================================================================
# ** End of File
#==============================================================================