drtarsus

Untitled

Dec 22nd, 2014
154
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Window_EnemyHubCommand < Window_Selectable
  2.   def initialize
  3.     super(0, 0, window_width, window_height)
  4.     self.opacity = 0
  5.     refresh
  6.     deactivate    
  7.   end
  8.  
  9.   ### ensures index is always valid
  10.   #--------------------------------------------------------------------------
  11.   def refresh
  12.     super
  13.     if index == item_max
  14.       select(0)
  15.     end
  16.     refresh_arrow
  17.   end
  18.  
  19.   ###  maked window full size
  20.   #--------------------------------------------------------------------------
  21.   def window_width
  22.     return Graphics.width
  23.   end
  24.   def window_height
  25.     return Graphics.height
  26.   end
  27.  
  28.   ### Places an arrow over the enemy battle
  29.   #--------------------------------------------------------------------------
  30.   def refresh_arrow    
  31.   end
  32.  
  33.  
  34.   ### disables up and down cursor
  35.   #--------------------------------------------------------------------------
  36.   def cursor_down(wrap = false)
  37.   end
  38.   def cursor_up(wrap = false)
  39.   end
  40.  
  41.   ### left and right cursor to scroll though targets
  42.   #--------------------------------------------------------------------------
  43.   def cursor_right(wrap = true)
  44.     if index < item_max - 1
  45.       select(index + 1)
  46.       else select(0)
  47.       end
  48.       refresh_arrow
  49.   end
  50.   def cursor_left(wrap = true)
  51.     if index == 0
  52.       select(item_max - 1)
  53.       else select(index - 1)
  54.       end
  55.       refresh_arrow
  56.   end  
  57.  
  58.  
  59.   #--------------------------------------------------------------------------
  60.   # * Get Max Objects
  61.   #--------------------------------------------------------------------------
  62.   def item_max
  63.     $game_troop.alive_members.size
  64.   end
  65.   #--------------------------------------------------------------------------
  66.   # * Get Enemy Object
  67.   #--------------------------------------------------------------------------
  68.   def enemy
  69.     $game_troop.alive_members[@index]
  70.   end
  71.   #--------------------------------------------------------------------------
  72.   # * Draw Item
  73.   #--------------------------------------------------------------------------
  74.   def draw_item(index)
  75.     #change_color(normal_color)
  76.     #name = $game_troop.alive_members[index].name
  77.     #draw_text(item_rect_for_text(index), name)
  78.   end
  79.   #--------------------------------------------------------------------------
  80.   # * Show Window
  81.   #--------------------------------------------------------------------------
  82.   def show
  83.     if @info_viewport
  84.       width_remain = Graphics.width - width
  85.       self.x = width_remain
  86.       @info_viewport.rect.width = width_remain
  87.       select(0)
  88.     end
  89.     super
  90.   end
  91.   #--------------------------------------------------------------------------
  92.   # * Hide Window
  93.   #--------------------------------------------------------------------------
  94.   def hide
  95.     @info_viewport.rect.width = Graphics.width if @info_viewport
  96.     super
  97.   end
  98.  
  99. end
RAW Paste Data