Project1

标题: 为什么装备界面莫名其妙多了一个空位置(没装备) [打印本页]

作者: 恐惧剑刃    时间: 2013-5-8 13:53
标题: 为什么装备界面莫名其妙多了一个空位置(没装备)
本帖最后由 恋′挂机 于 2013-5-8 17:59 编辑

  1. #==============================================================================
  2. # ■ Window_EquipItem
  3. #------------------------------------------------------------------------------
  4. #  装备画面、显示浏览变更装备的候补物品的窗口。
  5. #==============================================================================

  6. class Window_EquipItem < Window_Selectable
  7.   #--------------------------------------------------------------------------
  8.   # ● 初始化对像
  9.   #     actor      : 角色
  10.   #     equip_type : 装备部位 (0~3)
  11.   #--------------------------------------------------------------------------
  12.   def initialize(actor, equip_type)
  13.     super(135, 280, 355, 200)
  14.     self.back_opacity = 150   
  15.     [url=home.php?mod=space&uid=95897]@actor[/url] = actor
  16.     @equip_type = equip_type
  17.     @column_max = 1
  18.     refresh
  19.     self.active = false
  20.     self.index = -1
  21.   end
  22.   #--------------------------------------------------------------------------
  23.   # ● 获取物品
  24.   #--------------------------------------------------------------------------
  25.   def item
  26.     return @data[self.index]
  27.   end
  28.   #--------------------------------------------------------------------------
  29.   # ● 刷新
  30.   #--------------------------------------------------------------------------
  31.   def refresh
  32.     if self.contents != nil
  33.       self.contents.dispose
  34.       self.contents = nil
  35.     end
  36.     @data = []
  37.     # 添加可以装备的武器
  38.     if @equip_type == 0
  39.       weapon_set = $data_classes[@actor.class_id].weapon_set
  40.       for i in 1...$data_weapons.size
  41.         if $game_party.weapon_number(i) > 0 and weapon_set.include?(i)
  42.           @data.push($data_weapons[i])
  43.         end
  44.       end
  45.     end
  46.     # 添加可以装备的防具
  47.     if @equip_type != 0
  48.       armor_set = $data_classes[@actor.class_id].armor_set
  49.       for i in 1...$data_armors.size
  50.         if $game_party.armor_number(i) > 0 and armor_set.include?(i)
  51.           if $data_armors[i].kind == @equip_type-1
  52.             @data.push($data_armors[i])
  53.           end
  54.         end
  55.       end
  56.     end
  57.     # 添加空白
  58.     @data.push(nil)
  59.     # 生成位图、描绘全部项目
  60.     @item_max = @data.size
  61.     self.contents = Bitmap.new(width - 32, row_max * 32)
  62.     for i in 0...@item_max-1
  63.       draw_item(i)
  64.     end
  65.   end
  66.   #--------------------------------------------------------------------------
  67.   # ● 项目的描绘
  68.   #     index : 项目符号
  69.   #--------------------------------------------------------------------------
  70.   def draw_item(index)
  71.     item = @data[index]
  72.     x = 4
  73.     y = index * 32
  74.     case item
  75.     when RPG::Weapon
  76.       number = $game_party.weapon_number(item.id)
  77.     when RPG::Armor
  78.       number = $game_party.armor_number(item.id)
  79.     end
  80.     bitmap = RPG::Cache.icon(item.icon_name)
  81.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
  82.     self.contents.font.color = normal_color
  83.     self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
  84.     self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
  85.     self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
  86.   end
  87.   #--------------------------------------------------------------------------
  88.   # ● 刷新帮助文本
  89.   #--------------------------------------------------------------------------
  90.   def update_help
  91.     @help_window.set_text(self.item == nil ? "" : self.item.description)
  92.   end
  93. end
复制代码
十分感谢!
作者: 小和尚    时间: 2013-5-9 06:07
= = 我个人的理解.. 那个空应该是取消装备吧...  默认的装备界面里也有..
作者: 亿万星辰    时间: 2013-5-9 06:23
如果实在看着不舒服就把它改成“卸下装备”




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1