BlackFeather 发表于 2010-4-4 18:33:58

战斗时不显示无用物品

#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================
# ■ Window_Item
#------------------------------------------------------------------------------
#  物品画面、战斗画面、显示浏览物品的窗口。
#==============================================================================
class Window_Item < Window_Selectable
  #--------------------------------------------------------------------------
  # ● 刷新
  #--------------------------------------------------------------------------
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    # 在战斗中以外添加武器、防具
    unless $game_temp.in_battle
      # 添加宝物
      for i in 1...$data_items.size
        if $game_party.item_number(i) > 0
            @data.push($data_items)
        end
      end
      for i in 1...$data_armors.size
        if $game_party.armor_number(i) > 0
          @data.push($data_armors)
        end
      end
    else
      for i in 1...$data_items.size
        if $game_party.item_number(i) > 0
          occasion = $data_items.occasion
          if occasion == 0 or occasion == 1
             @data.push($data_items)
          end
        end
      end
    end
    # 添加武器
    for i in 1...$data_weapons.size
      if $game_party.weapon_number(i) > 0
        @data.push($data_weapons)
      end
    end   
    # 如果项目数不是 0 就生成位图、重新描绘全部项目
    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 32)
      for i in 0...@item_max
        draw_item(i)
      end
    end
  end
end

最爱南宫煌 发表于 2010-4-4 18:38:43

这个啊,我也有这个脚本,不过,我个人觉得没有什么大的用处。
什么时候我也把我收藏的脚本发上来。

BlackFeather 发表于 2010-4-4 18:58:58

我已经发了很多!

最爱南宫煌 发表于 2010-4-5 19:41:11

看出来了,要不你怎么得分啊……
页: [1]
查看完整版本: 战斗时不显示无用物品