# 计算光标的宽度
cursor_width = 1200
# 计算光标坐标
# x = 4 + index % 2 * (288 + 32)
# y = index / 2 * 32
#x =32+ @index*66 - self.ox-1# 8 #
x =10 +@index% 4 * (84 + 1)
y =5+ @index/ 4 * 120
z = 1999
#y = 14 #@index*20 - self.oy-1
# 更新光标矩形
self.cursor_rect.set(x, y, 84 ,120)
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
def update
super
# (Input::UP) (Input::DOWN) (Input::RIGHT) (Input::LEFT)
# 可以移动光标的情况下
if self.active and @item_max >= 0 and @index >= 0
# 方向键下被按下的情况下
if Input.repeat?(Input::RIGHT)
# 光标向左移动
$game_system.se_play($data_system.cursor_se)
@index = (@index+1+@item_max) % @item_max if @item_max != 0
update_help
end
# 方向键上被按下的情况下
if Input.repeat?(Input::LEFT)
# 光标向右移动
$game_system.se_play($data_system.cursor_se)
@index = (@index-1+@item_max) % @item_max if @item_max != 0
update_help
end
end
#-------------------------------------------------------------------------
if self.active and @item_max >= 0 and @index >= 0
# 方向键下被按下的情况下
if Input.repeat?(Input::UP)
# 光标向左移动
$game_system.se_play($data_system.cursor_se)
@index = (@index-1+@item_max) / @item_max if @item_max != 0
update_help
end
# 方向键上被按下的情况下
if Input.repeat?(Input::DOWN)
# 光标向右移动
$game_system.se_play($data_system.cursor_se)
@index = (@index+1+@item_max) / @item_max if @item_max != 0
update_help
end
#-------------------------------------------------------------------------
end
# 刷新帮助文本 (update_help 定义了继承目标)
if @help_window != nil and @ajsdgfshfajklshfa == nil
update_help
update_help
@ajsdgfshfajklshfa = true
end
# 刷新光标矩形
update_cursor_rect
end
def now_selected_troop
return @all_fighters[@index]
end