def mvBgm(bgm)
name = bgm.name
p name
path = "Audio/BGM/" + name + ".ogg"
exist = File.exist?(path)
if !exist
ori = $rootDir + path
if File.exist?(ori)
p ori
File.rename(ori,path)
end
end
end
def mvImg(img)
path1 = img+".png"
path2 = img+".jpg"
exist = File.exist?(path1) || File.exist?(path2)
if !exist
ori1 = $rootDir + path1
ori2 = $rootDir + path2
if File.exist?(ori1)
File.rename(ori1,path1)
elsif File.exist?(ori2)
file.rename(ori2,path2)
end
end
end
module Cache
def self.normal_bitmap(path)
mvImg(path)
@cache[path] = Bitmap.new(path) unless include?(path)
@cache[path]
end
end
class Game_Map
def autoplay
if @map.autoplay_bgm
mvBgm(@map.bgm)
end
@map.bgm.play if @map.autoplay_bgm
@map.bgs.play if @map.autoplay_bgs
end
end
module BattleManager
def self.play_battle_bgm
mvBgm($game_system.battle_bgm)
$game_system.battle_bgm.play
RPG::BGS.stop
end