TheoAllen

YEA - Name Icon

Feb 10th, 2014
505
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 2.51 KB | None | 0 0
  1. # =============================================================================
  2. # TheoAllen + YEA Battle Engine | Name Icon
  3. # Version : 1.0
  4. # Contact : www.rpgmakerid.com (or) http://theolized.blogspot.com
  5. # (This script documentation is written in informal indonesian language)
  6. # -----------------------------------------------------------------------------
  7. # Requires :
  8. # >> YEA - Battle Engine
  9. # =============================================================================
  10. # =============================================================================
  11. ($imported ||= {})[:Theo_NameIcon] = true
  12. # =============================================================================
  13. # Change Logs:
  14. # -----------------------------------------------------------------------------
  15. # 2014.02.11 - Finished script
  16. # =============================================================================
  17. =begin
  18.  
  19.   Perkenalan :
  20.   Script ini cuman nambahin icon di samping nama battler
  21.  
  22.   Cara penggunaan :
  23.   Pasang script ini di bawah YEA Battle Engine
  24.   Gunakan notetag <icon: index>
  25.  
  26.   Index adalah icon index. Ganti dengan angka. Semisal
  27.   <icon: 99>
  28.  
  29.   Terms of Service :
  30.   Wa ngikutin ToSnya Yanfly ~
  31.  
  32. =end
  33. # =============================================================================
  34. # Tidak ada konfigurasi
  35. # =============================================================================
  36. class RPG::BaseItem
  37.  
  38.   def icon
  39.     return @type if @type
  40.     note[/<icon\s*:\s*(\d+)/i]
  41.     @type = $1.to_i
  42.     return @type
  43.   end
  44.  
  45. end
  46.  
  47. class Game_Battler
  48.  
  49.   def icon
  50.     actor? ? actor.icon : enemy.icon
  51.   end
  52.  
  53. end
  54.  
  55. class Window_BattleHelp
  56.   # ---------------------------------------------------------------------------
  57.   # Overwrite : Refresh Battler Name
  58.   # ---------------------------------------------------------------------------
  59.   def refresh_battler_name(battler)
  60.     contents.clear
  61.     reset_font_settings
  62.     change_color(normal_color)
  63.     @text = battler_name(battler) + " "
  64.     icons = battler.state_icons + battler.buff_icons
  65.     dy = icons.size <= 0 ? line_height / 2 : 0
  66.     battler_icon = battler.icon
  67.     dx = -12 if battler_icon > 0
  68.     draw_text(0, dy, contents.width, line_height, @text, 1)
  69.     dx = (contents.width - (icons.size * 24)) / 2
  70.     draw_actor_icons(battler, dx, line_height, contents.width)
  71.     return unless battler_icon > 0
  72.     rect = text_size(@text)
  73.     rect.width += 2
  74.     dx = contents.width/2 + rect.width/2
  75.     draw_icon(battler_icon, dx, dy)
  76.   end
  77.  
  78. end
Advertisement
Add Comment
Please, Sign In to add comment