#==============================================================================
# ■ Window_MenuCommand
#------------------------------------------------------------------------------
# 菜单的命令选择行窗口。
#==============================================================================
class Window_zhenweiCommand < Window_Base
attr_reader :chuzhan_index
attr_reader :zhenwei_index
#--------------------------------------------------------------------------
# ● 初始化对像
# actor : 角色
#--------------------------------------------------------------------------
def initialize(zhenwei_index=0)
@zhenwei_index=0
super(32+200, 32, 480, 320)
origin_x=120
origin_y=110
@zhenwei_base = Sprite.new
@zhenwei_base.bitmap = RPG::Cache.title("")
@zhenwei_base.x = 200#origin_x
@zhenwei_base.y = 20#origin_y
@zhenwei_buttons = [] #@底部按钮=[]
@zhenwei_base_1 = Sprite.new #@完成按钮=精灵.new
@zhenwei_base_1.bitmap = RPG::Cache.title("bottom-button-2-basic")
@zhenwei_base_1.x = origin_x+10
@zhenwei_base_1.y = origin_y+50
@zhenwei_base_2 = Sprite.new #@完成按钮=精灵.new
@zhenwei_base_2.bitmap = RPG::Cache.title("bottom-button-2-basic")
@zhenwei_base_2.x = origin_x+80
@zhenwei_base_2.y = origin_y+100
@zhenwei_base_3 = Sprite.new #@完成按钮=精灵.new
@zhenwei_base_3.bitmap = RPG::Cache.title("bottom-button-2-basic")
@zhenwei_base_3.x = origin_x+10
@zhenwei_base_3.y = origin_y+160
@zhenwei_base_4 = Sprite.new #@完成按钮=精灵.new
@zhenwei_base_4.bitmap = RPG::Cache.title("bottom-button-2-basic")
@zhenwei_base_4.x = origin_x+80
@zhenwei_base_4.y = origin_y+180
@zhenwei_base_5 = Sprite.new #@完成按钮=精灵.new
@zhenwei_base_5.bitmap = RPG::Cache.title("bottom-button-2-basic")
@zhenwei_base_5.x = origin_x+10
@zhenwei_base_5.y = origin_y+240
@zhenwei_base_6 = Sprite.new #@完成按钮=精灵.new
@zhenwei_base_6.bitmap = RPG::Cache.title("bottom-button-2-basic")
@zhenwei_base_6.x = origin_x+180
@zhenwei_base_6.y = origin_y+50
@zhenwei_base_7 = Sprite.new #@完成按钮=精灵.new
@zhenwei_base_7.bitmap = RPG::Cache.title("bottom-button-2-basic")
@zhenwei_base_7.x = origin_x+240
@zhenwei_base_7.y = origin_y+80
@zhenwei_base_8 = Sprite.new #@完成按钮=精灵.new
@zhenwei_base_8.bitmap = RPG::Cache.title("bottom-button-2-basic")
@zhenwei_base_8.x = origin_x+180
@zhenwei_base_8.y = origin_y+160
@zhenwei_base_9 = Sprite.new #@完成按钮=精灵.new
@zhenwei_base_9.bitmap = RPG::Cache.title("bottom-button-2-basic")
@zhenwei_base_9.x = origin_x+240
@zhenwei_base_9.y = origin_y+180
@zhenwei_base_10 = Sprite.new #@完成按钮=精灵.new
@zhenwei_base_10.bitmap = RPG::Cache.title("bottom-button-2-basic")
@zhenwei_base_10.x = origin_x+180
@zhenwei_base_10.y = origin_y+240
@zhenwei_buttons.push @zhenwei_base_1# @底部按钮。按下完成按钮
@zhenwei_buttons.push @zhenwei_base_2# @底部按钮。按下完成按钮
@zhenwei_buttons.push @zhenwei_base_3# @底部按钮。按下完成按钮
@zhenwei_buttons.push @zhenwei_base_4# @底部按钮。按下完成按钮
@zhenwei_buttons.push @zhenwei_base_5# @底部按钮。按下完成按钮
@zhenwei_buttons.push @zhenwei_base_6# @底部按钮。按下完成按钮
@zhenwei_buttons.push @zhenwei_base_7# @底部按钮。按下完成按钮
@zhenwei_buttons.push @zhenwei_base_8# @底部按钮。按下完成按钮
@zhenwei_buttons.push @zhenwei_base_9# @底部按钮。按下完成按钮
@zhenwei_buttons.push @zhenwei_base_10# @底部按钮。按下完成按钮
# @zhenwei_index = index
# @zhenwei_index =0
adj_x = 0 # 调整_x=0
adj_y = 0 # 调整_y=0
#--------------------------------------------------------------------------
# ● 一些方法的重载
#--------------------------------------------------------------------------
def dispose #定义释放
# @zhenwei_base.dispose
@zhenwei_base_1.dispose
@zhenwei_base_2.dispose
@zhenwei_base_3.dispose
@zhenwei_base_4.dispose
@zhenwei_base_5.dispose
@zhenwei_base_6.dispose
@zhenwei_base_7.dispose
@zhenwei_base_8.dispose
@zhenwei_base_9.dispose
@zhenwei_base_10.dispose
def z=(z)
super(z)
# @delete_button.z=z+1
# @zhenwei_base.z=z+1
# @zhenwei_base_1.z=z+1
# @zhenwei_base_2.z=z+1
# @zhenwei_base_3.z=z+1
# @zhenwei_base_4.z=z+1
# @zhenwei_base_5.z=z+1
# @zhenwei_base_6.z=z+1
# @zhenwei_base_7.z=z+1
# @zhenwei_base_8.z=z+1
# @zhenwei_base_9.z=z+1
# @zhenwei_base_10.z=z+1
end
def x=(x)
super(x)
adj_x = 0
# @button_base.x=x+origin_x
# @zhenwei_base_1.x=x+origin_x+10
# @zhenwei_base_2.x=x+origin_x+50
# @zhenwei_base_3.x=x+origin_x+10
# @zhenwei_base_4.x=x+origin_x+50
# @zhenwei_base_5.x=x+origin_x+10
# @zhenwei_base_6.x=x+origin_x+100
# @zhenwei_base_7.x=x+origin_x+180
# @zhenwei_base_8.x=x+origin_x+100
# @zhenwei_base_9.x=x+origin_x+180
# @zhenwei_base_10.x=x+origin_x+100
end #
def y=(y)
super(y)
# adj_y = 0
# @zhenwei_base_1.y=y+origin_y+40
# @zhenwei_base_2.y=y+origin_y+80
# @zhenwei_base_3.y=y+origin_y+40
# @zhenwei_base_4.y=y+origin_y+80
# @zhenwei_base_5.y=y+origin_y+40
# @zhenwei_base_6.y=y+origin_y+120
# @zhenwei_base_7.y=y+origin_y+180
# @zhenwei_base_8.y=y+origin_y+120
# @zhenwei_base_9.y=y+origin_y+180
# @zhenwei_base_10.y=y+origin_y+120
end
def visible=(visible)
super(visible)
# @zhenwei_base.visible = visible
@zhenwei_base_1.visible = visible
@zhenwei_base_2.visible = visible
@zhenwei_base_3.visible = visible
@zhenwei_base_4.visible = visible
@zhenwei_base_5.visible = visible
@zhenwei_base_6.visible = visible
@zhenwei_base_7.visible = visible
@zhenwei_base_8.visible = visible
@zhenwei_base_9.visible = visible
@zhenwei_base_10.visible = visible
# @finish_button.visible = visible
end
end
def contents_opacity=(opacity)
super(opacity)
@zhenwei_base_1.opacity = opacity
@zhenwei_base_2.opacity = opacity
@zhenwei_base_3.opacity = opacity
@zhenwei_base_4.opacity = opacity
@zhenwei_base_5.opacity = opacity
@zhenwei_base_6.opacity = opacity
@zhenwei_base_7.opacity = opacity
@zhenwei_base_8.opacity = opacity
@zhenwei_base_9.opacity = opacity
@zhenwei_base_10.opacity = opacity
@finish_button.opacity = opacity
end
end
def index=(index)
@zhenwei_index=index
end
def back_normal(index)
#p index
@zhenwei_index = -1
for i in 0..@max_item_row_2-1
@zhenwei_buttons[i].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[i].bitmap = nil
end
#对于i,单位为0..@选定的单位[@索引]。大小-1
for i in 0..@selected_units[@index].size-1
@icons[i].bitmap = RPG::Cache.icon(Figter_data::CHARACTER_NAME[@selected_units[@index][i]])
#p Figter_data::CHARACTER_NAME[twoArray[@index][i]]
end
end
#--------------------------------------------------------------------------
# ● 阵位1
#--------------------------------------------------------------------------
def zhenwei_1_spawn
# @efs_team_spawn[@index]=[9,11]
$scene = Scene_chuzhan.new(4)
end
#--------------------------------------------------------------------------
# ● 阵位2
#--------------------------------------------------------------------------
def zhenwei_2_spawn
#@efs_team_spawn[@index]=[9,12]
$scene = Scene_chuzhan.new
end
#--------------------------------------------------------------------------
# ● 阵位3
#--------------------------------------------------------------------------
def zhenwei_3_spawn
# @efs_team_spawn[@index]=[9,13]
$scene = Scene_chuzhan.new #refresh
end
#--------------------------------------------------------------------------
# ● 阵位4
#--------------------------------------------------------------------------
def zhenwei_4_spawn
# @efs_team_spawn[@index]=[9,14]
$scene = Scene_chuzhan.new# refresh
end
#--------------------------------------------------------------------------
# ● 阵位5
#--------------------------------------------------------------------------
def zhenwei_5_spawn
# @efs_team_spawn[@index]=[9,15]
$scene = Scene_chuzhan.new # refresh
end
#--------------------------------------------------------------------------
# ● 阵位6
#--------------------------------------------------------------------------
def zhenwei_6_spawn
# @efs_team_spawn[@index]=[9,16]
$scene = Scene_chuzhan.new # refresh
end
#--------------------------------------------------------------------------
# ● 阵位7
#--------------------------------------------------------------------------
def zhenwei_7_spawn
# @efs_team_spawn[@index]=[9,17]
$scene = Scene_chuzhan.new# refresh
end
#--------------------------------------------------------------------------
# ● 阵位8
#--------------------------------------------------------------------------
def zhenwei_8_spawn
# @efs_team_spawn[@index]=[9,18]
$scene = Scene_chuzhan.new #refresh
end
#--------------------------------------------------------------------------
# ● 阵位9
#--------------------------------------------------------------------------
def zhenwei_9_spawn
# @efs_team_spawn[@index]=[9,19]
$scene = Scene_chuzhan.new # refresh
end
#--------------------------------------------------------------------------
# ● 阵位10
#--------------------------------------------------------------------------
def zhenwei_10_spawn
# @efs_team_spawn[@index]=[9,20]
$scene = Scene_chuzhan.new # refresh
end