Oh no, I made another script!
Fullscreen Choices Version: 2.1a Author: Welfare-Daddy Pacman Date: 20/4/2011
Version History
<Version 1.0> 11.04.2011 - Original Release <Version 2.0> 19.04.2011 - Revamped script: added more customization, fixed layout and moved main processing out of class declaration. <Version 2.0a> 19.04.2011 - Script works now. Doi. <Version 2.1> 19.04.2011 - Got rid of the scene in the battle test. <Version 2.1a> 20.04.2011 - Made script more efficient by making it inherit from Scene_Title instead of Scene_Base, allowing the battle test to run smoother. Planned Future Versions
Version 2.5 - Putting music into the choice scene. Description
This script is a rewrite of Main. Do not put it in Materials. Replace Main with this script. This script simply puts a choice of playing windowed or full-screened or simply quitting the game before the title screen shows.
Features
Screenshots Hardly necessary.
Instructions
Follow the instructions in the script to the letter.
Script
Spoiler for Code :
=begin ================================================================================ Author: Welfare-Daddy Pacman (rmrk.net) Based from Mr. Wiggles Version 2.0 Last update: 19/4/2011 Description: This script simply puts a choice of playing windowed or full-screened or simply quitting the game before the title screen shows. Instructions: -Replace Main with this script. Plug-and-play, unless you want to configure some stuff. -Configuration begins at line 17 and ends at line 35. ================================================================================ =end #------------------------------------------------------------------------------- # BEGIN EDITING SECTION #------------------------------------------------------------------------------- SKIP_TOGGLE = false # This will skip the toggle if you have a save slot. COMMAND_OPACITY = 160 # Change this value to the opacity you want. INPUT_KEY = Input::C # This is the key used to confirm the command prompt. QUIT_KEY = Input::B # This is the key used to quit the command prompt. SCENE = Scene_Title.new # The scene that is after or before Scene_Screenchoice. FULLSCREENTEXT = "Full-screen" # The text displayed on the full-screen option. WINDOWEDTEXT = "Windowed" # The text displayed on the windowed option. QUITTEXT = "Quit" # The text displayed on the quit option. WINDOWX = 272 # The x placement of the command window. WINDOWY = 208 # The y placement of the command window. WINDOWWIDTH = 192 # The width of the window. Alter this to accommodate # for large option texts. #------------------------------------------------------------------------------- # END EDITING SECTION A #------------------------------------------------------------------------------- # Start Scene_Screenchoice #------------------------------------------------------------------------------- class Scene_Screenchoice < Scene_Title def main if $BTEST # If battle test battle_test # Run battle test else @title = Scene_Title.new @title.load_database s1 = FULLSCREENTEXT # Check FULLSCREENTEXT s2 = WINDOWEDTEXT # Check WINDOWEDTEXT s3 = QUITTEXT # Check QUITTEXT @command_window = Window_Command.new(WINDOWWIDTH, [s1, s2, s3]) # Create @command_window.opacity = COMMAND_OPACITY # Check opacity @command_window.x = WINDOWX - @command_window.width / 2 # Check X @command_window.y = WINDOWY - @command_window.height / 2 # Check Y Graphics.transition # Transition loop do # Loop Graphics.update # Update graphics Input.update # Update input update # Duh. if $scene != self # If scene isn't self break # Stop updating end end Graphics.freeze # Freeze Graphics @command_window.dispose # Dispose command window end end #------------------------------------------------------------------------------- # Update #------------------------------------------------------------------------------- def update @command_window.update if Input.trigger?(INPUT_KEY) case @command_window.index when 0 Sound.play_decision unless $keybd call_fullscreen end call_scene_title when 1 Sound.play_decision call_scene_title when 2 close_window end end if Input.trigger?(QUIT_KEY) close_window end end #------------------------------------------------------------------------------- # Call Scene_Title #------------------------------------------------------------------------------- def call_scene_title $scene = Scene_Title.new end #------------------------------------------------------------------------------- # Call Fullscreen #------------------------------------------------------------------------------- def call_fullscreen $keybd = Win32API.new 'user32.dll', 'keybd_event', ['i', 'i', 'l', 'l'], 'v' $keybd.call 0xA4, 0, 0, 0 $keybd.call 13, 0, 0, 0 $keybd.call 13, 0, 2, 0 $keybd.call 0xA4, 0, 2, 0 end #------------------------------------------------------------------------------- # Close Window #------------------------------------------------------------------------------- def close_window Sound.play_decision RPG::BGM.fade(800) RPG::BGS.fade(800) RPG::ME.fade(800) $scene = nil end end #------------------------------------------------------------------------------- # Main Processing #------------------------------------------------------------------------------- begin Graphics.freeze if SKIP_TOGGLE and (Dir.glob('Save*.rvdata').size > 0) $scene = SCENE else $scene = Scene_Screenchoice.new end while $scene != nil $scene.main end Graphics.transition(20) rescue Errno::ENOENT filename = $!.message.sub("No such file or directory - ", "") print("Unable to find file #{filename}.") end #------------------------------------------------------------------------------- # END #-------------------------------------------------------------------------------
Credit
Welfare-Daddy Pacman Mr. Wiggles Thanks
Mr. Wiggles for the original script. Modern Algebra for his help with scripting (and being awesome). LoganForrests for the same reason. Zeriab for improving suggestions. Support
I'm on RMRK a lot. Just post here or PM me.
Known Compatibility Issues
Will probably not work with debug scripts that refer to main.
Demo
Not applicable.
Author's Notes
Free for use in commercial and non-commercial games with credit. If you are using it in a commercial game, let me know.
Restrictions
Eh. Don't take credit for mine or Mr. Wiggles work.
For indie games.