取消静音按钮,添加总音量滑条
This commit is contained in:
@@ -23,6 +23,7 @@ function saveSettings()
|
|||||||
end
|
end
|
||||||
function applySettings()
|
function applySettings()
|
||||||
love.window.setFullscreen(SETTING.fullscreen)
|
love.window.setFullscreen(SETTING.fullscreen)
|
||||||
|
love.audio.setVolume(SETTING.mainVol)
|
||||||
LANG.set(SETTING.lang)
|
LANG.set(SETTING.lang)
|
||||||
VK.setShape(SETTING.VKSkin)
|
VK.setShape(SETTING.VKSkin)
|
||||||
applyBlockSatur(SETTING.blockSatur)
|
applyBlockSatur(SETTING.blockSatur)
|
||||||
|
|||||||
@@ -301,6 +301,7 @@ SETTING={--Settings
|
|||||||
warn=true,
|
warn=true,
|
||||||
|
|
||||||
--Sound
|
--Sound
|
||||||
|
mainVol=1,
|
||||||
sfx=1,
|
sfx=1,
|
||||||
sfx_spawn=0,
|
sfx_spawn=0,
|
||||||
sfx_warn=.4,
|
sfx_warn=.4,
|
||||||
|
|||||||
@@ -375,6 +375,7 @@ return{
|
|||||||
game="←Game",
|
game="←Game",
|
||||||
graphic="Video→",
|
graphic="Video→",
|
||||||
|
|
||||||
|
mainVol="Main Volume",
|
||||||
bgm="BGM",
|
bgm="BGM",
|
||||||
sfx="SFX",
|
sfx="SFX",
|
||||||
stereo="Stereo",
|
stereo="Stereo",
|
||||||
|
|||||||
@@ -340,6 +340,7 @@ return{
|
|||||||
game="←Juego",
|
game="←Juego",
|
||||||
graphic="Video→",
|
graphic="Video→",
|
||||||
|
|
||||||
|
-- mainVol="Main Volume",
|
||||||
bgm="BGM",
|
bgm="BGM",
|
||||||
sfx="SFX",
|
sfx="SFX",
|
||||||
stereo="Estéreo",
|
stereo="Estéreo",
|
||||||
|
|||||||
@@ -339,6 +339,7 @@ return{
|
|||||||
game="←Jeu",
|
game="←Jeu",
|
||||||
graphic="Vidéo→",
|
graphic="Vidéo→",
|
||||||
|
|
||||||
|
-- mainVol="Main Volume",
|
||||||
bgm="Musique",
|
bgm="Musique",
|
||||||
sfx="Sons",
|
sfx="Sons",
|
||||||
stereo="Stéréo",
|
stereo="Stéréo",
|
||||||
|
|||||||
@@ -363,6 +363,7 @@ return{
|
|||||||
game="←Jogo",
|
game="←Jogo",
|
||||||
graphic="Vídeo→",
|
graphic="Vídeo→",
|
||||||
|
|
||||||
|
-- mainVol="Main Volume",
|
||||||
bgm="BGM",
|
bgm="BGM",
|
||||||
sfx="SFX",
|
sfx="SFX",
|
||||||
stereo="Stereo",
|
stereo="Stereo",
|
||||||
|
|||||||
@@ -257,6 +257,7 @@ return{
|
|||||||
game="←Game",
|
game="←Game",
|
||||||
graphic="Video→",
|
graphic="Video→",
|
||||||
|
|
||||||
|
mainVol="#_#",
|
||||||
bgm="#~#",
|
bgm="#~#",
|
||||||
sfx="#!#",
|
sfx="#!#",
|
||||||
stereo="←~→",
|
stereo="←~→",
|
||||||
|
|||||||
@@ -100,6 +100,7 @@ return{
|
|||||||
game="←游戏设置",
|
game="←游戏设置",
|
||||||
graphic="改画面→",
|
graphic="改画面→",
|
||||||
|
|
||||||
|
mainVol="总",
|
||||||
bgm="曲",
|
bgm="曲",
|
||||||
spawn="出块",
|
spawn="出块",
|
||||||
warn="警告",
|
warn="警告",
|
||||||
|
|||||||
@@ -374,6 +374,7 @@ return{
|
|||||||
game="←游戏设置",
|
game="←游戏设置",
|
||||||
graphic="画面设置→",
|
graphic="画面设置→",
|
||||||
|
|
||||||
|
mainVol="总音量",
|
||||||
bgm="音乐",
|
bgm="音乐",
|
||||||
sfx="音效",
|
sfx="音效",
|
||||||
stereo="立体声",
|
stereo="立体声",
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ local sin=math.sin
|
|||||||
local rnd=math.random
|
local rnd=math.random
|
||||||
|
|
||||||
local scene={}
|
local scene={}
|
||||||
local soundBeforeMute
|
|
||||||
|
|
||||||
local last--Last touch time
|
local last--Last touch time
|
||||||
local jump--Animation timer(10 to 0)
|
local jump--Animation timer(10 to 0)
|
||||||
@@ -76,29 +75,15 @@ scene.widgetList={
|
|||||||
WIDGET.newButton{name="game", x=200, y=80,w=240,h=80,color='lC',font=35,code=swapScene('setting_game','swipeR')},
|
WIDGET.newButton{name="game", x=200, y=80,w=240,h=80,color='lC',font=35,code=swapScene('setting_game','swipeR')},
|
||||||
WIDGET.newButton{name="graphic",x=1080,y=80,w=240,h=80,color='lC',font=35,code=swapScene('setting_video','swipeL')},
|
WIDGET.newButton{name="graphic",x=1080,y=80,w=240,h=80,color='lC',font=35,code=swapScene('setting_video','swipeL')},
|
||||||
|
|
||||||
WIDGET.newSlider{name="bgm", x=300, y=190,w=420,color='lG',disp=SETval('bgm'),code=function(v)SETTING.bgm=v BGM.freshVolume()end},
|
WIDGET.newSlider{name="mainVol",x=300, y=170,w=520,color='lG',disp=SETval('mainVol'),code=function(v)SETTING.mainVol=v love.audio.setVolume(SETTING.mainVol)end},
|
||||||
WIDGET.newSlider{name="sfx", x=300, y=260,w=420,color='lC',change=function()SFX.play('blip_1')end,disp=SETval('sfx'),code=SETsto('sfx')},
|
WIDGET.newSlider{name="bgm", x=300, y=240,w=420,color='lG',disp=SETval('bgm'),code=function(v)SETTING.bgm=v BGM.freshVolume()end},
|
||||||
WIDGET.newSlider{name="stereo", x=300, y=330,w=420,color='lC',change=function()SFX.play('move',1,-1)SFX.play('lock',1,1)end,disp=SETval('stereo'),code=SETsto('stereo'),hideF=function()return SETTING.sx==0 end},
|
WIDGET.newSlider{name="sfx", x=300, y=310,w=420,color='lC',change=function()SFX.play('blip_1')end,disp=SETval('sfx'),code=SETsto('sfx')},
|
||||||
WIDGET.newSlider{name="spawn", x=300, y=400,w=420,color='lC',change=function()SFX.fplay('spawn_'..math.random(7),SETTING.sfx_spawn)end,disp=SETval('sfx_spawn'),code=SETsto('sfx_spawn')},
|
WIDGET.newSlider{name="stereo", x=300, y=380,w=420,color='lC',change=function()SFX.play('move',1,-1)SFX.play('lock',1,1)end,disp=SETval('stereo'),code=SETsto('stereo'),hideF=function()return SETTING.sx==0 end},
|
||||||
WIDGET.newSlider{name="warn", x=300, y=470,w=420,color='lC',change=function()SFX.fplay('warning',SETTING.sfx_warn)end,disp=SETval('sfx_warn'),code=SETsto('sfx_warn')},
|
WIDGET.newSlider{name="spawn", x=300, y=450,w=420,color='lC',change=function()SFX.fplay('spawn_'..math.random(7),SETTING.sfx_spawn)end,disp=SETval('sfx_spawn'),code=SETsto('sfx_spawn')},
|
||||||
WIDGET.newSlider{name="vib", x=300, y=540,w=420,color='lN',unit=10,change=function()VIB(2)end,disp=SETval('vib'),code=SETsto('vib')},
|
WIDGET.newSlider{name="warn", x=300, y=520,w=420,color='lC',change=function()SFX.fplay('warning',SETTING.sfx_warn)end,disp=SETval('sfx_warn'),code=SETsto('sfx_warn')},
|
||||||
WIDGET.newSlider{name="voc", x=300, y=610,w=420,color='lN',change=function()VOC.play('test')end,disp=SETval('voc'),code=SETsto('voc')},
|
WIDGET.newSlider{name="vib", x=300, y=590,w=420,color='lN',unit=10,change=function()VIB(2)end,disp=SETval('vib'),code=SETsto('vib')},
|
||||||
|
WIDGET.newSlider{name="voc", x=300, y=660,w=420,color='lN',change=function()VOC.play('test')end,disp=SETval('voc'),code=SETsto('voc')},
|
||||||
|
|
||||||
WIDGET.newKey{name="mute", x=1160,y=180,w=80,color='lR',fText=TEXTURE.mute,
|
|
||||||
code=function()
|
|
||||||
if SETTING.sfx+SETTING.sfx_spawn+SETTING.sfx_warn+SETTING.bgm+SETTING.vib+SETTING.voc==0 then
|
|
||||||
if not soundBeforeMute then
|
|
||||||
soundBeforeMute={1,0,.4,.7,0,0}
|
|
||||||
end
|
|
||||||
SETTING.sfx,SETTING.sfx_spawn,SETTING.sfx_warn,SETTING.bgm,SETTING.vib,SETTING.voc=unpack(soundBeforeMute)
|
|
||||||
soundBeforeMute=false
|
|
||||||
else
|
|
||||||
soundBeforeMute={
|
|
||||||
SETTING.sfx,SETTING.sfx_spawn,SETTING.sfx_warn,SETTING.bgm,SETTING.vib,SETTING.voc}
|
|
||||||
SETTING.sfx,SETTING.sfx_spawn,SETTING.sfx_warn,SETTING.bgm,SETTING.vib,SETTING.voc=0,0,0,0,0,0
|
|
||||||
end
|
|
||||||
BGM.freshVolume()
|
|
||||||
end},
|
|
||||||
WIDGET.newSwitch{name="fine", x=1150,y=270,disp=SETval('fine'),code=function()SETTING.fine=not SETTING.fine if SETTING.fine then SFX.play('finesseError',.6)end end},
|
WIDGET.newSwitch{name="fine", x=1150,y=270,disp=SETval('fine'),code=function()SETTING.fine=not SETTING.fine if SETTING.fine then SFX.play('finesseError',.6)end end},
|
||||||
|
|
||||||
WIDGET.newSelector{name="cv", x=1100,y=380,w=200,list={'miya','naki','xiaoya','miku'},disp=function()return cv end,code=function(i)cv=i end},
|
WIDGET.newSelector{name="cv", x=1100,y=380,w=200,list={'miya','naki','xiaoya','miku'},disp=function()return cv end,code=function(i)cv=i end},
|
||||||
|
|||||||
Reference in New Issue
Block a user