修复一些背景相关问题,框架跟进

This commit is contained in:
MrZ_26
2022-03-31 16:57:57 +08:00
parent 5f539a2d4f
commit 5e8af423f2
7 changed files with 16 additions and 15 deletions

View File

@@ -180,7 +180,7 @@ Z.setOnFnKeys({
end
end
end,
function()print(WIDGET.getSelected()or"no widget selected")end,
function()print(BG.locked)end,
function()for k,v in next,_G do print(k,v)end end,
function()if love['_openConsole']then love['_openConsole']()end end,
})

View File

@@ -165,17 +165,15 @@ do--function applySettings()
BG.set()
elseif SETTING.bg=='off'then
BG.unlock()
BG.set('fixColor')
BG.send(SETTING.bgAlpha,SETTING.bgAlpha,SETTING.bgAlpha)
BG.set('fixColor',SETTING.bgAlpha,SETTING.bgAlpha,SETTING.bgAlpha)
BG.lock()
elseif SETTING.bg=='custom'then
if love.filesystem.getInfo('conf/customBG')then
local res,image=pcall(gc.newImage,love.filesystem.newFile('conf/customBG'))
if res then
BG.unlock()
BG.set('custom')
gc.setDefaultFilter('linear','linear')
BG.send(SETTING.bgAlpha,image)
BG.set('custom',SETTING.bgAlpha,image)
gc.setDefaultFilter('nearest','nearest')
BG.lock()
else
@@ -184,8 +182,7 @@ do--function applySettings()
else--Switch off when custom BG not found
SETTING.bg='off'
BG.unlock()
BG.set('fixColor')
BG.send(SETTING.bgAlpha,SETTING.bgAlpha,SETTING.bgAlpha)
BG.set('fixColor',SETTING.bgAlpha,SETTING.bgAlpha,SETTING.bgAlpha)
BG.lock()
end
end

View File

@@ -199,8 +199,7 @@ local scene={}
function scene.sceneInit()
reset()
BG.set('fixColor')
BG.send(.26,.26,.26)
BG.set('fixColor',.26,.26,.26)
BGM.play(bgm)
end

View File

@@ -106,8 +106,7 @@ end
local scene={}
function scene.sceneInit()
BG.set('fixColor')
BG.send(.26,.62,.26)
BG.set('fixColor',.26,.62,.26)
_newGame()
selected=false
end

View File

@@ -12,8 +12,7 @@ function scene.sceneInit()
lastKey=nil
speed=0
keyTime={}for i=1,40 do keyTime[i]=-1e99 end
BG.set('fixColor')
BG.send(.26,.26,.26)
BG.set('fixColor',.26,.26,.26)
BGM.play('push')
end

View File

@@ -97,7 +97,14 @@ scene.widgetList={
},
WIDGET.newSlider{name='bgAlpha', x=1020,y=1430,w=200,
axis={0,.8},disp=SETval('bgAlpha'),
code=function(v)SETTING.bgAlpha=v BG.send(v,v,v)end,
code=function(v)
SETTING.bgAlpha=v
if BG.cur=='fixColor' then
BG.send(v,v,v)
else
BG.send(v)
end
end,
hideF=function()return SETTING.bg=='on'end
},