estriole

EST - RACE TRAIT MENU ADDON

Dec 13th, 2012
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 3.82 KB | None | 0 0
  1. $imported = {} if $imported.nil?
  2. if $imported["YEA-StatusMenu"] == true
  3.  
  4.  
  5. module YEA
  6.   module STATUS
  7.     BIOGRAPHY_NICKNAME_TEXT = "%s %s"   # How the nickname will appear.    
  8.   end #end module status
  9. end #end module yea
  10.  
  11. # AUTO INSERTING RACE BELOW CERTAIN SYMBOL
  12. index, target = nil
  13. for i in 0..YEA::STATUS::COMMANDS.size-1
  14.  index = i if YEA::STATUS::COMMANDS[i] == :biography
  15. end
  16. target = index - YEA::STATUS::COMMANDS.size if index !=nil
  17. YEA::STATUS::COMMANDS.insert(target,[:race, "Race Info"]) if target!=nil
  18. YEA::STATUS::COMMANDS.insert(-1,[:race, "Race Info"])if target==nil
  19. # END AUTO INSERTING
  20.  
  21. class Window_StatusCommand < Window_Command
  22.  
  23.   def make_command_list
  24.     return unless @actor
  25.     for command in YEA::STATUS::COMMANDS
  26.       case command[0]
  27.       #--- Default ---
  28.       when :general, :parameters, :properties, :biography
  29.         add_command(command[1], command[0])
  30.       #--- Yanfly Engine Ace ---
  31.       when :rename
  32.         next unless $imported["YEA-RenameActor"]
  33.         add_command(command[1], command[0], @actor.rename_allow?)
  34.       when :retitle
  35.         next unless $imported["YEA-RenameActor"]
  36.         add_command(command[1], command[0], @actor.retitle_allow?)
  37.       when :race
  38.         next unless $imported["EST-RACE"]
  39.         if $imported["EST-ARMY MANAGER"] == true
  40.         next if $game_party.army_mode == 1
  41.         end
  42.         add_command(command[1], command[0])        
  43.       #--- Custom Commands ---
  44.       else
  45.         process_custom_command(command)
  46.       end
  47.     end
  48.     if !$game_temp.scene_status_index.nil?
  49.       select($game_temp.scene_status_index)
  50.       self.oy = $game_temp.scene_status_oy
  51.     end
  52.     $game_temp.scene_status_index = nil
  53.     $game_temp.scene_status_oy = nil
  54.   end
  55.  
  56.  
  57.  
  58. end#end class windowstatuscommand
  59.  
  60. class Window_StatusItem < Window_Base
  61.  
  62.   def draw_window_contents
  63.     case @command_window.current_symbol
  64.     when :general
  65.       draw_actor_general
  66.     when :parameters
  67.       draw_parameter_graph
  68.     when :properties
  69.       draw_properties_list
  70.     when :biography, :rename, :retitle
  71.       draw_actor_biography
  72.     when :race
  73.       draw_race      
  74.     else
  75.       draw_custom
  76.     end
  77.   end
  78.  
  79.   def draw_race
  80. #~     fmt = YEA::STATUS::BIOGRAPHY_NICKNAME_TEXT
  81. #~     text = sprintf(fmt, @actor.name, @actor.nickname)
  82. #~     contents.font.size = YEA::STATUS::BIOGRAPHY_NICKNAME_SIZE
  83. #~     draw_text(0, 0, contents.width, line_height*2, text, 1)
  84.     reset_font_settings
  85.     race = @actor.get_race_name
  86.     race = "Unknown" if !race
  87.     racetext = "Race"
  88.     width = (contents.width - 24)/3-24
  89.     change_color(system_color)
  90.     draw_text(24, 0, width, line_height*2, racetext, 0)
  91.     change_color(normal_color)
  92.     draw_text(178, 0, width, line_height*2, race, 0)
  93.  
  94.     change_color(system_color)
  95.     text = "Racial Skills"
  96.     draw_text(24, line_height, width, line_height*2, text, 0)
  97.    
  98.     draw_race_skill
  99.     #draw_text_ex(24, line_height*2, @actor.description)
  100.   end
  101.  
  102.   def draw_race_skill
  103.     dx = 24
  104.     dw = (contents.width - 24) / 3 - 24
  105.     dy = 60
  106.     abilitytext = @actor.get_ability_text
  107.     abilitytext = ["None"] if !abilitytext
  108.    
  109.     for i in 0..abilitytext.size-1
  110.     colour = Color.new(255, 0, 0, translucent_alpha/2)
  111.     rect = Rect.new(dx+1, dy+1, dw-2, line_height-2)
  112.     contents.fill_rect(rect, colour)
  113.       if abilitytext[i] != "None"
  114.       change_color(system_color)
  115.       draw_text(dx+4, dy, dw-8, line_height, abilitytext[i][0], 0)
  116.       change_color(normal_color)
  117.       draw_text(dx+4+dw+8, dy, dw+300, line_height, abilitytext[i][1], 0)
  118.       else
  119.       nonetext = "None"
  120.       change_color(system_color)
  121.       draw_text(dx+4, dy, dw-8, line_height, nonetext, 0)    
  122.       end
  123.     dy += line_height-1
  124.     end
  125.    
  126.   end
  127.  
  128.  
  129. end #end class windowstatusitem
  130.  
  131.  
  132. end #end if imported
Advertisement
Add Comment
Please, Sign In to add comment