Last active
April 15, 2016 15:42
-
-
Save rutan/021da6af5bfd7b7a49d0d1e850bdb100 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
#=============================================================================== | |
# ■ MEをSEにすり替えさん for RGSS3 | |
#------------------------------------------------------------------------------- | |
# 2016/04/16 Ru/むっくRu | |
#------------------------------------------------------------------------------- | |
# 指定のスイッチがONのとき、MEをSEとして再生します。 | |
# MEをSEとして再生するため、BGMが途切れずに再生されます。 | |
# | |
# 音量変更スクリプトさんと併用する場合は、 | |
# このスクリプトを音量変更スクリプトさんより下に設置してください | |
#------------------------------------------------------------------------------- | |
# 【更新履歴】 | |
# 2016/04/16 おためし | |
#------------------------------------------------------------------------------- | |
#=============================================================================== | |
# ● 設定項目 | |
#=============================================================================== | |
module HZM_VXA | |
module ChangeME2SE | |
# ● MEをSEとして再生する機能をONにするスイッチのID | |
# ここで指定したIDのスイッチがONのときのみ、MEをSE扱いします | |
SWITCH_ID = 1 | |
end | |
end | |
#=============================================================================== | |
# ↑ ここまで設定 ↑ | |
# ↓ 以下、スクリプト部 ↓ | |
#=============================================================================== | |
module HZM_VXA | |
module ChangeME2SE | |
def self.enable? | |
$game_switches[SWITCH_ID] | |
end | |
end | |
end | |
class << Audio | |
#----------------------------------------------------------------------------- | |
# ● 再生:ME(エイリアス) | |
#----------------------------------------------------------------------------- | |
alias hzm_vxa_change_me2se_me_play me_play | |
def me_play(filename, volume = 100, pitch = 100) | |
if HZM_VXA::ChangeME2SE.enable? | |
if defined?(hzm_vxa_audioVol_se_play) | |
hzm_vxa_audioVol_se_play(filename, self.me_vol * volume / 100, pitch) | |
else | |
se_play(filename, volume, pitch) | |
end | |
else | |
hzm_vxa_change_me2se_me_play(filename, volume, pitch) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment