# ▽△▽ XRXSv10. MeLT-VX.MS4. 縦長ターゲット ▽△▽ # # publish 2010/ 3/27 # update - # [伸縮対応] # #============================================================================== # --- メニューステータス --- #============================================================================== class Window_MenuStatus < Window_Selectable #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(x, y) super(x, y, 384, 416) @item_max = [$game_party.members.size, 5].min @column_max = @item_max @line_height = self.contents.height 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] w = [self.contents.width / @column_max, 96].min - 4 x = 2 + index * (self.contents.width / @column_max) y = 2 draw_actor_face(actor, x + [(w - 96) / 2, 0].max, y, w) draw_actor_name(actor, x, y + 96) draw_actor_class(actor, x, y + 96 + WLH * (2 + (index % 2))) draw_actor_level(actor, x, y + 96 + WLH * 4) draw_actor_state(actor, x, @line_height - WLH * 3, w / 24 * 24) draw_actor_hp(actor, x, @line_height - WLH * 2, w) draw_actor_mp(actor, x, @line_height - WLH * 1, w) if @line_height >= 96 + WLH * 9 s2 = actor.next_rest_exp_s s_next = sprintf(Vocab::ExpNext, Vocab::level) self.contents.font.color = system_color self.contents.draw_text(x, y + 96 + WLH * 5, w, WLH, s_next) self.contents.font.color = normal_color self.contents.draw_text(x, y + 96 + WLH * 6, w, WLH, s2, 2) end end #-------------------------------------------------------------------------- # ● カーソルの更新 #-------------------------------------------------------------------------- def update_cursor if @index < 0 # カーソルなし self.cursor_rect.empty elsif @index == 99 # 全体 self.cursor_rect.set(0, 0, contents.width, @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