整理全局函数名以及库的require方法

This commit is contained in:
MrZ626
2021-03-05 01:15:09 +08:00
parent 069b547e58
commit b1ca2c8dda
99 changed files with 135 additions and 132 deletions

View File

@@ -70,7 +70,7 @@ function scene.keyDown(key)
LOG.print(text.exportSuccess,COLOR.green)
elseif key=="v"and kb.isDown("lctrl","rctrl")or key=="cV"then
local str=sys.getClipboardText()
local args=splitStr(str:sub((str:find(":")or 0)+1),"!")
local args=SPLITSTR(str:sub((str:find(":")or 0)+1),"!")
if #args<4 then goto fail end
if not(
pasteQuestArgs(args[1])and

View File

@@ -14,7 +14,7 @@ function scene.sceneInit()
end
function scene.wheelMoved(_,y)
wheelScroll(y)
WHEELMOV(y)
end
function scene.keyDown(k)
if k=="up"then

View File

@@ -94,7 +94,7 @@ local loadingThread=coroutine.create(function()
STAT.run=STAT.run+1
LOADED=true
--[[TODO
WS.send("user",json.encode{
WS.send("user",JSON.encode{
id=USER.id,
authToken=USER.authToken,
})

View File

@@ -7,7 +7,7 @@ local function login()
LOG.print(text.noPassword)return
end
--[[TODO
WS.send("user",json.encode{
WS.send("user",JSON.encode{
email=email,
password=password,
})

View File

@@ -72,13 +72,13 @@ scene.widgetList={
if LOGIN then
--[[TODO
if USER.accessToken then
WS.send("app",json.encode{
WS.send("app",JSON.encode{
opration="access",
email=USER.email,
accessToken=USER.accessToken,
})
else
WS.send("app",json.encode{
WS.send("app",JSON.encode{
opration="access",
email=USER.email,
authToken=USER.authToken,

View File

@@ -6,7 +6,7 @@ function scene.sceneInit()
end
function scene.wheelMoved(_,y)
wheelScroll(y)
WHEELMOV(y)
end
function scene.keyDown(k)
if k=="up"then

View File

@@ -21,7 +21,7 @@ function scene.sceneInit()
end
function scene.wheelMoved(_,y)
wheelScroll(y)
WHEELMOV(y)
end
function scene.keyDown(key)
local S=selected

View File

@@ -40,7 +40,7 @@ function scene.sceneBack()
end
function scene.wheelMoved(_,y)
wheelScroll(y)
WHEELMOV(y)
end
function scene.keyDown(k)
if k=="up"then
@@ -63,7 +63,7 @@ end
function scene.socketRead(mes)
local cmd=mes:sub(1,1)
local args=splitStr(mes:sub(2),";")
local args=SPLITSTR(mes:sub(2),";")
if cmd=="J"or cmd=="L"then
textBox:push{
COLOR.lR,args[1],

View File

@@ -151,10 +151,10 @@ end
function scene.socketRead(mes)
local cmd=mes:sub(1,1)
local args=splitStr(mes:sub(2),";")
local args=SPLITSTR(mes:sub(2),";")
if cmd=="J"then
if playerInitialized then
local L=splitStr(args[1],",")
local L=SPLITSTR(args[1],",")
textBox:push{
COLOR.lR,L[1],
COLOR.dY,"#"..L[2].." ",
@@ -162,7 +162,7 @@ function scene.socketRead(mes)
}
end
for i=1,#args do
local L=splitStr(args[i],",")
local L=SPLITSTR(args[i],",")
ins(playerData,{name=L[1],id=L[2],sid=L[3],conf=L[4],ready=L[5]=="1"})
end
playerInitialized=true

View File

@@ -8,7 +8,7 @@ local lastCreateRoomTime=0
local function enterRoom(roomID)
--[[TODO
WS.connect("play","/play",json.encode{
WS.connect("play","/play",JSON.encode{
email=USER.email,
token=USER.accessToken,
id=roomID,
@@ -21,7 +21,7 @@ local function fresh()
lastfreshTime=TIME()
rooms=nil
--[[TODO
WS.connect("play","/play",json.encode{
WS.connect("play","/play",JSON.encode{
email=USER.email,
accessToken=USER.accessToken,
})
@@ -38,7 +38,7 @@ function scene.sceneInit()
end
function scene.wheelMoved(_,y)
wheelScroll(y)
WHEELMOV(y)
end
function scene.keyDown(k)
if k=="r"then
@@ -48,7 +48,7 @@ function scene.keyDown(k)
elseif k=="n"then
if TIME()-lastCreateRoomTime>26 then
--[[TODO
WS.send("room",json.encode{
WS.send("room",JSON.encode{
email=USER.email,
accessToken=USER.accessToken,
room_name=(USER.name or"???").."'s room",

View File

@@ -40,7 +40,7 @@ function scene.sceneInit(org)
local frameLostRate=(S.frame/S.time/60-1)*100
form={
{COLOR.white,toTime(S.time),COLOR[frameLostRate>10 and"red"or frameLostRate>3 and"yellow"or"grey"],format(" (%.2f%%)",frameLostRate)},
{COLOR.white,TIMESTR(S.time),COLOR[frameLostRate>10 and"red"or frameLostRate>3 and"yellow"or"grey"],format(" (%.2f%%)",frameLostRate)},
format("%d/%d/%d",S.key,S.rotate,S.hold),
format("%d %.2fPPS",S.piece,S.piece/S.time),
format("%d(%d) %.2fLPM",S.row,S.dig,S.row/S.time*60),

View File

@@ -16,7 +16,7 @@ function scene.keyDown(key)
LOG.print(text.diffPassword)return
end
--[[
json.encode{
JSON.encode{
username=username,
email=email,
password=password,

View File

@@ -15,7 +15,7 @@ local function dumpCB(T)
"string","base64",
love.data.compress(
"string","zlib",
dumpTable(T)
DUMPTABLE(T)
)
)
)

View File

@@ -29,7 +29,7 @@ function scene.sceneInit()
item={
S.run,
S.game,
toTime(S.time),
TIMESTR(S.time),
S.key.." "..S.rotate.." "..S.hold,
S.piece.." "..S.row.." "..int(S.atk),
S.recv.." "..S.off.." "..S.pend,