This repository has been archived on 2026-05-18. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
rpgskeleton/Scripts/RPG/Window_MenuActor.rb
2014-04-23 21:59:50 -07:00

45 lines
1.6 KiB
Ruby

# -*- coding: utf-8 -*-
#==============================================================================
# ** Window_MenuActor
#------------------------------------------------------------------------------
# This window is for selecting actors that will be the target of item or
# skill use.
#==============================================================================
class Window_MenuActor < Window_MenuStatus
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0)
self.visible = false
end
#--------------------------------------------------------------------------
# * Processing When OK Button Is Pressed
#--------------------------------------------------------------------------
def process_ok
$game_party.target_actor = $game_party.members[index] unless @cursor_all
call_ok_handler
end
#--------------------------------------------------------------------------
# * Restore Previous Selection Position
#--------------------------------------------------------------------------
def select_last
select($game_party.target_actor.index || 0)
end
#--------------------------------------------------------------------------
# * Set Position of Cursor for Item
#--------------------------------------------------------------------------
def select_for_item(item)
@cursor_fix = item.for_user?
@cursor_all = item.for_all?
if @cursor_fix
select($game_party.menu_actor.index)
elsif @cursor_all
select(0)
else
select_last
end
end
end