#==============================================================================
# ■ Window_Selectable_plus vol.1.30
#------------------------------------------------------------------------------
# 1行選択肢のカーソル移動を拡張(Window_Selectableより下に挿入)
# ※キーの押しっぱなし移動の場合、trigger?をrepeat?に書き換える
# 11/10/01
#==============================================================================
class Window_Selectable < Window_Base
  #--------------------------------------------------------------------------
  # ■ フレーム更新
  #--------------------------------------------------------------------------
  if !$@;alias hidesp_update_plus update;end
  def update
    if self.active
      if @item_max <= @column_max
        # □項目の最後を選択中の場合
        if @index == @item_max - 1
          # □方向ボタンの右が押された場合(項目の最初を選択)
          if Input.repeat?(Input::RIGHT)
            $game_system.se_play($data_system.cursor_se)
            @index = 0
            update_plus
            super
            return
          end
        # □項目の最初を選択中の場合
        elsif @index == 0
          # □方向ボタンの左が押された場合(項目の最後を選択)
          if Input.repeat?(Input::LEFT)
            $game_system.se_play($data_system.cursor_se)
            @index = @item_max - 1
            update_plus
            super
            return
          end
        end
      end
    end
    # □元の処理を実行
    hidesp_update_plus
  end
  #--------------------------------------------------------------------------
  # ■ 共通処理の実行
  #--------------------------------------------------------------------------
  def update_plus
    # ヘルプテキストを更新 (update_help は継承先で定義される)
    if self.active && @help_window != nil
      update_help
    end
    # カーソルの矩形を更新
    update_cursor_rect
  end
end