设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 2838|回复: 3
打印 上一主题 下一主题

[已经解决] 求解,那个支援单张图标的脚本出错了

[复制链接]

Lv1.梦旅人

哆啦菌

梦石
0
星屑
46
在线时间
795 小时
注册时间
2010-7-24
帖子
3800
跳转到指定楼层
1
发表于 2012-3-18 04:05:28 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
本帖最后由 fxwd 于 2012-3-18 10:03 编辑

class RPG::BaseItem
  #--------------------------------------------------------------------------
  # ● 获取图标
  #--------------------------------------------------------------------------
  def get_icon
    self.note.split(/[\r\n]+/).each { |line|
      return $1 if line =~ /\[(?:icon) (\S+)\]/
    }
    return nil
  end
  #--------------------------------------------------------------------------
  # ● 图标 index
  #--------------------------------------------------------------------------
  alias draw_single_icon_icon_index icon_index
  def icon_index
    icon_index = get_icon
    # 如果有指定图标
    if icon_index && icon_index =~ /\d+/ # 如果指定的是數字
      @icon_index = icon_index.to_i # 轉換成數字  #--------------------------------------------------------------------------
  alias draw_single_icon_draw_icon draw_icon
  def draw_icon(icon_index, x, y, enabled = true)
    if icon_index.is_a?(Integer) # 判断是否为整数
    elsif icon_index
      return icon_index # 返回指定图标文件名
    end
    return draw_single_icon_icon_index # 否则返回原本的图标 index
  end
end
class Window_Base
  #--------------------------------------------------------------------------
  # ● 绘制图标

      # 调用原本的绘制图标方法
      draw_single_icon_draw_icon(icon_index, x, y, enabled)
    else # 指定图标时
      bitmap = Cache.load_bitmap("Graphics/Icons/", icon_index)
      rect = Rect.new(0, 0, 24, 24)
      contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
    end
  end
end
这个脚本,用了之后提示CACHE106行出错了,什么意思?
随便看看

Lv4.逐梦者

醉啸 长风万里

梦石
0
星屑
6057
在线时间
6586 小时
注册时间
2007-12-16
帖子
4501

贵宾

2
发表于 2012-3-18 09:06:50 | 只看该作者
没找到你设置的图标

还在龟速填坑中
回复 支持 反对

使用道具 举报

Lv1.梦旅人

哆啦菌

梦石
0
星屑
46
在线时间
795 小时
注册时间
2010-7-24
帖子
3800
3
 楼主| 发表于 2012-3-18 10:03:14 | 只看该作者
哦,谢谢,解决了,是因为我把那张图片弄成了PNG格式的了
随便看看
回复 支持 反对

使用道具 举报

Lv2.观梦者

天仙

梦石
0
星屑
610
在线时间
184 小时
注册时间
2008-4-15
帖子
5023

贵宾

4
发表于 2012-3-18 12:50:32 | 只看该作者
补充一点,如果文件夹中有两个同名文件(扩充名不同)时,也会出错
VA脚本开工中...
偷窃脚本1.0 - 已完成
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-5-8 08:32

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表