Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module YEA
- module SAVE
- TITLE_SELECT_HELP = "Please select a file to load."
- end
- end
- class Scene_Load < Scene_File
- ##
- # Change to load immediately
- #
- def create_file_window
- wy = @help_window.height
- @file_window = Window_FileList.new(0, wy)
- @file_window.set_handler(:ok, method(:on_action_load))
- @file_window.set_handler(:cancel, method(:return_scene))
- end
- ##
- # Remove action window
- #
- def create_all_windows
- create_help_window
- create_file_window
- create_status_window
- end
- ##
- # Alter status window size accordingly
- #
- def create_status_window
- wx = @file_window.width
- wy = @help_window.height
- @status_window = Window_FileStatus.new(wx, wy, @file_window)
- end
- ##
- # Change select help text
- #
- def create_help_window
- @help_window = Window_Help.new(1)
- @help_window.set_text(YEA::SAVE::TITLE_SELECT_HELP)
- end
- end
- class Scene_File < Scene_MenuBase
- ##
- # Reduce help window size
- #
- def create_help_window
- @help_window = Window_Help.new(1)
- @help_window.set_text(YEA::SAVE::SELECT_HELP)
- end
- ##
- # Autosave starts on 'load' where as other saves start on 'save'
- #
- def on_file_ok
- @action_window.activate
- index = @file_window.index == 0 ? 0 : 1
- @action_window.select(index)
- end
- end
- ##
- # Disable save and delete for the auto-save
- #
- class Window_FileAction < Window_HorzCommand
- alias_method :zeriab_save_enabled?, :save_enabled?
- def save_enabled?
- return false if @file_window.index <= 0
- return zeriab_save_enabled?
- end
- alias_method :zeriab_delete_enabled?, :delete_enabled?
- def delete_enabled?
- return false if @file_window.index <= 0
- return zeriab_delete_enabled?
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement