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

Project1

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

[已经解决] 求助!关于禁止存档!

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
55 小时
注册时间
2014-5-12
帖子
59
跳转到指定楼层
1
发表于 2014-5-12 17:00:26 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 [email protected] 于 2014-5-12 19:01 编辑

按视频改了程序,存档时没有差错,只要迷宫中禁止存档,就会出现错误!这个要怎么办啊!
  1. ==============================================================================
  2. # ■ Window_Menu
  3. #------------------------------------------------------------------------------
  4. #  菜单命令选择行窗口。
  5. #==============================================================================

  6. class Window_Menu < Window_Selectable
  7.   #--------------------------------------------------------------------------
  8.   # ● 初始化对像
  9.   #     width    : 窗口的宽
  10.   #     commands : 命令字符串序列
  11.   #--------------------------------------------------------------------------
  12.   def initialize#(width, commands)
  13.     # 由命令的个数计算出窗口的高
  14.     super(160, 0, 480, 64)
  15.     @commands = ["物品","术法","装备","状态","存储","退出"]
  16.     @column_max = 6
  17.     @item_max = @commands.size
  18.     self.z = 150
  19.     self.contents = Bitmap.new(480 - 32, 32)
  20.     refresh
  21.     self.index = 0
  22.   end
  23.      #--------------------------------------------------------------------------
  24.   # ● 刷新
  25.   #--------------------------------------------------------------------------
  26.   def refresh
  27.     self.contents.clear
  28.     # Color.new(Red,Green,Blue,A) 0~255
  29.     for i in 0...@item_max
  30.       if i == self.index
  31.         color = Color.new(0,0,200,255)
  32.         font_name = "楷体_GB2312"
  33.       else
  34.         color = normal_color
  35.         font_name = "黑体"
  36.       end
  37.       draw_item(i, color, font_name)
  38.     end
  39.   end
  40.   #--------------------------------------------------------------------------
  41.   # ● 描绘项目
  42.   #     index : 项目编号
  43.   #     color : 文字色
  44.   #--------------------------------------------------------------------------
  45.   def draw_item(index, color, font_name)
  46.     self.contents.font.color = color
  47.     self.contents.font.name = font_name
  48.     rect = Rect.new(3 + 80 * index, 2, self.contents.width - 8, 32)
  49.     self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  50.     self.contents.draw_text(rect, @commands[index])
  51.   end
  52.   #--------------------------------------------------------------------------
  53.   # ● 项目无效化
  54.   #     index : 项目编号
  55.   #--------------------------------------------------------------------------
  56.   def disable_item(index)
  57. 58行    draw_item(index, disabled_color)
  58. end
  59.   #--------------------------------------------------------------------------
  60.   # ● 刷新光标矩形
  61.   #--------------------------------------------------------------------------
  62.   def update_cursor_rect
  63.     self.contents.clear
  64.     # Color.new(Red,Green,Blue,A) 0~255
  65.     for i in 0...@item_max
  66.       if i == self.index
  67.         color = Color.new(0,0,200,255)
  68.         font_name = "楷体_GB2312"
  69.       else
  70.         color = normal_color
  71.         font_name = "黑体"
  72.       end
  73.       draw_item(i, color, font_name)
  74.     end
  75.   end
  76. end
复制代码

QQ截图20140512165802.jpg (11.57 KB, 下载次数: 6)

这是神马?

这是神马?

不知道问题出在哪.rar

1.65 MB, 下载次数: 11

我缩减了,不过,脚本没减!错误还是错误!

点评

注意哦~版规里是禁止手动更改标签的……下次如果让别的版主看见要扣经验了……  发表于 2014-5-12 19:05
脚本请用代码框……帮你编辑上了……  发表于 2014-5-12 18:41
附上工程  发表于 2014-5-12 17:50

Lv1.梦旅人

梦石
0
星屑
50
在线时间
55 小时
注册时间
2014-5-12
帖子
59
2
 楼主| 发表于 2014-5-12 18:07:31 | 只看该作者
怎么弄,文件太大了!40M
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
55 小时
注册时间
2014-5-12
帖子
59
3
 楼主| 发表于 2014-5-12 18:22:58 | 只看该作者
[email protected] 发表于 2014-5-12 18:07
怎么弄,文件太大了!40M

上传了!不容易啊!
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
55 小时
注册时间
2014-5-12
帖子
59
4
 楼主| 发表于 2014-5-12 18:23:23 | 只看该作者
[email protected] 发表于 2014-5-12 18:07
怎么弄,文件太大了!40M

上传了!不容易啊!
回复 支持 反对

使用道具 举报

Lv3.寻梦者

○赛

梦石
0
星屑
1249
在线时间
1276 小时
注册时间
2013-1-22
帖子
2246

贵宾

5
发表于 2014-5-12 18:42:40 | 只看该作者
本帖最后由 天地有正气 于 2014-5-12 18:43 编辑

错误太明显了…………
你这里draw_item给出了两个参数
但是你之前又定义需要3个参数……当然会出错咯!

解决方法:第58行改为:
draw_item(index, disabled_color,self.contents.font.name)

点评

太给力啦!我整了半天都不会!视频上面没有这个错误!脚本什么的太难了!正是万分感谢!  发表于 2014-5-12 19:00
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-30 19:33

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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