class Window_Command_New < Window_Selectable
def initialize(actors=4,enemynums=0)
super(438, 20, 172, 160)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = HS::OPACITY
@commands = ["战斗","物品","魔法","状态","装备","队列","任务","系统"]
@item_max = 8
@column_max = 2
@actors = actors
@enemynums = enemynums
draw_item(0, @enemynums==0 ? disabled_color : normal_color)
draw_item(1, 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))
self.contents.draw_text(rect, @commands[index], 1)
end
def update_cursor_rect
x = 4 + index % 2 * 70
y = index / 2 * 32
self.cursor_rect.set(x, y, 64, 32)
end
end
class Scene_Menu
def initialize(menu_index = 0)
@menu_index = menu_index
end
def main
# check_enemy_in_map($game_player.x,$game_player.y)
cmd = Window_Command_New.new($game_party.actors.size)
cmd.index = @menu_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_Map.new
end
if Input.trigger?(Input::C)
case cmd.index
when 0
$game_system.se_play($data_system.buzzer_se)
when 1
$game_system.se_play($data_system.decision_se)
$scene = Scene_Item.new
when 2
$game_system.se_play($data_system.decision_se)
$scene = Scene_Skill.new
when 3
$game_system.se_play($data_system.decision_se)
$scene = Scene_Status.new
when 4
$game_system.se_play($data_system.decision_se)
$scene = Scene_Equip.new
when 5
$game_system.se_play($data_system.decision_se)
$scene = Scene_Change_Turn.new
when 6
$game_system.se_play($data_system.decision_se)
$scene = Scene_Charactor.new
when 7
print "自己安排什么 储存、读取、什么的等"
end
end
if $scene != self
break
end
end
Graphics.freeze
cmd.dispose
end
end
class Window_Command_New < Window_Selectable
def initialize(actors=4,enemynums=0)
super(438, 20, 172, 160)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = HS::OPACITY
@commands = ["战斗","物品","魔法","状态","装备","队列","任务","系统"]
@item_max = 8
@column_max = 2
@actors = actors
@enemynums = enemynums
draw_item(0, @enemynums==0 ? disabled_color : normal_color)
draw_item(1, 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))
self.contents.draw_text(rect, @commands[index], 1)
end
def update_cursor_rect
x = 4 + index % 2 * 70
y = index / 2 * 32
self.cursor_rect.set(x, y, 64, 32)
end
end
class Scene_Menu
def initialize(menu_index = 0)
@menu_index = menu_index
end
def main
# check_enemy_in_map($game_player.x,$game_player.y)
cmd = Window_Command_New.new($game_party.actors.size)
cmd.index = @menu_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_Map.new
end
if Input.trigger?(Input::C)
case cmd.index
when 0
$game_system.se_play($data_system.buzzer_se)
when 1
$game_system.se_play($data_system.decision_se)
$scene = Scene_Item.new
when 2
$game_system.se_play($data_system.decision_se)
$scene = Scene_Skill.new
when 3
$game_system.se_play($data_system.decision_se)
$scene = Scene_Status.new
when 4
$game_system.se_play($data_system.decision_se)
$scene = Scene_Equip.new
when 5
$game_system.se_play($data_system.decision_se)
$scene = Scene_Change_Turn.new
when 6
$game_system.se_play($data_system.decision_se)
$scene = Scene_Charactor.new
when 7
$game_system.se_play($data_system.decision_se
$scene = Scene_End.new
end
end
if $scene != self
break
end
end
Graphics.freeze
cmd.dispose
end
end
以下引用hitlerson于2008-5-31 16:52:34的发言:
一个萝卜一个坑,一个连接只能对应一个地方
改程序吧
when 7 改成
when 7 # 游戏结束
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 切换到游戏结束画面
$scene = Scene_End.new
end
#==============================================================================
# ■ Scene_End
#------------------------------------------------------------------------------
# 处理游戏结束画面的类。
#==============================================================================
class Scene_End
#--------------------------------------------------------------------------
# ● 主处理
#--------------------------------------------------------------------------
def main
# 生成命令窗口
s4 = "保存"
s5 = "读取"
s1 = "返回标题画面"
s2 = "退出"
s3 = "取消"
@command_window = Window_Command.new(192, [s4, s5, s1, s2, s3])
@command_window.x = 320 - @command_window.width / 2
@command_window.y = 240 - @command_window.height / 2
# 执行过渡
Graphics.transition
# 主循环
loop do
# 刷新游戏画面
Graphics.update
# 刷新输入情报
Input.update
# 刷新画面
update
# 如果画面切换的话就中断循环
if $scene != self
break
end
end
# 准备过渡
Graphics.freeze
# 释放窗口
@command_window.dispose
# 如果在标题画面切换中的情况下
if $scene.is_a?(Scene_Title)
# 淡入淡出画面
Graphics.transition
Graphics.freeze
end
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
def update
# 刷新命令窗口
@command_window.update
# 按下 B 键的情况下
if Input.trigger?(Input::B)
# 演奏取消 SE
$game_system.se_play($data_system.cancel_se)
# 切换到菜单画面
$scene = Scene_Menu.new(5)
return
end
# 按下 C 键的场合下
if Input.trigger?(Input::C)
# 命令窗口光标位置分支
case @command_window.index
when 0
command_to_save
when 1
command_to_load
when 2 # 返回标题画面
command_to_title
when 3 # 退出
command_shutdown
when 4 # 取消
command_cancel
end
return
end
end
#--------------------------------------------------------------------------
# ● 选择命令 [返回标题画面] 时的处理
#--------------------------------------------------------------------------
def command_to_save
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 切换到菜单画面
$scene = Scene_Save.new
end
#--------------------------------------------------------------------------
# ● 选择命令 [返回标题画面] 时的处理
#--------------------------------------------------------------------------
def command_to_load
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 切换到菜单画面
$scene = Scene_Load.new
end
#--------------------------------------------------------------------------
# ● 选择命令 [返回标题画面] 时的处理
#--------------------------------------------------------------------------
def command_to_title
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 淡入淡出 BGM、BGS、ME
Audio.bgm_fade(800)
Audio.bgs_fade(800)
Audio.me_fade(800)
# 切换到标题画面
$scene = Scene_Title.new
end
#--------------------------------------------------------------------------
# ● 选择命令 [退出] 时的处理
#--------------------------------------------------------------------------
def command_shutdown
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 淡入淡出 BGM、BGS、ME
Audio.bgm_fade(800)
Audio.bgs_fade(800)
Audio.me_fade(800)
# 退出
$scene = nil
end
#--------------------------------------------------------------------------
# ● 选择命令 [取消] 时的处理
#--------------------------------------------------------------------------
def command_cancel
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 切换到菜单画面
$scene = Scene_Menu.new(5)
end
end
以下引用havealook于2008-5-31 17:08:40的发言:
那个要调坐标 - -
LZ参考:http://rpg.blue/web/htm/news567.htm做
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |