Advertisement
mrbubble

Compatibility Patch: YEA Status Menu + KMS Generic Gauge

Jun 30th, 2012
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.90 KB | None | 0 0
  1. #==============================================================================
  2. # Compatibility Patch :                                         v1.0 (6/29/12)
  3. #   YEA Status Menu + KMS Generic Gauge
  4. #==============================================================================
  5. # Script by:
  6. #     Mr. Bubble
  7. #--------------------------------------------------------------------------
  8. # Place this script below both YEA Status Menu and KMS Generic Gauge
  9. # in your script edtior.
  10. #
  11. #  !! IMPORTANT - READ THIS FIRST !!
  12. #
  13. # Due to a strange drawing abnormality that I have been unable to address
  14. # when trying to make YEA Status Menu compatibility with Generic Gauge images,
  15. # this "patch" will have to do. It will not allow you to use custom gauges
  16. # within YEA Status Menu, but it will avoid the error that occurs when
  17. # KMS Generic Gauge is also installed in the same project.
  18. #==============================================================================
  19.  
  20. $imported = {} if $imported.nil?
  21. $kms_imported = {} if $kms_imported.nil?
  22.  
  23. #==============================================================================
  24. # ■ Window_StatusItem
  25. #==============================================================================
  26.  
  27. if $imported["YEA-StatusMenu"] && $kms_imported["GenericGauge"]
  28. class Window_StatusItem < Window_Base
  29.   #--------------------------------------------------------------------------
  30.   # * Draw Gauge
  31.   #     rate   : Rate (full at 1.0)
  32.   #     color1 : Left side gradation
  33.   #     color2 : Right side gradation
  34.   #--------------------------------------------------------------------------
  35.   def draw_gauge(x, y, width, rate, color1, color2)
  36.     fill_w = (width * rate).to_i
  37.     gauge_y = y + line_height - 8
  38.     contents.fill_rect(x, gauge_y, width, 6, gauge_back_color)
  39.     contents.gradient_fill_rect(x, gauge_y, fill_w, 6, color1, color2)
  40.   end
  41. end
  42. end # if $imported["YEA-StatusMenu"]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement