Project1
标题:
怎么在菜单中呼出怪物图鉴?
[打印本页]
作者:
luoky
时间:
2012-10-3 13:29
标题:
怎么在菜单中呼出怪物图鉴?
http://rpg.blue/thread-101635-1-1.html
作者:
莉德露
时间:
2012-10-3 13:38
先插入那個腳本
然後在腳本Scene_Menu更改為
#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
# 這個類用來執行顯示ESC選單畫面的程式。
#==============================================================================
class Scene_Menu < Scene_Base
#--------------------------------------------------------------------------
# * 物件初始化
# menu_index : 命令游標的起始位置
#--------------------------------------------------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
end
#--------------------------------------------------------------------------
# * 程式開始
#--------------------------------------------------------------------------
def start
super
create_menu_background
create_command_window
@gold_window = Window_Gold.new(0, 360)
@status_window = Window_MenuStatus.new(160, 0)
end
#--------------------------------------------------------------------------
# * 程式中止
#--------------------------------------------------------------------------
def terminate
super
dispose_menu_background
@command_window.dispose
@gold_window.dispose
@status_window.dispose
end
#--------------------------------------------------------------------------
# * 更新幀
#--------------------------------------------------------------------------
def update
super
update_menu_background
@command_window.update
@gold_window.update
@status_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::skill
s3 = Vocab::equip
s4 = Vocab::status
s5 = Vocab::save
s6 = Vocab::game_end
s7 = "怪物圖鑒"
@command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6,s7])
@command_window.index = @menu_index
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,2,3 # 技能,整備,狀態
start_actor_selection
when 4 # 存檔
$scene = Scene_File.new(true, false, false)
when 5 # 結束遊戲
$scene = Scene_End.new
when 6 # 圖鑒
$scene = Scene_EnemyGuide.new
end
end
end
#--------------------------------------------------------------------------
# * 開始接收主角選擇指令輸入資訊
#--------------------------------------------------------------------------
def start_actor_selection
@command_window.active = false
@status_window.active = true
if $game_party.last_actor_index < @status_window.item_max
@status_window.index = $game_party.last_actor_index
else
@status_window.index = 0
end
end
#--------------------------------------------------------------------------
# * 停止接收主角選擇指令輸入資訊
#--------------------------------------------------------------------------
def end_actor_selection
@command_window.active = true
@status_window.active = false
@status_window.index = -1
end
#--------------------------------------------------------------------------
# * 更新主角選擇指令輸入資訊
#--------------------------------------------------------------------------
def update_actor_selection
if Input.trigger?(Input::B)
Sound.play_cancel
end_actor_selection
elsif Input.trigger?(Input::C)
$game_party.last_actor_index = @status_window.index
Sound.play_decision
case @command_window.index
when 1 # 技能
$scene = Scene_Skill.new(@status_window.index)
when 2 # 整備
$scene = Scene_Equip.new(@status_window.index)
when 3 # 狀態
$scene = Scene_Status.new(@status_window.index)
end
end
end
end
复制代码
作者:
luoky
时间:
2012-10-3 13:48
莉德露 发表于 2012-10-3 13:38
先插入那個腳本
然後在腳本Scene_Menu更改為
谢谢,不过
when 5 # 結束遊戲
97. $scene = Scene_End.new
98. when 6 # 結束遊戲
99. $scene = Scene_EnemyGuide.new
复制代码
写错了吧
作者:
莉德露
时间:
2012-10-3 13:55
luoky 发表于 2012-10-3 13:48
谢谢,不过写错了吧
沒有吧
而且,那個圖鑒腳本
也會自動生成一個選項在你的主菜單里啊
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1