涉及框架的设置项统一应用,不再细分时机

修改errData的获得方式
WIDGET新增setOnChange方法,不再依赖THEME
This commit is contained in:
MrZ626
2021-12-16 12:39:42 +08:00
parent 8e075adf8f
commit 9c8c9f2106
10 changed files with 120 additions and 103 deletions

View File

@@ -9,9 +9,9 @@ local scene={}
function scene.sceneInit()
BGcolor=rnd()>.026 and{.3,.5,.9}or{.62,.3,.926}
sysAndScn=SYSTEM.."-"..VERSION.string.." scene:"..Z.errData[#Z.errData].scene
sysAndScn=SYSTEM.."-"..VERSION.string.." scene:"..Z.getErrData('#').scene
errorText=LOADED and text.errorMsg or"An error has occurred while the game was loading.\nAn error log has been created so you can send it to the author."
errorShot,errorInfo=Z.errData[#Z.errData].shot,Z.errData[#Z.errData].mes
errorShot,errorInfo=Z.getErrData('#').shot,Z.getErrData('#').mes
NET.wsclose_app()
NET.wsclose_user()
NET.wsclose_play()

View File

@@ -42,7 +42,7 @@ end
local function _setLang(lid)
SETTING.locale=lid
applyLanguage()
applySettings()
TEXT.clear()
TEXT.show(langList[lid],640,360,100,'appear',.626)
collectgarbage()

View File

@@ -59,7 +59,7 @@ scene.widgetList={
local D=_parseCB()
if D then
TABLE.update(D,SETTING)
applyAllSettings()
applySettings()
saveSettings()
MES.new('check',text.importSuccess)
else

View File

@@ -45,7 +45,7 @@ scene.widgetList={
WIDGET.newSlider{name='reTime', x=330, y=320, w=300,lim=180,unit=10,disp=SETval('reTime'), code=SETsto('reTime'),show=function(S)return(.5+S.disp()*.25).."s"end},
WIDGET.newSelector{name='RS', x=300, y=420, w=300,color='S', disp=SETval('RS'), code=SETsto('RS'),list={'TRS','SRS','SRS_plus','SRS_X','BiRS','ARS_Z','DRS_weak','ASC','ASC_plus','C2','C2_sym','Classic','Classic_plus','None','None_plus'}},
WIDGET.newSelector{name='menuPos',x=980, y=320, w=300,color='O', disp=SETval('menuPos'), code=SETsto('menuPos'),list={'left','middle','right'}},
WIDGET.newSwitch{name='sysCursor',x=1060, y=390, lim=580, disp=SETval('sysCursor'),code=function()SETTING.sysCursor=not SETTING.sysCursor applyCursor()end},
WIDGET.newSwitch{name='sysCursor',x=1060, y=390, lim=580, disp=SETval('sysCursor'),code=function()SETTING.sysCursor=not SETTING.sysCursor applySettings()end},
WIDGET.newSwitch{name='autoPause',x=1060, y=450, lim=580, disp=SETval('autoPause'),code=SETrev('autoPause')},
WIDGET.newSwitch{name='autoSave', x=1060, y=500, lim=580, disp=SETval('autoSave'), code=SETrev('autoSave')},
WIDGET.newSwitch{name='autoLogin',x=960, y=580, lim=480, disp=SETval('autoLogin'),code=SETrev('autoLogin')},

View File

@@ -11,7 +11,7 @@ function scene.fileDropped(file)
if pcall(gc.newImage,file)then
love.filesystem.write('conf/customBG',file:read('data'))
SETTING.bg='custom'
applyBG()
applySettings()
else
MES.new('error',text.customBGloadFailed)
end
@@ -79,18 +79,18 @@ scene.widgetList={
WIDGET.newSwitch{name='highCam', x=450,y=1270,lim=360,disp=SETval('highCam'), code=SETrev('highCam')},
WIDGET.newSwitch{name='warn', x=450,y=1340,lim=360,disp=SETval('warn'), code=SETrev('warn')},
WIDGET.newSwitch{name='clickFX', x=950,y=980,lim=360,disp=SETval('clickFX'), code=SETrev('clickFX')},
WIDGET.newSwitch{name='power', x=950,y=1070,lim=360,disp=SETval('powerInfo'), code=function()SETTING.powerInfo=not SETTING.powerInfo Z.setPowerInfo(SETTING.powerInfo)end},
WIDGET.newSwitch{name='clean', x=950,y=1160,lim=360,disp=SETval('cleanCanvas'), code=function()SETTING.cleanCanvas=not SETTING.cleanCanvas Z.setCleanCanvas(SETTING.cleanCanvas)end},
WIDGET.newSwitch{name='fullscreen', x=950,y=1250,lim=360,disp=SETval('fullscreen'), code=function()SETTING.fullscreen=not SETTING.fullscreen applyFullscreen()end},
WIDGET.newSwitch{name='clickFX', x=950,y=980,lim=360,disp=SETval('clickFX'), code=function()SETTING.clickFX=not SETTING.clickFX applySettings()end},
WIDGET.newSwitch{name='power', x=950,y=1070,lim=360,disp=SETval('powerInfo'), code=function()SETTING.powerInfo=not SETTING.powerInfo applySettings()end},
WIDGET.newSwitch{name='clean', x=950,y=1160,lim=360,disp=SETval('cleanCanvas'), code=function()SETTING.cleanCanvas=not SETTING.cleanCanvas applySettings()end},
WIDGET.newSwitch{name='fullscreen', x=950,y=1250,lim=360,disp=SETval('fullscreen'), code=function()SETTING.fullscreen=not SETTING.fullscreen applySettings()end},
WIDGET.newKey{name='bg_on', x=680,y=1340,w=200,h=80,code=function()SETTING.bg='on'applyBG()end},
WIDGET.newKey{name='bg_off', x=900,y=1340,w=200,h=80,code=function()SETTING.bg='off'applyBG()end},
WIDGET.newKey{name='bg_on', x=680,y=1340,w=200,h=80,code=function()SETTING.bg='on'applySettings()end},
WIDGET.newKey{name='bg_off', x=900,y=1340,w=200,h=80,code=function()SETTING.bg='off'applySettings()end},
WIDGET.newKey{name='bg_custom', x=1120,y=1340,w=200,h=80,
code=function()
if love.filesystem.getInfo('conf/customBG')then
SETTING.bg='custom'
applyBG()
applySettings()
else
MES.new('info',text.customBGhelp)
end
@@ -105,12 +105,12 @@ scene.widgetList={
WIDGET.newSelector{name='blockSatur', x=800,y=1440,w=300,color='lN',
list={'normal','soft','gray','light','color'},
disp=SETval('blockSatur'),
code=function(v)SETTING.blockSatur=v;applyBlockSatur(SETTING.blockSatur)end
code=function(v)SETTING.blockSatur=v;applySettings(SETTING.blockSatur)end
},
WIDGET.newSelector{name='fieldSatur', x=800,y=1540,w=300,color='lN',
list={'normal','soft','gray','light','color'},
disp=SETval('fieldSatur'),
code=function(v)SETTING.fieldSatur=v;applyFieldSatur(SETTING.fieldSatur)end
code=function(v)SETTING.fieldSatur=v;applySettings(SETTING.fieldSatur)end
},
WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,sound='back',font=60,fText=CHAR.icon.back,code=backScene},