涉及框架的设置项统一应用,不再细分时机
修改errData的获得方式 WIDGET新增setOnChange方法,不再依赖THEME
This commit is contained in:
23
main.lua
23
main.lua
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user