Script Name:Optional Battle Music
Author:Sandgolem
Version:2
Number Of Scripts:1
Description:No Description
Screenshots:None
Instructions:For best results place somewhere under Scene_Debug, the SDK & any audio system rewrites if you're using them. This RMXP script aliases the following:
Game_System bgm_play
Game_System bgm_stop
Scene_Map call_battle
Frequently Asked Questions:None
Script:
CODE
#==========================================================================
# ** SG Optional Battle Music
#==========================================================================
# by sandgolem
# Version 2
# January 15th, 2008
#==========================================================================
module SG
OptBatMusicSwitch = 1
end
#==========================================================================
if Object.const_defined?('SDK')
SDK.log('SG Optional Battle Music', 'sandgolem', 2, '15.01.08')
@sg_nobattlebgm_disabled = true if !SDK.enabled?('SG Optional Battle Music')
end
if !@sg_nobattlebgm_disabled
#--------------------------------------------------------------------------
class Game_System
alias_method :sg_optionalbatbgm_play, :bgm_play
def bgm_play(bgm)
sg_optionalbatbgm_play(bgm) if !$sg_temporary_keepmusic
end
alias_method :sg_optionalbatbgm_stop, :bgm_stop
def bgm_stop
sg_optionalbatbgm_stop if !$sg_temporary_keepmusic
end
end
class Scene_Map
alias_method :sg_optionalbatbgm_callbattle, :call_battle
def call_battle
$sg_temporary_keepmusic = true if $game_switches[SG::OptBatMusicSwitch]
sg_optionalbatbgm_callbattle
$sg_temporary_keepmusic = nil
end
end
$sg_temporary_keepmusic = nil
#--------------------------------------------------------------------------
end