Project1
标题:
求助!关于禁止存档!
[打印本页]
作者:
2492537670@qq.c
时间:
2014-5-12 17:00
标题:
求助!关于禁止存档!
本帖最后由 2492537670@qq.c 于 2014-5-12 19:01 编辑
按视频改了程序,存档时没有差错,只要迷宫中禁止存档,就会出现错误!这个要怎么办啊!
==============================================================================
# ■ Window_Menu
#------------------------------------------------------------------------------
# 菜单命令选择行窗口。
#==============================================================================
class Window_Menu < Window_Selectable
#--------------------------------------------------------------------------
# ● 初始化对像
# width : 窗口的宽
# commands : 命令字符串序列
#--------------------------------------------------------------------------
def initialize#(width, commands)
# 由命令的个数计算出窗口的高
super(160, 0, 480, 64)
@commands = ["物品","术法","装备","状态","存储","退出"]
@column_max = 6
@item_max = @commands.size
self.z = 150
self.contents = Bitmap.new(480 - 32, 32)
refresh
self.index = 0
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self.contents.clear
# Color.new(Red,Green,Blue,A) 0~255
for i in 0...@item_max
if i == self.index
color = Color.new(0,0,200,255)
font_name = "楷体_GB2312"
else
color = normal_color
font_name = "黑体"
end
draw_item(i, color, font_name)
end
end
#--------------------------------------------------------------------------
# ● 描绘项目
# index : 项目编号
# color : 文字色
#--------------------------------------------------------------------------
def draw_item(index, color, font_name)
self.contents.font.color = color
self.contents.font.name = font_name
rect = Rect.new(3 + 80 * index, 2, self.contents.width - 8, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.draw_text(rect, @commands[index])
end
#--------------------------------------------------------------------------
# ● 项目无效化
# index : 项目编号
#--------------------------------------------------------------------------
def disable_item(index)
58行 draw_item(index, disabled_color)
end
#--------------------------------------------------------------------------
# ● 刷新光标矩形
#--------------------------------------------------------------------------
def update_cursor_rect
self.contents.clear
# Color.new(Red,Green,Blue,A) 0~255
for i in 0...@item_max
if i == self.index
color = Color.new(0,0,200,255)
font_name = "楷体_GB2312"
else
color = normal_color
font_name = "黑体"
end
draw_item(i, color, font_name)
end
end
end
复制代码
作者:
2492537670@qq.c
时间:
2014-5-12 18:07
怎么弄,文件太大了!40M
作者:
2492537670@qq.c
时间:
2014-5-12 18:22
2492537670@qq.c 发表于 2014-5-12 18:07
怎么弄,文件太大了!40M
上传了!不容易啊!
作者:
2492537670@qq.c
时间:
2014-5-12 18:23
2492537670@qq.c 发表于 2014-5-12 18:07
怎么弄,文件太大了!40M
上传了!不容易啊!
作者:
天地有正气
时间:
2014-5-12 18:42
本帖最后由 天地有正气 于 2014-5-12 18:43 编辑
错误太明显了…………
你这里draw_item给出了两个参数
但是你之前又定义需要3个参数……当然会出错咯!
解决方法:第58行改为:
draw_item(index, disabled_color,self.contents.font.name)
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X5.0