Jump to content
EDX442

Get currently selected actor in equipment menu?

Recommended Posts

Yes! There is! I actually had to figure this out for equipment-related stuffs too.

So, here's something I cobbled together...

 

Spoiler

class Game_Party < Game_Unit

  #--------------------------------------------------------------------------
  # * Get Actor Selected on Menu Screen
  #--------------------------------------------------------------------------
  def menu_actor
    $game_actors[@menu_actor_id] || members[0]
  end
  #--------------------------------------------------------------------------
  # * Set Actor Selected on Menu Screen
  #--------------------------------------------------------------------------
  def menu_actor=(actor)
    @menu_actor_id = actor.id
    $game_variables[99] = actor.id if $game_variables[99] != 0
  end
  #--------------------------------------------------------------------------
  # * Select Next Actor on Menu Screen
  #--------------------------------------------------------------------------
  def menu_actor_next
    index = members.index(menu_actor) || -1
#   $game_variables[98] = (index + 1) % members.size
    index = (index + 1) % members.size
    $game_variables[98] = index
    self.menu_actor = members[index]
#   $game_variables[98] = members[index]
  end
  #--------------------------------------------------------------------------
  # * Select Previous Actor on Menu Screen
  #--------------------------------------------------------------------------
  def menu_actor_prev
    index = members.index(menu_actor) || 1
#   $game_variables[98] = (index + members.size - 1) % members.size
    index = (index + members.size - 1) % members.size
    $game_variables[98] = index
    self.menu_actor = members[index]
#   $game_variables[98] = members[index]
  end
end 

 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted