Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Window_ActorMenuStatus < Window_Base
- attr_accessor :actor
- def initialize(x, y, actor)
- super(x, y, 360, 96)
- @actor = actor
- refresh
- end
- def refresh
- create_contents
- draw_actor_name(@actor, 4, 0)
- draw_actor_level(@actor, 140, 0)
- draw_actor_hp(@actor, 240, 0)
- draw_actor_mp(@actor, 254, 32)
- end
- end
- class MenuStatus_FF8 # // Container
- attr_reader :x
- attr_reader :y
- attr_accessor :index
- def initialize( x, y )
- @x, @y = x, y
- @index = 0
- @windows = {}
- @actor_windows = []
- @item_max = 0
- end
- def x=( new_x )
- return if @x == new_x
- @x = new_x
- @windows.values.each { |w| w.x = @x }
- end
- def y=( new_y )
- return if @y == new_y
- @y = new_y
- @windows.values.each { |w| w.x = @y }
- end
- def refresh()
- i = 0
- @actor_windows.clear
- @windows.values.each { |w| w.dispose }
- @windows.clear
- $game_party.members.each { |m|
- winm = "Actor#{i}"
- win = Window_ActorMenuStatus.new( 20, 56+(96*i), m )
- @windows[winm] = win
- @actor_windows[i] = win
- i += 1
- }
- @item_max = @actor_windows.size()
- end
- def update()
- @windows.each { |win| win.update() }
- update_user_input()
- end
- def update_user_input()
- return if @item_max == 0
- if Input.trigger?( Input::UP )
- Sound.play_cursor
- reset_window_positions()
- @index -= 1
- @index %= @item_max
- @actor_windows[@index].x = 40
- elsif Input.trigger?( Input::DOWN )
- Sound.play_cursor
- @index += 1
- @index %= @item_max
- @actor_windows[@index].x = 40
- end
- end
- def reset_window_positions()
- for i in 0...@item_max
- @actor_windows[i].x = 20
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment