| 
 
| 赞 | 0 |  
| VIP | 0 |  
| 好人卡 | 0 |  
| 积分 | 1 |  
| 经验 | 631 |  
| 最后登录 | 2012-3-5 |  
| 在线时间 | 47 小时 |  
 Lv1.梦旅人 
	梦石0 星屑50 在线时间47 小时注册时间2011-12-9帖子23 | 
| 本帖最后由 仲秋启明 于 2011-12-20 15:58 编辑 
 我是用这个修改图标的脚本的。。但不知道为什么按照方法导入叫本后。。图标却没显示
  。。详细看图 复制代码#==============================================================================
# ■ Window_ActorCommand
#------------------------------------------------------------------------------
#  战斗画面显示角色指令的窗口。
#==============================================================================
class Window_ActorCommand < Window_Selectable
  #--------------------------------------------------------------------------
  # ● 定义实例变量
  #--------------------------------------------------------------------------  
  attr_reader   :commands                 # 命令  
  #--------------------------------------------------------------------------
  # ● 初始化对象
  #     width      : 窗口的宽
  #     commands   : 命令字符串序列
  #     column_max : 行数 (2 行以上时选择)
  #     row_max    : 列数 (0:列数加起来)
  #     spacing : 选项横向排列时间隔空白宽度
  #--------------------------------------------------------------------------
  def initialize(width = 150, commands = [], column_max = 1, row_max = 4, spacing = 32)
    if row_max == 0
      row_max = (commands.size + column_max - 1) / column_max
    end
    super(0, 0, width, row_max * WLH + 32, spacing)
    self.active = false
    @commands = []
    @icon_list = [1, 52, 128, 144]
    @item_max = commands.size
    @column_max = column_max
    @remember_index = -1
    self.index = 0
    # refresh
    update
  end
  #--------------------------------------------------------------------------
  # ● 刷新
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    for i in 0...@item_max
      draw_item(i)
    end
  end
  #--------------------------------------------------------------------------
  # ● 设置自定义特技指令名称
  #     actor :角色
  #--------------------------------------------------------------------------
  def setup(actor)
    s1 = Vocab::attack
    s2 = Vocab::skill
    s3 = Vocab::guard
    s4 = Vocab::item
    if actor.class.skill_name_valid     # 特技指令名称有效?
      s2 = actor.class.skill_name       # 替换指令名
    end
    @commands = [s1, s2, s3, s4]
    @item_max = 4
    refresh
    self.index = 0
  end  
  
  #--------------------------------------------------------------------------
  # ● 描绘项目
  #     index : 项目编号
  #     enabled : 有效标记录。是false 的时候半透明绘画
  #--------------------------------------------------------------------------
  def draw_item(index, enabled = true)
    rect = item_rect(index)
    rect.x += 4
    rect.width -= 8
    self.contents.clear_rect(rect)
    draw_icon(@icon_list[index], rect.x, rect.y, true) if index == self.index
    self.contents.font.color = normal_color
    self.contents.font.color.alpha = enabled ? 255 : 128
    rect.x += 26
    self.contents.draw_text(rect, @commands[index])
  end
  
  #--------------------------------------------------------------------------
  # ● 刷新类型
  #--------------------------------------------------------------------------
  def update
    super
    @remember_index = self.index if self.index == -1
    if @remember_index != self.index
      @remember_index = self.index
      refresh
    end
  end
  
end
 | 
 
理想效果.png
(97.35 KB, 下载次数: 43)
 
 我想弄成这样 
错误.png
(77.52 KB, 下载次数: 42)
 
 这个是我现在用的,用了叫本,但图标没出现 |