整理代码
This commit is contained in:
@@ -306,7 +306,7 @@ function love.gamepadpressed(_,i)
|
|||||||
if gamepadDown[SCN.cur]then gamepadDown[SCN.cur](i)
|
if gamepadDown[SCN.cur]then gamepadDown[SCN.cur](i)
|
||||||
elseif keyDown[SCN.cur]then keyDown[SCN.cur](keyMirror[i]or i)
|
elseif keyDown[SCN.cur]then keyDown[SCN.cur](keyMirror[i]or i)
|
||||||
elseif i=="back"then SCN.back()
|
elseif i=="back"then SCN.back()
|
||||||
else WIDGET.gamepadPressed(i)
|
else WIDGET.gamepadPressed(keyMirror[i]or i)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function love.gamepadreleased(_,i)
|
function love.gamepadreleased(_,i)
|
||||||
|
|||||||
@@ -228,7 +228,6 @@ end
|
|||||||
function key:press()
|
function key:press()
|
||||||
self.code()
|
self.code()
|
||||||
end
|
end
|
||||||
|
|
||||||
function WIDGET.newKey(D)--name,x,y,w[,h][,color][,font],code[,hide]
|
function WIDGET.newKey(D)--name,x,y,w[,h][,color][,font],code[,hide]
|
||||||
if not D.h then D.h=D.w end
|
if not D.h then D.h=D.w end
|
||||||
local _={
|
local _={
|
||||||
@@ -317,7 +316,6 @@ function switch:press()
|
|||||||
self.code()
|
self.code()
|
||||||
SFX.play("move")
|
SFX.play("move")
|
||||||
end
|
end
|
||||||
|
|
||||||
function WIDGET.newSwitch(D)--name,x,y[,font][,disp],code,hide
|
function WIDGET.newSwitch(D)--name,x,y[,font][,disp],code,hide
|
||||||
local _={
|
local _={
|
||||||
name= D.name,
|
name= D.name,
|
||||||
@@ -453,7 +451,7 @@ function slider:drag(x)
|
|||||||
self.change()
|
self.change()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function slider:release(x,y)
|
function slider:release(x)
|
||||||
self.lastTime=0
|
self.lastTime=0
|
||||||
self:drag(x)
|
self:drag(x)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user