赞 | 2 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 4954 |
最后登录 | 2024-3-18 |
在线时间 | 54 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 81
- 在线时间
- 54 小时
- 注册时间
- 2008-12-24
- 帖子
- 345
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
class Window_Command_New2 < Window_Selectable
def initialize(actors=4,enemynums=0)
super(438, 20, 172, 160)
self.contents = Bitmap.new(width - 32, height - 32)
case $game_variables[2]
when 0
@commands = ["空"]
when 1
@commands = ["1"]
when 2
@commands = ["1","2"]
when 3
@commands = ["1","2","3"]
when 4
@commands = ["1","2","3","4"]
when 5
@commands = ["1","2","3","4","5"]
when 6
@commands = ["1","2","3","4","5","6"]
when 7
@commands = ["1","2","3","4","5","6","7"]
when 8
@commands = ["1","2","3","4","5","6","7","8"]
end
@item_max = 8
@column_max = 2
@actors = actors
draw_item(0, @actors==0 ? disabled_color : normal_color)
draw_item(1, @actors==0 ? disabled_color : normal_color)
draw_item(2, @actors==0 ? disabled_color : normal_color)
draw_item(3, @actors==0 ? disabled_color : normal_color)
draw_item(4, @actors==0 ? disabled_color : normal_color)
draw_item(5, @actors==0 ? disabled_color : normal_color)
draw_item(6, normal_color)
draw_item(7, normal_color)
self.index = 0
end
def draw_item(index, color)
self.contents.font.color = color
x = 4 + index % 2 * 70
y = index / 2 * 32
rect = Rect.new(x, y, 64, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
#错行 提示 typeerror
#错行 提示 cannot convert nil into string
self.contents.draw_text(rect, @commands[index], 1)
#错行 提示 typeerror
#错行 提示 cannot convert nil into string
end
def update_cursor_rect
x = 4 + index % 2 * 70
y = index / 2 * 32
self.cursor_rect.set(x, y, 64, 32)
end
end
#用脚本调用 $scene = Scene_Ydck.new
class Scene_Ydck
def initialize(ydck_index = 0)
@ydck_index = ydck_index
end
def main
# check_enemy_in_map($game_player.x,$game_player.y)
cmd = Window_Command_New2.new($game_party.actors.size)
cmd.index = @ydck_index
Graphics.transition
loop do
Graphics.update
Input.update
cmd.update
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new
end
if Input.trigger?(Input::C)
case cmd.index
when 0
#回到地图
$scene = Scene_Map.new
#调用公共事件1 以下依次类推
$game_system.map_interpreter.setup($data_common_events[1].list, 0)
$game_system.map_interpreter.update
when 1
$scene = Scene_Map.new
$game_system.map_interpreter.setup($data_common_events[2].list, 0)
$game_system.map_interpreter.update
when 2
$scene = Scene_Map.new
$game_system.map_interpreter.setup($data_common_events[3].list, 0)
$game_system.map_interpreter.update
when 3
$scene = Scene_Map.new
$game_system.map_interpreter.setup($data_common_events[4].list, 0)
$game_system.map_interpreter.update
when 4
$scene = Scene_Map.new
$game_system.map_interpreter.setup($data_common_events[5].list, 0)
$game_system.map_interpreter.update
when 5
$scene = Scene_Map.new
$game_system.map_interpreter.setup($data_common_events[6].list, 0)
$game_system.map_interpreter.update
when 6
$scene = Scene_Map.new
$game_system.map_interpreter.setup($data_common_events[7].list, 0)
$game_system.map_interpreter.update
when 7
$scene = Scene_Map.new
$game_system.map_interpreter.setup($data_common_events[8].list, 0)
$game_system.map_interpreter.update
end
end
if $scene != self
break
end
end
Graphics.freeze
cmd.dispose
end
end 本贴由论坛斑竹天圣的马甲结贴,如楼主认为问题未解决,请重新将此贴编辑为“有事请教”,并回帖叙述疑点即可~ ^-^ |
|