draw_gauge(rect.x + 47, rect.y+20, 50, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
draw_gauge(rect.x + 42, rect.y+24, 50, actor.mp_rate, mp_gauge_color1, mp_gauge_color2)
if Saba::KisekiStatus::SHOW_TP
draw_gauge(rect.x + 37, rect.y+28, 50, actor.tp_rate, tp_gauge_color1, tp_gauge_color2)
end
@last_hps.push(actor.hp_rate)
@last_mps.push(actor.mp_rate)
@last_tps.push(actor.tp_rate)
end
#--------------------------------------------------------------------------
# ● 顔画像の端を消します
#--------------------------------------------------------------------------
def clear_edge(bitmap)
22.times { |i|
bitmap.clear_rect(0, i, 22 - i, 1)
bitmap.clear_rect(26 + i, i, 22 - i, 1)
bitmap.clear_rect(0, i + 26, i, 1)
bitmap.clear_rect(48 - i, i + 26, i, 1)
}
end
#--------------------------------------------------------------------------
# ● ゲージの描画
# rate : 割合(1.0 で満タン)
# color1 : グラデーション 左端
# color2 : グラデーション 右端
#--------------------------------------------------------------------------
def draw_gauge(x, y, width, rate, color1, color2)
fill_w = (width * rate).to_i
gauge_y = y + line_height - 8
contents.fill_rect(x-2, gauge_y-1, width+4, 4, text_color(15))
contents.fill_rect(x-1, gauge_y-2, width+2, 6, text_color(15))
contents.fill_rect(x, gauge_y, width, 2, gauge_back_color)
contents.gradient_fill_rect(x, gauge_y, fill_w, 2, color1, color2)
end
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
def update
super
if $game_switches[Saba::KisekiStatus::INVISIBLE_SWITCH] == true &&
! $game_message.busy? && ! $game_message.visible
self.visible = true
else
self.visible = false
return
end
hps = []
mps = []
tps = []
for actor in $game_party.battle_members
hps.push(actor.hp_rate)
mps.push(actor.mp_rate)
tps.push(actor.tp_rate)
end
if @last_hps != hps || @last_mps != mps || @last_tps != tps
refresh
end
end
end
class Scene_Map
#--------------------------------------------------------------------------
# ● 全ウィンドウの作成
#--------------------------------------------------------------------------
alias saba_kiseki_status_create_all_windows create_all_windows
def create_all_windows
saba_kiseki_status_create_all_windows
@kiseki_status_window = Window_KisekiStatus.new
end
end