Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================
- # * Window_SaveFile
- #==============================================================================
- class Window_SaveFile < Window_Base
- # Help!
- WIDTH_OF_THE_SAVE_WINDOW = 416
- #--------------------------------------------------------------------------
- # * Overwrite: Initialize
- #--------------------------------------------------------------------------
- def initialize(file_index, filename)
- super((Graphics.width - WIDTH_OF_THE_SAVE_WINDOW) / 2,
- (((Graphics.height - 4 * (WLH)) / 2) + file_index * (WLH)) - 16,
- WIDTH_OF_THE_SAVE_WINDOW, WLH+32)
- self.opacity = 0
- @file_index = file_index
- @filename = filename
- load_gamedata
- refresh
- @selected = false
- end
- #--------------------------------------------------------------------------
- # Overwrite: Refresh
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- self.contents.font.color = normal_color
- name = Vocab::File + " #{@file_index + 1}"
- self.contents.draw_text(4, 0, 200, WLH, name)
- @name_width = contents.text_size(name).width
- if @file_exist
- draw_chapter(80, 0, contents.width, 0)
- draw_playtime(0, 0, contents.width - 4, 2)
- end
- end
- #~ def draw_chapter(x, y, width, align)
- #~ for i in 0...WLTR::CHAPTER_TELLER::CHAPTER_MAX
- #~ if @game_variables[WLTR::CHAPTER_TELLER::CHAPTER_VARIABLE] == i
- #~ words = WLTR::CHAPTER_TELLER::CHAPTER_WORDS[i] unless WLTR::CHAPTER_TELLER::CHAPTER_WORDS[i] == nil
- #~ end
- #~ end
- #~ self.contents.font.color = normal_color
- #~ self.contents.draw_text(x, y, width, WLH, words, align) unless words == nil
- #~ self.contents.draw_text(x, y, width, WLH, "Chapter Name", align)
- #~ end
- end
- #==============================================================================
- # ** Scene_File
- #==============================================================================
- class Scene_File < Scene_Base
- #--------------------------------------------------------------------------
- # Overwrite: Start
- #--------------------------------------------------------------------------
- def start
- super
- create_menu_background
- create_savefile_windows
- @help_window = Window_Base.new(0, (@savefile_windows[@item_max - 1].y +
- @savefile_windows[@item_max - 1].height) - 16,
- Graphics.width, 56)
- @help_window.opacity = 0
- @help_window.contents.font.color = @help_window.system_color
- if @saving
- @index = $game_temp.last_file_index
- @help_window.contents.draw_text(0, 0, @help_window.width,
- 24, Vocab::SaveMessage, 1)
- else
- @index = self.latest_file_index
- @help_window.contents.draw_text(0, 0, @help_window.width,
- 24, Vocab::LoadMessage, 1)
- end
- @savefile_windows[@index].selected = true
- end
- #--------------------------------------------------------------------------
- # Overwrite: Terminate
- #--------------------------------------------------------------------------
- def terminate
- super
- @help_window.dispose
- dispose_menu_background
- dispose_item_windows
- end
- #--------------------------------------------------------------------------
- # Overwrite: Update
- #--------------------------------------------------------------------------
- def update
- super
- update_menu_background
- update_savefile_windows
- update_savefile_selection
- end
- #--------------------------------------------------------------------------
- # Overwrite: Create Savefile Windows
- #--------------------------------------------------------------------------
- def create_savefile_windows
- @savefile_windows = []
- for i in 0..3
- @savefile_windows.push(Window_SaveFile.new(i, make_filename(i)))
- end
- @item_max = 4
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement