Skip to content

Instantly share code, notes, and snippets.

@BenMakesGames
Last active March 13, 2023 15:42
Show Gist options
  • Save BenMakesGames/8923770 to your computer and use it in GitHub Desktop.
Save BenMakesGames/8923770 to your computer and use it in GitHub Desktop.
=begin
with this script, pressing ESC takes you directly to the "Quit" dialog,
AND adds two new options to this dialog: Save, and Load.
useful for games without inventory or party-management, where having the
normal menu is inappropriate.
Buy Me a Coffee? :D https://ko-fi.com/A0A12KQ16
=end
class Scene_Map
#--------------------------------------------------------------------------
# * Call Menu Screen
#--------------------------------------------------------------------------
def call_menu
Sound.play_ok
SceneManager.call(Scene_End)
end
end
class Scene_End
#--------------------------------------------------------------------------
# * Create Command Window
#--------------------------------------------------------------------------
def create_command_window
@command_window = Window_GameEnd.new
@command_window.set_handler(:save, method(:command_save))
@command_window.set_handler(:load, method(:command_load))
@command_window.set_handler(:shutdown, method(:command_shutdown))
@command_window.set_handler(:cancel, method(:return_scene))
end
#--------------------------------------------------------------------------
# * [Save] Command
#--------------------------------------------------------------------------
def command_save
SceneManager.call(Scene_Save)
end
#--------------------------------------------------------------------------
# * [Load] Command
#--------------------------------------------------------------------------
def command_load
SceneManager.call(Scene_Load)
end
end
class Window_GameEnd
#--------------------------------------------------------------------------
# * Create Command List
#--------------------------------------------------------------------------
def make_command_list
add_command("Resume", :cancel)
add_command("Save Game", :save)
add_command("Load Game", :load)
add_command("Quit", :shutdown)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment