#encoding:utf-8 #============================================================================== # ■ Window_Status #------------------------------------------------------------------------------ # 状态画面中,显示角色基本信息的窗口。 #============================================================================== class Window_Status < Window_Selectable SLOT_NAME_WIDTH = 92 #-------------------------------------------------------------------------- # ● [别名修改]绘制装备 #-------------------------------------------------------------------------- alias draw_equipments_slot_name draw_equipments def draw_equipments(x, y) draw_equipments_slot_name(x, y) # 调用原方法 @actor.equips.each_with_index do |item, i| change_color(system_color, enable?(i)) draw_text(x, y + line_height * i, 92, line_height, slot_name(i)) end end #-------------------------------------------------------------------------- # ● [子类重载]绘制物品名称 # enabled : 有效的标志。false 的时候使用半透明效果绘制 #-------------------------------------------------------------------------- def draw_item_name(item, x, y, enabled = true, width = 172) super(item, x + SLOT_NAME_WIDTH, y, enabled, width) end #-------------------------------------------------------------------------- # ● [复制]获取装备栏的名字 #-------------------------------------------------------------------------- def slot_name(index) @actor ? Vocab::etype(@actor.equip_slots[index]) : "" end #-------------------------------------------------------------------------- # ● [复制]查询这个装备栏的装备是否可以替换 #-------------------------------------------------------------------------- def enable?(index) @actor ? @actor.equip_change_ok?(index) : false end end
#encoding:utf-8
#==============================================================================
# ■ Window_Status
#------------------------------------------------------------------------------
# 状态画面中,显示角色基本信息的窗口。
#==============================================================================
class Window_Status < Window_Selectable
SLOT_NAME_WIDTH = 92
#--------------------------------------------------------------------------
# ● [别名修改]绘制装备
#--------------------------------------------------------------------------
alias draw_equipments_slot_name draw_equipments
def draw_equipments(x, y)
draw_equipments_slot_name(x, y) # 调用原方法
@actor.equips.each_with_index do |item, i|
change_color(system_color, enable?(i))
draw_text(x, y + line_height * i, 92, line_height, slot_name(i))
end
end
#--------------------------------------------------------------------------
# ● [子类重载]绘制物品名称
# enabled : 有效的标志。false 的时候使用半透明效果绘制
#--------------------------------------------------------------------------
def draw_item_name(item, x, y, enabled = true, width = 172)
super(item, x + SLOT_NAME_WIDTH, y, enabled, width)
end
#--------------------------------------------------------------------------
# ● [复制]获取装备栏的名字
#--------------------------------------------------------------------------
def slot_name(index)
@actor ? Vocab::etype(@actor.equip_slots[index]) : ""
end
#--------------------------------------------------------------------------
# ● [复制]查询这个装备栏的装备是否可以替换
#--------------------------------------------------------------------------
def enable?(index)
@actor ? @actor.equip_change_ok?(index) : false
end
end
|