Confira o Videos Épicos #45!
4 Respostas   244 Visualizações
0 Membros e 1 Visitante estão vendo este tópico.
#==============================================================================# ■ Window_SaveFile#------------------------------------------------------------------------------# セーブ画面およびロード画面で表示する、セーブファイルのウィンドウです。#==============================================================================class Window_SaveFile < Window_Base #-------------------------------------------------------------------------- # ● 公開インスタンス変数 #-------------------------------------------------------------------------- attr_reader :selected # 選択状態 #-------------------------------------------------------------------------- # ● オブジェクト初期化 # index : セーブファイルのインデックス #-------------------------------------------------------------------------- def initialize(height, index) super(0, index * height , Graphics.width , height + 15) @file_index = index refresh @selected = false end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh contents.clear change_color(normal_color) name = Vocab::File + " #{@file_index + 1}" draw_text(4, 0, 200, line_height , name) @name_width = text_size(name).width draw_party_characters(152, 75) draw_playtime(-60, contents.height - line_height, contents.width - 4, 2) end #-------------------------------------------------------------------------- # ● パーティキャラの描画 #-------------------------------------------------------------------------- def draw_party_characters(x, y) header = DataManager.load_header(@file_index) return unless header header[:characters].each_with_index do |data, i| draw_character(data[0], data[1], x + i * 48, y) end end #-------------------------------------------------------------------------- # ● プレイ時間の描画 #-------------------------------------------------------------------------- def draw_playtime(x, y, width, align) header = DataManager.load_header(@file_index) return unless header draw_text(x, y, width, line_height, header[:playtime_s], 2) end #-------------------------------------------------------------------------- # ● 選択状態の設定 #-------------------------------------------------------------------------- def selected=(selected) @selected = selected update_cursor end #-------------------------------------------------------------------------- # ● カーソルの更新 #-------------------------------------------------------------------------- def update_cursor if @selected cursor_rect.set(0, 0, @name_width + 8, line_height) else cursor_rect.empty end endend
super(0, index * height , Graphics.width , height + 15)
super(0, index * height + 15, Graphics.width , height + 15)
class Window_SaveFile < Window_Base def initialize(height, index) super(0, index * height + 15, Graphics.width, height + 15) @file_index = index refresh @selected = false end endclass Scene_File < Scene_MenuBase def create_savefile_viewport @savefile_viewport = Viewport.new @savefile_viewport.rect.y = @help_window.height - 15 @savefile_viewport.rect.height -= @help_window.height - 15 endend
class Window_SaveFile < Window_Base def standard_padding return 10 end def refresh contents.clear change_color(normal_color) name = Vocab::File + " #{@file_index + 1}" draw_text(4, 0, 200, line_height, name) @name_width = text_size(name).width draw_party_characters(152, 75) draw_playtime(0, contents.height - line_height, contents.width - 4, 2) end end