# ▽△▽ XRXSv10. MeLT-VX.MS2. シャープハンターズ ▽△▽ # # publish 2010/ 3/ 8 # update - 4/ 4 # [伸縮・ワイド対応] # #============================================================================== # ワイド機能 #============================================================================== class Game_System attr_accessor :wide_screen end #============================================================================== # スライドへの対応 #============================================================================== module XRXSV10MS2_Sliding def slidable_scenes return super + [Scene_Menu] end end class Window_MenuStatus < Window_Selectable include XRXSV10MS2_Sliding end #============================================================================== # --- メニューステータス --- #============================================================================== class Window_MenuStatus < Window_Selectable def split_height return (416 - 32) / [Game_Party::MAX_MEMBERS, 4].max end #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(x, y) super(x, y, 384, 416) self.opacity = 255 @column_max = 1 @line_height = split_height @three_line_mode = (@line_height >= 76) refresh self.active = false self.index = -1 if self.opacity == 0 nh = [@item_max * @line_height, 266 * Graphics.height / 416].max ny = (Graphics.height - nh) / 2 self.x += 16 self.y += ny - 16 end end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh self.contents.clear @item_max = $game_party.members.size for index in 0...@item_max draw_item(index) end contents_split! rescue nil end #-------------------------------------------------------------------------- # 項目の描画 #-------------------------------------------------------------------------- def draw_item(index) x = 0 y = @line_height * index w = self.contents.width h = @line_height actor = $game_party.members[index] # 座標・幅の計算 x1 = 96 x2 = x1 + 6 # 三行/二行 分岐 if @three_line_mode state_width = 96 x3 = x1 + 12 x4 = x1 + 120 y1 = y + (h / 3 - WLH) / 2 y2 = y1 + (h / 3) y3 = y2 + (h / 3) y4 = y2 y5 = y3 else x3 = x2 + ($game_system.wide_screen ? 46 : 60) + 24 n = [[(w - (x3 + 120 + 12)) / 24, 1].max, 4].min state_width = n * 24 x4 = x3 + state_width + 4 y1 = y + (h / 2 - WLH) / 2 y2 = [y1 + h / 2, y + h - WLH].min y3 = y2 y4 = y1 y5 = y2 end x5 = [x4, x1 + ($game_system.wide_screen ? 82 : 108)].max meter_width = w - (x4 + 8) # 描画 face = get_actor_face(actor, 96, h - 4) self.contents.blt(2, y + 2, face, face.rect, self.hp_color(actor).alpha) face.dispose draw_actor_name(actor, x1, y1) draw_actor_level(actor, x2, y2) draw_actor_state(actor, x3, y3, state_width) draw_actor_class(actor, x5, y1) if @three_line_mode draw_actor_hp(actor, x4, y4 - 1, meter_width) draw_actor_mp(actor, x4, y5 - 2, meter_width) end #-------------------------------------------------------------------------- # 顔グラフィックの一部の取得 #-------------------------------------------------------------------------- def get_actor_face(actor, drawable_width = 96, drawable_height = 96) drawable_width = [drawable_width, 96].min drawable_height = [drawable_height, 96].min face = Cache.face(actor.face_name) x = (actor.face_index % 4 * 96) + (96 - drawable_width ) / 2 y = (actor.face_index / 4 * 96) + (96 - drawable_height) / 4 face_rect = Rect.new(x, y, drawable_width, drawable_height) bitmap = Bitmap.new(drawable_width, drawable_height) bitmap.blt(0, 0, face, face_rect) face.dispose return bitmap end #-------------------------------------------------------------------------- # ● カーソルの更新 #-------------------------------------------------------------------------- def update_cursor if @index < 0 # カーソルなし self.cursor_rect.empty elsif @index == 99 # 全体 self.cursor_rect.set(0, 0, self.contents.width, @item_max * @line_height) else # 通常 or 自分(+100) i = @index % 100 w = self.contents.width h = @line_height x = 0 y = h * i self.cursor_rect.set(x, y, w, h) end end end