end
#--------------------------------------------------------------------------
# ● 刷新画面 (命令窗口被激活的情况下)
#--------------------------------------------------------------------------
def update_zhenwei_IndexCommand
# end
# 按下 C 键的情况下
if Input.trigger?(Input::C)
# @zhenwei_IndexCommand.zhenwei_index == 0
if @zhenwei_IndexCommand.zhenwei_index == 0
@zhenwei_IndexCommand.zhenwei_1_spawn
elsif
if @zhenwei_IndexCommand.zhenwei_index == 1
@zhenwei_IndexCommand.zhenwei_2_spawn
elsif
if @zhenwei_IndexCommand.zhenwei_index == 2
@zhenwei_IndexCommand.zhenwei_3_spawn
elsif
if @zhenwei_IndexCommand.zhenwei_index == 3
@zhenwei_IndexCommand.zhenwei_4_spawn
elsif
if @zhenwei_IndexCommand.zhenwei_index == 4
@zhenwei_IndexCommand.zhenwei_5_spawn
elsif
if @zhenwei_IndexCommand.zhenwei_index == 5
@zhenwei_IndexCommand.zhenwei_6_spawn
elsif
if @zhenwei_IndexCommand.zhenwei_index == 6
@zhenwei_IndexCommand.zhenwei_7_spawn
elsif
if @zhenwei_IndexCommand.zhenwei_index == 7
@zhenwei_IndexCommand.zhenwei_8_spawn
elsif
if @zhenwei_IndexCommand.zhenwei_index == 8
@zhenwei_IndexCommand.zhenwei_9_spawn
elsif
if @zhenwei_IndexCommand.zhenwei_index == 9
@zhenwei_IndexCommand.zhenwei_10_spawn
end
end
end
end
end
end
end
end
end
end
# 按下 B 键的情况下
if Input.trigger?(Input::B)
# 演奏取消 SE
$game_system.se_play($data_system.cancel_se)
# 切换的地图画面
$scene = Scene_chuzhan.new
return
end
end
end
end[/pre]
[pre lang="ruby"]#==============================================================================
# ■ Window_MenuCommand
#------------------------------------------------------------------------------
# 菜单的命令选择行窗口。
#==============================================================================
class Window_zhenweiCommand < Window_Base
attr_reader :chuzhan_index
attr_reader :zhenwei_index
#--------------------------------------------------------------------------
# ● 初始化对像
# actor : 角色
#--------------------------------------------------------------------------
def back_normal(index)
#p index
@zhenwei_index = -1
for i in 0..@max_item_row_2-1
@zhenwei_buttons.bitmap = RPG::Cache.title("bottom-button-"+(i+1).to_s+"-basic")#+i.to_s)
end
else
@zhenwei_buttons[index].bitmap = RPG::Cache.title("bottom-button-"+(index+1).to_s+"-basic")#+i.to_s)
end
end
#--------------------------------------------------------------------------
# ● 更新光标矩形
#--------------------------------------------------------------------------
def update_cursor_rect
if @zhenwei_index < 0
for i in 0..@max_item_row_2-1
back_normal(i)
end
return
end
#p @index,@second_index
# @second_index%=2 完成
@zhenwei_buttons[@zhenwei_index].bitmap = RPG::Cache.title("bottom-button-"+(@second_index+1).to_s+"-l")#+i.to_s)
end
# end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
def update
if self.active
if Input.repeat?(Input::DOWN)
$game_system.se_play($data_system.cursor_se)
@v_index = (@v_index+1)%@max_row
#@last_index = @index
if @v_index == 0
#back_normal(@zhenwei_index)
@zhenwei_index = -1
for i in 0..@max_item_row_2-1
back_normal(i)
end
else
#back_normal(@index)
@zhenwei_index = 1
#@index%=@max_item_row_2
if @player_or_enermy == 0
@groups[@index].bitmap = RPG::Cache.title("team-basic")#+i.to_s)
else
@groups[@index].bitmap = RPG::Cache.title("enermy-basic")#+i.to_s)
end
end
refresh
end
if Input.repeat?(Input::UP)
$game_system.se_play($data_system.cursor_se)
#back_normal(@index)
@v_index = (@v_index-1)%@max_row
# @last_index = @index
if @v_index == 0
#back_normal(@zhenwei_index)
@zhenwei_index = -1
for i in 0..@max_item_row_2-1
back_normal(i)
end
else
#back_normal(@index)
@zhenwei_index = 1
#@index%=@max_item_row_2
if @player_or_enermy == 0 #队伍1-5背景
@groups[@index].bitmap = RPG::Cache.title("team-basic")#+i.to_s)
else # 敌人队伍1-5背景
@groups[@index].bitmap = RPG::Cache.title("enermy-basic")#+i.to_s)
end
end
refresh
end
if @v_index == 0
# 方向键左被按下的情况下
if Input.repeat?(Input::RIGHT)
$game_system.se_play($data_system.cursor_se)
back_normal(@index)
@index = (@index+1)%@group_max
until @able[@index]
@index = (@index+1)%@group_max
end
refresh
end
# 方向键右被按下的情况下
if Input.repeat?(Input::LEFT)
$game_system.se_play($data_system.cursor_se)
back_normal(@index)
@index = (@index+@item_max-1)%@group_max
until @able[@index]
@index = (@index+@item_max-1)%@group_max
end
refresh
end
else # level 2
# 方向键左被按下的情况下
if Input.repeat?(Input::RIGHT)
$game_system.se_play($data_system.cursor_se)
back_normal(@zhenwei_index)
@zhenwei_index = (@zhenwei_index+1)%@max_item_row_2
#p @zhenwei_index
refresh
end
# 方向键右被按下的情况下
if Input.repeat?(Input::LEFT)
$game_system.se_play($data_system.cursor_se)
back_normal(@zhenwei_index)
@zhenwei_index = (@zhenwei_index-1)%@max_item_row_2
refresh
end
end # @v_index == 0
end
update_cursor_rect #if @slide_over
end
#--------------------------------------------------------------------------
# ● 获取东西
#--------------------------------------------------------------------------
def item_num(index = @index) # 定义项目 (索引=@索引)
return @selected_units[@index].size
end
def set_units(a)
@selected_units = a
end
#--------------------------------------------------------------------------
# ● 更新内容
#--------------------------------------------------------------------------
def refresh
for i in 0...@item_max
@icons.bitmap = nil
end
#对于i,单位为0..@选定的单位[@索引]。大小-1
for i in 0..@selected_units[@index].size-1
@icons.bitmap = RPG::Cache.icon(Figter_data::CHARACTER_NAME[@selected_units[@index]])
#p Figter_data::CHARACTER_NAME[twoArray[@index]]
end