Save/Load Menu on button press

Zero_G

Veteran
Veteran
Joined
Mar 28, 2020
Messages
35
Reaction score
26
First Language
English
Primarily Uses
RMVXA
Just a port of my VXACE Script

Ruby:
=begin
===============================================================================
 Save Menu on button press (by Zero_G)
 Version: RGSS
===============================================================================
   ==  Description ==
 This script will open the save/load window on a button press.

 More actions for buttons can be done.
 
 == Terms of Use ==
 - Free for use in non-commercial projects with credits
 - Free for use in commercial projects
 - Please provide credits to Zero_G
 
 == Credits ==
 -Script modified from "Button Common Events" (VXACE) by "Yanfly"

 == Changelog ==
 v1.1 - Canceling load screen now returns to game instead of main menu
 
 == Usage ==
 Just add the plugin before main.
-------------------------------------------------------------------------------
=end

module ZERO
  
  SAVE_KEY = Input::L
  LOAD = true    #Activate or deactivate load function
  LOAD_KEY = Input::F9

end

# Change on_cancel behaviour of Scene_load so it returns to game instead of menu
class Scene_Title
  alias zero_save_main main
  def main
    $load_from_key = false # Reset var when loading main menu
    zero_save_main
  end  
end

class Scene_Load < Scene_File
  def on_cancel
    if ($load_from_key)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Map.new
    else
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Title.new
    end
  end
end

# Call scene load and scene save when button is pressed
class Scene_Map
  alias zero_update update
  def update
    zero_update
    
    if Input.trigger?(ZERO::SAVE_KEY)
      call_save
    end
    
    if Input.trigger?(ZERO::LOAD_KEY) && ZERO::LOAD
      $game_player.straighten
      $load_from_key = true
      $scene = Scene_Load.new
    end
  end
end

class Scene_Battle
  alias save_battle_update update
  def update
    if Input.trigger?(ZERO::LOAD_KEY) && ZERO::LOAD
      $game_player.straighten
      $load_from_key = true
      $scene = Scene_Load.new
    end
    save_battle_update
  end
end
 
Last edited:

Zero_G

Veteran
Veteran
Joined
Mar 28, 2020
Messages
35
Reaction score
26
First Language
English
Primarily Uses
RMVXA
Update v1.1 - Canceling load screen now returns to game instead of main menu
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,096
Members
137,587
Latest member
Usagiis
Top