| 
 
| 赞 | 3 |  
| VIP | 0 |  
| 好人卡 | 0 |  
| 积分 | 9 |  
| 经验 | 4062 |  
| 最后登录 | 2025-8-26 |  
| 在线时间 | 123 小时 |  
 Lv2.观梦者 
	梦石0 星屑886 在线时间123 小时注册时间2014-12-5帖子116 | 
| 
本帖最后由 狂乱月眼 于 2017-7-7 20:32 编辑
x
加入我们,或者,欢迎回来。您需要 登录 才可以下载或查看,没有帐号?注册会员  
 请问如何去除图标边框的描绘而保留字体颜色的描绘?
 
 复制代码#==============================================================================
#  ■ 物品颜色描绘 Ver.1.3  - By 柍若
# [使用方法]
#    - 在备注栏内填写"<品质 n>",其中n表示品质等级。
#==============================================================================
module ItemLevelDrawer
#==============================================================================
                 
    # true: 默认全局描绘    / false: 手动设置描绘
    
    WhenZero = true   # 开启则当品质为0(即不填)时,默认描绘品质1颜色
#------------------------------------------------------------------------------
    # true: 圆角    / false: 方角
    
    CornerShape = true
#------------------------------------------------------------------------------
    # 背景块不透明度
    
    BackOpacity = 160
#------------------------------------------------------------------------------
    
    # 各品质颜色设置,预设7种,可自行添加新品级
    # 数据库设定的品质大于下列品质的最大值时,将不描绘品质
    
    ColorSet = [[255, 255, 255],   # 备注 <品质 1> 或不填    [ 白 ]
    
                [128, 255, 128],   # 备注 <品质 2>        [ 绿 ]
                 
                [128, 128, 255],   # 备注 <品质 3>        [ 蓝 ]
                 
                [255,   0, 255],   # 备注 <品质 4>        [ 紫 ]
                 
                [255, 128, 128],   # 备注 <品质 5>        [ 红 ]
                 
                [255, 128,   0],   # 备注 <品质 6>        [ 橙 ]
                 
                [255, 255, 128],   # 备注 <品质 7>        [ 黄 ]
                 
                ]
#==============================================================================
end
#==============================================================================
# ■ Window_Base
#==============================================================================
class Window_Base < Window
  alias din2 draw_item_name
  def draw_item_name(item, x, y, enabled = true, width = 172)
    return unless item
    n = $1.to_i if /<品质 (\d+?)>/i =~ item.note
    x += 2
    return din2(item, x, y, enabled, width) unless n or ItemLevelDrawer::WhenZero and n.to_i <= ItemLevelDrawer::ColorSet.size
    n -= 1 if n and n >= 1 
    n = 0 unless n
    n = ItemLevelDrawer::ColorSet[n.to_i]
    self.contents.fill_rect(x+1, y+2, 22, 20, Color.new(n[0], n[1], n[2], ItemLevelDrawer::BackOpacity))
    s = 1 if ItemLevelDrawer::CornerShape
    self.contents.fill_rect(x+s.to_i, y+1, 24-s.to_i*2, 1, Color.new(n[0], n[1], n[2]))
    self.contents.fill_rect(x, y+s.to_i+1, 1, 22-s.to_i*2, Color.new(n[0], n[1], n[2]))
    self.contents.fill_rect(x+s.to_i, y+22, 24-s.to_i*2, 1, Color.new(n[0], n[1], n[2]))
    self.contents.fill_rect(x+23, y+s.to_i+1, 1, 22-s.to_i*2, Color.new(n[0], n[1], n[2]))
    draw_icon(item.icon_index, x, y, enabled)
    change_color(Color.new(n[0], n[1], n[2]), enabled)
    draw_text_ex(x + 30, y, item.name, Color.new(n[0], n[1], n[2]))
  end
  def draw_text_ex(x, y, text, initial_color = normal_color)
    reset_font_settings(initial_color)
    text = convert_escape_characters(text)
    pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(text)}
    process_character(text.slice!(0, 1), text, pos) until text.empty?
  end
  def reset_font_settings(initial_color = normal_color)
    change_color(initial_color)
    contents.font.size = Font.default_size
    contents.font.bold = Font.default_bold
    contents.font.italic = Font.default_italic
  end
end
#==============================================================================
# End of Script
#==============================================================================
 | 
 评分
查看全部评分
 |