关闭背景时亮度可调

新增自定义图片背景功能(可调透明度,目前仅电脑可用)
This commit is contained in:
MrZ626
2021-11-28 03:55:57 +08:00
parent 0be2eb9107
commit be54c0e641
15 changed files with 135 additions and 28 deletions

View File

@@ -108,8 +108,32 @@ do--function applyBlockSatur,applyFieldSatur(mode)
SHADER.fieldSatur:send('k',m[2])
end
end
function applyBG()
if SETTING.bg=='on'then
BG.unlock()
BG.set()
elseif SETTING.bg=='off'then
BG.unlock()
BG.set('gray')
BG.send(SETTING.bgAlpha)
BG.lock()
elseif SETTING.bg=='custom'then
if love.filesystem.getInfo('conf/customBG')then
BG.unlock()
BG.set('custom')
gc.setDefaultFilter('linear','linear')
local image=gc.newImage(love.filesystem.newFile('conf/customBG'))
gc.setDefaultFilter('nearest','nearest')
BG.send(SETTING.bgAlpha,image)
BG.lock()
else
SETTING.bg='off'
applyBG()
end
end
end
function applyAllSettings()
love.window.setFullscreen(SETTING.fullscreen)
applyFullscreen()
love.audio.setVolume(SETTING.mainVol)
VK.setShape(SETTING.VKSkin)
BGM.setVol(SETTING.bgm)
@@ -119,6 +143,7 @@ function applyAllSettings()
applyFieldSatur(SETTING.fieldSatur)
applyLanguage()
applyCursor()
applyBG()
end
--Royale mode