# ▽△▽ XRXSv10. MeLT-VX.MS3. ファインパートナー ▽△▽ # # publish 2010/ 3/10 # update - /19 # [伸縮対応] # #============================================================================== # カスタマイズポイント #============================================================================== module XRXSV10MS3 # # 使用するウィンドウスキン名 # SkinName = "Window" # # 立ち位置 (左1〜10右) # ACTORX = [3, 9] end #============================================================================== # 立ち絵ファイル名取得式 #============================================================================== class Game_Battler def picture_name return "" end end class Game_Actor < Game_Battler def picture_name original_name = self.face_name + "-" + (self.face_index + 1).to_s name = original_name begin name += super pict = Cache.picture(name) rescue name = original_name end return name end end #============================================================================== # 立ち絵ファイルビットマップの取得 #============================================================================== class Game_Actor < Game_Battler def picture return (Cache.picture(self.picture_name) rescue Bitmap.new(16,16)) end end #============================================================================== # --- メニューステータススプライト --- #============================================================================== class Sprite_Slidable < Sprite_Base end class Sprite_MenuStatus < Sprite_Slidable end class Sprite_MenuStatusBackStand < Sprite_Slidable end module XRXSV10MS3_Sliding def slidable_scenes return super + [Scene_Menu] end def slide_sprites @slide_sprites = [] if @slide_sprites == nil return @slide_sprites end end #============================================================================== # --- メニューステータス --- #============================================================================== class Window_MenuStatus < Window_Selectable include XRXSV10MS3_Sliding #-------------------------------------------------------------------------- # 立ち絵スタイルを取る条件 #-------------------------------------------------------------------------- def picture_mode? return $scene.is_a?(Scene_Menu) end #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(x, y) @stand_pictures = [] @status_bitmaps = [] @stand_x_offsets = [0,0] super(x, y, 384, 416) #@original_x = self.x @column_max = 1 @foot_y = 0 #self.x = @original_x self.opacity = 255 if (slidable? rescue false) self.opacity = 0 self.x += 16 end refresh self.active = false self.index = -1 slidein! if (slidable? rescue false) end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh self.contents.clear @stand_pictures.each{|bitmap| bitmap.dispose } @stand_pictures.clear @status_bitmaps.each{|bitmap| bitmap.dispose } @status_bitmaps.clear self.slide_sprites.each{|sprite| sprite.dispose } self.slide_sprites.clear @item_max = [$game_party.members.size, 2].min stand_height = 0 actor2 = $game_party.members[1] if actor2 != nil stand_height = actor2.picture.height end skin = Cache.system(XRXSV10MS3::SkinName) stand_height = [stand_height, WLH * 3].max start_y = [(self.contents.height - (stand_height + 80)) / 2, 0].max @foot_y = start_y + stand_height + 80 for i in 0..1 actor = $game_party.members[1 - i] next if actor == nil foot_y = @foot_y - (1 - i) * 80 status_x = i * 64 # 立ち絵 @stand_pictures[1 - i] = actor.picture # ステータス土台 skin_rect = Rect.new( 0, 24, 64, 16) area_rect = Rect.new(status_x + 1, foot_y - 5, self.contents.width - 1, 4) for j in 0..11 opacity = [(12 - j) * 32, 255].min self.contents.stretch_blt(area_rect, skin, skin_rect, opacity) area_rect.y -= 4 end skin_rect = Rect.new(68, 56, 56, 8) area_rect = Rect.new(status_x, foot_y - 5, self.contents.width, 4) self.contents.stretch_blt(area_rect, skin, skin_rect, 192) # ステータス内容 width = self.contents.width / 2 draw_status(actor, status_x, foot_y, width) copy_rect = Rect.new(status_x, foot_y - WLH * 3, self.contents.width, WLH * 3) @status_bitmaps[1 - i] = Bitmap.new(self.contents.width, WLH * 3) @status_bitmaps[1 - i].blt(0, 0, self.contents, copy_rect) self.contents.clear end self.contents.clear if (slidable? rescue false) for i in 0..1 actor = $game_party.members[1 - i] next if actor == nil center_x = self.contents.width * XRXSV10MS3::ACTORX[i].to_i / 11 foot_y = @foot_y - (1 - i) * 80 sprite = Sprite_MenuStatus.new sprite.bitmap = @status_bitmaps[1 - i] sprite.x = self.x + 32 + i * 64 sprite.y = self.y + 16 + foot_y sprite.oy = WLH*3 sprite.z = self.z + [1, 3][i] self.slide_sprites[i] = sprite if self.picture_mode? sprite = Sprite_MenuStatusBackStand.new sprite.bitmap = @stand_pictures[1-i] x_min = center_x - sprite.bitmap.width / 2 x_max = self.contents.width - sprite.bitmap.width n = 0 if @item_max == 2 n = i * self.contents.width / 2 end @stand_x_offsets[i] = [[x_min, x_max].min, n].max #sprite.x = self.x + 32 + @stand_x_offsets[i] sprite.y = self.y + 16 + foot_y - 1 - sprite.bitmap.height sprite.z = self.z + [-1, 2][i] self.slide_sprites[2+i] = sprite end end self.x = self.x else for i in 0..1 actor = $game_party.members[1 - i] next if actor == nil center_x = self.contents.width * XRXSV10MS3::ACTORX[i].to_i / 11 foot_y = @foot_y - (1 - i) * 80 picture = @stand_pictures[1 - i] x = center_x - picture.width / 2 y = foot_y - 1 - picture.height self.contents.blt(x, y, picture, picture.rect) bitmap = @status_bitmaps[1 - i] status_x = i * 64 self.contents.blt(status_x, foot_y - WLH*3, bitmap, bitmap.rect) end end end #-------------------------------------------------------------------------- # 描画:ステータス #-------------------------------------------------------------------------- def draw_status(actor, x, foot_y, width) mw = width / 2 x1 = x + 8 x2 = x + 8 + mw y1 = foot_y - WLH * 3 y2 = foot_y - WLH * 2 y3 = foot_y - WLH - 4 draw_actor_state(actor, x1, y1) draw_actor_name(actor, x1, y2) draw_actor_level(actor, x2, y2) draw_actor_hp(actor, x1, y3, mw - 16) draw_actor_mp(actor, x2, y3, mw - 16) end #-------------------------------------------------------------------------- # ● カーソルの更新 #-------------------------------------------------------------------------- def update_cursor if @index < 0 # カーソルなし self.cursor_rect.empty elsif @index == 99 # 全体 h = WLH * 6 y = self.contents.height - h self.cursor_rect.set(0, y, self.contents.width, h) elsif @index < @item_max # 通常 or 自分(+100) i = @index % 100 x = (i == 0 ? 64 : 0) h = WLH * 2 y = @foot_y - WLH * 2 - (i == 0 ? 0 : 80) w = self.contents.width - x self.cursor_rect.set(x, y, w, h) end end #-------------------------------------------------------------------------- # スライドイン! #-------------------------------------------------------------------------- def slidein! super(-4) end #-------------------------------------------------------------------------- # プロパティの連動 #-------------------------------------------------------------------------- def x=(n) super xs = [n + 16, n + 80, n + 16 + @stand_x_offsets[0], n + 16 + @stand_x_offsets[1]] for i in 0..3 next if self.slide_sprites[i] == nil self.slide_sprites[i].x = xs[i] end end end