BGM和BG模块设置成功(包括重复)返回true
This commit is contained in:
@@ -34,7 +34,8 @@ function BG.setDefault(bg)
|
||||
end
|
||||
function BG.set(background)
|
||||
if not background then background=BG.default end
|
||||
if not BGs[background]or background==BG.cur or not SETTING.bg then return end
|
||||
if not BGs[background]or not SETTING.bg then return end
|
||||
if background~=BG.cur then
|
||||
BG.discard()
|
||||
BG.cur=background
|
||||
background=BGs[background]
|
||||
@@ -47,4 +48,6 @@ function BG.set(background)
|
||||
BG.discard= background.discard or NULL
|
||||
BG.init()
|
||||
end
|
||||
return true
|
||||
end
|
||||
return BG
|
||||
@@ -63,9 +63,10 @@ function BGM.init(list)
|
||||
if SETTING.bgm==0 then
|
||||
BGM.nowPlay=s
|
||||
BGM.playing=Sources[s]
|
||||
return
|
||||
return true
|
||||
end
|
||||
if s and Sources[s]and BGM.nowPlay~=s then
|
||||
if s and Sources[s]then
|
||||
if BGM.nowPlay~=s then
|
||||
if BGM.nowPlay then TASK.new(fadeOut,BGM.playing)end
|
||||
TASK.removeTask_iterate(removeCurFadeOut,fadeOut,Sources[s])
|
||||
TASK.removeTask_code(fadeIn)
|
||||
@@ -75,6 +76,8 @@ function BGM.init(list)
|
||||
BGM.playing=Sources[s]
|
||||
BGM.playing:play()
|
||||
end
|
||||
return true
|
||||
end
|
||||
end
|
||||
function BGM.freshVolume()
|
||||
if BGM.playing then
|
||||
|
||||
Reference in New Issue
Block a user