From fe2abf69038a1f6cbe6009ec8c4dd2891cfc1b6f Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Tue, 22 Dec 2020 14:54:01 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=84=E8=8C=83=E4=BB=A3=E7=A0=81=EF=BC=8C?= =?UTF-8?q?=E5=A4=A7=E9=87=8Fxxx=3Dnil=E6=8D=A2=E6=88=90xxx=3Dfalse?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zframework/background.lua | 6 ++--- Zframework/init.lua | 8 +++---- Zframework/scene.lua | 42 ++++++++++++++++----------------- Zframework/widget.lua | 16 ++++++------- main.lua | 2 +- parts/backgrounds/badapple.lua | 2 +- parts/backgrounds/fan.lua | 2 +- parts/backgrounds/space.lua | 2 +- parts/backgrounds/tunnel.lua | 2 +- parts/backgrounds/wing.lua | 2 +- parts/gametoolfunc.lua | 24 +++++++++---------- parts/globalTables.lua | 32 ++++++++++++------------- parts/modes/bigbang.lua | 1 - parts/modes/custom_clear.lua | 2 +- parts/modes/custom_puzzle.lua | 2 +- parts/modes/master_phantasm.lua | 2 +- parts/player/init.lua | 36 ++++++++++++++-------------- parts/player/player.lua | 4 ++-- parts/scenes/chat.lua | 4 ++-- parts/scenes/history.lua | 2 +- parts/scenes/mod.lua | 4 ++-- parts/scenes/mode.lua | 14 +++++------ parts/scenes/play.lua | 2 +- parts/scenes/setting_touch.lua | 36 ++++++++++++++-------------- parts/tick.lua | 6 ++--- 25 files changed, 127 insertions(+), 128 deletions(-) diff --git a/Zframework/background.lua b/Zframework/background.lua index f60a1487..6ef82b73 100644 --- a/Zframework/background.lua +++ b/Zframework/background.lua @@ -7,11 +7,11 @@ local BGlist={ } local BG={ cur="none", - init=nil, - resize=nil, + init=false, + resize=false, update=NULL, draw=BGlist.none.draw, - event=nil, + event=false, discard=NULL, } diff --git a/Zframework/init.lua b/Zframework/init.lua index dc3acfac..97a765a6 100644 --- a/Zframework/init.lua +++ b/Zframework/init.lua @@ -31,7 +31,7 @@ local ins,rem=table.insert,table.remove local SCR=SCR local mx,my,mouseShow=-20,-20,false -local touching=nil--First touching ID(userdata) +local touching--First touching ID(userdata) local xOy=SCR.xOy joysticks={} @@ -146,7 +146,7 @@ function love.touchmoved(id,x,y,dx,dy) else WIDGET.moveCursor(x,y) if not WIDGET.sel then - touching=nil + touching=false end end end @@ -156,9 +156,9 @@ function love.touchreleased(id,x,y) if id==touching then WIDGET.press(x,y) WIDGET.release(x,y) - touching=nil + touching=false if WIDGET.sel and not WIDGET.sel.keepFocus then - WIDGET.sel=nil + WIDGET.sel=false end end if SCN.touchUp then SCN.touchUp(id,x,y)end diff --git a/Zframework/scene.lua b/Zframework/scene.lua index 9e7d40da..6216ab68 100644 --- a/Zframework/scene.lua +++ b/Zframework/scene.lua @@ -8,33 +8,33 @@ local SCN={ cur="NULL",--Current scene name swapping=false,--If Swapping stat={ - tar=nil, --Swapping target - style=nil, --Swapping style - mid=nil, --Loading point - time=nil, --Full swap time - draw=nil, --Swap draw func + tar=false, --Swapping target + style=false,--Swapping style + mid=false, --Loading point + time=false, --Full swap time + draw=false, --Swap draw func }, stack={"quit","slowFade"},--Scene stack scenes=scenes, --Events - update=nil, - draw=nil, - mouseClick=nil, - touchClick=nil, - mouseDown=nil, - mouseMove=nil, - mouseUp=nil, - wheelMoved=nil, - touchDown=nil, - touchUp=nil, - touchMove=nil, - keyDown=nil, - keyUp=nil, - gamepadDown=nil, - gamepadUp=nil, - socketRead=nil, + update=false, + draw=false, + mouseClick=false, + touchClick=false, + mouseDown=false, + mouseMove=false, + mouseUp=false, + wheelMoved=false, + touchDown=false, + touchUp=false, + touchMove=false, + keyDown=false, + keyUp=false, + gamepadDown=false, + gamepadUp=false, + socketRead=false, }--Scene datas, returned function SCN.add(name,scene) diff --git a/Zframework/widget.lua b/Zframework/widget.lua index 744a5f7a..95b7d15d 100644 --- a/Zframework/widget.lua +++ b/Zframework/widget.lua @@ -499,13 +499,13 @@ function WIDGET.newSlider(D)--name,x,y,w[,unit][,smooth][,font][,change],disp,co }, unit= D.unit or 1, - smooth=nil, + smooth= false, font= D.font or 30, change= D.change, disp= D.disp, code= D.code, hide= D.hide, - show= nil, + show= false, } if D.smooth~=nil then _.smooth=D.smooth @@ -534,7 +534,7 @@ local selector={ type="selector", ATV=8,--Activating time(0~4) select=0,--Selected item ID - selText=nil,--Selected item name + selText=false,--Selected item name } function selector:reset() self.ATV=0 @@ -787,7 +787,7 @@ function WIDGET.newTextBox(D)--name,x,y,w[,h][,font][,secret][,regex],hide end WIDGET.active={}--Table contains all active widgets -WIDGET.sel=nil--Selected widget +WIDGET.sel=false--Selected widget function WIDGET.lnk_BACK() SCN.back()end function WIDGET.lnk_CUSval(k) return function() return CUSTOMENV[k] end end @@ -813,7 +813,7 @@ WIDGET.indexMeta={ } function WIDGET.set(list) kb.setTextInput(false) - WIDGET.sel=nil + WIDGET.sel=false WIDGET.active=list or NONE --Reset all widgets @@ -841,7 +841,7 @@ function WIDGET.moveCursor(x,y) end end if WIDGET.sel and not WIDGET.sel.keepFocus then - WIDGET.sel=nil + WIDGET.sel=false end end function WIDGET.press(x,y) @@ -852,7 +852,7 @@ function WIDGET.press(x,y) elseif W.type=="slider"then WIDGET.drag(x,y) end - if W.hide and W.hide()then WIDGET.sel=nil end + if W.hide and W.hide()then WIDGET.sel=false end end function WIDGET.drag(x,y) local W=WIDGET.sel @@ -860,7 +860,7 @@ function WIDGET.drag(x,y) if W.type=="slider"then W:drag(x,y) elseif not W:isAbove(x,y)then - WIDGET.sel=nil + WIDGET.sel=false end end function WIDGET.release(x,y) diff --git a/main.lua b/main.lua index 7daaa401..041f39f8 100644 --- a/main.lua +++ b/main.lua @@ -24,7 +24,7 @@ LOADED=false NOGAME=false LOGIN=false EDITING="" -WSCONN=nil +WSCONN=false math.randomseed(os.time()*626) love.keyboard.setKeyRepeat(true) diff --git a/parts/backgrounds/badapple.lua b/parts/backgrounds/badapple.lua index 9b22b33b..d8cb430c 100644 --- a/parts/backgrounds/badapple.lua +++ b/parts/backgrounds/badapple.lua @@ -51,6 +51,6 @@ function back.draw() gc.pop() end function back.discard() - video=nil + video=false end return back \ No newline at end of file diff --git a/parts/backgrounds/fan.lua b/parts/backgrounds/fan.lua index 9204de28..d85638ba 100644 --- a/parts/backgrounds/fan.lua +++ b/parts/backgrounds/fan.lua @@ -70,6 +70,6 @@ function back.draw() gc.pop() end function back.discard() - petal=nil + petal=false end return back \ No newline at end of file diff --git a/parts/backgrounds/space.lua b/parts/backgrounds/space.lua index 0fc974ed..2599828c 100644 --- a/parts/backgrounds/space.lua +++ b/parts/backgrounds/space.lua @@ -43,6 +43,6 @@ function back.draw() gc.translate(10,10) end function back.discard() - stars=nil + stars=false end return back \ No newline at end of file diff --git a/parts/backgrounds/tunnel.lua b/parts/backgrounds/tunnel.lua index c9f9e55a..59ef4dc8 100644 --- a/parts/backgrounds/tunnel.lua +++ b/parts/backgrounds/tunnel.lua @@ -38,6 +38,6 @@ function back.draw() end end function back.discard() - ring=nil + ring=false end return back \ No newline at end of file diff --git a/parts/backgrounds/wing.lua b/parts/backgrounds/wing.lua index 28be42fe..a70ff948 100644 --- a/parts/backgrounds/wing.lua +++ b/parts/backgrounds/wing.lua @@ -68,6 +68,6 @@ function back.event(level) end end function back.discard() - bar,crystal=nil + bar,crystal=false,false end return back \ No newline at end of file diff --git a/parts/gametoolfunc.lua b/parts/gametoolfunc.lua index da5fda57..7a919016 100644 --- a/parts/gametoolfunc.lua +++ b/parts/gametoolfunc.lua @@ -44,7 +44,7 @@ function destroyPlayers() CC.free(P.bot_opt) CC.free(P.bot_wei) CC.destroy(P.AI_bot) - P.AI_mode=nil + P.AI_mode=false end PLAYERS[i]=nil end @@ -137,7 +137,7 @@ function pasteSequence(str) for _=1,b-32 do ins(bag,reg) end - reg=nil + reg=false end end end @@ -293,7 +293,7 @@ function pasteMission(str) for _=1,b-113 do ins(mission,reg) end - reg=nil + reg=false end end end @@ -356,7 +356,7 @@ function randomTarget(P)--Return a random opponent for P end end function freshMostDangerous() - GAME.mostDangerous,GAME.secDangerous=nil + GAME.mostDangerous,GAME.secDangerous=false,false local m,m2=0,0 for i=1,#PLAYERS.alive do local h=#PLAYERS.alive[i].field @@ -376,7 +376,7 @@ function freshMostDangerous() end end function freshMostBadge() - GAME.mostBadge,GAME.secBadge=nil + GAME.mostBadge,GAME.secBadge=false,false local m,m2=0,0 for i=1,#PLAYERS.alive do local P=PLAYERS.alive[i] @@ -463,12 +463,12 @@ function applyCustomGame() if BAG[1]then GAME.modeEnv.bag=BAG else - GAME.modeEnv.bag=nil + GAME.modeEnv.bag=false end if MISSION[1]then GAME.modeEnv.mission=MISSION else - GAME.modeEnv.mission=nil + GAME.modeEnv.mission=false end end function loadGame(M,ifQuickPlay)--Load a mode and go to game scene @@ -582,11 +582,11 @@ function resetGameData(args) for i=1,#PLAYERS do PLAYERS[i]:changeAtk(randomTarget(PLAYERS[i])) end - GAME.stage=nil - GAME.mostBadge=nil - GAME.secBadge=nil - GAME.mostDangerous=nil - GAME.secDangerous=nil + GAME.stage=false + GAME.mostBadge=false + GAME.secBadge=false + GAME.mostDangerous=false + GAME.secDangerous=false GAME.stage=1 end STAT.game=STAT.game+1 diff --git a/parts/globalTables.lua b/parts/globalTables.lua index 2a77ebbd..d9e603e0 100644 --- a/parts/globalTables.lua +++ b/parts/globalTables.lua @@ -206,42 +206,42 @@ GAME={--Global game data frame=0, --Frame count result=false, --Game result (string) - rank=nil, --Rank reached + rank=false, --Rank reached pauseTime=0, --Time paused pauseCount=0, --Pausing count warnLVL0=0, --Warning level warnLVL=0, --Warning level (show) seed=1046101471, --Game seed - curMode=nil, --Current gamemode object + curMode=false, --Current gamemode object mod={}, --List of loaded mods - modeEnv=nil, --Current gamemode environment + modeEnv=false, --Current gamemode environment setting={}, --Game settings rep={}, --Recording list, key,time,key,time... recording=false, --If recording replaying=false, --If replaying saved=false, --If recording saved - prevBG=nil, --Previous background, for restore BG when quit setting page + prevBG=false, --Previous background, for restore BG when quit setting page --Data for royale mode - stage=nil, --Game stage - mostBadge=nil, --Most badge owner - secBadge=nil, --Second badge owner - mostDangerous=nil, --Most dangerous player - secDangerous=nil, --Second dangerous player + stage=false, --Game stage + mostBadge=false, --Most badge owner + secBadge=false, --Second badge owner + mostDangerous=false,--Most dangerous player + secDangerous=false, --Second dangerous player } --Userdata tables RANKS=FILE.load("conf/unlock")or{sprint_10=0}--Ranks of modes USER=FILE.load("conf/user")or{--User infomation - email=nil, - auth_token=nil, - access_token=nil, + email=false, + auth_token=false, + access_token=false, - username=nil, - motto=nil, - avatar=nil, + username=false, + motto=false, + avatar=false, xp=0,lv=1, } SETTING={--Settings @@ -319,7 +319,7 @@ else clear={},spin={}, pc=0,hpc=0,b2b=0,b3b=0,score=0, lastPlay="sprint_10",--Last played mode ID - date=nil, + date=false, todayTime=0, }for i=1,29 do STAT.clear[i]={0,0,0,0,0,0}STAT.spin[i]={0,0,0,0,0,0,0}end end diff --git a/parts/modes/bigbang.lua b/parts/modes/bigbang.lua index 272d36bd..bb697a37 100644 --- a/parts/modes/bigbang.lua +++ b/parts/modes/bigbang.lua @@ -5,7 +5,6 @@ return{ drop=1e99,lock=1e99, holdCount=0, dropPiece=function(P)P:lose()end, - task=nil, bg="bg1",bgm="new era", }, pauseLimit=true, diff --git a/parts/modes/custom_clear.lua b/parts/modes/custom_clear.lua index f4097725..d2b0f3cc 100644 --- a/parts/modes/custom_clear.lua +++ b/parts/modes/custom_clear.lua @@ -61,7 +61,7 @@ return{ PLY.newPlayer(1) local L=GAME.modeEnv.opponent if L~=0 then - GAME.modeEnv.target=nil + GAME.modeEnv.target=false if L<6 then PLY.newAIPlayer(2,AIBUILDER("9S",2*L)) else diff --git a/parts/modes/custom_puzzle.lua b/parts/modes/custom_puzzle.lua index 528d5797..e583b02a 100644 --- a/parts/modes/custom_puzzle.lua +++ b/parts/modes/custom_puzzle.lua @@ -42,7 +42,7 @@ return{ PLY.newPlayer(1) local L=GAME.modeEnv.opponent if L~=0 then - GAME.modeEnv.target=nil + GAME.modeEnv.target=false if L<6 then PLY.newAIPlayer(2,AIBUILDER("9S",2*L)) else diff --git a/parts/modes/master_phantasm.lua b/parts/modes/master_phantasm.lua index 17b3558c..b62641e5 100644 --- a/parts/modes/master_phantasm.lua +++ b/parts/modes/master_phantasm.lua @@ -7,7 +7,7 @@ local function check_LVup(P) --Stage 1: clear 3 techrash if T==12 then--Stage 2: swap color of S/Z & J/L P.waiting=30 - P.curMission=nil + P.curMission=false ENV.skin[1],ENV.skin[2]=ENV.skin[2],ENV.skin[1] ENV.skin[3],ENV.skin[4]=ENV.skin[4],ENV.skin[3] diff --git a/parts/player/init.lua b/parts/player/init.lua index adfcbc69..54d30ada 100644 --- a/parts/player/init.lua +++ b/parts/player/init.lua @@ -130,7 +130,7 @@ local function newEmptyPlayer(id,mini) P.atker,P.atking,P.lastRecv={} P.dropDelay,P.lockDelay=0,0 - P.showTime=nil + P.showTime=false P.keepVisible=true --P.cur={bk=matrix[2], id=shapeID, color=colorID, name=nameID} @@ -165,7 +165,7 @@ local function newEmptyPlayer(id,mini) P.type="none" P.sound=false - -- P.newNext=nil--Call prepareSequence()to get a function to get new next + -- P.newNext=false--Call prepareSequence()to get a function to get new next P.keyPressing={}for i=1,12 do P.keyPressing[i]=false end P.movDir,P.moving,P.downing=0,0,0--Last move key,DAS charging,downDAS charging @@ -184,7 +184,7 @@ local function newEmptyPlayer(id,mini) P.bonus={}--Text objects P.endCounter=0--Used after gameover - P.result=nil--String:"WIN"/"K.O." + P.result=false--String:"WIN"/"K.O." return P end @@ -272,23 +272,23 @@ local function applyGameEnv(P)--Finish gameEnv processing if ENV.nextCount==0 then ENV.nextPos=false end if P.mini then - ENV.lockFX=nil - ENV.dropFX=nil - ENV.moveFX=nil - ENV.clearFX=nil - ENV.splashFX=nil - ENV.shakeFX=nil - ENV.text=nil + ENV.lockFX=false + ENV.dropFX=false + ENV.moveFX=false + ENV.clearFX=false + ENV.splashFX=false + ENV.shakeFX=false + ENV.text=false else - if ENV.lockFX==0 then ENV.lockFX=nil end - if ENV.dropFX==0 then ENV.dropFX=nil end - if ENV.moveFX==0 then ENV.moveFX=nil end - if ENV.clearFX==0 then ENV.clearFX=nil end - if ENV.splashFX==0 then ENV.splashFX=nil end - if ENV.shakeFX==0 then ENV.shakeFX=nil end + if ENV.lockFX==0 then ENV.lockFX=false end + if ENV.dropFX==0 then ENV.dropFX=false end + if ENV.moveFX==0 then ENV.moveFX=false end + if ENV.clearFX==0 then ENV.clearFX=false end + if ENV.splashFX==0 then ENV.splashFX=false end + if ENV.shakeFX==0 then ENV.shakeFX=false end end - if ENV.ghost==0 then ENV.ghost=nil end - if ENV.center==0 then ENV.center=nil end + if ENV.ghost==0 then ENV.ghost=false end + if ENV.center==0 then ENV.center=false end end ---------------------------------------------------- diff --git a/parts/player/player.lua b/parts/player/player.lua index 1a0573de..5f1a97ab 100644 --- a/parts/player/player.lua +++ b/parts/player/player.lua @@ -400,7 +400,7 @@ function Player.changeAtk(P,R) P.atking=R ins(R.atker,P) else - P.atking=nil + P.atking=false end end function Player.freshBlock(P,mode)--string mode: push/move/fresh/newBlock @@ -1332,7 +1332,7 @@ do--Player.drop(P)--Place piece P.curMission=P.curMission+1 SFX.play("reach") if P.curMission>#ENV.mission then - P.curMission=nil + P.curMission=false if not finish then finish="finish"end end elseif ENV.missionKill then diff --git a/parts/scenes/chat.lua b/parts/scenes/chat.lua index 6d79a920..11f51062 100644 --- a/parts/scenes/chat.lua +++ b/parts/scenes/chat.lua @@ -31,7 +31,7 @@ local scene={} function scene.sceneInit() heartBeatTimer=0 - remain=nil + remain=false if #texts==0 then ins(texts,{COLOR.dG,text.chatStart}) @@ -48,7 +48,7 @@ function scene.sceneInit() end function scene.sceneBack() wsWrite("/quit") - WSCONN=nil + WSCONN=false LOG.print(text.wsDisconnected,"warn") end diff --git a/parts/scenes/history.lua b/parts/scenes/history.lua index d1ca0b2f..03ee65a7 100644 --- a/parts/scenes/history.lua +++ b/parts/scenes/history.lua @@ -11,7 +11,7 @@ function scene.sceneInit() texts=require"parts/updateLog" scrollPos=1 if newVersionLaunch then - newVersionLaunch=nil + newVersionLaunch=false scrollPos=3 end end diff --git a/parts/scenes/mod.lua b/parts/scenes/mod.lua index 58684855..d499bade 100644 --- a/parts/scenes/mod.lua +++ b/parts/scenes/mod.lua @@ -44,12 +44,12 @@ local scene={} local selected--Mod selected function scene.sceneInit() - selected=nil + selected=false BG.set("tunnel") end function scene.mouseMove(x,y) - selected=nil + selected=false for _,M in next,MODOPT do if(x-M.x)^2+(y-M.y)^2<2000 then selected=M diff --git a/parts/scenes/mode.lua b/parts/scenes/mode.lua index 43ccfdec..c04a2448 100644 --- a/parts/scenes/mode.lua +++ b/parts/scenes/mode.lua @@ -7,15 +7,15 @@ local int,abs=math.floor,math.abs local sin=math.sin local mapCam={ - sel=nil,--Selected mode ID + sel=false,--Selected mode ID xOy=mt.newTransform(0,0,0,1),--Transformation for map display keyCtrl=false,--If controlling with key --For auto zooming when enter/leave scene - zoomMethod=nil, - zoomK=nil, + zoomMethod=false, + zoomK=false, } -local touchDist=nil +local touchDist local scene={} @@ -82,7 +82,7 @@ function scene.mouseClick(x,y) mapCam.sel=SEL SFX.play("click") else - mapCam.sel=nil + mapCam.sel=false end elseif _ then scene.keyDown("return") @@ -91,7 +91,7 @@ function scene.mouseClick(x,y) mapCam.keyCtrl=false end function scene.touchDown() - touchDist=nil + touchDist=false end function scene.touchMove(_,x,y,dx,dy) local L=tc.getTouches() @@ -124,7 +124,7 @@ function scene.keyDown(key) SCN.go("mod") elseif key=="escape"then if mapCam.sel then - mapCam.sel=nil + mapCam.sel=false else SCN.back() end diff --git a/parts/scenes/play.lua b/parts/scenes/play.lua index b766aadb..c3b42802 100644 --- a/parts/scenes/play.lua +++ b/parts/scenes/play.lua @@ -31,7 +31,7 @@ function scene.sceneInit() GAME.restartCount=0 if GAME.init then resetGameData() - GAME.init=nil + GAME.init=false end noKey=GAME.replaying noTouch=not SETTING.VKSwitch or noKey diff --git a/parts/scenes/setting_touch.lua b/parts/scenes/setting_touch.lua index ab569752..71d90848 100644 --- a/parts/scenes/setting_touch.lua +++ b/parts/scenes/setting_touch.lua @@ -7,13 +7,13 @@ local scene={} local defaultSetSelect local snapUnit -local select--Button selected +local selected--Button selected function scene.sceneInit() BG.set("rainbow") defaultSetSelect=1 snapUnit=1 - select=nil + selected=false end function scene.sceneBack() FILE.save(VK_org,"conf/virtualkey") @@ -36,34 +36,34 @@ local function onVK_org(x,y) end function scene.mouseDown(x,y,k) if k==2 then SCN.back()end - select=onVK_org(x,y)or select + selected=onVK_org(x,y)or selected end function scene.mouseMove(_,_,dx,dy) - if select and ms.isDown(1)and not WIDGET.sel then - local B=VK_org[select] + if selected and ms.isDown(1)and not WIDGET.sel then + local B=VK_org[selected] B.x,B.y=B.x+dx,B.y+dy end end function scene.mouseUp() - if select then - local B=VK_org[select] + if selected then + local B=VK_org[selected] local k=snapUnit B.x,B.y=int(B.x/k+.5)*k,int(B.y/k+.5)*k end end function scene.touchDown(_,x,y) - select=onVK_org(x,y)or select + selected=onVK_org(x,y)or selected end function scene.touchUp() - if select then - local B=VK_org[select] + if selected then + local B=VK_org[selected] local k=snapUnit B.x,B.y=int(B.x/k+.5)*k,int(B.y/k+.5)*k end end function scene.touchMove(_,_,_,dx,dy) - if select and not WIDGET.sel then - local B=VK_org[select] + if selected and not WIDGET.sel then + local B=VK_org[selected] B.x,B.y=B.x+dx,B.y+dy end end @@ -73,7 +73,7 @@ local function VirtualkeyPreview() for i=1,#VK_org do local B=VK_org[i] if B.ava then - local c=select==i and .6 or 1 + local c=selected==i and .6 or 1 gc.setColor(c,1,c,SETTING.VKAlpha) gc.setLineWidth(B.r*.07) gc.circle("line",B.x,B.y,B.r,10) @@ -190,7 +190,7 @@ scene.widgetList={ end end defaultSetSelect=defaultSetSelect%5+1 - select=nil + selected=false LOG.print("[ "..defaultSetSelect.." ]") end}, WIDGET.newSelector{name="snap", x=760,y=90,w=200,h=80,color="yellow",list={1,10,20,40,60,80},disp=function()return snapUnit end,code=function(i)snapUnit=i end}, @@ -201,15 +201,15 @@ scene.widgetList={ WIDGET.newButton{name="back", x=760,y=190,w=200,h=80,font=35,code=WIDGET.lnk_BACK}, WIDGET.newSlider{name="size", x=450,y=270,w=460,unit=19,font=40,show="vkSize", disp=function() - return VK_org[select].r/10-1 + return VK_org[selected].r/10-1 end, code=function(v) - if select then - VK_org[select].r=(v+1)*10 + if selected then + VK_org[selected].r=(v+1)*10 end end, hide=function() - return not select + return not selected end}, } diff --git a/parts/tick.lua b/parts/tick.lua index 8acba2a7..6db7874f 100644 --- a/parts/tick.lua +++ b/parts/tick.lua @@ -17,8 +17,8 @@ function Tick.httpREQ_getAccessToken(task) end else LOGIN=false - USER.access_token=nil - USER.auth_token=nil + USER.access_token=false + USER.auth_token=false local err=json.decode(response.body) if err then LOG.print(text.loginFailed..": "..text.netErrorCode..response.code.."-"..err.message,"warn") @@ -54,7 +54,7 @@ local function tick_wsCONN_read() end elseif readErr then wsWrite("/quit") - WSCONN=nil + WSCONN=false LOG.print(text.wsDisconnected,"warn") return end