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

修改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

@@ -62,6 +62,19 @@ BGM.setMaxSources(5)
BGM.setChange(function(name)MES.new('music',text.nowPlaying..name,5)end)
VOC.setDiversion(.62)
WIDGET.setOnChange(function()
if SCN.cur~='custom_field'then
local colorList=THEME.getThemeColor()
if not colorList then return end
local rnd=math.random
for _,W in next,SCN.scenes[SCN.cur].widgetList do
if W.color then
W.color=colorList[rnd(#colorList)]
end
end
end
end)
table.insert(_LOADTIMELIST_,("Load Zframework: %.3fs"):format(TIME()-_LOADTIME_))
--Create shortcuts
@@ -125,10 +138,6 @@ end})
table.insert(_LOADTIMELIST_,("Load Parts: %.3fs"):format(TIME()-_LOADTIME_))
--Init Zframework
Z.setCleanCanvas(SETTING.cleanCanvas)
Z.setFrameMul(SETTING.frameMul)
Z.setClickFX(SETTING.clickFX)
do--Z.setCursor
local normImg=GC.DO{16,16,
{'fCirc',8,8,4},
@@ -575,7 +584,7 @@ if FIRSTLAUNCH and MOBILE then
end
--Apply system setting
applyAllSettings()
applySettings()
--Load replays
for _,fileName in next,fs.getDirectoryItems('replay')do
@@ -653,9 +662,9 @@ if TABLE.find(arg,'--test')then
TASK.new(function()
while true do
YIELD()
if Z.errData[1]then break end
if Z.getErr(1)then break end
end
LOG("\27[91m\27[1mAutomatic Test Failed :(\27[0m\nThe error message is:\n"..table.concat(Z.errData[1].mes,"\n").."\27[91m\nAborting\27[0m")
LOG("\27[91m\27[1mAutomatic Test Failed :(\27[0m\nThe error message is:\n"..table.concat(Z.getErr(1).mes,"\n").."\27[91m\nAborting\27[0m")
TEST.yieldN(60)
love.event.quit(1)
end)