修复一些背景相关问题,框架跟进
This commit is contained in:
Submodule Zframework updated: a91c3d67f2...559a8a46a7
2
main.lua
2
main.lua
@@ -180,7 +180,7 @@ Z.setOnFnKeys({
|
|||||||
end
|
end
|
||||||
end
|
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()for k,v in next,_G do print(k,v)end end,
|
||||||
function()if love['_openConsole']then love['_openConsole']()end end,
|
function()if love['_openConsole']then love['_openConsole']()end end,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -165,17 +165,15 @@ do--function applySettings()
|
|||||||
BG.set()
|
BG.set()
|
||||||
elseif SETTING.bg=='off'then
|
elseif SETTING.bg=='off'then
|
||||||
BG.unlock()
|
BG.unlock()
|
||||||
BG.set('fixColor')
|
BG.set('fixColor',SETTING.bgAlpha,SETTING.bgAlpha,SETTING.bgAlpha)
|
||||||
BG.send(SETTING.bgAlpha,SETTING.bgAlpha,SETTING.bgAlpha)
|
|
||||||
BG.lock()
|
BG.lock()
|
||||||
elseif SETTING.bg=='custom'then
|
elseif SETTING.bg=='custom'then
|
||||||
if love.filesystem.getInfo('conf/customBG')then
|
if love.filesystem.getInfo('conf/customBG')then
|
||||||
local res,image=pcall(gc.newImage,love.filesystem.newFile('conf/customBG'))
|
local res,image=pcall(gc.newImage,love.filesystem.newFile('conf/customBG'))
|
||||||
if res then
|
if res then
|
||||||
BG.unlock()
|
BG.unlock()
|
||||||
BG.set('custom')
|
|
||||||
gc.setDefaultFilter('linear','linear')
|
gc.setDefaultFilter('linear','linear')
|
||||||
BG.send(SETTING.bgAlpha,image)
|
BG.set('custom',SETTING.bgAlpha,image)
|
||||||
gc.setDefaultFilter('nearest','nearest')
|
gc.setDefaultFilter('nearest','nearest')
|
||||||
BG.lock()
|
BG.lock()
|
||||||
else
|
else
|
||||||
@@ -184,8 +182,7 @@ do--function applySettings()
|
|||||||
else--Switch off when custom BG not found
|
else--Switch off when custom BG not found
|
||||||
SETTING.bg='off'
|
SETTING.bg='off'
|
||||||
BG.unlock()
|
BG.unlock()
|
||||||
BG.set('fixColor')
|
BG.set('fixColor',SETTING.bgAlpha,SETTING.bgAlpha,SETTING.bgAlpha)
|
||||||
BG.send(SETTING.bgAlpha,SETTING.bgAlpha,SETTING.bgAlpha)
|
|
||||||
BG.lock()
|
BG.lock()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -199,8 +199,7 @@ local scene={}
|
|||||||
|
|
||||||
function scene.sceneInit()
|
function scene.sceneInit()
|
||||||
reset()
|
reset()
|
||||||
BG.set('fixColor')
|
BG.set('fixColor',.26,.26,.26)
|
||||||
BG.send(.26,.26,.26)
|
|
||||||
BGM.play(bgm)
|
BGM.play(bgm)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -106,8 +106,7 @@ end
|
|||||||
local scene={}
|
local scene={}
|
||||||
|
|
||||||
function scene.sceneInit()
|
function scene.sceneInit()
|
||||||
BG.set('fixColor')
|
BG.set('fixColor',.26,.62,.26)
|
||||||
BG.send(.26,.62,.26)
|
|
||||||
_newGame()
|
_newGame()
|
||||||
selected=false
|
selected=false
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -12,8 +12,7 @@ function scene.sceneInit()
|
|||||||
lastKey=nil
|
lastKey=nil
|
||||||
speed=0
|
speed=0
|
||||||
keyTime={}for i=1,40 do keyTime[i]=-1e99 end
|
keyTime={}for i=1,40 do keyTime[i]=-1e99 end
|
||||||
BG.set('fixColor')
|
BG.set('fixColor',.26,.26,.26)
|
||||||
BG.send(.26,.26,.26)
|
|
||||||
BGM.play('push')
|
BGM.play('push')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -97,7 +97,14 @@ scene.widgetList={
|
|||||||
},
|
},
|
||||||
WIDGET.newSlider{name='bgAlpha', x=1020,y=1430,w=200,
|
WIDGET.newSlider{name='bgAlpha', x=1020,y=1430,w=200,
|
||||||
axis={0,.8},disp=SETval('bgAlpha'),
|
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
|
hideF=function()return SETTING.bg=='on'end
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user