#============================================================================== # ■ セーブ画面改造 #------------------------------------------------------------------------------ # セーブ画面を改造します。 # 1.従来の歩行グラフィック+顔グラフィック+名前+レベル描画をオプションに # 好みでHPゲージとMPゲージも描画 # 顔グラフィックの描画位置は2パターン。4人パーティ用と5人パーティ用 # 2.画面の下半分にあらすじ描画 # オンになっているスイッチによって指定されたあらすじを描画 # あらすじを描画しないようにすれば画面を二分割して使うようになります # # 「マップ名表示」と併用する場合にはこちらを上にしてください # 要「共通定義」Ver1.08以降 # *月下荘 # URL:http://gekkasou.shiteyattari.com/ #============================================================================== module An_CS #セーブファイルの数 デフォルトは4 Files = 4 #顔グラフィック描画パターン(0=>四人用、1=>五人用) Pattern = 0 #レベルの描画 Level = true #歩行グラフィック Actor_Graphics = false #HPゲージとMPゲージの描画 H_Gauge = true M_Gauge = false #名前を描画する際に番号をつける #1.ラルフ、2.ウルリカ等 Number = true #あらすじ機能 #falseにすると画面を二分割して使うようになります Outline = true Out = [] #あらすじ設定 #Out[スイッチ番号] = "文章" #改行は\n、普通の改行でもOK #スイッチ番号が大きいほうが優先される Out[56] = "これまでのあらすじ:\n王様に150Gと銅の剣をもらった これだけじゃどうしようもないから、とりあえず軍資金を集めよう \n 話によると、どうやら南の洞窟に金銀財宝が眠っているらしい。 すごく胡散臭いけど、行ってみるだけいってみよう" Out[57] = "これまでのあらすじ:\n胡散臭い噂は所詮噂だった だけど変わりに頼もしい仲間が加わった。 終わりよければすべてよしというけど、本当にそれでいいのか疑問に思った\n 次の目的地だけど、どうやら海の向こうにあるらしい この近くに港町があったはずだからそこなら船が出てるはずだ。" end #============================================================================== # ■ Window_SaveFile #============================================================================== class Window_SaveFile < Window_Base #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(file_index, filename) if An_CS::Outline super(0, 56, 544, 372) self.opacity = 0 self.contents_opacity = 0 else super(0, 56 + file_index % 2 * 180, 544, 180) end @file_index = file_index @filename = filename load_gamedata refresh @selected = false end #-------------------------------------------------------------------------- # ● ゲームデータの一部をロード #-------------------------------------------------------------------------- def load_gamedata @time_stamp = Time.at(0) @file_exist = FileTest.exist?(@filename) if @file_exist file = File.open(@filename, "r") @time_stamp = file.mtime begin @characters = Marshal.load(file) @frame_count = Marshal.load(file) @last_bgm = Marshal.load(file) @last_bgs = Marshal.load(file) @game_system = Marshal.load(file) @game_message = Marshal.load(file) @game_switches = Marshal.load(file) @game_variables = Marshal.load(file) @game_self_switches = Marshal.load(file) @game_actors = Marshal.load(file) @game_party = Marshal.load(file) @game_troop = Marshal.load(file) @game_map = Marshal.load(file) @game_player = Marshal.load(file) @total_sec = @frame_count / Graphics.frame_rate rescue @file_exist = false ensure file.close end end end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- 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_party_characters(118, 24) draw_playtime(0, 0, contents.width - 4, 2) if An_CS::Outline for t in 0...An_CS::Out.size next if An_CS::Out[t].nil? if @game_switches[t] text = An_CS::Out[t] end end self.contents.draw_line_text(0, 144, contents.width, text) end end end #-------------------------------------------------------------------------- # ● パーティキャラの描画 #-------------------------------------------------------------------------- def draw_party_characters(x, y) for i in 0...@characters.size actor = @game_actors[@game_party.members[i].id] if An_CS::Pattern == 0 #パターン1 x1 = x + 100 * i ; y1 = y + 16 x2 = 0 ; y2 = y + WLH * i + 4 ; w1 = 110 x3 = 0 ; y3 = y + WLH * i + 12 x4 = 0 ; y4 = y + WLH * i + 16 ; w2 = 118 elsif An_CS::Pattern == 1 #パターン2 x1 = 100 * i ; y1 = y + WLH x2 = 100 * i ; y2 = y - 12 ; w1 = 96 x3 = 100 * i ; y3 = y - 4 x4 = 100 * i ; y4 = y ; w2 = 96 end draw_actor_face(actor, x1, y1) if An_CS::Level draw_actor_level(actor, x1, y1) end if An_CS::Actor_Graphics name = @characters[i][0] index = @characters[i][1] draw_character(name, index, x1 + 16, y1 + 54) end if An_CS::H_Gauge draw_actor_hp(actor, x1, y1 + 74, 96) y1 -= 20 end if An_CS::M_Gauge draw_actor_mp(actor, x1, y1 + 74, 96) end self.contents.font.color = normal_color name = "" name += "#{i + 1}."if An_CS::Number name += "#{actor.name}" contents.draw_text(x4, y4, w2, WLH, name) end end #-------------------------------------------------------------------------- # ● 選択状態の設定 #-------------------------------------------------------------------------- def selected=(selected) @selected = selected if An_CS::Outline self.contents_opacity = selected ? 255 : 0 end update_cursor end end #============================================================================== # ■ Scene_File #============================================================================== class Scene_File < Scene_Base #-------------------------------------------------------------------------- # ● 開始処理 #-------------------------------------------------------------------------- alias an_cs_start start def start if An_CS::Outline @background_window = Window_Base.new(0, 56, 544, 360) end an_cs_start update_visible_selection end #-------------------------------------------------------------------------- # ● 終了処理 #-------------------------------------------------------------------------- alias an_cs_terminate terminate def terminate an_cs_terminate @background_window.dispose if An_CS::Outline $temp_actors = nil end #-------------------------------------------------------------------------- # □ セーブファイルウィンドウの作成 #-------------------------------------------------------------------------- def create_savefile_windows @savefile_windows = [] for i in 0...An_CS::Files @savefile_windows.push(Window_SaveFile.new(i, make_filename(i))) end @item_max = An_CS::Files end #-------------------------------------------------------------------------- # ● セーブファイル選択の更新 #-------------------------------------------------------------------------- alias an_cs_update_savefile_selection update_savefile_selection def update_savefile_selection an_cs_update_savefile_selection update_visible_selection end #-------------------------------------------------------------------------- # ● ウインドウの可視状態による更新 #-------------------------------------------------------------------------- def update_visible_selection unless An_CS::Outline index = @index #奇数の場合偶数になおす(判定が楽になるため) if @index % 2 == 1 index -= 1 end for i in 0...@savefile_windows.size @savefile_windows[i].visible = (i == index or i == index + 1) end end end end #Ver2.03