Project1

标题: 求教大神这个装备品级脚本的修改(已经解决!) [打印本页]

作者: RMVXA    时间: 2018-9-14 11:11
标题: 求教大神这个装备品级脚本的修改(已经解决!)
本帖最后由 RMVXA 于 2018-9-14 20:01 编辑

找到了一个好脚本,但是希望能有一点点功能上的改进,求大神帮忙改一下,谢谢啦:
1.可以把下图装备后面的冒号和数量改成白色字体吗?
2.可以在技能里的图标去掉边框,只有道具和装备的图标有边框吗?
   


脚本如下:

#==============================================================================
# ■ 物品颜色描绘
# By :VIPArcher [email: [email protected]]
#  -- 本脚本来自 http://rm.66rpg.com 使用或转载请保留以上信息。

#==============================================================================
$VIPArcherScript ||= {};$VIPArcherScript[:itemcolor] = __FILE__ #20141007
#-------------------------------------------------------------------------------
module VIPArcher end
#==============================================================================
# ★ 设定部分 ★
#==============================================================================

module VIPArcher::ItemColor
  RIM = true #是否描绘边框
  FILL = true #是否填充边框
  #为了方便设置品质等级,
  Color_Lv = {
# 品质 => 控制符颜色编号,
    0  =>  0,
    1  =>  3,
    2  =>  12,
    3  =>  27,
    # 继续添加
  };Color_Lv.default = 0 #这行不能删
end
#==============================================================================
# ☆ 设定结束 ☆
#==============================================================================

class RPG::BaseItem
  include VIPArcher::ItemColor
  #--------------------------------------------------------------------------
  # ● 获取道具的品质
  #--------------------------------------------------------------------------

  def color
    @note =~ /\<(?:color|品质|颜色)\s*(\d+)\>/i
    [[$1.to_i,Color_Lv.size - 1].min,0].max
  end
end
#-------------------------------------------------------------------------------
class Window_Base < Window
  include VIPArcher::ItemColor
  #--------------------------------------------------------------------------
  # ● 描绘物品
  #--------------------------------------------------------------------------

  def draw_item_name(item, x, y, enabled = true, width = 172)
    return unless item
    item_color = text_color(Color_Lv[item.color])
    change_color(item_color, enabled)
    self.color_fill_rect(x,y,item_color) if RIM
    draw_icon(item.icon_index, x, y, enabled)
    draw_text(x + 24, y, width, line_height, item.name)
  end
  #--------------------------------------------------------------------------
  # ● 绘制图标边框
  #--------------------------------------------------------------------------

  def color_fill_rect(x,y,item_color)
    item_alpha = item_color.clone
    item_alpha.alpha = 160
    contents.fill_rect(x+1 ,y+1 ,22, 22 ,item_alpha) if FILL
    contents.fill_rect(x+1 ,y+1 ,22, 1  ,item_color)
    contents.fill_rect(x   ,y+2 ,1 , 20 ,item_color)
    contents.fill_rect(x+1 ,y+22,22, 1  ,item_color)
    contents.fill_rect(x+23,y+2 ,1 , 20 ,item_color)
  end
end






作者: 张咚咚    时间: 2018-9-14 12:01
替换
  1. def draw_item_name(item, x, y, enabled = true, width = 172)
  2.     return unless item
  3.     item_color = text_color(Color_Lv[item.color])
  4.     change_color(item_color, enabled)
  5.     self.color_fill_rect(x,y,item_color) if RIM and not item.is_a?(RPG::Skill)
  6.     draw_icon(item.icon_index, x, y, enabled)
  7.     draw_text(x + 24, y, width, line_height, item.name)
  8.     change_color(normal_color)
  9. end
复制代码

作者: 骷髅岛遗老    时间: 2018-9-15 14:57
想问一下LZ这个脚本是怎么使用的……




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