Vai al contenuto

Rilevato Ad-Blocker. Per favore disabilita il tuo adblocker quando navighi su makerando.com - Non c'è nessun annuncio invasivo.

  • Chatbox

    You don't have permission to chat.
    Load More
Ally

Interfacce Syvkal's Menu Bars

Recommended Posts

Nome Script: Syvkal's Menu Bars
Versione: 4.1
Autore/i: Syvkal

Informazioni:
Con questo script,potete avere le barre HP, MP etc,in stile diverso,come potete vedere dalle immagini ^^

Screenshots:

CogWheelBars.jpg
CogWheelBarsStatus.jpg
CogWheelSlantBars.jpg
CogWheelBarsTest2.jpg


Istruzioni:
Inserite lo script sotto Material.
Le istruzioni sono all'interno dello Script ;)

Script:

#==============================================================================
# ** Syvkal's Menu Bars
#------------------------------------------------------------------------------
# by Syvkal
# Version 4.1
# 05-20-08
#==============================================================================
#
#  - INTRODUCTION -
#
#  This system implements a series of Plug 'N' Play Menu Bars
#  The Bars were inspired CogWheel, but all coding was done by me
#   ( Except Wortana's 'gradient_fill_rect' Bug Fix )
#
#------------------------------------------------------------------------------
#
#  - USAGE -
#
#  This system will work as soon as you put it in the Script Editor
#  You can edit the script from the Configuration System
#  However, it has also been made so you can easily make your own bars
#
#       ---------------------------------------------------
#
#  To draw a bar use:
#     draw_custom_gauge
#
#  Followed by:
#     (value, max, x, y, color1, color2, width, height, slanted, up)
#
#     value    : bar calculation value
#     max      : bar max value
#     x        : draw spot x-coordinate
#     y        : draw spot y-coordinate
#     color1   : bar gradient color 1          EITHER Color.new(r,g,b,a)
#     color2   : bar gradient color 2          OR Numeric Text color
#     width    : Width
#     height   : Height
#     slanted  : draw slanted bar
#     vertical : draw bar vertically
#
#       ---------------------------------------------------
#
#  To draw a ring use:
#     draw_custom_ring
#
#  Followed by:
#     (value, max, x, y, color1, color2, radius, height, amount, start, reverse)

#     value   : bar calculation value
#     max     : bar max value
#     x       : draw spot x-coordinate
#     y       : draw spot y-coordinate
#     color1  : bar gradient color 1
#     color2  : bar gradient color 2
#     radius  : distance from center point
#     height  : Height
#     amount  : size of ring   - default 360�
#     start   : start position - max 360�
#     reverse : draw ring in reverse
#
#------------------------------------------------------------------------------
#
#  - SCRIPTERS USAGE -
#
#  I have added a few extra features to allow scripters to easily use the bars
#  Seeing as the bars can be drawn Normal, Vertical or in a Ring I've added a
#  feature to allow you to turn off the bars when drawing an actors HP, MP etc.
#  When drawing an actors HP etc. simply add 'true' on the end. Like this:
#       draw_actor_hp(actor, x, y, width, true)
#
#  I've also separated the different bars so they're easier to draw
#
#   draw_actor_hp_gauge(actor, x, y, width)         Will draw a normal bar
#   draw_actor_hp_gauge(actor, x, y, width, true)   Will draw a vertical bar
#   draw_actor_hp_ring(actor, x, y, radius, height, amount, start)
#                                                   Will draw a ring
#
#------------------------------------------------------------------------------
#
#  - SCRIPT CALLS -
#
#  There are no script calls necessary to enable this script
#  However, you can change any of the constants in game if you wish
#  This can be done by the Script Call Funtion in an event
#
#  For example:
#      COG::HPMPSLANT = true
#
#  Will make the HP and MP bars Slant
#  And setting it to false will turn them back to normal
#
#==============================================================================
module BAR
   #===================================================#
   #  **  C O N F I G U R A T I O N   S Y S T E M  **  #
   #===================================================#

  # Parameter Max Value
    P_MAX = 500
# The system uses a 'rate' feature. It is set when drawing a bar
# The 'rate' is how much the bar is filled as a decimal (max : 1)
# This is used to enable color change as the bar decreased in amount
    $rate = 0    # Don't touch this
# The system uses a series of CONSTANTS that can be edited here
# They control the basic gauge colors and the manner the gauge is filled:

  # Gauge Border Colors
    COLOR1 = Color.new(0, 0, 0, 192)         # Outer Border
    COLOR2 = Color.new(255, 255, 192, 192)   # Inner Border
  # Gauge Empty filler
    COLOR3 = Color.new(0, 0, 0, 12)          # Half of Inner Shading
    COLOR4 = Color.new(64, 0, 0, 92)         # Half of Inner Shading
  # Gauge Settings
    EMPTY  = false   # EMPTY  gauge (false - Side : true - Vertical)
    FILLER = false   # FILLER gauge (false - Side : true - Vertical)
  # Border Settings    -    Applies only to standard bars
    CORNER = false                            # Remove corners?

# The Parameter colors can be text colors taken from the windowskin or
# colors like above. You don't need set your own 'rate' functions
# it does it for you
  # Parameter Gauge Color1
    ATKCOLOR1 = 2
    DEFCOLOR1 = 17
    SPICOLOR1 = 30
    AGICOLOR1 = 12
  # Parameter Gauge Color2
    ATKCOLOR2 = 20
    DEFCOLOR2 = 21
    SPICOLOR2 = 31
    AGICOLOR2 = 4

# The system has been made to use a series of SWITCHES that can be edited here
# They control whether certain Bars are Normal or Slanted:

    HPMPSLANT  = false    # Slanted HP and MP Bars?
    EXPSLANT   = false    # Slanted Exp Bars?
    PARSLANT   = false    # Slanted Parameter Bars?
    DVVLBSLANT = true     # Slanted Limit Break Bars?

   #===================================================#
   #  ** C O M P L E X   C O N F I G U R A T I O N **  #
   #===================================================#

# The system allows you to edit the main gauge colous from here
# Functions had to be used instead of Constants so the $rate feature still works
# Edit only if you know what you're doing:

  def self::hpcolor1 # HP Guage Color1
    return Color.new(80 - 24 * $rate, 80 * $rate, 14 * $rate, 192)
  end
  def self::hpcolor2 # HP Guage Color2
    return Color.new(240 - 72 * $rate, 240 * $rate, 62 * $rate, 192)
  end
  def self::mpcolor1 # MP Guage Color1
    return Color.new(14 * $rate, 80 - 24 * $rate, 80 * $rate, 192)
  end
  def self::mpcolor2 # MP Guage Color2
    return Color.new(62 * $rate, 240 - 72 * $rate, 240 * $rate, 192)
  end
  def self::expcolor1 # EXP Guage Color1
    Color.new(80 * $rate, 80 - 80 * $rate ** 2, 80 - 80 * $rate, 192)
  end
  def self::expcolor2 # EXP Guage Color2
    Color.new(240 * $rate, 240 - 240 * $rate ** 2, 240 - 240 * $rate, 192)
  end
   #===================================================#
   #  **     E N D   C O N F I G U R A T I O N     **  #
   #===================================================#
end
#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
#  Added EXP and Next Level EXP for numeric for calculations
#==============================================================================
class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # * Get EXP - numeric for calculations
  #--------------------------------------------------------------------------
  def now_exp
    return @exp - @exp_list[@level]
  end
  #--------------------------------------------------------------------------
  # * Get Next Level EXP - numeric for calculations
  #--------------------------------------------------------------------------
  def next_exp
    return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
  end
end
#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
#  Added the 'Draw' functions for each gauge
#==============================================================================
class Window_Base < Window
  #--------------------------------------------------------------------------
  # * Includes The BAR Module
  #--------------------------------------------------------------------------
  include BAR
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias draw_actor_parameter_original draw_actor_parameter
  #--------------------------------------------------------------------------
  # * Draw HP gauge
  #     vertical : draw bar vertically
  #--------------------------------------------------------------------------
  def draw_actor_hp_gauge(actor, x, y, width = 120, vertical = false)
    $rate = actor.hp.to_f / actor.maxhp
    gw = width * actor.hp / actor.maxhp
    w = vertical ? 6 : width; h = vertical ? width : 6
    HPMPSLANT ? self.contents.cogwheel_fill_slant(x, y + WLH - 8, gw, w, h, BAR::hpcolor1, BAR::hpcolor2, vertical) :
    self.contents.cogwheel_fill_rect(x, y + WLH - 8, gw, w, h, BAR::hpcolor1, BAR::hpcolor2, vertical)
  end
  #--------------------------------------------------------------------------
  # * Draw MP gauge
  #     vertical : draw bar vertically
  #--------------------------------------------------------------------------
  def draw_actor_mp_gauge(actor, x, y, width = 120, vertical = false)
    $rate = actor.mp.to_f / [actor.maxmp, 1].max
    gw = width * actor.mp / [actor.maxmp, 1].max
    w = vertical ? 6 : width; h = vertical ? width : 6
    HPMPSLANT ? self.contents.cogwheel_fill_slant(x, y + WLH - 8, gw, w, h, BAR::mpcolor1, BAR::mpcolor2, vertical) :
    self.contents.cogwheel_fill_rect(x, y + WLH - 8, gw, w, h, BAR::mpcolor1, BAR::mpcolor2, vertical)
  end
  #--------------------------------------------------------------------------
  # * Draw Exp gauge
  #     actor    : actor
  #     x        : draw spot x-coordinate
  #     y        : draw spot y-coordinate
  #     width    : Width
  #     vertical : draw bar vertically
  #--------------------------------------------------------------------------
  def draw_actor_exp_gauge(actor, x, y, width = 170, vertical = false)
    $rate = actor.now_exp.to_f / [actor.next_exp, 1].max
    gw = width * actor.now_exp / [actor.next_exp, 1].max
    w = vertical ? 6 : width; h = vertical ? width : 6
    EXPSLANT ? self.contents.cogwheel_fill_slant(x, y + WLH - 8, gw, w, h, BAR::expcolor1, BAR::expcolor2, vertical) :
    self.contents.cogwheel_fill_rect(x, y + WLH - 8, gw, w, h, BAR::expcolor1, BAR::expcolor2, vertical)
  end
  #--------------------------------------------------------------------------
  # * Draw Parameters
  #     hide_bar : draw Parameters without gauge
  #--------------------------------------------------------------------------
  def draw_actor_parameter(actor, x, y, type, hide_bar = false)
    hide_bar ? nil : draw_actor_parameter_gauge(actor, x, y, type)
    draw_actor_parameter_original(actor, x, y, type)
  end
  #--------------------------------------------------------------------------
  # * Draw Parameters gauge
  #     actor    : actor
  #     x        : draw spot x-coordinate
  #     y        : draw spot y-coordinate
  #     type     : Type of parameters (0-3)
  #     width    : Width
  #     vertical : draw bar vertically
  #--------------------------------------------------------------------------
  def draw_actor_parameter_gauge(actor, x, y, type, width = 160, vertical = false)
    case type
    when 0
      e1 = actor.atk
      gc1 = ATKCOLOR1.is_a?(Integer) ? text_color(ATKCOLOR1) : ATKCOLOR1
      gc2 = ATKCOLOR2.is_a?(Integer) ? text_color(ATKCOLOR2) : ATKCOLOR2
    when 1
      e1 = actor.def
      gc1 = DEFCOLOR1.is_a?(Integer) ? text_color(DEFCOLOR1) : DEFCOLOR1
      gc2 = DEFCOLOR2.is_a?(Integer) ? text_color(DEFCOLOR2) : DEFCOLOR2
    when 2
      e1 = actor.spi
      gc1 = SPICOLOR1.is_a?(Integer) ? text_color(SPICOLOR1) : SPICOLOR1
      gc2 = SPICOLOR2.is_a?(Integer) ? text_color(SPICOLOR2) : SPICOLOR2
    when 3
      e1 = actor.agi
      gc1 = AGICOLOR1.is_a?(Integer) ? text_color(AGICOLOR1) : AGICOLOR1
      gc2 = AGICOLOR2.is_a?(Integer) ? text_color(AGICOLOR2) : AGICOLOR2
    end
    e2 = P_MAX
    rate = [e1.to_f / e2.to_f, 1].min
    gw = width * [e1.to_f / e2.to_f, 1].min
    r = gc2.red * rate
    g = (gc2.green - 72) * rate
    b = gc2.blue  * rate
    a = gc2.alpha
    w = vertical ? 6 : width; h = vertical ? width : 6
    PARSLANT ? self.contents.cogwheel_fill_slant(x, y + WLH - 8, gw, w, h, gc1, Color.new(r, g, b, a), vertical) :
    self.contents.cogwheel_fill_rect(x, y + WLH - 8, gw, w, h, gc1, Color.new(r, g, b, a), vertical)
  end
  #--------------------------------------------------------------------------
  # * Draw Custom gauge
  #     value    : bar calculation value
  #     max      : bar max value
  #     x        : draw spot x-coordinate
  #     y        : draw spot y-coordinate
  #     color1   : bar gradient color 1
  #     color2   : bar gradient color 2
  #     width    : Width
  #     height   : Height
  #     slanted  : draw slanted bar
  #     vertical : draw bar vertically
  #--------------------------------------------------------------------------
  def draw_custom_gauge(value, max, x, y, color1, color2, width=120, height=6, slanted = false, vertical = false)
    rate = [value.to_f / max.to_f, 1].min
    gw = width * [value.to_f / max.to_f, 1].min
    gc1 = color1.is_a?(Integer) ? text_color(color1) : color1
    gc2 = color2.is_a?(Integer) ? text_color(color2) : color2
    r = gc2.red * rate
    g = (gc2.green - 72) * rate
    b = gc2.blue  * rate
    a = gc2.alpha
    w = vertical ? 6 : width; h = vertical ? width : 6
    slanted ? self.contents.cogwheel_fill_slant(x, y + WLH - 8, gw, w, h, gc1, Color.new(r, g, b, a), vertical) :
    self.contents.cogwheel_fill_rect(x, y + WLH - 8, gw, w, h, gc1, Color.new(r, g, b, a), vertical)
  end
  #--------------------------------------------------------------------------
  # * Draw Limit Break gauge
  #     vertical : draw bar vertically
  #--------------------------------------------------------------------------
  def draw_actor_lb(actor, x, y, width = 120, vertical = false)
    return unless actor.lb_gauge_visible?
    st1 = lb_gauge_normal_start_color; st2 = lb_gauge_max_start_color
    ed1 = lb_gauge_normal_end_color; ed2 = lb_gauge_max_end_color
    rate = actor.limitbreak.to_f / [LB_MAX, 1].max
    gw = width * actor.limitbreak / LB_MAX
    gc1 = (gw == width ? st2 : Color.new(st1.red,st1.green-(10*rate),st1.blue-(10*rate), 192))
    gc2 = (gw == width ? ed2 : Color.new(ed1.red,ed1.green-(10*rate),ed1.blue-(10*rate), 192))
    w = vertical ? 6 : width; h = vertical ? width : 6
    DVVLBSLANT ? self.contents.cogwheel_fill_slant(x, y + WLH - 8, gw, w, h, gc1, gc2, vertical) :
    self.contents.cogwheel_fill_rect(x, y + WLH - 8, gw, w, h, gc1, gc2, vertical)
  end
  #--------------------------------------------------------------------------
  # * Draw HP gauge ring
  #     actor   : actor
  #     x       : draw spot x-coordinate
  #     y       : draw spot y-coordinate
  #     radius  : distance from center point
  #     height  : Height
  #     amount  : size of ring   - default 360�
  #     start   : start position - max 360�
  #     reverse : draw ring in reverse
  #--------------------------------------------------------------------------
  def draw_actor_hp_ring(actor, x, y, radius, height, amount = 360, start = 0, reverse = false)
    $rate = actor.hp.to_f / actor.maxhp
    gw = amount * actor.hp / actor.maxhp
    self.contents.cogwheel_fill_ring(x, y, gw, radius, height, BAR::hpcolor1, BAR::hpcolor2, amount, start, reverse)
  end
  #--------------------------------------------------------------------------
  # * Draw MP gauge ring
  #     actor   : actor
  #     x       : draw spot x-coordinate
  #     y       : draw spot y-coordinate
  #     radius  : distance from center point
  #     height  : Height
  #     amount  : size of ring   - default 360�
  #     start   : start position - max 360�
  #     reverse : draw ring in reverse
  #--------------------------------------------------------------------------
  def draw_actor_mp_ring(actor, x, y, radius, height, amount = 360, start = 0, reverse = false)
    $rate = actor.mp.to_f / [actor.maxmp, 1].max
    gw = amount * actor.mp / [actor.maxmp, 1].max
    self.contents.cogwheel_fill_ring(x, y, gw, radius, height, BAR::mpcolor1, BAR::mpcolor2, amount, start, reverse)
  end
  #--------------------------------------------------------------------------
  # * Draw Exp gauge ring
  #     actor   : actor
  #     x       : draw spot x-coordinate
  #     y       : draw spot y-coordinate
  #     radius  : distance from center point
  #     height  : Height
  #     amount  : size of ring   - default 360�
  #     start   : start position - max 360�
  #     reverse : draw ring in reverse
  #--------------------------------------------------------------------------
  def draw_actor_exp_ring(actor, x, y, radius, height, amount = 360, start = 0, reverse = false)
    $rate = actor.now_exp.to_f / [actor.next_exp, 1].max
    gw = amount * actor.now_exp / [actor.next_exp, 1].max
    self.contents.cogwheel_fill_ring(x, y, gw, radius, height, BAR::expcolor1, BAR::expcolor2, amount, start, reverse)
  end
  #--------------------------------------------------------------------------
  # * Draw Custom gauge ring
  #     value   : bar calculation value
  #     max     : bar max value
  #     x       : draw spot x-coordinate
  #     y       : draw spot y-coordinate
  #     color1  : bar gradient color 1
  #     color2  : bar gradient color 2
  #     radius  : distance from center point
  #     height  : Height
  #     amount  : size of ring   - default 360�
  #     start   : start position - max 360�
  #     reverse : draw ring in reverse
  #--------------------------------------------------------------------------
  def draw_custom_ring(value, max, x, y, color1, color2, radius, height, amount = 360, start = 0, reverse = false)
    rate = [value.to_f / max.to_f, 1].min
    gw = amount * [value.to_f / max.to_f, 1].min
    gc1 = color1.is_a?(Integer) ? text_color(color1) : color1
    gc2 = color2.is_a?(Integer) ? text_color(color2) : color2
    r = gc2.red * rate
    g = (gc2.green - 72) * rate
    b = gc2.blue  * rate
    a = gc2.alpha
    self.contents.cogwheel_fill_ring(x, y, gw, radius, height, gc1, Color.new(r, g, b, a), amount, start, reverse)
  end
  #--------------------------------------------------------------------------
  # * Draw HP
  #     hide_bar : draw Parameters without gauge
  #--------------------------------------------------------------------------
  def draw_actor_hp(actor, x, y, width = 120, hide_bar = false)
    hide_bar ? nil : draw_actor_hp_gauge(actor, x, y, width)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 30, WLH, Vocab::hp_a)
    self.contents.font.color = hp_color(actor)
    last_font_size = self.contents.font.size
    xr = x + width
    if width < 120
      self.contents.draw_text(xr - 44, y, 44, WLH, actor.hp, 2)
    else
      self.contents.draw_text(xr - 99, y, 44, WLH, actor.hp, 2)
      self.contents.font.color = normal_color
      self.contents.draw_text(xr - 55, y, 11, WLH, "/", 2)
      self.contents.draw_text(xr - 44, y, 44, WLH, actor.maxhp, 2)
    end
  end
  #--------------------------------------------------------------------------
  # * Draw MP
  #     hide_bar : draw Parameters without gauge
  #--------------------------------------------------------------------------
  def draw_actor_mp(actor, x, y, width = 120, hide_bar = false)
    hide_bar ? nil : draw_actor_mp_gauge(actor, x, y, width)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 30, WLH, Vocab::mp_a)
    self.contents.font.color = mp_color(actor)
    last_font_size = self.contents.font.size
    xr = x + width
    if width < 120
      self.contents.draw_text(xr - 44, y, 44, WLH, actor.mp, 2)
    else
      self.contents.draw_text(xr - 99, y, 44, WLH, actor.mp, 2)
      self.contents.font.color = normal_color
      self.contents.draw_text(xr - 55, y, 11, WLH, "/", 2)
      self.contents.draw_text(xr - 44, y, 44, WLH, actor.maxmp, 2)
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Exp
  #     actor    : actor
  #     x        : draw spot x-coordinate
  #     y        : draw spot y-coordinate
  #     width    : Width
  #     hide_bar : draw Parameters without gauge
  #--------------------------------------------------------------------------
  def draw_actor_exp(actor, x, y, width = 170, hide_bar = false)
    hide_bar ? nil : draw_actor_exp_gauge(actor, x, y, width)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 45, WLH, "Exp")
    self.contents.font.color = normal_color
    xr = x + width
    if width < 170
      self.contents.draw_text(xr - 60, y, 60, WLH,  actor.next_rest_exp_s, 2)
    else
      self.contents.draw_text(xr - 131, y, 60, WLH, actor.exp_s, 2)
      self.contents.draw_text(xr - 71, y, 11, WLH, "/", 2)
      self.contents.draw_text(xr - 60, y, 60, WLH, actor.next_exp_s, 2)
    end
  end
end
#==============================================================================
# ** Window_SkillStatus
#------------------------------------------------------------------------------
#  Edited so te Bars don't cut off
#==============================================================================
class Window_SkillStatus < Window_Base
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    draw_actor_name(@actor, 4, 0)
    draw_actor_level(@actor, 140, 0)
    draw_actor_hp(@actor, 238, 0)
    draw_actor_mp(@actor, 390, 0)
  end
end
#==============================================================================
# ** Bitmap
#------------------------------------------------------------------------------
#  Added gauge Calculations
#==============================================================================
class Bitmap
  #--------------------------------------------------------------------------
  # * Includes The BAR Module
  #--------------------------------------------------------------------------
  include BAR
  #--------------------------------------------------------------------------
  # * Wortana's 'gradient_fill_rect' Bug Fix
  #--------------------------------------------------------------------------
  alias gradient_original gradient_fill_rect unless method_defined?('gradient_original')
  def gradient_fill_rect(*args)
    args.pop if !args.last if args.size == 4 || 7 and !args.last
    gradient_original(*args)
  end
  #--------------------------------------------------------------------------
  # * CogWheel Style Fill of Rect
  #--------------------------------------------------------------------------
  def cogwheel_fill_rect(x, y, gw, width, height, gc1, gc2, up = false)
    rect_border(x-2, y-2, width+4, height+4, COLOR1, CORNER)
    rect_border(x-1, y-1, width+2, height+2, COLOR2, CORNER)
    gradient_fill_rect(x, y, width, height, COLOR3, COLOR4, EMPTY)
    gradient_fill_rect(x, y, up ? width : gw, up ? gw : height, gc1, gc2, FILLER)
  end
  #--------------------------------------------------------------------------
  # * CogWheel Style Fill of Slanted Rect
  #--------------------------------------------------------------------------
  def cogwheel_fill_slant(x, y, gw, width, height, gc1, gc2, up = false)
    bgx = up ? 2 : 4; bdx = up ? 1 : 2
    bgy = up ? 4 : 2; bdy = up ? 2 : 1
    bgw = up ? 4 : 8; bdw = up ? 2 : 4
    bgh = up ? 8 : 4; bdh = up ? 4 : 2
    slant_border(x-bgx, y-bgy, width+bgw, height+bgh, COLOR1, up)
    slant_border(x-bdx, y-bdy, width+bdw, height+bdh, COLOR2, up)
    gradient_fill_slant(x, y, width, height, COLOR3, COLOR4, EMPTY, up)
    gradient_fill_slant(x, y,up ? width : gw,up ? gw : height, gc1, gc2, FILLER, up)
  end
  #--------------------------------------------------------------------------
  # * CogWheel Style Fill of Ring
  #--------------------------------------------------------------------------
  def cogwheel_fill_ring(x, y, gw, radius, height, gc1, gc2, amount = 360, start = 0, reverse = false)
    fill_ring(x-2, y-2, radius, height+4, COLOR1, amount, start, reverse)
    fill_ring(x-1, y-1, radius, height+2, COLOR2, amount, start, reverse)
    if amount >= 220
      gradient_fill_ring(x, y, radius, height, COLOR3, COLOR4, [amount/2, 180].min, start, reverse)
      gradient_fill_ring(x, y, radius, height, COLOR4, COLOR3, [amount/2, 180].min, start+(amount/2), reverse)
    else
      gradient_fill_ring(x, y, radius, height, COLOR3, COLOR4, [amount, 360].min, start, reverse)
    end
    if gw >= 220
      gw1 = amount/2; gw2 = gw / 2
      gradient_fill_ring(x, y, radius, height, gc1, gc2, gw1, start, reverse)
      gradient_fill_ring(x, y, radius, height, gc2, gc1, gw2, start +(amount/2), reverse)
    else
      gradient_fill_ring(x, y, radius, height, gc1, gc2, gw, start, reverse)
    end
  end
  #--------------------------------------------------------------------------
  # * Fill of Border
  #--------------------------------------------------------------------------
  def rect_border(x, y, width, height, gc1, edge = false)
    fill_rect(x + (edge ? 1 : 0), y, width - (edge ? 2 : 0), 2, gc1)
    fill_rect(x + (edge ? 1 : 0), y+(height-2), width - (edge ? 2 : 0), 2, gc1)
    fill_rect(x, y+1, 2, height-2, gc1)
    fill_rect(x +(width-2), y+1, 2, height-2, gc1)
  end
  #--------------------------------------------------------------------------
  # * Gradient Fill of Slanted Rect
  #--------------------------------------------------------------------------
  def gradient_fill_slant(x, y, width, height, gc1, gc2, vertical = false, up = false)
    if up
      for i in 1..width
        if vertical
          gradient_fill_rect(x + width - i, y+i+1, 1, (height-2)-width, gc1, gc2, vertical)
        else
          color = get_gradient_pixel(gc1, gc2, width, i)
          fill_rect(x + width - i, y+i+1, 1, (height-2)-width, color)
        end
      end
    else
      for i in 1..height
        if vertical
          color = get_gradient_pixel(gc1, gc2, height, i)
          fill_rect(x+i+1, y + height - i, (width-2)-height, 1, color)
        else
          gradient_fill_rect(x+i+1, y + height - i, (width-2)-height, 1, gc1, gc2)
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Fill of Slanted Rect
  #--------------------------------------------------------------------------
  def fill_slant(x, y, width, height, gc1, up = false)
    oh = up ? width : height
    for i in 1..oh
      if up
        fill_rect(x + width -i, y+i, 1, height-width, gc1)
      else
        fill_rect(x+i, y + height -i, width-height, 1, gc1)
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Fill of Slanted Border
  #--------------------------------------------------------------------------
  def slant_border(x, y, width, height, gc1, up = false)
    oh = up ? width : height
    for i in 1..oh-2
      if up
        fill_rect(x + width-1 -i, y+((height-1)-width)+i, 1, 2, gc1)
        fill_rect(x + width-1 -i, y+1+i, 1, 2, gc1)
        fill_rect(x + width-1, y+1, 1, height-width, gc1)
        fill_rect(x, y+width, 1, height-width, gc1)
      else
        fill_rect(x+((width-1)-height)+i, y + height-1 -i, 2, 1, gc1)
        fill_rect(x+1+i, y + height-1 -i, 2, 1, gc1)
        fill_rect(x+1, y + height -1, width-height, 1, gc1)
        fill_rect(x+height, y, width-height, 1, gc1)
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Fill of Ring
  #--------------------------------------------------------------------------
  def fill_ring(ox, oy, radius, height, gc1, amount = 360, start = 0, reverse = false)
    d = 2.0 * Math::PI / 360
    for i in 1..[amount, 360].min
      s = i + start
      if reverse
        x = ox + ( radius * Math.sin( d * s ) ).to_i
        y = oy - ( radius * Math.cos( d * s ) ).to_i
      else
        x = ox - ( radius * Math.cos( d * s ) ).to_i
        y = oy + ( radius * Math.sin( d * s ) ).to_i
      end
      fill_rect(x, y, height, height, gc1)
    end
  end
  #--------------------------------------------------------------------------
  # * Gradient Fill of Ring
  #--------------------------------------------------------------------------
  def gradient_fill_ring(ox, oy, radius, height, gc1, gc2, amount = 360, start = 0, reverse = false)
    d = 2.0 * Math::PI / 360
    for i in 1..amount
      s = i + start
      if reverse
        x = ox + ( radius * Math.sin( d * s ) ).to_i
        y = oy - ( radius * Math.cos( d * s ) ).to_i
      else
        x = ox - ( radius * Math.cos( d * s ) ).to_i
        y = oy + ( radius * Math.sin( d * s ) ).to_i
      end
      color = get_gradient_pixel(gc1, gc2, amount, i)
      fill_rect(x, y, height, height, color)
    end
  end
  #--------------------------------------------------------------------------
  # * Get Pixel Color for Gradient Fill
  #--------------------------------------------------------------------------
  def get_gradient_pixel(gc1, gc2, amount, i)
    red = gc1.red * (amount - i) / amount + gc2.red * i / amount
    green = gc1.green * (amount - i) / amount + gc2.green * i / amount
    blue = gc1.blue * (amount - i) / amount + gc2.blue * i / amount
    alpha = gc1.alpha * (amount - i) / amount + gc2.alpha * i / amount
    return Color.new(red, green, blue, alpha)
  end
end

Condividi questo messaggio


Link di questo messaggio
Condividi su altri siti

Crea un account o accedi per lasciare un commento

You need to be a member in order to leave a comment

Crea un account

Iscriviti per un nuovo account nella nostra comunità. È facile!

Registra un nuovo account

Accedi

Sei già registrato? Accedi qui.

Accedi Ora

  • Contenuti simili

    • Da MrSte
      Autore/i: Nicke
       
      Versione: 1.0a
       
      Informazioni: Questo Script permette di aggiungere o di creare delle missioni per il proprio gioco, aggiungendo EXP, Soldi, Armi oppure Oggetti come ricompensa 
       
      Script:
       
      Core (Prima di installare lo Script, installate questo): http://niclas-thornqvist.se/rpg/scripts/ace/xs-core.txt
       
      Script: http://niclas-thornqvist.se/rpg/scripts/ace/xs-journal.txt
       
      Crediti:
      Creditate l'autore dello Script ovvero Nicke, lo script può essere usato anche per giochi commerciali 
    • Da Ally
      Nome Script: MSX - Scene_Menu MOD
      Versione: 1.0
      Autore/i: Melosx
       
      Informazioni:
      Modifica il menu. Riscrive lo stile delle barre non solo nel menù ma in tutto il gioco.
       
      Screenshots:
       
       
       
      Istruzioni:
      Nello script.
       
      Script:
       
       
    • Da Ally
      Nome Script: MSX - Name Input
      Versione: 1.0
      Autore/i: Melosx
       
      Features:
      Modifica la schermata di inserimento del nome eroe.
       
      Screenshots:
       
       
       
      Istruzioni:
      Copiare sotto materialse sopra main.
       
      Script:
       
       
    • Da Ally
      Nome Script: MSX - Window_SaveFile
      Versione: 1.0
      Autore/i: Melosx
       
      Informazioni:
      Nuova finestra di salvataggio con più elementi. Consiglio l'utilizzo dello script Text Cache per una corretta resa delle stringhe di testo.
       
      Screenshots:
       
       
       
      Istruzioni:
      Copiare lo script Sopra Main e sotto Materials
       
      Script:
       
       
      #==============================================================================# ** MSX - Window_SaveFile II#==============================================================================# Author: Melosx# Versione: 1.0# Release Date: 27/03/2012# #==============================================================================# * Description# -----------------------------------------------------------------------------# This script change the Window_SaveFile by adding more information.# This release add: actor name, level, class, map name and gold.##==============================================================================# * Instruction# -----------------------------------------------------------------------------# Place the script under Materials and above Main.##==============================================================================#==============================================================================# ** DataManager#==============================================================================module DataManager def self.make_save_header header = {} header[:characters] = $game_party.characters_for_savefile header[:playtime_s] = $game_system.playtime_s header[:info] = $game_party.characters_info_for_savefile header endend#==============================================================================# ** Game_Party#==============================================================================class Game_Party < Game_Unit def characters_info_for_savefile battle_members.collect do |actor| map_name = load_data("Data/MapInfos.rvdata2")[$game_map.map_id].name [actor.name, actor.level, actor.class.name, $game_party.gold, map_name, actor.face_name, actor.face_index] end endend#==============================================================================# ** Window_SaveFile#==============================================================================class Window_SaveFile < Window_Base def refresh contents.clear self.contents.font.size = 16 change_color(normal_color) name = Vocab::File + " #{@file_index + 1}" draw_text(4, 0, 200, line_height, name) @name_width = text_size(name).width draw_playtime(0, contents.height - line_height, contents.width - 4, 2) draw_info draw_party_characters(150, 117) end def draw_party_characters(x, y) header = DataManager.load_header(@file_index) return unless header header[:characters].each_with_index do |data, i| draw_character(data[0], data[1], x + i * 115, y) end end def draw_playtime(x, y, width, align) header = DataManager.load_header(@file_index) return unless header draw_text(x, y, width, line_height, "Playtime: " + header[:playtime_s], 2) end def draw_info header = DataManager.load_header(@file_index) return unless header header[:info].each_with_index do |data, i| draw_face(data[5], data[6], 70 + i * 115, 23) draw_text(70 + i * 115, 3, 110, line_height, data[0], 0) draw_text(75 + i * 115, 38, 110, line_height, Vocab.level_a + " " + data[1].to_s, 0) draw_text(75 + i * 115, 23, 105, line_height, data[2], 0) draw_text(0, contents.height - line_height, contents.width - 4, line_height, "Map: " + data[4], 1) draw_text(4, contents.height - line_height, contents.width - 4, line_height, "Gold: " + data[3].to_s + Vocab::currency_unit, 0) end endend#==============================================================================# ** Scene_File#==============================================================================class Scene_File < Scene_MenuBase def visible_max return 2 endendend
    • Da Ally
      Nome Script: Syvkal's Menu Bars VXAce
      Versione: 1.2
      Autore/i: Syvkal
       
      Informazioni:
      Con questo script,potete avere le barre HP, MP etc,in stile diverso,come potete vedere dalle immagini ^^
      Lo stesso script è anche presente per il VX...
       
      Screenshots:
       
       
       
      Istruzioni:
      Inserire lo script sotto Material.
      Altre istruzioni all'interno dello script.
       
      Script
       
       
      #==============================================================================# ** Syvkal's Menu Bars VXAce#------------------------------------------------------------------------------# by Syvkal# Version 1.2# 19-03-12#------------------------------------------------------------------------------# * Original available at:# www.rpgmakervxace.net & forums.rpgmakerweb.com# Please do not redistribute this script#------------------------------------------------------------------------------# * Terms of Use# Available for use in commercial games provided that I get a free copy # Email me: [email protected]# Please do not redistribute this script#==============================================================================## - INTRODUCTION -## This system implements a series of Plug 'N' Play Menu Bars/Gauges# The Bars (and some of the colour schemes) were inspired CogWheel,# but all coding was done by me##------------------------------------------------------------------------------## - USAGE -## This system will work as soon as you put it in the Script Editor# You can edit the script from the Configuration System## --- Custom Gauges -----------------------------------## I have designed the script so you can easily (with minimal scripting# knowledge) add you own custom gauges for any attribute you want## To draw a gauge use:# draw_syvkal_gauge(x, y, width, rate, color1, color2, slant)## rate : Percentage of your custom attribute max (full at 1.0)# color1 : left side gradient color# color2 : right side gradient color# style : gauge draw style (explained in the Configuration System)## --- Auto Generate Color ---------------------------## Additionally, I have added an extra function to make it easy to# create your own colours that change as the gauge decreases## To generate a custom colour use:# auto_color(color1, color2, r)## r : Percentage of your custom attribute max (full at 1.0)# color1 : Colour you want for when the gauge is full# color2 : Colour you want for when the gauge is nearly empty## This generates a SINGLE colour that changes with the gauge# Each gauge requires two colours so it has a gradient## --- Ring Bars -------------------------------------## Ring Bars have been removed for now, I didn't like how they looked# Testing has shown RGSS3 is more capable of the kind of ring bars I# wanted to make, but I want to perfect them first##============================================================================== #===================================================# # ** M I N O R C O N F I G U R A T I O N ** # #===================================================# #-------------------------------------------------------------------------- # * Parameter Gauge Max # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Minor addition allowing you to choose a max for the parameter gauges # Best set just above your actor's highest stat (to allow for buffs) # Excludes HP, MP, TP # (This does not affect your actor's stats, but simply makes the gauges # fill up quicker and look more appealing) #-------------------------------------------------------------------------- P_MAX = 400 # Parameter Gauge Max #-------------------------------------------------------------------------# # ** Full Configuration system further down ** # #-------------------------------------------------------------------------##==============================================================================# ** Window_Base#------------------------------------------------------------------------------# Replaces various 'Draw' functions to add each gauge.#==============================================================================class Window_Base < Window #===================================================# # ** C O N F I G U R A T I O N S Y S T E M ** # #===================================================# #-------------------------------------------------------------------------- # * Gauge Draw Styles # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Use different bracket types to 'draw' the style of each bar # Available bracket types: # ( ) < > | / \ # Simply mix and match for achieve your desired effect # # To use the default rectangular gauges, use | or simply leave blank # eg. '| |' or '' # Any invalid symbol will result in the default | as well # # - - W A R N I N G - - # # When using the following bracket: # \ # Ensure it is followed a space (eg. '| \ ') or itself (eg. '| \\') # If the rest of the text below turns purple, you've done it wrong #-------------------------------------------------------------------------- HPSTYLE = '| |' # Style of the HP Gauge MPSTYLE = '| |' # Style of the MP Gauge TPSTYLE = '/ /' # Style of the TP Gauge PARSTYLE = '( )' # Style of the Parameter Gauges #-------------------------------------------------------------------------- # * Additional Gauge Preferences # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Simple adjustments to aesthetics # Advised to use SLANTDSIZE if you have used / or \ in multiple bars #-------------------------------------------------------------------------- THICKCURVED = false # Slightly thicken curved bars? SLANTDSIZE = true # Shorten slanted bars? #-------------------------------------------------------------------------- # * Gauge Border Colors # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Control the colours of the gauge borders #-------------------------------------------------------------------------- COLOR1 = Color.new(0, 0, 0, 192) # Outer Border COLOR2 = Color.new(255, 255, 192, 192) # Inner Border #-------------------------------------------------------------------------- # * Empty Cauge Filler Colors # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Control the colours of the empty gauge filler #-------------------------------------------------------------------------- COLOR3 = Color.new(0, 0, 0, 12) # Half of Inner Shading COLOR4 = Color.new(64, 0, 0, 92) # Half of Inner Shading #-------------------------------------------------------------------------- # * Paramater Gauge Colors # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Control the colours of various parameters such as ATK, DEF, etc. # (HP, MP, TP are in the 'Complex Configuration' section) #-------------------------------------------------------------------------- def param_gauge_color1(param_id) case param_id when 2 text_color(20) # ATK Gauge Color1 when 3 text_color(14) # DEF Gauge Color1 when 4 text_color(30) # MAT Gauge Color1 when 5 text_color(13) # MDF Gauge Color1 when 6 text_color(28) # AGI Gauge Color1 when 7 text_color(19) # LUK Gauge Color1 end end def param_gauge_color2(param_id) case param_id when 2 text_color(21) # ATK Gauge Color1 when 3 text_color(6) # DEF Gauge Color1 when 4 text_color(31) # MAT Gauge Color1 when 5 text_color(5) # MDF Gauge Color1 when 6 text_color(29) # AGI Gauge Color1 when 7 text_color(7) # LUK Gauge Color1 end end #===================================================# # ** C O M P L E X C O N F I G U R A T I O N ** # #===================================================# #-------------------------------------------------------------------------- # * HP Gauge Colors # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Control the colours of the HP gauge # (Edit only if you know what you're doing) #-------------------------------------------------------------------------- def hp_gauge_color1 # HP Guage Color1 return Color.new(80 - 24 * @rate, 80 * @rate, 14 * @rate, 192) end def hp_gauge_color2 # HP Guage Color2 return Color.new(240 - 72 * @rate, 240 * @rate, 62 * @rate, 192) end #-------------------------------------------------------------------------- # * MP Gauge Colors # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Control the colours of the MP gauge # (Edit only if you know what you're doing) #-------------------------------------------------------------------------- def mp_gauge_color1 # MP Guage Color1 return Color.new(14 * @rate, 80 - 24 * @rate, 80 * @rate, 192) end def mp_gauge_color2 # MP Guage Color2 return Color.new(62 * @rate, 240 - 72 * @rate, 240 * @rate, 192) end #-------------------------------------------------------------------------- # * TP Gauge Colors # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Control the colours of the TP gauge # (Edit only if you know what you're doing) #-------------------------------------------------------------------------- def tp_gauge_color1 # TP Gauge Color1 return auto_color(Color.new(192,0,0,192), Color.new(255,110,0,192)) end def tp_gauge_color2 # TP Gauge Color2 return auto_color(Color.new(255,165,0,192), Color.new(255,220,0,192)) end #===================================================# # ** E N D C O N F I G U R A T I O N ** # #===================================================# #-------------------------------------------------------------------------- # * Public Instance Variables #-------------------------------------------------------------------------- attr_accessor :rate # Rate for Colour calculations #-------------------------------------------------------------------------- # * Alias Listings #-------------------------------------------------------------------------- alias draw_actor_param_original draw_actor_param alias initialize_original initialize #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize(x, y, width, height) @rate = 1.0 initialize_original(x, y, width, height) end #-------------------------------------------------------------------------- # * Draw HP #-------------------------------------------------------------------------- def draw_actor_hp(actor, x, y, width = 124) @rate = [actor.hp_rate, 1.0].min draw_syvkal_gauge(x, y, width, @rate, hp_gauge_color1, hp_gauge_color2, HPSTYLE) change_color(system_color) draw_text(x, y, 30, line_height, Vocab::hp_a) draw_current_and_max_values(x, y, width, actor.hp, actor.mhp, hp_color(actor), normal_color) end #-------------------------------------------------------------------------- # * Draw MP #-------------------------------------------------------------------------- def draw_actor_mp(actor, x, y, width = 124) @rate = [actor.mp_rate, 1.0].min draw_syvkal_gauge(x, y, width, @rate, mp_gauge_color1, mp_gauge_color2, MPSTYLE) change_color(system_color) draw_text(x, y, 30, line_height, Vocab::mp_a) draw_current_and_max_values(x, y, width, actor.mp, actor.mmp, mp_color(actor), normal_color) end #-------------------------------------------------------------------------- # * Draw TP #-------------------------------------------------------------------------- def draw_actor_tp(actor, x, y, width = 124) @rate = [actor.tp_rate, 1.0].min draw_syvkal_gauge(x, y, width, @rate, tp_gauge_color1, tp_gauge_color2, TPSTYLE) change_color(system_color) draw_text(x, y, 30, line_height, Vocab::tp_a) change_color(tp_color(actor)) draw_text(x + width - 42, y, 42, line_height, actor.tp.to_i, 2) end #-------------------------------------------------------------------------- # * Draw Parameters # actor : actor # x : draw spot x-coordinate # y : draw spot y-coordinate # type : Type of parameters (0-3) #-------------------------------------------------------------------------- def draw_actor_param(actor, x, y, param_id, width = 156) draw_syvkal_gauge(x, y, width, actor.params_rate(param_id), param_gauge_color1(param_id), param_gauge_color2(param_id), PARSTYLE) draw_actor_param_original(actor, x, y, param_id) end #-------------------------------------------------------------------------- # * Auto Generate Color # color1 : initial color # color2 : ending color # r : rate (full at 1.0) 1 -> color1, 0 -> color2 #-------------------------------------------------------------------------- def auto_color(color1, color2, r = @rate) a_color = Color.new a_color.red = (1-r)*color2.red + r*color1.red a_color.green = (1-r)*color2.green + r*color1.green a_color.blue = (1-r)*color2.blue + r*color1.blue a_color.alpha = (1-r)*color2.alpha + r*color1.alpha return a_color end #-------------------------------------------------------------------------- # * Draw Syvkal Style Gauge # rate : Rate (full at 1.0) # color1 : Left side color # color2 : Right side color # style : gauge draw style #-------------------------------------------------------------------------- def draw_syvkal_gauge(x, y, width, rate, color1, color2, style = '') fill_w = (width * rate).to_i gauge_y = y + line_height - 8 h = 6 style.slice!(/\s*/); style = style.split(/\s*/) if style.empty? or (style[0] == '|' && style[1] == '|') contents.fill_rect(x-2, gauge_y-2, width+4, 10, COLOR1) contents.fill_rect(x-1, gauge_y-1, width+2, 8, COLOR2) contents.gradient_fill_rect(x, gauge_y, width, 6, COLOR3, COLOR4) contents.gradient_fill_rect(x, gauge_y, fill_w, 6, color1, color2) else adj1 = style_adj_string(style[0]); adj2 = style_adj_string(style[1], true) h += 4 for i in 0...h a1 = eval(adj1[0]); a2 = eval(adj2[0]) a3 = adj1[2]; a4 = adj2[4].nil? ? adj2[2] : adj2[4] contents.fill_rect(x-a3 +a1, gauge_y-2 + i, width+(a3+a4) - a1 - a2, 1, COLOR1) end h -= 2 for i in 0...h a1 = eval(adj1[0]); a2 = eval(adj2[0]) a3 = adj1[1]; a4 = adj2[3].nil? ? adj2[1] : adj2[3] contents.fill_rect(x-a3 +a1, gauge_y-1 + i, width+(a3+a4) - a1 - a2, 1, COLOR2) end h -= 2 for i in 0...h a1 = eval(adj1[0]); a2 = eval(adj2[0]) contents.gradient_fill_rect(x +a1, gauge_y +i, width - a1 - a2, 1, COLOR3, COLOR4) end for i in 0...h a1 = eval(adj1[0]); a2 = eval(adj2[0]) contents.gradient_fill_rect(x +a1, gauge_y +i, fill_w - a1 - a2, 1, color1, color2) end end end #-------------------------------------------------------------------------- # * Get Style Specific Adjustment Array # sym : edge style '(', ')', '<', '>', '|', '/' or '\' # edge : end of the gauge? # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Returns an array containing the following: # * a formular string to be evaluated # * adjustments to x and width values for Outer and Inner Borders #-------------------------------------------------------------------------- def style_adj_string(sym, edge = false) case sym when '/' SLANTDSIZE ? [(edge ? 'i+2' : '(h+1) - i'), 3, 5] : [(edge ? 'i' : '(h-1) - i'), 3, 5] when '\\' SLANTDSIZE ? [(edge ? '(h+1) - i' : 'i+2'), 3, 5] : [(edge ? '(h-1) - i' : 'i'), 3, 5] when '<' [(edge ? '(h/2)-((h/2) - i).abs' : '((h/2) - i).abs'), 2, 3] when '>' [(edge ? '((h/2) - i).abs' : '(h/2)-((h/2) - i).abs'), 2, 3] when '(' [(edge ? '((h/2) * Math.sin(i * 1.0 * Math::PI / (h-1))).round.to_i' : '(h-6) - ((h/2) * Math.sin(i * 1.0 * Math::PI / (h-1))).round.to_i'), THICKCURVED ? 3 : 2, THICKCURVED ? 5 : 4, 3, 5] when ')' [(edge ? '(h-3) - ((h/2) * Math.sin(i * 1.0 * Math::PI / (h-1))).round.to_i' : '((h/2) * Math.sin(i * 1.0 * Math::PI / (h-1))).round.to_i'), 3, 5, THICKCURVED ? 3 : 2, THICKCURVED ? 5 : 4] else # eg. | or invalid sym ['0', 1, 2] end end #-------------------------------------------------------------------------- # * Draw Gauge #-------------------------------------------------------------------------- def draw_gauge(x, y, width, rate, color1, color2, style = '') r = [rate, 1.0].min draw_syvkal_gauge(x, y, width, r, color1, color2, style) endend#==============================================================================# ** Game_BattlerBase#------------------------------------------------------------------------------# Added specialised 'params_rate' function.#==============================================================================class Game_BattlerBase #-------------------------------------------------------------------------- # * Get Percentage of Paramaters #-------------------------------------------------------------------------- def params_rate(param_id) return [param(param_id).to_f / P_MAX, 1.0].min endend#==============================================================================# ** Script Import#============================================================================== $imported = {} if $imported == nil $imported["Syvkal's Menu Bars"] = true
×