Project1

标题: 想刪除選單內盾牌跟頭盔的位置 [打印本页]

作者: liu5417    时间: 2013-10-31 16:57
标题: 想刪除選單內盾牌跟頭盔的位置
本帖最后由 liu5417 于 2013-10-31 23:47 编辑



如圖,想刪除掉盾牌跟頭盔的裝備位置,如何辦到呢?

我只想留 武器,防具,飾品 3個欄位就好。
作者: tan12345    时间: 2013-10-31 17:34
  1. class Window_EquipSlot < Window_Selectable
  2.   #--------------------------------------------------------------------------
  3.   # ● 绘制项目
  4.   #--------------------------------------------------------------------------
  5.   def draw_item(index)
  6.     return unless @actor
  7.     rect = item_rect_for_text(index)
  8.     change_color(system_color, enable?(index))
  9.     draw_text(rect.x, rect.y, 92, line_height, slot_name(index)) if index != 1 and index != 2
  10.     draw_item_name(@actor.equips[index], rect.x + 92, rect.y, enable?(index)) if index != 1 and index != 2
  11.   end
  12. end
复制代码

作者: liu5417    时间: 2013-10-31 17:42
tan12345 发表于 2013-10-31 17:34

謝謝

但是還是選的到耶



,有辦法整個移除嗎? 然後下面的鎧甲和飾品遞浦上去這樣

不好意思麻煩了
作者: deeg    时间: 2013-10-31 17:55
本帖最后由 deeg 于 2013-10-31 18:07 编辑

提供一個比較笨的做法
把Window_EquipSlot裡面的item_max改成下面的樣式


  #--------------------------------------------------------------------------
  # ● 取得專案數
  #--------------------------------------------------------------------------
  def item_max
    @actor ? 3 : 0
  end


然後把再去數據庫把盾牌跟頭盔的名稱改成你要的的防具跟飾品
效果如下圖,名稱我沒改就是了
      

未命名.jpg (47.06 KB, 下载次数: 47)

未命名.jpg

作者: 喵呜喵5    时间: 2013-10-31 19:50
  1. class Game_Actor < Game_Battler
  2.   def equip_slots
  3.     return [0,0,4] if dual_wield?
  4.     return [0,1,4]
  5.   end
  6. end
复制代码

作者: tan12345    时间: 2013-10-31 20:08
喵呜喵5的方法是对的




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