ghost和center透明度可调,部分设置值域改为[0%,100%],控件交互优化,滑条显示当前值

This commit is contained in:
MrZ626
2020-08-27 03:52:13 +08:00
parent f6ff36c142
commit b9722dcca1
14 changed files with 198 additions and 144 deletions

View File

@@ -3,7 +3,7 @@ local rem=table.remove
local function fadeOut(id)
local src=BGM.list[id]
local v=src:getVolume()-.025*setting.bgm*.01
local v=src:getVolume()-.025*setting.bgm
src:setVolume(v>0 and v or 0)
if v<=0 then
src:stop()
@@ -12,10 +12,10 @@ local function fadeOut(id)
end
local function fadeIn(id)
local src=BGM.list[id]
local v=setting.bgm*.01
local v=setting.bgm
v=min(v,src:getVolume()+.025*v)
src:setVolume(v)
if v>=setting.bgm*.01 then return true end
if v>=setting.bgm then return true end
end
local BGM={
@@ -68,7 +68,7 @@ function BGM.play(s)
end
function BGM.freshVolume()
if BGM.playing then
local v=setting.bgm*.01
local v=setting.bgm
if v>0 then
BGM.playing:setVolume(v)
if BGM.suspend then
@@ -76,9 +76,10 @@ function BGM.freshVolume()
BGM.nowPlay,BGM.suspend=BGM.suspend
end
else
BGM.playing:setVolume(0)
BGM.playing:pause()
BGM.suspend,BGM.nowPlay=BGM.nowPlay
if BGM.nowPlay then
BGM.playing:pause()
BGM.suspend,BGM.nowPlay=BGM.nowPlay
end
end
end
end