Advertisement
mrbubble

KGC_GenericGauge + gagay Disgaea Skill System Patch

Aug 28th, 2011
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 4.24 KB | None | 0 0
  1. #==============================================================================
  2. # KGC_GenericGauge + gagay Disgaea Skill System Patch
  3. # v1.0 (August 28, 2011)
  4. # By Mr. Bubble
  5. #-----------------------------------------------------------------------------
  6. # Installation: The Disgaea Skill System script must be placed ABOVE
  7. #               KGC Generic Gauge in your script editor's Materials
  8. #               section. Then, insert this patch into its own page
  9. #               anywhere below those two scripts in the Materials
  10. #               section.
  11. #-----------------------------------------------------------------------------
  12. #   This patch makes KGC Generic Gauge and gagay's Disgaea Skill System
  13. # compatible with each other. Unfortunately, the DSS script also defines
  14. # a method with the same exact name (Window_Base#draw_gauge) which makes
  15. # this patch contain a method overwrite.
  16. #   If gagay updates his script and it breaks this patch, let me know.
  17. #-----------------------------------------------------------------------------
  18.  
  19. #-----------------------------------------------------------------------------
  20. # ++ Generic Gauge Customization for Disgaea Skill System ++
  21. #-----------------------------------------------------------------------------
  22.  
  23. module Bubs
  24. module GG_For_DSS
  25.   # > Gauge Settings
  26.   GG_DSS_IMAGE  = "GaugeEXP" # > Gauge file Name in the "Graphics/System" folder
  27.   GG_DSS_OFFSET = [-23, -2]  # > Gauge Position Adjustment [x, y]
  28.   GG_DSS_LENGTH = -4         # > Gauge Length Adjustment
  29.   GG_DSS_SLOPE  = 30         # > Degree of Gauge Slope between -89 ~ 89 degrees
  30.  
  31. end
  32. end
  33.  
  34. #==============================================================================
  35. #------------------------------------------------------------------------------
  36. #------- Do not edit below this point unless you know what you're doing -------
  37. #------------------------------------------------------------------------------
  38. #==============================================================================
  39.  
  40. $imported = {} if $imported == nil
  41.  
  42. #==============================================================================
  43. # ** Window_Base
  44. #==============================================================================
  45. class Window_Base < Window
  46.   include Bubs::GG_For_DSS
  47.   def draw_skill(skill, x, y, enabled = true)
  48.     if skill != nil
  49.       unless skill.no_level
  50.         if enabled; c1 = text_color(2); c2 = text_color(18); else; c1 = text_color(7); c2 = text_color(8); end
  51.         current = skill.exp
  52.         max = skill.exp_needed
  53.         if $imported["GenericGauge"]
  54.           # draw_gauge(file, x, y, width, value, limit, offset,
  55.           #            len_offset, slope, gauge_type)
  56.           draw_gauge(GG_DSS_IMAGE, x, y, 170, current, max, GG_DSS_OFFSET,
  57.                      GG_DSS_LENGTH, GG_DSS_SLOPE, :normal)      
  58.         else
  59.           draw_gauge(current, max, x+2, y-7, 170, c1, c2)
  60.         end
  61.       end
  62.      
  63.       draw_icon(skill.icon_index, x+3, y, enabled)
  64.       self.contents.font.color = normal_color
  65.       self.contents.font.size = 15
  66.       self.contents.font.color = text_color(6)
  67.       self.contents.font.color.alpha = enabled ? 255 : 128
  68.       if skill.no_level
  69.         self.contents.draw_text(x + 130, y+2, 40, WLH, "---", 2)
  70.       else
  71.         self.contents.draw_text(x + 130, y+2, 40, WLH, Vocab.level_a+skill.level.to_s, 2) unless skill.level == skill.max_level
  72.       end
  73.      
  74.       if skill.level == skill.max_level
  75.         case GBP::DISGAEA_SKILL::MASTERSKILL_DISPLAY_METHOD
  76.         when 1 #normal
  77.           self.contents.draw_text(x + 130, y+2, 40, WLH, Vocab.level_a+skill.level.to_s, 2)
  78.         when 2 #icon display
  79.           draw_icon(GBP::DISGAEA_SKILL::MASTERSKILL_ICON, x+150, y-1, enabled)
  80.         when 3 #special text
  81.           self.contents.draw_text(x + 130, y+2, 40, WLH, GBP::DISGAEA_SKILL::MASTERSKILL_TEXT, 2)
  82.         end #case
  83.       end
  84.      
  85.       self.contents.font.color = text_color(skill.skill_color)
  86.       self.contents.font.color.alpha = enabled ? 255 : 128
  87.       self.contents.draw_text(x + 27, y+2, 110, WLH, skill.name)
  88.       self.contents.font.size = Font.default_size
  89.       self.contents.font.color = normal_color
  90.       self.contents.font.color.alpha = 255
  91.     end
  92.   end
  93. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement