fix many warnings (#889)

* fix many warnings

some of them can be solved by using a prototype-based system
maybe I can try to use some of these systems to reform backgrounds...

* Update app_mahjong.lua

---------

Co-authored-by: MrZ_26 <1046101471@qq.com>
This commit is contained in:
Imple Lee
2023-05-03 00:27:54 +08:00
committed by GitHub
parent 7dd73ef8d3
commit fe29cc532d
15 changed files with 15 additions and 19 deletions

View File

@@ -334,7 +334,7 @@ SKIN.load{
SFX.init((function()--[Warning] Not loading files here, just get the list of sound needed
local L={}
for _,v in next,fs.getDirectoryItems('media/effect/chiptune/') do
if FILE.isSafe('media/effect/chiptune/'..v,"Dangerous file : %SAVE%/media/effect/chiptune/"..v) then
if FILE.isSafe('media/effect/chiptune/'..v) then
table.insert(L,v:sub(1,-5))
end
end
@@ -343,7 +343,7 @@ end)())
BGM.init((function()
local L={}
for _,v in next,fs.getDirectoryItems('media/music') do
if FILE.isSafe('media/music/'..v,"Dangerous file : %SAVE%/media/music/"..v) then
if FILE.isSafe('media/music/'..v) then
L[v:sub(1,-5)]='media/music/'..v
end
end

View File

@@ -5,7 +5,6 @@ local t
function back.init()
t=math.random()*2600
BG.resize(SCR.w,SCR.h)
end
function back.update(dt)
t=(t+dt)%6200

View File

@@ -5,7 +5,6 @@ local shader=SHADER.grad2
local t
function back.init()
t=math.random()*2600
BG.resize(nil,SCR.h)
end
function back.update(dt)
t=(t+dt)%6200

View File

@@ -5,7 +5,6 @@ local shader=SHADER.rgb1
local t
function back.init()
t=math.random()*2600
BG.resize(SCR.w,SCR.h)
end
function back.update(dt)
t=(t+dt)%6200

View File

@@ -5,7 +5,6 @@ local shader=SHADER.rgb2
local t
function back.init()
t=math.random()*2600
BG.resize(SCR.w,SCR.h)
end
function back.update(dt)
t=(t+dt)%6200

View File

@@ -92,7 +92,7 @@ function BOT.new(P,data)
P:setHold(1)
end
local cc=cc or REQUIRE"CCloader"
local cc=REQUIRE"CCloader"
if not cc then
data.type=false
return BOT.new(P,data)

View File

@@ -6,6 +6,6 @@ return {
PLY.draw.applyField(P)
GC.setColor(1,1,1,.1)
GC.draw(IMG.electric,0,106,0,2.6)
PLY.draw.cancelField(P)
PLY.draw.cancelField()
end,
}

View File

@@ -64,7 +64,7 @@ return {
end
end end
end
PLY.draw.cancelField(P)
PLY.draw.cancelField()
end,
task=function(P)
P.modeData.rankPts=1

View File

@@ -9,7 +9,7 @@ return {
GC.setColor(1,.3,.3,.5-i*.04)
GC.rectangle('fill',30*L[i]-30,0,30,600)
end
PLY.draw.cancelField(P)
PLY.draw.cancelField()
end,
hook_drop=function(P)
local C=P.lastPiece

View File

@@ -8,7 +8,7 @@ return {
PLY.draw.applyField(P)
GC.setColor(1,.3,.3,.2)
GC.rectangle('fill',30*L[1]-30,0,30,600)
PLY.draw.cancelField(P)
PLY.draw.cancelField()
end
end,
hook_drop=function(P)

View File

@@ -9,7 +9,7 @@ return {
GC.setColor(1,.3,.3,.4-i*.05)
GC.rectangle('fill',30*L[i]-30,0,30,600)
end
PLY.draw.cancelField(P)
PLY.draw.cancelField()
end,
hook_drop=function(P)
local C=P.lastPiece

View File

@@ -46,7 +46,7 @@ return {
end
end end
end
PLY.draw.cancelField(P)
PLY.draw.cancelField()
end,
},
load=function()

View File

@@ -2779,7 +2779,7 @@ function Player:revive()
self.b2b=0
for i=1,h do
self:createClearingFX(i,1.5)
self:createClearingFX(i)
end
SYSFX.newShade(1.4,self.fieldX,self.fieldY,300*self.size,610*self.size)
SYSFX.newRectRipple(2,self.fieldX,self.fieldY,300*self.size,610*self.size)

View File

@@ -124,9 +124,9 @@ end
function scene.mouseDown()
_throwCard()
end
function scene.touchMove(x,y) scene.mouseMove(x,y) end
function scene.touchDown(x,y) scene.mouseMove(x,y) end
function scene.touchClick(x,y) scene.mouseDown(x,y) end
scene.touchMove=scene.mouseMove
scene.touchDown=scene.mouseMove
scene.touchClick=scene.mouseDown
function scene.keyDown(key)
if key=='left' then
if selected then

View File

@@ -118,12 +118,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; applySettings(SETTING.blockSatur) end
code=function(v) SETTING.blockSatur=v; applySettings() 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; applySettings(SETTING.fieldSatur) end
code=function(v) SETTING.fieldSatur=v; applySettings() end
},
WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,sound='back',font=60,fText=CHAR.icon.back,code=backScene},