Advertisement
mrbubble

Comp. Patch: YEA Victory Aftermath + KMS Generic Gauge

Jan 24th, 2012
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 2.64 KB | None | 0 0
  1. #==============================================================================
  2. # Compatibility Patch :                                          v1.0 (1/24/12)
  3. #   YEA Victory Aftermath + KMS Generic Gauge
  4. #==============================================================================
  5. # Script by:
  6. #     Mr. Bubble
  7. #--------------------------------------------------------------------------
  8. # Place this script below both YEA Victory Aftermath and KMS Generic Gauge
  9. # in your script edtior.
  10. #==============================================================================
  11.  
  12. module Bubs
  13. module GGPatch
  14.   # * Gauge File Names
  15.   #  Images must be placed in the "Graphics/System" folder of your project
  16.   VA_EXP_IMAGE = "GaugeEXP"       # Victory Aftermath EXP
  17.   VA_MAX_LEVEL_IMAGE = "GaugeEXP" # MAX Level Victory Aftermath EXP,
  18.                                   # Gauge file name for when the actor
  19.                                   # is at MAX level
  20.  
  21.   # * Gauge Position Offset [x, y]
  22.   VA_EXP_OFFSET = [-23, -2]  # Victory Aftermath EXP
  23.  
  24.   # * Gauge Length Adjustment
  25.   VA_EXP_LENGTH = -4  # Victory Aftermath EXP
  26.  
  27.   # * Gauge Slope
  28.   #   Must be between -89 ~ 89 degrees
  29.   VA_EXP_SLOPE = 30  # Victory Aftermath EXP
  30. end
  31. end
  32.  
  33.  
  34. #==============================================================================
  35. # ■ Window_VictoryEXP_Front
  36. #==============================================================================
  37.  
  38. $imported = {} if $imported.nil?
  39. $kms_imported = {} if $kms_imported.nil?
  40.  
  41. class Window_VictoryEXP_Front < Window_VictoryEXP_Back
  42.   if $imported["YEA-VictoryAftermath"] && $kms_imported["GenericGauge"]
  43.   #--------------------------------------------------------------------------
  44.   # overwrite : draw_exp_gauge
  45.   #--------------------------------------------------------------------------
  46.   def draw_exp_gauge(actor, rect, rate)
  47.     rate = [[rate, 1.0].min, 0.0].max
  48.     dx = (rect.width - [rect.width, 96].min) / 2 + rect.x
  49.     dy = rect.y + line_height * 2 + 96
  50.     dw = [rect.width, 96].min
  51.     image = rate >= 1.0 ? Bubs::GGPatch::VA_MAX_LEVEL_IMAGE : Bubs::GGPatch::VA_EXP_IMAGE
  52.     draw_gauge(image, dx, dy, dw,
  53.               rate,
  54.               Bubs::GGPatch::VA_EXP_OFFSET,
  55.               Bubs::GGPatch::VA_EXP_LENGTH,
  56.               Bubs::GGPatch::VA_EXP_SLOPE)
  57.     fmt = YEA::VICTORY_AFTERMATH::EXP_PERCENT
  58.     text = sprintf(fmt, [rate * 100, 100.00].min)
  59.     if [rate * 100, 100.00].min == 100.00
  60.       text = YEA::VICTORY_AFTERMATH::LEVELUP_TEXT
  61.       text = YEA::VICTORY_AFTERMATH::MAX_LVL_TEXT if actor.max_level?
  62.     end
  63.     draw_text(dx, dy, dw, line_height, text, 1)
  64.   end
  65.  
  66.   end # end $imported
  67. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement