整理全局函数名以及库的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

@@ -7,7 +7,7 @@ local tabs={
"\t\t\t\t",
"\t\t\t\t\t",
}
function dumpTable(L,t)
return function(L,t)
local s
if t then
s="{\n"
@@ -40,7 +40,7 @@ function dumpTable(L,t)
T=type(v)
if T=="number"then v=tostring(v)
elseif T=="string"then v="\""..v.."\""
elseif T=="table"then v=dumpTable(v,t+1)
elseif T=="table"then v=DUMPTABLE(v,t+1)
elseif T=="boolean"then v=tostring(v)
else error("Error data type!")
end

View File

@@ -13,7 +13,7 @@ function FILE.load(name)
return s()
end
else
local res=json.decode(s)
local res=JSON.decode(s)
if res then
return res
end
@@ -26,13 +26,13 @@ function FILE.save(data,name,mode)
if not mode then mode=""end
name=name
if mode:find("l")then
data=dumpTable(data)
data=DUMPTABLE(data)
if not data then
LOG.print(name.." "..text.saveError.."dump error","error")
return
end
else
data=json.encode(data)
data=JSON.encode(data)
if not data then
LOG.print(name.." "..text.saveError.."json error","error")
return

View File

@@ -4,20 +4,20 @@ SCN= require"Zframework/scene"
LOG= require"Zframework/log"
WS= require"Zframework/websocket"
loadLib=require"Zframework/loadLib"
require"Zframework/wheelScroll"
LOADLIB=require"Zframework/loadLib"
WHEELMOV=require"Zframework/wheelScroll"
require"Zframework/setFont"
require"Zframework/mDraw"
require"Zframework/json"
require"Zframework/dumpTable"
require"Zframework/urlEncode"
JSON=require"Zframework/json"
DUMPTABLE=require"Zframework/dumpTable"
URLENCODE=require"Zframework/urlEncode"
-- require"Zframework/upperChar"
-- UPPERCHAR=require"Zframework/upperChar"
require"Zframework/copyTable"
require"Zframework/splitStr"
require"Zframework/toTime"
SPLITSTR=require"Zframework/splitStr"
TIMESTR=require"Zframework/timeStr"
VIB= require"Zframework/vibrate"
SFX= require"Zframework/sfx"

View File

@@ -20,9 +20,10 @@
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-- SOFTWARE.
-- Editted by MrZ
local ins,char=table.insert,string.char
json = {}
local json = {}
-------------------------------------------------------------------------------
-- Encode
@@ -350,4 +351,5 @@ function json.decode(str)
elseif LOG then
LOG.print(text.jsonError..": "..(b or"uknErr"),"warn")
end
end
end
return json

View File

@@ -1,10 +1,11 @@
local gc=love.graphics
local printf=love.graphics.printf
local draw=love.graphics.draw
function mStr(s,x,y)
gc.printf(s,x-626,y,1252,"center")
printf(s,x-626,y,1252,"center")
end
function mText(s,x,y)
gc.draw(s,x-s:getWidth()*.5,y)
draw(s,x-s:getWidth()*.5,y)
end
function mDraw(s,x,y,a,k)
gc.draw(s,x,y,a,k,nil,s:getWidth()*.5,s:getHeight()*.5)
draw(s,x,y,a,k,nil,s:getWidth()*.5,s:getHeight()*.5)
end

View File

@@ -1,5 +1,5 @@
local find,sub=string.find,string.sub
function splitStr(s,sep)
return function(s,sep)
local L={}
local p1,p2=1--start,target
while p1<=#s do

View File

@@ -1,5 +1,5 @@
local int,format=math.floor,string.format
function toTime(s)
return function(s)
if s<60 then
return format("%.3fs",s)
elseif s<3600 then

View File

@@ -7,6 +7,6 @@ local upperList={
[";"]=":",["'"]="\"",
[","]="<",["."]=">",["/"]="?",
}
function upperChar(c)
return function(c)
return upperList[c]or upper(c)
end

View File

@@ -1,6 +1,6 @@
local rshift=bit.rshift
local b16={[0]="0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"}
function urlEncode(str)
return function(str)
local out=""
for i=1,#str do
if str:sub(i,i):match("[a-zA-Z0-9]")then

View File

@@ -16,7 +16,7 @@ local band,bor,bxor=bit.band,bit.bor,bit.bxor
local shl,shr=bit.lshift,bit.rshift
local SOCK=require"socket".tcp()
require"Zframework/json"
local JSON=require"Zframework/json"
local mask_key={1,14,5,14}
local function _send(opcode,message)
@@ -81,7 +81,7 @@ do--Connect
l=SOCK:receive("*l")
until l==""
l=SOCK:receive("*l")
local reason=json.decode(l)if reason then reason=reason.message end
local reason=JSON.decode(l)if reason then reason=reason.message end
readCHN:push(code.."-"..(reason or l))
end
else
@@ -129,7 +129,7 @@ while true do
local code=res:find(" ")
code=res:sub(code+1,code+3)
local res=res:sub(res:find("\n\n")+1)
reason=json.decode(res)if reason then reason=reason.message end
reason=JSON.decode(res)if reason then reason=reason.message end
readCHN:push(code.."-"..(reason or res))
else
readCHN:push(string.format("%d-%s",shl(byte(res,1),8)+byte(res,2).."-"..res:sub(3,-3)))

View File

@@ -1,5 +1,5 @@
local floatWheel=0
function wheelScroll(y)
return function(y)
if y>0 then
if floatWheel<0 then floatWheel=0 end
floatWheel=floatWheel+y^1.2

View File

@@ -131,7 +131,7 @@ return{--返回一个table你也可以在之前定义一些常量或者函数
PLY.draw.drawTargetLine(P,r)--使用自带的境界高度线绘制函数
end,
score=function(P)return{P.stat.time,P.stat.piece}end,--游戏结束时需要保存的本局关键信息
scoreDisp=function(D)return toTime(D[1]).." "..D[2].." Pieces"end,--把score返回的数据显示出来的方法
scoreDisp=function(D)return TIMESTR(D[1]).." "..D[2].." Pieces"end,--把score返回的数据显示出来的方法
comp=function(a,b)return a[1]<b[1]or a[1]==b[1]and a[2]<b[2]end,--按照时间排序,时间一样就看块数
getRank=function(P)--计算评级
if P.stat.row<40 then return end--你总得打完40行对吧否则直接return空掉成绩都不记录

View File

@@ -14,7 +14,7 @@ local ins,rem=table.insert,table.remove
-- 11~13:LL,RR,DD
local blockPos={4,4,4,4,4,5,4}
-------------------------------------------------Cold clear
local _CC=loadLib("CC",{
local _CC=LOADLIB("CC",{
Windows="CCloader",
Linux="CCloader",
Android="libCCloader.so",

View File

@@ -674,7 +674,7 @@ do--function dumpBasicConfig()
for _,key in next,gameSetting do
S[key]=SETTING[key]
end
return data.encode("string","base64",json.encode(S))
return data.encode("string","base64",JSON.encode(S))
end
end
do--function resetGameData(args)
@@ -965,8 +965,8 @@ do--function saveRecording()
(USER.name or"Player")
local fileBody=
GAME.seed.."\n"..
json.encode(GAME.setting).."\n"..
json.encode(getModList()).."\n"..
JSON.encode(GAME.setting).."\n"..
JSON.encode(getModList()).."\n"..
dumpRecording(GAME.rep)
--Write file
@@ -1071,7 +1071,7 @@ end
do
--[[
launch:
local res=json.decode(res.body)
local res=JSON.decode(res.body)
if res.message=="OK"then
LOG.print(res.notice,360,COLOR.sky)
if VERSION_CODE>=res.version_code then
@@ -1105,7 +1105,7 @@ do
PATH.http..PATH.user,
"GET",
{["Content-Type"]="application/json"},
json.encode{
JSON.encode{
email=USER.email,
authToken=USER.authToken,
}
@@ -1126,13 +1126,13 @@ do
LOG.print(text.loginSuccessed)
--TODO:getUserInfo
json.encode{
JSON.encode{
email=USER.email,
authToken=USER.authToken,
}
--TODO:getAccessToken
json.encode{
JSON.encode{
email=USER.email,
authToken=USER.authToken,
}
@@ -1150,13 +1150,13 @@ do
PATH.http..PATH.access,
"POST",
{["Content-Type"]="application/json"},
json.encode{
JSON.encode{
email=USER.email,
authToken=USER.authToken,
}
)
else
local err=json.decode(res.body)
local err=JSON.decode(res.body)
if err then
LOG.print(text.httpCode..res.code..": "..err.message,"warn")
end
@@ -1233,7 +1233,7 @@ do
LOG.print(text.wsClose..message,"warn")
return
else
message=json.decode(message)
message=JSON.decode(message)
end
end
elseif status~="connecting"then
@@ -1256,7 +1256,7 @@ do
LOG.print(text.wsClose..message,"warn")
return
else
message=json.decode(message)
message=JSON.decode(message)
end
end
end

View File

@@ -1,4 +1,4 @@
return splitStr([=[
return SPLITSTR([=[
Gameplay:
The system will provide you with tetrominoes (4-block pieces),
with a total of 7 types, and the player needs to control them

View File

@@ -1,4 +1,4 @@
return splitStr([=[
return SPLITSTR([=[
游戏方法:
系统会提供的一个个四连骨牌("方块",总共7种)
玩家需要控制(左右移动和旋转90,180,270度)这些骨牌直到下落到场地底部,锁定

View File

@@ -49,7 +49,7 @@ return{
mText(drawableText.nextWave,69,380)
end,
score=function(P)return{P.modeData.event,P.stat.time}end,
scoreDisp=function(D)return D[1].." Waves "..toTime(D[2])end,
scoreDisp=function(D)return D[1].." Waves "..TIMESTR(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
local W=P.modeData.event

View File

@@ -60,7 +60,7 @@ return{
mText(drawableText.nextWave,69,380)
end,
score=function(P)return{P.modeData.event,P.stat.time}end,
scoreDisp=function(D)return D[1].." Waves "..toTime(D[2])end,
scoreDisp=function(D)return D[1].." Waves "..TIMESTR(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
local W=P.modeData.event

View File

@@ -21,7 +21,7 @@ return{
mStr(P.stat.clears[4],69,340)
end,
score=function(P)return{min(P.stat.row,200),P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..toTime(D[2])end,
scoreDisp=function(D)return D[1].." Lines "..TIMESTR(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
local L=P.stat.row

View File

@@ -27,7 +27,7 @@ return{
gc.draw(IMG.electric,124,106,0,2.6)
end,
score=function(P)return{min(P.stat.row,200),P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..toTime(D[2])end,
scoreDisp=function(D)return D[1].." Lines "..TIMESTR(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
local L=P.stat.row

View File

@@ -28,7 +28,7 @@ return{
gc.draw(IMG.electric,124,106,0,2.6)
end,
score=function(P)return{min(P.stat.row,200),P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..toTime(D[2])end,
scoreDisp=function(D)return D[1].." Lines "..TIMESTR(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
local L=P.stat.row

View File

@@ -24,7 +24,7 @@ return{
gc.draw(IMG.electric,124,106,0,2.6)
end,
score=function(P)return{min(P.stat.row,200),P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..toTime(D[2])end,
scoreDisp=function(D)return D[1].." Lines "..TIMESTR(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
local L=P.stat.row

View File

@@ -27,7 +27,7 @@ return{
gc.draw(IMG.electric,124,106,0,2.6)
end,
score=function(P)return{min(P.stat.row,100),P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..toTime(D[2])end,
scoreDisp=function(D)return D[1].." Lines "..TIMESTR(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
local L=P.stat.row

View File

@@ -56,7 +56,7 @@ return{
mStr(P.stat.clears[4],69,340)
end,
score=function(P)return{min(P.stat.row,40),P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..toTime(D[2])end,
scoreDisp=function(D)return D[1].." Lines "..TIMESTR(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
local L=P.stat.row

View File

@@ -60,7 +60,7 @@ return{
mText(drawableText.maxcmb,69,450)
end,
score=function(P)return{min(P.modeData.point,100),P.stat.time}end,
scoreDisp=function(D)return D[1].." Combo "..toTime(D[2])end,
scoreDisp=function(D)return D[1].." Combo "..TIMESTR(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
local L=P.modeData.point

View File

@@ -58,7 +58,7 @@ return{
mText(drawableText.maxcmb,69,450)
end,
score=function(P)return{min(P.modeData.point,100),P.stat.time}end,
scoreDisp=function(D)return D[1].." Combo "..toTime(D[2])end,
scoreDisp=function(D)return D[1].." Combo "..TIMESTR(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
local L=P.stat.row

View File

@@ -55,7 +55,7 @@ return{
mText(drawableText.rpm,69,380)
end,
score=function(P)return{P.modeData.event,P.stat.time}end,
scoreDisp=function(D)return D[1].." Waves "..toTime(D[2])end,
scoreDisp=function(D)return D[1].." Waves "..TIMESTR(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
local W=P.modeData.event

View File

@@ -55,7 +55,7 @@ return{
mText(drawableText.rpm,69,380)
end,
score=function(P)return{P.modeData.event,P.stat.time}end,
scoreDisp=function(D)return D[1].." Waves "..toTime(D[2])end,
scoreDisp=function(D)return D[1].." Waves "..TIMESTR(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
local W=P.modeData.event

View File

@@ -27,7 +27,7 @@ return{
mStr(100-P.stat.dig,69,265)
end,
score=function(P)return{P.stat.time,P.stat.piece}end,
scoreDisp=function(D)return toTime(D[1]).." "..D[2].." Pieces"end,
scoreDisp=function(D)return TIMESTR(D[1]).." "..D[2].." Pieces"end,
comp=function(a,b)return a[1]<b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
if P.stat.dig<100 then return end

View File

@@ -24,7 +24,7 @@ return{
mStr(10-P.stat.dig,69,265)
end,
score=function(P)return{P.stat.time,P.stat.piece}end,
scoreDisp=function(D)return toTime(D[1]).." "..D[2].." Pieces"end,
scoreDisp=function(D)return TIMESTR(D[1]).." "..D[2].." Pieces"end,
comp=function(a,b)return a[1]<b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
if P.stat.dig<10 then return end

View File

@@ -27,7 +27,7 @@ return{
mStr(400-P.stat.dig,69,265)
end,
score=function(P)return{P.stat.time,P.stat.piece}end,
scoreDisp=function(D)return toTime(D[1]).." "..D[2].." Pieces"end,
scoreDisp=function(D)return TIMESTR(D[1]).." "..D[2].." Pieces"end,
comp=function(a,b)return a[1]<b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
if P.stat.dig<400 then return end

View File

@@ -27,7 +27,7 @@ return{
mStr(40-P.stat.dig,69,265)
end,
score=function(P)return{P.stat.time,P.stat.piece}end,
scoreDisp=function(D)return toTime(D[1]).." "..D[2].." Pieces"end,
scoreDisp=function(D)return TIMESTR(D[1]).." "..D[2].." Pieces"end,
comp=function(a,b)return a[1]<b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
if P.stat.dig<40 then return end

View File

@@ -107,7 +107,7 @@ return{
mStr(R>=0 and R or 0,69,265)
end,
score=function(P)return{min(P.stat.row,100),P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..toTime(D[2])end,
scoreDisp=function(D)return D[1].." Lines "..TIMESTR(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
local L=P.stat.row

View File

@@ -21,7 +21,7 @@ return{
mStr(R>=0 and R or 0,69,265)
end,
score=function(P)return{min(P.stat.row,100),P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..toTime(D[2])end,
scoreDisp=function(D)return D[1].." Lines "..TIMESTR(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
local L=P.stat.row

View File

@@ -6,7 +6,7 @@ return{
env={
noTele=true,
wait=8,fall=20,
target=10,dropPiece=function (P)
target=10,dropPiece=function(P)
if P.combo>1 or P.b2b>0 or P.lastPiece.row>1 then
if P.combo>1 then P:showText("2x",0,-220,40,"flicker",.3)end
if P.b2b>0 then P:showText("spin",0,-160,40,"flicker",.3)end

View File

@@ -37,7 +37,7 @@ return{
gc.rectangle("fill",25,375,90,4)
end,
score=function(P)return{math.min(P.stat.row,200),P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..toTime(D[2])end,
scoreDisp=function(D)return D[1].." Lines "..TIMESTR(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
local L=P.stat.row

View File

@@ -33,7 +33,7 @@ return{
gc.rectangle("fill",25,375,90,4)
end,
score=function(P)return{math.min(P.stat.row,200),P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..toTime(D[2])end,
scoreDisp=function(D)return D[1].." Lines "..TIMESTR(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
local L=P.stat.row

View File

@@ -63,7 +63,7 @@ return{
gc.rectangle("fill",25,375,90,4)
end,
score=function(P)return{P.modeData.point,P.stat.time}end,
scoreDisp=function(D)return D[1].."P "..toTime(D[2])end,
scoreDisp=function(D)return D[1].."P "..TIMESTR(D[2])end,
comp=function(a,b)
return a[1]>b[1]or(a[1]==b[1]and a[2]<b[2])
end,

View File

@@ -65,7 +65,7 @@ return{
gc.rectangle("fill",25,375,90,4)
end,
score=function(P)return{P.modeData.point,P.stat.time}end,
scoreDisp=function(D)return D[1].."P "..toTime(D[2])end,
scoreDisp=function(D)return D[1].."P "..TIMESTR(D[2])end,
comp=function(a,b)
return a[1]>b[1]or(a[1]==b[1]and a[2]<b[2])
end,

View File

@@ -62,7 +62,7 @@ return{
gc.rectangle("fill",25,375,90,4)
end,
score=function(P)return{P.modeData.point,P.stat.time}end,
scoreDisp=function(D)return D[1].."P "..toTime(D[2])end,
scoreDisp=function(D)return D[1].."P "..TIMESTR(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
local S=P.modeData.point

View File

@@ -154,7 +154,7 @@ return{
gc.rectangle("fill",25,375,90,4)
end,
score=function(P)return{P.result=="WIN"and 260 or P.modeData.point,P.stat.time}end,
scoreDisp=function(D)return D[1].."P "..toTime(D[2])end,
scoreDisp=function(D)return D[1].."P "..TIMESTR(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
local p=P.modeData.point

View File

@@ -22,7 +22,7 @@ return{
mText(drawableText.pc,69,432)
end,
score=function(P)return{P.stat.pc,P.stat.time}end,
scoreDisp=function(D)return D[1].." PCs "..toTime(D[2])end,
scoreDisp=function(D)return D[1].." PCs "..TIMESTR(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
local L=P.stat.pc

View File

@@ -22,7 +22,7 @@ return{
mText(drawableText.pc,69,432)
end,
score=function(P)return{P.stat.pc,P.stat.time}end,
scoreDisp=function(D)return D[1].." PCs "..toTime(D[2])end,
scoreDisp=function(D)return D[1].." PCs "..TIMESTR(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
local L=P.stat.pc

View File

@@ -20,7 +20,7 @@ return{
mText(drawableText.pc,69,432)
end,
score=function(P)return{P.stat.pc,P.stat.time}end,
scoreDisp=function(D)return D[1].." PCs "..toTime(D[2])end,
scoreDisp=function(D)return D[1].." PCs "..TIMESTR(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
local L=P.stat.pc

View File

@@ -69,7 +69,7 @@ return{
mText(drawableText.pc,69,412)
end,
score=function(P)return{P.stat.pc,P.stat.time}end,
scoreDisp=function(D)return D[1].." PCs "..toTime(D[2])end,
scoreDisp=function(D)return D[1].." PCs "..TIMESTR(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
local L=P.stat.pc

View File

@@ -59,7 +59,7 @@ return{
mText(drawableText.pc,69,412)
end,
score=function(P)return{P.stat.pc,P.stat.time}end,
scoreDisp=function(D)return D[1].." PCs "..toTime(D[2])end,
scoreDisp=function(D)return D[1].." PCs "..TIMESTR(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
local L=P.stat.pc

View File

@@ -66,7 +66,7 @@ return{
gc.circle("line",69,200,30+45*beat)
end,
score=function(P)return{math.min(P.stat.row,200),P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..toTime(D[2])end,
scoreDisp=function(D)return D[1].." Lines "..TIMESTR(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
local L=P.stat.row

View File

@@ -66,7 +66,7 @@ return{
gc.circle("line",69,200,30+45*beat)
end,
score=function(P)return{math.min(P.stat.row,200),P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..toTime(D[2])end,
scoreDisp=function(D)return D[1].." Lines "..TIMESTR(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
local L=P.stat.row

View File

@@ -72,7 +72,7 @@ return{
gc.circle("line",69,200,30+45*beat)
end,
score=function(P)return{math.min(P.stat.row,200),P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..toTime(D[2])end,
scoreDisp=function(D)return D[1].." Lines "..TIMESTR(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
local L=P.stat.row

View File

@@ -25,7 +25,7 @@ return{
PLY.newAIPlayer(2,AIBUILDER("CC",10,1,true,10000))
end,
score=function(P)return{P.stat.piece,P.stat.time}end,
scoreDisp=function(D)return D[1].." Pieces "..toTime(D[2])end,
scoreDisp=function(D)return D[1].." Pieces "..TIMESTR(D[2])end,
comp=function(a,b)return a[1]<b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
if P.result=="WIN"then

View File

@@ -25,7 +25,7 @@ return{
PLY.newAIPlayer(2,AIBUILDER("CC",10,2,true,16000))
end,
score=function(P)return{P.stat.piece,P.stat.time}end,
scoreDisp=function(D)return D[1].." Pieces "..toTime(D[2])end,
scoreDisp=function(D)return D[1].." Pieces "..TIMESTR(D[2])end,
comp=function(a,b)return a[1]<b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
if P.result=="WIN"then

View File

@@ -25,7 +25,7 @@ return{
PLY.newAIPlayer(2,AIBUILDER("CC",10,3,true,26000))
end,
score=function(P)return{P.stat.piece,P.stat.time}end,
scoreDisp=function(D)return D[1].." Pieces "..toTime(D[2])end,
scoreDisp=function(D)return D[1].." Pieces "..TIMESTR(D[2])end,
comp=function(a,b)return a[1]<b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
if P.result=="WIN"then

View File

@@ -25,7 +25,7 @@ return{
PLY.newAIPlayer(2,AIBUILDER("CC",10,1,true,13000))
end,
score=function(P)return{P.stat.piece,P.stat.time}end,
scoreDisp=function(D)return D[1].." Pieces "..toTime(D[2])end,
scoreDisp=function(D)return D[1].." Pieces "..TIMESTR(D[2])end,
comp=function(a,b)return a[1]<b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
if P.result=="WIN"then

View File

@@ -25,7 +25,7 @@ return{
PLY.newAIPlayer(2,AIBUILDER("CC",10,3,true,40000))
end,
score=function(P)return{P.stat.piece,P.stat.time}end,
scoreDisp=function(D)return D[1].." Pieces "..toTime(D[2])end,
scoreDisp=function(D)return D[1].." Pieces "..TIMESTR(D[2])end,
comp=function(a,b)return a[1]<b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
if P.result=="WIN"then

View File

@@ -12,7 +12,7 @@ return{
PLY.newAIPlayer(2,AIBUILDER("9S",4))
end,
score=function(P)return{P.stat.time}end,
scoreDisp=function(D)return toTime(D[1])end,
scoreDisp=function(D)return TIMESTR(D[1])end,
comp=function(a,b)return a[1]<b[1]end,
getRank=function(P)
if P.result=="WIN"then

View File

@@ -12,7 +12,7 @@ return{
PLY.newAIPlayer(2,AIBUILDER("9S",6))
end,
score=function(P)return{P.stat.time}end,
scoreDisp=function(D)return toTime(D[1])end,
scoreDisp=function(D)return TIMESTR(D[1])end,
comp=function(a,b)return a[1]<b[1]end,
getRank=function(P)
if P.result=="WIN"then

View File

@@ -12,7 +12,7 @@ return{
PLY.newAIPlayer(2,AIBUILDER("CC",6,2,true,30000))
end,
score=function(P)return{P.stat.time}end,
scoreDisp=function(D)return toTime(D[1])end,
scoreDisp=function(D)return TIMESTR(D[1])end,
comp=function(a,b)return a[1]<b[1]end,
getRank=function(P)
if P.result=="WIN"then

View File

@@ -12,7 +12,7 @@ return{
PLY.newAIPlayer(2,AIBUILDER("9S",5))
end,
score=function(P)return{P.stat.time}end,
scoreDisp=function(D)return toTime(D[1])end,
scoreDisp=function(D)return TIMESTR(D[1])end,
comp=function(a,b)return a[1]<b[1]end,
getRank=function(P)
if P.result=="WIN"then

View File

@@ -12,7 +12,7 @@ return{
PLY.newAIPlayer(2,AIBUILDER("CC",7,3,true,50000))
end,
score=function(P)return{P.stat.time}end,
scoreDisp=function(D)return toTime(D[1])end,
scoreDisp=function(D)return TIMESTR(D[1])end,
comp=function(a,b)return a[1]<b[1]end,
getRank=function(P)
if P.result=="WIN"then

View File

@@ -18,7 +18,7 @@ return{
PLY.draw.drawTargetLine(P,r)
end,
score=function(P)return{P.stat.time,P.stat.piece}end,
scoreDisp=function(D)return toTime(D[1]).." "..D[2].." Pieces"end,
scoreDisp=function(D)return TIMESTR(D[1]).." "..D[2].." Pieces"end,
comp=function(a,b)return a[1]<b[1]or(a[1]==b[1] and a[2]<b[2])end,
getRank=function(P)
if P.stat.row<40 then return end

View File

@@ -17,7 +17,7 @@ return{
PLY.draw.drawTargetLine(P,r)
end,
score=function(P)return{P.stat.time,P.stat.piece}end,
scoreDisp=function(D)return toTime(D[1]).." "..D[2].." Pieces"end,
scoreDisp=function(D)return TIMESTR(D[1]).." "..D[2].." Pieces"end,
comp=function(a,b)return a[1]<b[1]or(a[1]==b[1] and a[2]<b[2])end,
getRank=function(P)
if P.stat.row<40 then return end

View File

@@ -16,7 +16,7 @@ return{
PLY.draw.drawTargetLine(P,r)
end,
score=function(P)return{P.stat.time,P.stat.piece}end,
scoreDisp=function(D)return toTime(D[1]).." "..D[2].." Pieces"end,
scoreDisp=function(D)return TIMESTR(D[1]).." "..D[2].." Pieces"end,
comp=function(a,b)return a[1]<b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
if P.stat.row<1000 then return end

View File

@@ -16,7 +16,7 @@ return{
PLY.draw.drawTargetLine(P,r)
end,
score=function(P)return{P.stat.time,P.stat.piece}end,
scoreDisp=function(D)return toTime(D[1]).." "..D[2].." Pieces"end,
scoreDisp=function(D)return TIMESTR(D[1]).." "..D[2].." Pieces"end,
comp=function(a,b)return a[1]<b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
if P.stat.row<100 then return end

View File

@@ -16,7 +16,7 @@ return{
PLY.draw.drawTargetLine(P,r)
end,
score=function(P)return{P.stat.time,P.stat.piece}end,
scoreDisp=function(D)return toTime(D[1]).." "..D[2].." Pieces"end,
scoreDisp=function(D)return TIMESTR(D[1]).." "..D[2].." Pieces"end,
comp=function(a,b)return a[1]<b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
if P.stat.row<10 then return end

View File

@@ -16,7 +16,7 @@ return{
PLY.draw.drawTargetLine(P,r)
end,
score=function(P)return{P.stat.time,P.stat.piece}end,
scoreDisp=function(D)return toTime(D[1]).." "..D[2].." Pieces"end,
scoreDisp=function(D)return TIMESTR(D[1]).." "..D[2].." Pieces"end,
comp=function(a,b)return a[1]<b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
if P.stat.row<20 then return end

View File

@@ -16,7 +16,7 @@ return{
PLY.draw.drawTargetLine(P,r)
end,
score=function(P)return{P.stat.time,P.stat.piece}end,
scoreDisp=function(D)return toTime(D[1]).." "..D[2].." Pieces"end,
scoreDisp=function(D)return TIMESTR(D[1]).." "..D[2].." Pieces"end,
comp=function(a,b)return a[1]<b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
if P.stat.row<400 then return end

View File

@@ -16,7 +16,7 @@ return{
PLY.draw.drawTargetLine(P,r)
end,
score=function(P)return{P.stat.time,P.stat.piece}end,
scoreDisp=function(D)return toTime(D[1]).." "..D[2].." Pieces"end,
scoreDisp=function(D)return TIMESTR(D[1]).." "..D[2].." Pieces"end,
comp=function(a,b)return a[1]<b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
if P.stat.row<40 then return end

View File

@@ -31,7 +31,7 @@ return{
mText(drawableText.wave,69,375)
end,
score=function(P)return{P.modeData.event,P.stat.time}end,
scoreDisp=function(D)return D[1].." Waves "..toTime(D[2])end,
scoreDisp=function(D)return D[1].." Waves "..TIMESTR(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
local W=P.modeData.event

View File

@@ -37,7 +37,7 @@ return{
mText(drawableText.wave,69,375)
end,
score=function(P)return{P.modeData.event,P.stat.time}end,
scoreDisp=function(D)return D[1].." Waves "..toTime(D[2])end,
scoreDisp=function(D)return D[1].." Waves "..TIMESTR(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
local W=P.modeData.event

View File

@@ -32,7 +32,7 @@ return{
mText(drawableText.wave,69,375)
end,
score=function(P)return{P.modeData.event,P.stat.time}end,
scoreDisp=function(D)return D[1].." Waves "..toTime(D[2])end,
scoreDisp=function(D)return D[1].." Waves "..TIMESTR(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
local W=P.modeData.event

View File

@@ -36,7 +36,7 @@ return{
mText(drawableText.wave,69,375)
end,
score=function(P)return{P.modeData.event,P.stat.time}end,
scoreDisp=function(D)return D[1].." Waves "..toTime(D[2])end,
scoreDisp=function(D)return D[1].." Waves "..TIMESTR(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
local W=P.modeData.event

View File

@@ -38,7 +38,7 @@ return{
mText(drawableText.wave,69,375)
end,
score=function(P)return{P.modeData.event,P.stat.time}end,
scoreDisp=function(D)return D[1].." Waves "..toTime(D[2])end,
scoreDisp=function(D)return D[1].." Waves "..TIMESTR(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
local W=P.modeData.event

View File

@@ -23,7 +23,7 @@ return{
mText(drawableText.eff,69,363)
end,
score=function(P)return{P.stat.atk<=200 and int(P.stat.atk)or 200,P.stat.time}end,
scoreDisp=function(D)return D[1].." Attack "..toTime(D[2])end,
scoreDisp=function(D)return D[1].." Attack "..TIMESTR(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
local L=P.stat.atk

View File

@@ -35,7 +35,7 @@ return{
mText(drawableText.eff,69,363)
end,
score=function(P)return{P.stat.atk<=200 and int(P.stat.atk)or 200,P.stat.time}end,
scoreDisp=function(D)return D[1].." Attack "..toTime(D[2])end,
scoreDisp=function(D)return D[1].." Attack "..TIMESTR(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
local L=P.stat.atk

View File

@@ -22,7 +22,7 @@ return{
mText(drawableText.eff,69,363)
end,
score=function(P)return{P.stat.atk<=200 and int(P.stat.atk)or 200,P.stat.time}end,
scoreDisp=function(D)return D[1].." Attack "..toTime(D[2])end,
scoreDisp=function(D)return D[1].." Attack "..TIMESTR(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
local L=P.stat.atk

View File

@@ -32,7 +32,7 @@ return{
mText(drawableText.eff,69,363)
end,
score=function(P)return{P.stat.atk<=200 and int(P.stat.atk)or 200,P.stat.time}end,
scoreDisp=function(D)return D[1].." Attack "..toTime(D[2])end,
scoreDisp=function(D)return D[1].." Attack "..TIMESTR(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
local L=P.stat.atk

View File

@@ -22,7 +22,7 @@ return{
mText(drawableText.eff,69,363)
end,
score=function(P)return{P.stat.atk<=200 and int(P.stat.atk)or 200,P.stat.time}end,
scoreDisp=function(D)return D[1].." Attack "..toTime(D[2])end,
scoreDisp=function(D)return D[1].." Attack "..TIMESTR(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
local L=P.stat.atk

View File

@@ -32,7 +32,7 @@ return{
mText(drawableText.eff,69,363)
end,
score=function(P)return{P.stat.atk<=200 and int(P.stat.atk)or 200,P.stat.time}end,
scoreDisp=function(D)return D[1].." Attack "..toTime(D[2])end,
scoreDisp=function(D)return D[1].." Attack "..TIMESTR(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
local L=P.stat.atk

View File

@@ -22,7 +22,7 @@ return{
mText(drawableText.eff,69,363)
end,
score=function(P)return{P.stat.atk<=200 and int(P.stat.atk)or 200,P.stat.time}end,
scoreDisp=function(D)return D[1].." Attack "..toTime(D[2])end,
scoreDisp=function(D)return D[1].." Attack "..TIMESTR(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
local L=P.stat.atk

View File

@@ -32,7 +32,7 @@ return{
mText(drawableText.eff,69,363)
end,
score=function(P)return{P.stat.atk<=200 and int(P.stat.atk)or 200,P.stat.time}end,
scoreDisp=function(D)return D[1].." Attack "..toTime(D[2])end,
scoreDisp=function(D)return D[1].." Attack "..TIMESTR(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
local L=P.stat.atk

View File

@@ -27,7 +27,7 @@ return{
mText(drawableText.tsd,69,315)
end,
score=function(P)return{P.modeData.event,P.stat.time}end,
scoreDisp=function(D)return D[1].."TSD "..toTime(D[2])end,
scoreDisp=function(D)return D[1].."TSD "..TIMESTR(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
local T=P.modeData.event

View File

@@ -28,7 +28,7 @@ return{
mText(drawableText.tsd,69,315)
end,
score=function(P)return{P.modeData.event,P.stat.time}end,
scoreDisp=function(D)return D[1].."TSD "..toTime(D[2])end,
scoreDisp=function(D)return D[1].."TSD "..TIMESTR(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
local T=P.modeData.event

View File

@@ -28,7 +28,7 @@ return{
mText(drawableText.tsd,69,315)
end,
score=function(P)return{P.modeData.event,P.stat.time}end,
scoreDisp=function(D)return D[1].."TSD "..toTime(D[2])end,
scoreDisp=function(D)return D[1].."TSD "..TIMESTR(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
local T=P.modeData.event

View File

@@ -223,7 +223,7 @@ end
local function loadRemoteEnv(P,confStr)--Load gameEnv
local _,conf=pcall(love.data.decode,"string","base64",confStr)
if _ then
conf=json.decode(conf)
conf=JSON.decode(conf)
else
conf={}
LOG.print("Bad conf from "..P.userName.."#"..P.userID)

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,

View File

@@ -1,4 +1,4 @@
return splitStr([=[
return SPLITSTR([=[
"Patron"(time ordered, may not accurate) Thanks!!!
<<<<<<<<<<rmb1000+>>>>>>>>>>
☆★★☆☆☆☆★★☆