| 
 
| 赞 | 2 |  
| VIP | 333 |  
| 好人卡 | 91 |  
| 积分 | 2 |  
| 经验 | 55775 |  
| 最后登录 | 2017-7-18 |  
| 在线时间 | 2070 小时 |  
 Lv1.梦旅人 Mr.Gandum 
	梦石0 星屑226 在线时间2070 小时注册时间2007-1-31帖子3039 
 | 
| 直接插入Main上方。复制代码#==============================================================================
# ■ Scene_Item
#------------------------------------------------------------------------------
#  物品画面
#==============================================================================
class Scene_Item < Scene_ItemBase
  #--------------------------------------------------------------------------
  # ● 激活分类窗口
  #--------------------------------------------------------------------------
  def activate_category
    @item_window.unselect
    @category_window.activate
  end
  #--------------------------------------------------------------------------
  # ● 生成物品窗口
  #--------------------------------------------------------------------------
  alias lalalademacia_create_item_window create_item_window
  def create_item_window
    lalalademacia_create_item_window
    @item_window.set_category_window_active_method(method(:activate_category))
    @item_window.set_handler(:cancel, method(:return_scene))
  end
end
#==============================================================================
# ■ Window_ItemCategory
#------------------------------------------------------------------------------
#  物品画面和商店画面中,显示装备、所持物品等项目列表的窗口。
#==============================================================================
class Window_ItemCategory < Window_HorzCommand
  #--------------------------------------------------------------------------
  # ● 光标向下移动
  #--------------------------------------------------------------------------
  alias lalalademacia_cursor_down cursor_down
  def cursor_down(wrap = false)
    lalalademacia_cursor_down(wrap)
    Sound.play_cursor
    deactivate
    if @item_window
      @item_window.select(0)
      @item_window.activate
    end
  end
end
#==============================================================================
# ■ Window_ItemList
#------------------------------------------------------------------------------
#  物品画面中,显示持有物品的窗口。
#==============================================================================
class Window_ItemList < Window_Selectable
  #--------------------------------------------------------------------------
  # ● 处理光标的移动
  #--------------------------------------------------------------------------
  alias lalalademacia_process_cursor_move process_cursor_move
  def process_cursor_move
    if !cursor_movable?
      if Input.trigger?(:UP) && self.instance_of?(Window_ItemList)
        Sound.play_cursor
        @category_window_active_method.call if @category_window_active_method
        deactivate
        return
      end
    end
    lalalademacia_process_cursor_move
  end
  #--------------------------------------------------------------------------
  # ● 光标向上移动
  #--------------------------------------------------------------------------
  alias lalalademacia_cursor_up cursor_up
  def cursor_up(wrap = false)
    lalalademacia_cursor_up(wrap)
    if [0,1].include?(index) && self.instance_of?(Window_ItemList)
      Sound.play_cursor
      @category_window_active_method.call if @category_window_active_method
      deactivate
    end
  end
  #--------------------------------------------------------------------------
  # ● 设置分类窗口激活函数
  #--------------------------------------------------------------------------
  def set_category_window_active_method(method)
    @category_window_active_method = method
  end
end
 | 
 |