It works as far as I'm able to tell. It's always hard to test your own script because you're aware of what to do with it. Just poke me if it doesn't work.
#LoganForrests' Different MP Notations Script v1.1
#
# Platform: RPG Maker VX
#
# Date of last update : 23 March 2011
# Untested for script compatibility - let me know if there's issues
# I can be found on rmrk.net under the same name
#
# v 1.1
# Different colors can be assigned to each definition with an RGB/RGBA
# color setting
# v 1.0
# Allows actors to have their own definition for their mp pool
#
#
module LF
#Change the vocabulary used for each actor's mp
MP_VOCAB = {
# ACTOR ID => [MP Name, Red, Green, Blue, Alpha ], RGBA values between 0-255
1 => "MP",
2 => "SP",
3 => "AP",
} #DNR
#Change the color of the mp gauge for each name type
#If a type is not included (i.e. there is no match) the default gauge
#color will be used instead.
#ALPHA CHANNEL isn't necessary to be specified unless you want transparency
#Gauge color : LEFT SIDE
MP_GAUGE_COLOR_1 = {
# MP NAME => RED, GREEN, BLUE, ALPHA],
"MP" => [ 150, 0, 0],
"SP" => [ 0, 150, 0],
"AP" => [ 0, 0, 150],
}
#Gauge color : RIGHT SIDE
MP_GAUGE_COLOR_2 = {
# MP NAME => RED, GREEN, BLUE, ALPHA],
"MP" => [ 255, 0, 0],
"SP" => [ 0, 255, 0],
"AP" => [ 0, 0, 255],
}
end
class Window_Base
alias lf_mpv_draw_actor_mp draw_actor_mp
def draw_actor_mp(actor, x, y, width = 120)
mpvocab = Vocab::mp_a #set default text
if LF::MP_VOCAB.include?(actor.id)
mpvocab = LF::MP_VOCAB[actor.id] #change text if requested
end
draw_actor_mp_gauge(actor, x, y, width, mpvocab)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 30, WLH, mpvocab) #display mp text
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
alias lf_mpv_draw_actor_mp_gauge draw_actor_mp_gauge
def draw_actor_mp_gauge(actor, x, y, width = 120, type = nil)
if (LF::MP_GAUGE_COLOR_1.include?(type) && #ensure id is specified in
LF::MP_GAUGE_COLOR_2.include?(type) ) #both hashes
gw = width * actor.mp / [actor.maxmp, 1].max
gc1 = lf_mpv_gauge_color1(type)
gc2 = lf_mpv_gauge_color2(type)
self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
else #if none/only 1 is specified, run original method
lf_mpv_draw_actor_mp_gauge(actor, x, y, width)
end
end
def lf_mpv_gauge_color1(type)
r = LF::MP_GAUGE_COLOR_1[type][0]
g = LF::MP_GAUGE_COLOR_1[type][1]
b = LF::MP_GAUGE_COLOR_1[type][2]
a = LF::MP_GAUGE_COLOR_1[type][3] != nil ?
LF::MP_GAUGE_COLOR_1[type][3] : 255
return Color.new(r, g, b, a)
end
def lf_mpv_gauge_color2(type)
r = LF::MP_GAUGE_COLOR_2[type][0]
g = LF::MP_GAUGE_COLOR_2[type][1]
b = LF::MP_GAUGE_COLOR_2[type][2]
a = LF::MP_GAUGE_COLOR_1[type][3] != nil ?
LF::MP_GAUGE_COLOR_1[type][3] : 255
return Color.new(r, g, b, a)
end
end #class Window_Base
I've dated it and put the update notes on too, in case it wants to be used. Specifically if it doesn't want to work with other scripts - it's untested for compatibility because I don't use many other people's scripts whilst writing my own.