# ▽△▽ XRXSv10. MeLT-VX.MS1. ボックスデザイン ▽△▽ # # publish 2010/ 3/ 3 # update 2010/ 3/ 7 # [伸縮対応] # #============================================================================== # --- メニューステータス --- #============================================================================== class Window_MenuStatus < Window_Selectable #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(x, y) super(x, y, 384, 416) @column_max = 2 @line_height = (Graphics.height - 32) / (([Game_Party::MAX_MEMBERS, 5].max + (@column_max - 1)) / @column_max) @item_max = $game_party.members.size refresh self.active = false self.index = -1 end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh self.contents.clear for index in 0...$game_party.members.size draw_item(index) end end #-------------------------------------------------------------------------- # 項目の描画 #-------------------------------------------------------------------------- def draw_item(index) actor = $game_party.members[index] x = 2 + (index % @column_max) * (self.contents.width / @column_max) y = 2 + (index / @column_max).to_i * @line_height + (@line_height - 96) / 2 draw_actor_face(actor, x, y, 92) x += 92 #y += WLH / 2 w = [(self.contents.width - 4) / @column_max - 104, 120].min draw_actor_name(actor, x, y) #draw_actor_class(actor, x + 12, y) draw_actor_level(actor, x, y + WLH * 1) draw_actor_state(actor, x + 68, y + WLH * 1) draw_actor_hp(actor, x + 4, y + WLH * 2, w) draw_actor_mp(actor, x + 4, y + WLH * 3, w) end #-------------------------------------------------------------------------- # ● カーソルの更新 #-------------------------------------------------------------------------- def update_cursor if @index < 0 # カーソルなし self.cursor_rect.empty elsif @index == 99 # 全体 self.cursor_rect.set(0, 0, contents.width, @item_max * @line_height) elsif @index < @item_max # 通常 or 自分(+100) i = @index % 100 w = self.contents.width / @column_max h = @line_height x = w * (i % @column_max) y = h * (i / @column_max).to_i self.cursor_rect.set(x, y, w, h) end end end