Project1
标题: 请教单独做一个系统菜单,只有读存档,结束游戏,物品... [打印本页]
作者: zl245479821 时间: 2013-6-18 21:13
标题: 请教单独做一个系统菜单,只有读存档,结束游戏,物品...
本帖最后由 zl245479821 于 2013-6-20 21:09 编辑
就是想像系统菜单一样,但是只有物品,读存档,结束游戏作用,就像小红帽里那个。
作者: gaofei677 时间: 2013-6-19 13:50
class Scene_Menu < Scene_Base
def create_command_window
s1 = Vocab::item
s2 = Vocab::save
s3 = Vocab::game_end
@command_window = Window_Command.new(160, [s1, s2, s3])
@command_window.index = 0
if $game_party.members.size == 0 # 如果無人在隊
@command_window.draw_item(0, false) # 禁用[用品]
@command_window.draw_item(1, false) # 禁用[技能]
@command_window.draw_item(2, false) # 禁用[整備]
@command_window.draw_item(3, false) # 禁用[狀態]
end
if $game_system.save_disabled # 如果禁止存檔
@command_window.draw_item(4, false) # 禁用[存檔]
end
end
def update_command_selection
if Input.trigger?(Input::B)
Sound.play_cancel
$scene = Scene_Map.new
elsif Input.trigger?(Input::C)
if $game_party.members.size == 0 and @command_window.index < 4
Sound.play_buzzer
return
elsif $game_system.save_disabled and @command_window.index == 4
Sound.play_buzzer
return
end
Sound.play_decision
case @command_window.index
when 0 # 用品
$scene = Scene_Item.new
when 1 # 存檔
$scene = Scene_File.new(true, false, false)
when 2 # 結束遊戲
$scene = Scene_End.new
end
end
end
end
class Scene_Menu < Scene_Base
def create_command_window
s1 = Vocab::item
s2 = Vocab::save
s3 = Vocab::game_end
@command_window = Window_Command.new(160, [s1, s2, s3])
@command_window.index = 0
if $game_party.members.size == 0 # 如果無人在隊
@command_window.draw_item(0, false) # 禁用[用品]
@command_window.draw_item(1, false) # 禁用[技能]
@command_window.draw_item(2, false) # 禁用[整備]
@command_window.draw_item(3, false) # 禁用[狀態]
end
if $game_system.save_disabled # 如果禁止存檔
@command_window.draw_item(4, false) # 禁用[存檔]
end
end
def update_command_selection
if Input.trigger?(Input::B)
Sound.play_cancel
$scene = Scene_Map.new
elsif Input.trigger?(Input::C)
if $game_party.members.size == 0 and @command_window.index < 4
Sound.play_buzzer
return
elsif $game_system.save_disabled and @command_window.index == 4
Sound.play_buzzer
return
end
Sound.play_decision
case @command_window.index
when 0 # 用品
$scene = Scene_Item.new
when 1 # 存檔
$scene = Scene_File.new(true, false, false)
when 2 # 結束遊戲
$scene = Scene_End.new
end
end
end
end
不太完美,不过将就用吧
作者: gaofei677 时间: 2013-6-19 13:58
插入MIAN之前就行
作者: gaofei677 时间: 2013-6-19 14:14
我在新建工程试了试,没有发现任何问题,楼主最好截图来看看
作者: zl245479821 时间: 2013-6-19 14:20
gaofei677 发表于 2013-6-19 14:14
我在新建工程试了试,没有发现任何问题,楼主最好截图来看看
即使这个样。。
-
未命名.jpg
(7.28 KB, 下载次数: 23)
作者: gaofei677 时间: 2013-6-19 14:22
zl245479821 发表于 2013-6-19 14:20
即使这个样。。
以下是我的工程效果,楼主可以参考,实在不行,楼主把工程传上来吧
作者: zl245479821 时间: 2013-6-19 14:31
gaofei677 发表于 2013-6-19 14:22
以下是我的工程效果,楼主可以参考,实在不行,楼主把工程传上来吧
大大..对不起阿,我复制的时候不小心少了2个end,所以就...对不起阿,谢谢了。哎,能不能把那个人物和金钱都去掉,然后把那三个的框框放在中央啊?谢谢。
作者: gaofei677 时间: 2013-6-19 14:50
本帖最后由 gaofei677 于 2013-6-19 15:01 编辑
zl245479821 发表于 2013-6-19 14:31
大大..对不起阿,我复制的时候不小心少了2个end,所以就...对不起阿,谢谢了。哎,能不能把那个人物和金 ...
用此脚本替换2楼的脚本,同样插入MIAN之前
class Scene_Menu < Scene_Base
def start
super
create_menu_background
create_command_window
end
def terminate
super
dispose_menu_background
@command_window.dispose
end
def update
super
update_menu_background
@command_window.update
if @command_window.active
update_command_selection
elsif @status_window.active
update_actor_selection
end
end
def create_command_window
s1 = Vocab::item
s2 = Vocab::save
s3 = Vocab::game_end
@command_window = Window_Command.new(160, [s1, s2, s3])
@command_window.x = (544 - @command_window.width) / 2
@command_window.y = (416 - @command_window.height) / 2
@command_window.index = 0
if $game_party.members.size == 0 # 如果無人在隊
@command_window.draw_item(0, false) # 禁用[用品]
@command_window.draw_item(1, false) # 禁用[技能]
@command_window.draw_item(2, false) # 禁用[整備]
@command_window.draw_item(3, false) # 禁用[狀態]
end
if $game_system.save_disabled # 如果禁止存檔
@command_window.draw_item(4, false) # 禁用[存檔]
end
end
def update_command_selection
if Input.trigger?(Input::B)
Sound.play_cancel
$scene = Scene_Map.new
elsif Input.trigger?(Input::C)
if $game_party.members.size == 0 and @command_window.index < 4
Sound.play_buzzer
return
elsif $game_system.save_disabled and @command_window.index == 4
Sound.play_buzzer
return
end
Sound.play_decision
case @command_window.index
when 0 # 用品
$scene = Scene_Item.new
when 1 # 存檔
$scene = Scene_File.new(true, false, false)
when 2 # 結束遊戲
$scene = Scene_End.new
end
end
end
end
class Scene_Menu < Scene_Base
def start
super
create_menu_background
create_command_window
end
def terminate
super
dispose_menu_background
@command_window.dispose
end
def update
super
update_menu_background
@command_window.update
if @command_window.active
update_command_selection
elsif @status_window.active
update_actor_selection
end
end
def create_command_window
s1 = Vocab::item
s2 = Vocab::save
s3 = Vocab::game_end
@command_window = Window_Command.new(160, [s1, s2, s3])
@command_window.x = (544 - @command_window.width) / 2
@command_window.y = (416 - @command_window.height) / 2
@command_window.index = 0
if $game_party.members.size == 0 # 如果無人在隊
@command_window.draw_item(0, false) # 禁用[用品]
@command_window.draw_item(1, false) # 禁用[技能]
@command_window.draw_item(2, false) # 禁用[整備]
@command_window.draw_item(3, false) # 禁用[狀態]
end
if $game_system.save_disabled # 如果禁止存檔
@command_window.draw_item(4, false) # 禁用[存檔]
end
end
def update_command_selection
if Input.trigger?(Input::B)
Sound.play_cancel
$scene = Scene_Map.new
elsif Input.trigger?(Input::C)
if $game_party.members.size == 0 and @command_window.index < 4
Sound.play_buzzer
return
elsif $game_system.save_disabled and @command_window.index == 4
Sound.play_buzzer
return
end
Sound.play_decision
case @command_window.index
when 0 # 用品
$scene = Scene_Item.new
when 1 # 存檔
$scene = Scene_File.new(true, false, false)
when 2 # 結束遊戲
$scene = Scene_End.new
end
end
end
end
作者: gaofei677 时间: 2013-6-19 16:52
问题解决后请不要自行把帖子类型改为 已经解决
欢迎光临 Project1 (https://rpg.blue/) |
Powered by Discuz! X3.1 |