| 赞 | 16 |
| VIP | |
| 好人卡 | |
| 积分 | 14 |
| 经验 | |
| 最后登录 | 2023-11-7 |
| 在线时间 | 50 小时 |
- 梦石
- 0
- 星屑
- 1433
- 在线时间
- 50 小时
- 注册时间
- 2020-2-16
- 回帖
- 85
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有账号?注册会员
×
#==============================================================================
# ■ Scene_Menu
#------------------------------------------------------------------------------
# 处理菜单画面的类。
#==============================================================================
class Scene_Menu
#--------------------------------------------------------------------------
# ● 初始化对像
# menu_index : 命令光标的初期位置
#--------------------------------------------------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
@windows = []
end
#--------------------------------------------------------------------------
# ● 主处理
#--------------------------------------------------------------------------
def main
# 生成命令窗口
s1 = $data_system.words.item
s2 = $data_system.words.skill
s3 = $data_system.words.equip
s4 = "状态"
s5 = "存档"
s6 = "结束游戏"
@windows.push(Window_Command.new(160, [s1, s2, s3, s4, s5, s6]))
@windows[0].index = @menu_index
@windows.push(Window_PlayTime.new)
@windows[1].x = 0
@windows[1].y = 224
@windows.push(Window_Steps.new)
@windows[2].x = 0
@windows[2].y = 320
@windows.push(Window_Gold.new)
@windows[3].x = 0
@windows[3].y = 416
@windows.push(Window_MenuStatus.new)
@windows[4].x = 160
@windows[4].y = 0
# 同伴人数为 0 的情况下
if $game_party.actors.size == 0
# 物品、特技、装备、状态无效化
@windows[0].disable_item(0)
@windows[0].disable_item(1)
@windows[0].disable_item(2)
@windows[0].disable_item(3)
end
# 禁止存档的情况下
if $game_system.save_disabled
# 存档无效
@windows[0].disable_item(4)
end
# 执行过渡
Graphics.transition
# 主循环
loop do
# 刷新游戏画面
Graphics.update
# 刷新输入信息
Input.update
# 刷新画面
update
# 如果切换画面就中断循环
if $scene != self
break
end
end
# 准备过渡
Graphics.freeze
for i in 0...@windows.size
@windows[i].dispose
end
# 释放窗口
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
def update
for i in 0...@windows.size
@windows[i].update
end
return update_command if @windows[0].active
end
def update_command
# 按下 B 键的情况下
if Input.trigger?(Input::B)
# 演奏取消 SE
$game_system.se_play($data_system.cancel_se)
# 切换的地图画面
$scene = Scene_Map.new
return
end
if Input.trigger?(Input::C)
# 同伴人数为 0、存档、游戏结束以外的场合
if $game_party.actors.size == 0 and @windows[0].index < 4
# 演奏冻结 SE
$game_system.se_play($data_system.buzzer_se)
return
end
# 命令窗口的光标位置分支
case @windows[0].index
when 0 # 物品
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 切换到物品画面
$scene = Scene_Item.new
when 1 # 特技
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 激活状态窗口
@windows[0].active = false
@windows[4].active = true
@windows[4].index = 0
when 2 # 装备
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 激活状态窗口
@windows[0].active = false
@windows[4].active = true
@windows[4].index = 0
when 3 # 状态
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 激活状态窗口
@windows[0].active = false
@windows[4].active = true
@windows[4].index = 0
when 4 # 存档
# 禁止存档的情况下
if $game_system.save_disabled
# 演奏冻结 SE
$game_system.se_play($data_system.buzzer_se)
return
end
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 切换到存档画面
$scene = Scene_Save.new
when 5 # 游戏结束
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 切换到游戏结束画面
$scene = Scene_End.new
end
return
end
end
end
|
|