BGM模块也支持setDefault

This commit is contained in:
MrZ626
2020-12-28 22:14:02 +08:00
parent 27baab2f57
commit cb23837684
4 changed files with 8 additions and 2 deletions

View File

@@ -1,4 +1,5 @@
local BGM={
default=false,
getList={},
getCount=function()return 0 end,
play=NULL,
@@ -8,6 +9,9 @@ local BGM={
--nowPlay=[str:playing ID]
--playing=[src:playing SRC]
}
function BGM.setDefault(bgm)
BGM.default=bgm
end
function BGM.init(list)
BGM.init=nil
local min=math.min
@@ -56,6 +60,7 @@ function BGM.init(list)
BGM.loadOne=nil
function BGM.play(s)
if not s then s=BGM.default end
if SETTING.bgm==0 then
BGM.nowPlay=s
BGM.playing=Sources[s]