修复多处全局变量泄露,整理代码
This commit is contained in:
@@ -241,7 +241,7 @@ function DATA.copyQuestArgs()
|
|||||||
end
|
end
|
||||||
do--function DATA.pasteQuestArgs(str)
|
do--function DATA.pasteQuestArgs(str)
|
||||||
local sub=string.sub
|
local sub=string.sub
|
||||||
function pasteQuestArgs(str)
|
function DATA.pasteQuestArgs(str)
|
||||||
if #str<4 then return end
|
if #str<4 then return end
|
||||||
local ENV=CUSTOMENV
|
local ENV=CUSTOMENV
|
||||||
ENV.holdCount= byte(str,1)-48
|
ENV.holdCount= byte(str,1)-48
|
||||||
|
|||||||
@@ -1604,7 +1604,7 @@ local function tick_lose(self)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function tick_autoPause()
|
local function tick_autoPause()
|
||||||
local time=0
|
local time=0
|
||||||
while true do
|
while true do
|
||||||
yield()
|
yield()
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ local function new()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
scene={}
|
local scene={}
|
||||||
|
|
||||||
function scene.sceneInit()
|
function scene.sceneInit()
|
||||||
state=0
|
state=0
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ function scene.keyDown(key)
|
|||||||
local args=STRING.split(str:sub((str:find(":")or 0)+1),"!")
|
local args=STRING.split(str:sub((str:find(":")or 0)+1),"!")
|
||||||
if #args<4 then goto THROW_fail end
|
if #args<4 then goto THROW_fail end
|
||||||
if not(
|
if not(
|
||||||
pasteQuestArgs(args[1])and
|
DATA.pasteQuestArgs(args[1])and
|
||||||
DATA.pasteSequence(args[2])and
|
DATA.pasteSequence(args[2])and
|
||||||
DATA.pasteMission(args[3])
|
DATA.pasteMission(args[3])
|
||||||
)then goto THROW_fail end
|
)then goto THROW_fail end
|
||||||
|
|||||||
@@ -194,6 +194,7 @@ local baseRankColor={
|
|||||||
{.85,.8,.3,.3},
|
{.85,.8,.3,.3},
|
||||||
{.4,.7,.4,.3},
|
{.4,.7,.4,.3},
|
||||||
}
|
}
|
||||||
|
local rankColor=rankColor
|
||||||
local function drawModeShape(M,S,drawType)
|
local function drawModeShape(M,S,drawType)
|
||||||
if M.shape==1 then--Rectangle
|
if M.shape==1 then--Rectangle
|
||||||
gc.rectangle(drawType,M.x-S,M.y-S,2*S,2*S)
|
gc.rectangle(drawType,M.x-S,M.y-S,2*S,2*S)
|
||||||
|
|||||||
@@ -2,7 +2,8 @@ local gc=love.graphics
|
|||||||
local sin,log=math.sin,math.log10
|
local sin,log=math.sin,math.log10
|
||||||
local format=string.format
|
local format=string.format
|
||||||
|
|
||||||
local SCR,setFont,mStr=SCR,setFont,mStr
|
local GAME,SCR=GAME,SCR
|
||||||
|
local setFont,mStr=setFont,mStr
|
||||||
|
|
||||||
local fnsRankColor={
|
local fnsRankColor={
|
||||||
Z=COLOR.lY,
|
Z=COLOR.lY,
|
||||||
@@ -311,12 +312,12 @@ function scene.draw()
|
|||||||
end
|
end
|
||||||
|
|
||||||
scene.widgetList={
|
scene.widgetList={
|
||||||
WIDGET.newButton{name="setting", x=1120, y=70, w=240,h=90, color="lB",font=35,code=pressKey"s"},
|
WIDGET.newButton{name="setting", x=1120,y=70,w=240,h=90, color="lB",font=35,code=pressKey"s"},
|
||||||
WIDGET.newButton{name="replay", x=535, y=250, w=200,h=100,color="lY",font=30,code=pressKey"p",hide=function()return not(GAME.result or GAME.replaying)or #PLAYERS>1 end},
|
WIDGET.newButton{name="replay", x=535,y=250,w=200,h=100,color="lY",font=30,code=pressKey"p",hide=function()return not(GAME.result or GAME.replaying)or #PLAYERS>1 end},
|
||||||
WIDGET.newButton{name="save", x=745, y=250, w=200,h=100,color="G",font=30,code=pressKey"o",hide=function()return not(GAME.result or GAME.replaying)or #PLAYERS>1 or GAME.saved end},
|
WIDGET.newButton{name="save", x=745,y=250,w=200,h=100,color="G",font=30,code=pressKey"o",hide=function()return not(GAME.result or GAME.replaying)or #PLAYERS>1 or GAME.saved end},
|
||||||
WIDGET.newButton{name="resume", x=640, y=367, w=240,h=100,color="lG",font=30,code=pressKey"escape"},
|
WIDGET.newButton{name="resume", x=640,y=367,w=240,h=100,color="lG",font=30,code=pressKey"escape"},
|
||||||
WIDGET.newButton{name="restart", x=640, y=483, w=240,h=100,color="lR",font=35,code=pressKey"r"},
|
WIDGET.newButton{name="restart", x=640,y=483,w=240,h=100,color="lR",font=35,code=pressKey"r"},
|
||||||
WIDGET.newButton{name="quit", x=640, y=600, w=240,h=100,font=35,code=backScene},
|
WIDGET.newButton{name="quit", x=640,y=600,w=240,h=100,font=35,code=backScene},
|
||||||
}
|
}
|
||||||
|
|
||||||
return scene
|
return scene
|
||||||
Reference in New Issue
Block a user