pigu_6

Angelo| HUD

Dec 16th, 2012
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.72 KB | None | 0 0
  1.  
  2. #==============================================================================
  3. # ■ Angelo HUD v2.5
  4. #------------------------------------------------------------------------------
  5. #  Created by Brandon *** 8(13) customization options *** Plug N' Play!
  6. #==============================================================================
  7.  
  8. #==================================================#
  9. # ▼ UPDATE LOG #
  10. #--------#--------------------------------#--------#
  11. # v1 ● first release. #
  12. # v1.2 ● not released, #
  13. # ● add HUDVISIBLESWITCH #
  14. # ● add HP, MPSWITCH #
  15. # v1.5 ● not released, #
  16. # ● add FONT NAME & SIZE #
  17. # v1.8 ● not released, #
  18. # ● add WEAPONSWITCH #
  19. # v1.9 ● not released #
  20. # ● *BUG* Lag #
  21. # ● *BUG* Texts disappea- #
  22. # rence. #
  23. # v2 ● second release #
  24. # ● fixed v1.9 *BUGS* #
  25. # ● add R, G, B _BLA & #
  26. # _BDA #
  27. # ● *BUG* Transfer Player #
  28. # crash. #
  29. # v2.1 ● third release #
  30. # ● fixed v2 *BUG* #
  31. # ● changed update method #
  32. # ● changed Scene_Map #
  33. # update and dispose #
  34. # methods. #
  35. # ● *BUG* Lag #
  36. # v2.2 ● fourth release #
  37. # ● fixed v2.1 *BUG* #
  38. # ● now HUD will only re- #
  39. # fresh when the stats #
  40. # change. #
  41. # ● improved performance #
  42. #--------#--------------------------------#--------#
  43. # v2.5 ● current release #
  44. # ● improved stability #
  45. # ● added a option to link with other Angelo#
  46. # scripts #
  47. # ● -------------------------------- #
  48. # ● added gold count if Angelo Menu is pre- #
  49. # sent. #
  50. #==================================================#
  51. # ▼ THANKS TO: #
  52. # ● King of Sadism #
  53. # ● YF #
  54. # ● Valiant #
  55. # ● Amy Pond #
  56. # ● Jet #
  57. #==================================================#
  58.  
  59. #------------------------------------------------------------------------------
  60. # ▼ Customization Options
  61. #----------------------------#-------------------------------------------------
  62. # ● HUD_VISIBLE_SWITCH #
  63. #- - - - - - - - - - - - - #
  64. # Define the switch that you want to use to turn the HUD 'ON' or 'OFF', by de-
  65. # fault it's 1. When the switch is turned 'ON' the HUD will be turned 'ON' too,
  66. # and when the switch is turned 'OFF' the HUD is turned 'OFF' too.
  67. #------------------------------#-----------------------------------------------
  68. # ● FONT_NAME & FONT_SIZE #
  69. #- - - - - - - - - - - - - - #
  70. # In FONTNAME you define the font that you want to use with the HUD information.
  71. # In FONTSIZE you define the size of the font you've decided in FONTNAME.
  72. #-------------------#----------------------------------------------------------
  73. # ● HP_SWITCH #
  74. #- - - - - - - - -#
  75. # Define the switch that you want to use to turn the HP Display 'ON' or 'OFF',
  76. # by default it's 2. When the switch is turned 'ON' the HP Display will be
  77. # turned 'ON' too, and when the switch is turned 'OFF' the HP Display is turned
  78. # 'OFF' too.
  79. #-------------------#----------------------------------------------------------
  80. # ● MP_SWITCH #
  81. #- - - - - - - - -#
  82. # Define the switch that you want to use to turn the MP Display 'ON' or 'OFF',
  83. # by default it's 3. When the switch is turned 'ON' the MP Display will be
  84. # turned 'ON' too, and when the switch is turned 'OFF' the MP Display is turned
  85. # 'OFF' too.
  86. #------------------------------#-----------------------------------------------
  87. # ● WEAPON_AND_NAME_SWITCH #
  88. #- - - - - - - - - - - - - - #
  89. # Define the switch that you want to use to turn the Currently Equipped Weapon
  90. # Display and Actor Name 'ON' or 'OFF', by default it's 4. When the switch is
  91. # turned 'ON' this option will be turned 'ON' too, and when the switch is
  92. # turned 'OFF' this option is turned 'OFF' too.
  93. #---------------------#--------------------------------------------------------
  94. # ● R, G, B _BLA #
  95. #- - - - - - - - - -#
  96. # Define the amount of each color(Red, Green, Blue) presented in the lighter a-
  97. # rea of the Back of the HUD. By default it's black which means that R, G and B
  98. # are setted to '0'.
  99. #---------------------#--------------------------------------------------------
  100. # ● R, G, B _BDA #
  101. #- - - - - - - - - -#
  102. # Define the amount of each color(Red, Green, Blue) presented in the darker a-
  103. # rea of the Back of the HUD. By default it's black which means that R, G and B
  104. # are setted to '0'.
  105. #------------------------------------------------------------------------------
  106. # ▼ Post Scriptum
  107. #------------------------------------------------------------------------------
  108. # ● "I want to turn all the HUD or only some part of her at the same time with
  109. # the same switch, it's possible?"
  110. #- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  111. # Yes, just set the parts you wanted in the same
  112. # switch as the HUDVISIBLESWITCH.
  113. #------------------------------------------------------------------------------
  114. # ● "Which values you recommend to use in FONTSIZE?"
  115. #- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  116. # Use between 8 and 18, or the text will be too
  117. # small or too bigger. But some times it depends
  118. # on your FONTNAME.
  119. #------------------------------------------------------------------------------
  120. # ● "Which values you recommend to use in R, G, B _BLA and _BDA?"
  121. #- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  122. # You MUST use ONLY values between 0 and 255.
  123. #------------------------------------------------------------------------------
  124.  
  125. module ANGELO
  126.  
  127. HUD_VISIBLE_SWITCH = 201
  128.  
  129. FONT_NAME = "Times New Roman"
  130. FONT_SIZE = 16
  131.  
  132. HP_SWITCH = 202
  133. MP_SWITCH = 203
  134. WEAPON_AND_NAME_SWITCH = 204
  135.  
  136. #=======IMPORTANT=======IMPORTANT=======IMPORTANT=======IMPORTANT=======IMPORTANT
  137. # * * * IF YOU ARE USING OTHER ANGELO SCRIPTS, ENABLE THIS * * *
  138. #=======IMPORTANT=======IMPORTANT=======IMPORTANT=======IMPORTANT=======IMPORTANT
  139.  
  140. ENABLE_ANGELO_LINK = false
  141.  
  142. R_BLA = 0
  143. G_BLA = 0
  144. B_BLA = 0
  145.  
  146. R_BDA = 0
  147. G_BDA = 0
  148. B_BDA = 0
  149.  
  150. end
  151.  
  152. #------------------------------------------------------------------------------
  153. # !!!!DO NOT EDIT FROM HERE UNLESS YOU KNOW WHAT YOU'RE DOING!!!!
  154. #------------------------------------------------------------------------------
  155.  
  156. include ANGELO
  157.  
  158. class AngeloHUD < Window_Base
  159. def initialize
  160. super(-16, -16, Graphics.width + standard_padding * 2, Graphics.height + standard_padding * 2)
  161. self.opacity = 0
  162. $AngeloHUD = true
  163. refresh
  164. end
  165.  
  166. def refresh
  167. self.contents.clear
  168. self.contents.font = Font.new(FONT_NAME, FONT_SIZE)
  169. actor = $game_party.members[0]
  170. @hp = actor.hp
  171. @mp = actor.mp
  172. @mhp = actor.mhp
  173. @mmp = actor.mmp
  174. index = 0
  175. colorback = Color.new(R_BLA, G_BLA, B_BLA, 150)
  176. colorback2 = Color.new(R_BDA, G_BDA, B_BDA, 190)
  177.  
  178. if $game_switches[HUD_VISIBLE_SWITCH] == true
  179.  
  180. unless $game_switches[HP_SWITCH] == false
  181. self.contents.fill_rect(3, 364, 238, 16, colorback)
  182. self.contents.fill_rect(3, 368, 238, 8, colorback2)
  183. draw_gauge(19, 353, 200, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
  184. draw_text(40, 354, 100, 32, Vocab::hp_a)
  185. draw_current_and_max_values(90, 358, 116, actor.hp, actor.mhp, hp_color(actor), normal_color)
  186. end
  187.  
  188. unless $game_switches[MP_SWITCH] == false
  189. self.contents.fill_rect(3, 395, 238, 16, colorback)
  190. self.contents.fill_rect(3, 399, 238, 8, colorback2)
  191. draw_gauge(19, 384, 200, actor.mp_rate, mp_gauge_color1, mp_gauge_color2)
  192. draw_text(40, 385, 100, 32, Vocab::mp_a)
  193. draw_current_and_max_values(90, 389, 116, actor.mp, actor.mmp, mp_color(actor), normal_color)
  194. end
  195.  
  196. unless $game_switches[WEAPON_AND_NAME_SWITCH] == false
  197. self.contents.fill_rect(-64 + 85, 376, 125, 19, colorback)
  198. self.contents.fill_rect(-64 + 90, 376, 115, 19, colorback2)
  199. draw_actor_name(actor, -40 + 92, 373, 100)
  200. return unless actor.equips[index]
  201. draw_icon(actor.equips[index].icon_index, -64 + 92, 372, true)#(actor.equips[index], -64 + 92, 376, true)
  202. end
  203.  
  204. end
  205. def hud_changed
  206. return true if @hp != $game_party.members[0].hp
  207. return true if @mp != $game_party.members[0].mp
  208. return true if $game_switches[HP_SWITCH] != "OFF"
  209. return true if $game_switches[MP_SWITCH] != "OFF"
  210. return true if $game_switches[WEAPON_AND_NAME_SWITCH] != "OFF"
  211. return true if $game_switches[HUD_VISIBLE_SWITCH] != "OFF"
  212. return false
  213. end
  214. end
  215.  
  216. def update
  217. super
  218. refresh if hud_changed
  219. end
  220. end
  221.  
  222. class Scene_Map
  223. alias hud_main create_all_windows
  224.  
  225. def create_all_windows
  226. create_hud_window
  227. hud_main
  228. end
  229. def create_hud_window
  230. @hud = AngeloHUD.new
  231. if ENABLE_ANGELO_LINK && $Menu_Angelo == true
  232. @gold = Window_Gold.new
  233. @gold.opacity = 0
  234. @gold.x = 544 - @gold.contents.width - 10
  235. @gold.y = 375
  236. end
  237. end
  238. end
Advertisement
Add Comment
Please, Sign In to add comment