diff --git a/Zframework/aDraw.lua b/Zframework/aDraw.lua new file mode 100644 index 00000000..4dd9bfba --- /dev/null +++ b/Zframework/aDraw.lua @@ -0,0 +1,10 @@ +local printf=love.graphics.printf +local draw=love.graphics.draw +local aDraw={} +function aDraw.str(obj,x,y)printf(obj,x-626,y,1252,"center")end +function aDraw.simpX(obj,x,y)draw(obj,x-obj:getWidth()*.5,y)end +function aDraw.simpY(obj,x,y)draw(obj,x,y-obj:getHeight()*.5)end +function aDraw.X(obj,x,y,a,k)draw(obj,x,y,a,k,nil,obj:getWidth()*.5,0)end +function aDraw.Y(obj,x,y,a,k)draw(obj,x,y,a,k,nil,0,obj:getHeight()*.5)end +function aDraw.draw(obj,x,y,a,k)draw(obj,x,y,a,k,nil,obj:getWidth()*.5,obj:getHeight()*.5)end +return aDraw \ No newline at end of file diff --git a/Zframework/bgm.lua b/Zframework/bgm.lua index acfb0d2a..96864df1 100644 --- a/Zframework/bgm.lua +++ b/Zframework/bgm.lua @@ -50,7 +50,7 @@ function BGM.init(list) Sources[list[i]]:setLooping(true) Sources[list[i]]:setVolume(0) else - LOG.print("No BGM file: "..list[i],5,COLOR.orange) + LOG.print("No BGM file: "..list[i],5,COLOR.O) end if not skip and i~=count then coroutine.yield() diff --git a/Zframework/color.lua b/Zframework/color.lua index 3456562c..5550c0bb 100644 --- a/Zframework/color.lua +++ b/Zframework/color.lua @@ -4,51 +4,51 @@ local COLOR={ orange= {1.0, 0.6, 0.0}, yellow= {1.0, 1.0, 0.0}, lime= {0.7, 1.0, 0.0}, - grass= {0.5, 1.0, 0.0}, + jade= {0.5, 1.0, 0.0}, green= {0.0, 1.0, 0.0}, aqua= {0.0, 1.0, 0.6}, cyan= {0.0, 1.0, 1.0}, - sky= {0.0, 0.7, 1.0}, + navy= {0.0, 0.7, 1.0}, sea= {0.0, 0.4, 1.0}, blue= {0.2, 0.2, 1.0}, - purple= {0.4, 0.0, 1.0}, - grape= {0.7, 0.0, 1.0}, + violet= {0.4, 0.0, 1.0}, + purple= {0.7, 0.0, 1.0}, magenta= {1.0, 0.0, 1.0}, - pink= {1.0, 0.0, 0.5}, + wine= {1.0, 0.0, 0.5}, lRed= {1.0, 0.5, 0.5}, lFire= {1.0, 0.7, 0.5}, lOrange= {1.0, 0.8, 0.3}, lYellow= {1.0, 1.0, 0.5}, lLime= {0.8, 1.0, 0.4}, - lGrass= {0.6, 1.0, 0.4}, + lJade= {0.6, 1.0, 0.4}, lGreen= {0.5, 1.0, 0.5}, lAqua= {0.4, 1.0, 0.7}, lCyan= {0.5, 1.0, 1.0}, - lSky= {0.5, 0.8, 1.0}, + lNavy= {0.5, 0.8, 1.0}, lSea= {0.4, 0.7, 1.0}, lBlue= {0.7, 0.7, 1.0}, - lPurple= {0.7, 0.4, 1.0}, - lGrape= {0.8, 0.4, 1.0}, + lViolet= {0.7, 0.4, 1.0}, + lPurple= {0.8, 0.4, 1.0}, lMagenta= {1.0, 0.5, 1.0}, - lPink= {1.0, 0.4, 0.7}, + lWine= {1.0, 0.4, 0.7}, dRed= {0.6, 0.0, 0.0}, dFire= {0.6, 0.3, 0.0}, dOrange= {0.6, 0.4, 0.0}, dYellow= {0.6, 0.6, 0.0}, dLime= {0.5, 0.6, 0.0}, - dGrass= {0.3, 0.6, 0.0}, + dJade= {0.3, 0.6, 0.0}, dGreen= {0.0, 0.6, 0.0}, dAqua= {0.0, 0.6, 0.4}, dCyan= {0.0, 0.6, 0.6}, - dSky= {0.0, 0.4, 0.6}, + dNavy= {0.0, 0.4, 0.6}, dSea= {0.0, 0.2, 0.6}, dBlue= {0.1, 0.1, 0.6}, - dPurple= {0.2, 0.0, 0.6}, - dGrape= {0.4, 0.0, 0.6}, + dViolet= {0.2, 0.0, 0.6}, + dPurple= {0.4, 0.0, 0.6}, dMagenta= {0.6, 0.0, 0.6}, - dPink= {0.6, 0.0, 0.3}, + dWine= {0.6, 0.0, 0.3}, black= {0.0, 0.0, 0.0}, dGray= {0.3, 0.3, 0.3}, @@ -56,56 +56,67 @@ local COLOR={ lGray= {0.8, 0.8, 0.8}, white= {1.0, 1.0, 1.0}, } -local map={ - R="red", G="green", B="blue", C="cyan", Y="yellow", M="magenta", - lR="lRed", lG="lGreen",lB="lBlue", lC="lCyan", lY="lYellow", lM="lMagenta", - dR="dRed", dG="dGreen",dB="dBlue", dC="dCyan", dY="dYellow", dM="dMagenta", - W="white", -}for k,v in next,map do COLOR[k]=COLOR[v]end +for k,v in next,{ + R="red",F="fire",O="orange",Y="yellow",L="lime",J="jade",G="green",A="aqua",C="cyan",N="navy",S="sea",B="blue",V="violet",P="purple",M="magenta",W="wine", + lR="lRed",lF="lFire",lO="lOrange",lY="lYellow",lL="lLime",lJ="lJade",lG="lGreen",lA="lAqua",lC="lCyan",lN="lNavy",lS="lSea",lB="lBlue",lV="lViolet",lP="lPurple",lM="lMagenta",lW="lWine", + dR="dRed",dF="dFire",dO="dOrange",dY="dYellow",dL="dLime",dJ="dJade",dG="dGreen",dA="dAqua",dC="dCyan",dN="dNavy",dS="dSea",dB="dBlue",dV="dViolet",dP="dPurple",dM="dMagenta",dW="dWine", + D="black",dH="dGray",H="gray",lH="lGray",Z="white", + --Remain letter: EIKQTUX +}do + COLOR[k]=COLOR[v] +end +setmetatable(COLOR,{__index=function(_,k) + error("No color: "..tostring(k)) +end}) -local list_norm={"red","fire","orange","yellow","i","grass","green","aqua","cyan","sky","sea","blue","purple","grape","magenta","pink"} -local len_list_norm=#list_norm -local rnd=math.random -function COLOR.random_norm() - return COLOR[list_norm[rnd(len_list_norm)]] + +do--Random generators + local rnd=math.random + local list_norm={"red","fire","orange","yellow","lime","jade","green","aqua","cyan","navy","sea","blue","violet","purple","magenta","wine"} + local len_list_norm=#list_norm + function COLOR.random_norm() + return COLOR[list_norm[rnd(len_list_norm)]] + end + + local list_bright={"lRed","lFire","lOrange","lYellow","lLime","lJade","lGreen","lAqua","lCyan","lNavy","lSea","lBlue","lViolet","lPurple","lMagenta","lWine"} + local len_list_bright=#list_bright + function COLOR.random_bright() + return COLOR[list_bright[rnd(len_list_bright)]] + end + + local list_dark={"dRed","dFire","dOrange","dYellow","dLime","dJade","dGreen","dAqua","dCyan","dNavy","dSea","dBlue","dViolet","dPurple","dMagenta","dWine"} + local len_list_dark=#list_dark + function COLOR.random_dark() + return COLOR[list_dark[rnd(len_list_dark)]] + end end -local list_bright={"lRed","lFire","lOrange","lYellow","lLime","lGrass","lGreen","lAqua","lCyan","lSky","lSea","lBlue","lPurple","lGrape","lMagenta","lPink"} -local len_list_bright=#list_bright -function COLOR.random_bright() - return COLOR[list_bright[rnd(len_list_bright)]] -end - -local list_dark={"dRed","dFire","dOrange","dYellow","dLime","dGrass","dGreen","dAqua","dCyan","dSky","dSea","dBlue","dPurple","dGrape","dMagenta","dPink"} -local len_list_dark=#list_dark -function COLOR.random_dark() - return COLOR[list_dark[rnd(len_list_dark)]] -end - -local sin=math.sin -function COLOR.rainbow(phase) - return - sin(phase)*.4+.6, - sin(phase+2.0944)*.4+.6, - sin(phase-2.0944)*.4+.6 -end -function COLOR.rainbow_light(phase) - return - sin(phase)*.2+.7, - sin(phase+2.0944)*.2+.7, - sin(phase-2.0944)*.2+.7 -end -function COLOR.rainbow_dark(phase) - return - sin(phase)*.2+.4, - sin(phase+2.0944)*.2+.4, - sin(phase-2.0944)*.2+.4 -end -function COLOR.rainbow_gray(phase) - return - sin(phase)*.16+.5, - sin(phase+2.0944)*.16+.5, - sin(phase-2.0944)*.16+.5 +do--Rainbow generators + local sin=math.sin + function COLOR.rainbow(phase) + return + sin(phase)*.4+.6, + sin(phase+2.0944)*.4+.6, + sin(phase-2.0944)*.4+.6 + end + function COLOR.rainbow_light(phase) + return + sin(phase)*.2+.7, + sin(phase+2.0944)*.2+.7, + sin(phase-2.0944)*.2+.7 + end + function COLOR.rainbow_dark(phase) + return + sin(phase)*.2+.4, + sin(phase+2.0944)*.2+.4, + sin(phase-2.0944)*.2+.4 + end + function COLOR.rainbow_gray(phase) + return + sin(phase)*.16+.5, + sin(phase+2.0944)*.16+.5, + sin(phase-2.0944)*.16+.5 + end end return COLOR \ No newline at end of file diff --git a/Zframework/doGC.lua b/Zframework/doGC.lua index 48193c2e..f7367b5b 100644 --- a/Zframework/doGC.lua +++ b/Zframework/doGC.lua @@ -19,6 +19,15 @@ local cmds={ dCirc=function(...)gc.circle("line",...)end, fPoly=function(...)gc.polygon("fill",...)end, dPoly=function(...)gc.polygon("line",...)end, + + drArc=function(...)gc.arc("line",...)end, + flArc=function(...)gc.arc("fill",...)end, + dpArc=function(...)gc.arc("line","pie",...)end, + doArc=function(...)gc.arc("line","open",...)end, + dcArc=function(...)gc.arc("line","closed",...)end, + fpArc=function(...)gc.arc("fill","pie",...)end, + foArc=function(...)gc.arc("fill","open",...)end, + fcArc=function(...)gc.arc("fill","closed",...)end, } return function(L) gc.push() @@ -28,9 +37,7 @@ return function(L) gc.setColor(1,1,1) gc.setLineWidth(1) for i=3,#L do - print(L[i][1]) local cmd=cmds[L[i][1]] - print(L[i][1]) if type(cmd)=="string"then gc[cmd](unpack(L[i],2)) else diff --git a/Zframework/dumpTable.lua b/Zframework/dumpTable.lua index 9a48c432..1994d1f6 100644 --- a/Zframework/dumpTable.lua +++ b/Zframework/dumpTable.lua @@ -40,7 +40,7 @@ return function(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=TABLE.dump(v,t+1) elseif T=="boolean"then v=tostring(v) else error("Error data type!") end diff --git a/Zframework/file.lua b/Zframework/file.lua index 4453137f..66ca2f30 100644 --- a/Zframework/file.lua +++ b/Zframework/file.lua @@ -21,14 +21,14 @@ function FILE.load(name) return s end end - LOG.print(name.." "..text.loadError,COLOR.red) + LOG.print(name.." "..text.loadError,COLOR.R) end end function FILE.save(data,name,mode) if not mode then mode=""end if type(data)=="table"then if mode:find("l")then - data=DUMPTABLE(data) + data=TABLE.dump(data) if not data then LOG.print(name.." "..text.saveError.."dump error","error") return @@ -50,7 +50,7 @@ function FILE.save(data,name,mode) F:flush()F:close() if success then if not mode:find("q")then - LOG.print(text.saveDone,COLOR.green) + LOG.print(text.saveDone,COLOR.G) end else LOG.print(text.saveError..(mes or"unknown error"),"error") diff --git a/Zframework/init.lua b/Zframework/init.lua index b91d8303..221a1aa9 100644 --- a/Zframework/init.lua +++ b/Zframework/init.lua @@ -8,19 +8,15 @@ LOADLIB=require"Zframework.loadLib" WHEELMOV=require"Zframework.wheelScroll" require"Zframework.setFont" -MDRAW=require"Zframework.mDraw" - mStr=MDRAW.str - mText=MDRAW.simpX - mDraw=MDRAW.draw +ADRAW=require"Zframework.aDraw" + mStr=ADRAW.str + mText=ADRAW.simpX + mDraw=ADRAW.draw --- UPPERCHAR=require"Zframework.upperChar" JSON=require"Zframework.json" -DUMPTABLE=require"Zframework.dumpTable" -URLENCODE=require"Zframework.urlEncode" TABLE=require"Zframework.tableExtend" -SPLITSTR=require"Zframework.splitStr" -TIMESTR=require"Zframework.timeStr" +STRING=require"Zframework.stringExtend" VIB= require"Zframework.vibrate" SFX= require"Zframework.sfx" @@ -215,11 +211,11 @@ local function noDevkeyPressed(key) elseif key=="f5"then if WIDGET.sel then DBP(WIDGET.sel)end elseif key=="f6"then for k,v in next,_G do DBP(k,v)end elseif key=="f7"then if love._openConsole then love._openConsole()end - elseif key=="f8"then devMode=nil LOG.print("DEBUG OFF",COLOR.yellow) - elseif key=="f9"then devMode=1 LOG.print("DEBUG 1",COLOR.yellow) - elseif key=="f10"then devMode=2 LOG.print("DEBUG 2",COLOR.yellow) - elseif key=="f11"then devMode=3 LOG.print("DEBUG 3",COLOR.yellow) - elseif key=="f12"then devMode=4 LOG.print("DEBUG 4",COLOR.yellow) + elseif key=="f8"then devMode=nil LOG.print("DEBUG OFF",COLOR.Y) + elseif key=="f9"then devMode=1 LOG.print("DEBUG 1",COLOR.Y) + elseif key=="f10"then devMode=2 LOG.print("DEBUG 2",COLOR.Y) + elseif key=="f11"then devMode=3 LOG.print("DEBUG 3",COLOR.Y) + elseif key=="f12"then devMode=4 LOG.print("DEBUG 4",COLOR.Y) elseif key=="\\"then _G["\100\114\97\119\70\87\77"]=NULL elseif devMode==2 then if WIDGET.sel then @@ -249,7 +245,7 @@ function love.keypressed(key) return elseif key=="f8"then devMode=1 - LOG.print("DEBUG ON",COLOR.yellow) + LOG.print("DEBUG ON",COLOR.Y) elseif key=="f11"then switchFullscreen() elseif not SCN.swapping then @@ -281,7 +277,7 @@ function love.joystickremoved(JS) for i=1,#joysticks do if joysticks[i]==JS then rem(joysticks,i) - LOG.print("Joystick removed",COLOR.yellow) + LOG.print("Joystick removed",COLOR.Y) return end end @@ -454,10 +450,10 @@ local WScolor={ {.5,.8,1,.7}, } local devColor={ - COLOR.white, - COLOR.lMagenta, - COLOR.lGreen, - COLOR.lBlue, + COLOR.Z, + COLOR.lM, + COLOR.lG, + COLOR.lB, } love.draw,love.update=nil--remove default draw/update function love.run() @@ -588,7 +584,7 @@ function love.run() --Websocket status gc_push("transform") - gc.translate(SCR.w,0) + gc.translate(SCR.w,SCR.h-100) gc.scale(SCR.k) for i=1,5 do local status=WS.status(WSnames[i]) diff --git a/Zframework/loadLib.lua b/Zframework/loadLib.lua index 9f682e67..915a0b0d 100644 --- a/Zframework/loadLib.lua +++ b/Zframework/loadLib.lua @@ -4,7 +4,7 @@ return function(name,libName) if r1 and r2 then return r2 else - LOG.print("Cannot load "..name..": "..(r2 or r3),"warn",COLOR.red) + LOG.print("Cannot load "..name..": "..(r2 or r3),"warn",COLOR.R) end elseif SYSTEM=="Android"then local fs=love.filesystem @@ -17,25 +17,25 @@ return function(name,libName) if success then libFunc,message=package.loadlib(table.concat({SAVEDIR,libName.Android},"/"),libName.libFunc) if libFunc then - LOG.print(name.." lib loaded","warn",COLOR.green) + LOG.print(name.." lib loaded","warn",COLOR.G) break else - LOG.print("Cannot load "..name..": "..message,"warn",COLOR.red) + LOG.print("Cannot load "..name..": "..message,"warn",COLOR.R) end else - LOG.print("Write "..name.."-"..platform[i].." to saving failed: "..message,"warn",COLOR.red) + LOG.print("Write "..name.."-"..platform[i].." to saving failed: "..message,"warn",COLOR.R) end else - LOG.print("Read "..name.."-"..platform[i].." failed","warn",COLOR.red) + LOG.print("Read "..name.."-"..platform[i].." failed","warn",COLOR.R) end end if not libFunc then - LOG.print("Cannot load "..name,"warn",COLOR.red) + LOG.print("Cannot load "..name,"warn",COLOR.R) return end return libFunc() else - LOG.print("No "..name.." for "..SYSTEM,"warn",COLOR.red) + LOG.print("No "..name.." for "..SYSTEM,"warn",COLOR.R) return end return true diff --git a/Zframework/log.lua b/Zframework/log.lua index f82aebd7..81bd05c1 100644 --- a/Zframework/log.lua +++ b/Zframework/log.lua @@ -39,23 +39,23 @@ function LOG.print(text,T,C)--text,type/time,color local time local his if T=="warn"then - C=C or COLOR.yellow + C=C or COLOR.Y his=true time=180 elseif T=="error"then - C=C or COLOR.red + C=C or COLOR.R his=true time=210 elseif T=="message"then - C=C or COLOR.sky + C=C or COLOR.N his=true elseif type(T)=="number"then - C=C or COLOR.white + C=C or COLOR.Z time=T elseif type(T)=="table"then C=T elseif not C then - C=COLOR.white + C=COLOR.Z end if his then ins(debugMesHistory,SCN.cur..": "..tostring(text)) @@ -65,6 +65,6 @@ end function LOG.copy() local str=table.concat(debugMesHistory,"\n") love.system.setClipboardText(str) - LOG.print("Log copied",COLOR.blue) + LOG.print("Log copied",COLOR.B) end return LOG \ No newline at end of file diff --git a/Zframework/mDraw.lua b/Zframework/mDraw.lua deleted file mode 100644 index a1538c88..00000000 --- a/Zframework/mDraw.lua +++ /dev/null @@ -1,10 +0,0 @@ -local printf=love.graphics.printf -local draw=love.graphics.draw -local mDraw={} -function mDraw.str(str,x,y)printf(str,x-626,y,1252,"center")end -function mDraw.simpX(str,x,y)draw(str,x-str:getWidth()*.5,y)end -function mDraw.simpY(str,x,y)draw(str,x,y-str:getHeight()*.5)end -function mDraw.X(str,x,y,a,k)draw(str,x,y,a,k,nil,str:getWidth()*.5,0)end -function mDraw.Y(str,x,y,a,k)draw(str,x,y,a,k,nil,0,str:getHeight()*.5)end -function mDraw.draw(str,x,y,a,k)draw(str,x,y,a,k,nil,str:getWidth()*.5,str:getHeight()*.5)end -return mDraw \ No newline at end of file diff --git a/Zframework/sfx.lua b/Zframework/sfx.lua index 3ad983ad..eaff85a1 100644 --- a/Zframework/sfx.lua +++ b/Zframework/sfx.lua @@ -17,7 +17,7 @@ function SFX.init(list) if love.filesystem.getInfo(N)then Sources[list[i]]={love.audio.newSource(N,"static")} else - LOG.print("No SFX file: "..N,5,COLOR.orange) + LOG.print("No SFX file: "..N,5,COLOR.O) end if not skip and i~=count then coroutine.yield() diff --git a/Zframework/splitStr.lua b/Zframework/splitStr.lua deleted file mode 100644 index fcfbc94c..00000000 --- a/Zframework/splitStr.lua +++ /dev/null @@ -1,19 +0,0 @@ -local find,sub=string.find,string.sub -return function(s,sep,regex) - local L={} - local p1,p2=1--start,target - if regex then - while p1<=#s do - p2=find(s,sep,p1)or #s+1 - L[#L+1]=sub(s,p1,p2-1) - p1=p2+#sep - end - else - while p1<=#s do - p2=find(s,sep,p1,true)or #s+1 - L[#L+1]=sub(s,p1,p2-1) - p1=p2+#sep - end - end - return L -end \ No newline at end of file diff --git a/Zframework/stringExtend.lua b/Zframework/stringExtend.lua new file mode 100644 index 00000000..e62a3899 --- /dev/null +++ b/Zframework/stringExtend.lua @@ -0,0 +1,77 @@ +local STRING={} +local int,format=math.floor,string.format +local find,sub,upper=string.find,string.sub,string.upper + +do--function STRING.shiftChar(c) + local shiftMap={ + ["1"]="!",["2"]="@",["3"]="#",["4"]="$",["5"]="%", + ["6"]="^",["7"]="&",["8"]="*",["9"]="(",["0"]=")", + ["`"]="~",["-"]="_",["="]="+", + ["["]="{",["]"]="}",["\\"]="|", + [";"]=":",["'"]="\"", + [","]="<",["."]=">",["/"]="?", + } + function STRING.shiftChar(c) + return shiftMap[c]or upper(c) + end +end + +function STRING.split(s,sep,regex) + local L={} + local p1,p2=1--start,target + if regex then + while p1<=#s do + p2=find(s,sep,p1)or #s+1 + L[#L+1]=sub(s,p1,p2-1) + p1=p2+#sep + end + else + while p1<=#s do + p2=find(s,sep,p1,true)or #s+1 + L[#L+1]=sub(s,p1,p2-1) + p1=p2+#sep + end + end + return L +end + +function STRING.simpEmailCheck(e) + e=STRING.split(e,"@") + if #e~=2 then return false end + if e[1]:sub(-1)=="."or e[2]:sub(-1)=="."then return false end + local e1,e2=STRING.split(e[1],"."),STRING.split(e[2],".") + if #e1*#e2==0 then return false end + for _,v in next,e1 do if #v==0 then return false end end + for _,v in next,e2 do if #v==0 then return false end end + return true +end + +function STRING.time(s) + if s<60 then + return format("%.3f\"",s) + elseif s<3600 then + return format("%d'%05.2f\"",int(s/60),s%60) + else + local h=int(s/3600) + return format("%d:%.2d'%05.2f\"",h,int(s/60%60),s%60) + end +end + +do--function STRING.urlEncode(str) + local rshift=bit.rshift + local b16={[0]="0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"} + function STRING.urlEncode(str) + local out="" + for i=1,#str do + if str:sub(i,i):match("[a-zA-Z0-9]")then + out=out..str:sub(i,i) + else + local b=str:byte(i) + out=out.."%"..b16[rshift(b,4)]..b16[b%16] + end + end + return out + end +end + +return STRING \ No newline at end of file diff --git a/Zframework/tableExtend.lua b/Zframework/tableExtend.lua index fea18fea..8cce81a6 100644 --- a/Zframework/tableExtend.lua +++ b/Zframework/tableExtend.lua @@ -73,4 +73,60 @@ function TABLE.reIndex(org) end end end + +--Dump a simple lua table +do--function TABLE.dump(L,t) + local find=string.find + local tabs={ + [0]="", + "\t", + "\t\t", + "\t\t\t", + "\t\t\t\t", + "\t\t\t\t\t", + } + function dump(L,t) + local s + if t then + s="{\n" + else + s="return{\n" + t=1 + if type(L)~="table"then + return + end + end + local count=1 + for k,v in next,L do + local T=type(k) + if T=="number"then + if k==count then + k="" + count=count+1 + else + k="["..k.."]=" + end + elseif T=="string"then + if find(k,"[^0-9a-zA-Z_]")then + k="[\""..k.."\"]=" + else + k=k.."=" + end + elseif T=="boolean"then k="["..k.."]=" + else error("Error key type!") + end + T=type(v) + if T=="number"then v=tostring(v) + elseif T=="string"then v="\""..v.."\"" + elseif T=="table"then v=dump(v,t+1) + elseif T=="boolean"then v=tostring(v) + else error("Error data type!") + end + s=s..tabs[t]..k..v..",\n" + end + return s..tabs[t-1].."}" + end + TABLE.dump=dump +end + return TABLE \ No newline at end of file diff --git a/Zframework/theme.lua b/Zframework/theme.lua index a898dff7..d2d939e2 100644 --- a/Zframework/theme.lua +++ b/Zframework/theme.lua @@ -2,8 +2,8 @@ local THEME={ cur=false,--Current theme } local themeColor={ - xmas={COLOR.red,COLOR.white,COLOR.green}, - sprfes={COLOR.red,COLOR.orange,COLOR.yellow}, + xmas={COLOR.R,COLOR.Z,COLOR.G}, + sprfes={COLOR.R,COLOR.O,COLOR.Y}, } function THEME.calculate(Y,M,D) @@ -48,15 +48,15 @@ function THEME.set(theme) elseif theme=="xmas"then BG.setDefault("snow") BGM.setDefault("xmas") - LOG.print("==============",COLOR.red) - LOG.print("Merry Christmas!",COLOR.white) - LOG.print("==============",COLOR.red) + LOG.print("==============",COLOR.R) + LOG.print("Merry Christmas!",COLOR.Z) + LOG.print("==============",COLOR.R) elseif theme=="sprfes"then BG.setDefault("firework") BGM.setDefault("spring festival") - LOG.print(" ★☆☆★",COLOR.red) - LOG.print("新年快乐!",COLOR.white) - LOG.print(" ★☆☆★",COLOR.red) + LOG.print(" ★☆☆★",COLOR.R) + LOG.print("新年快乐!",COLOR.Z) + LOG.print(" ★☆☆★",COLOR.R) elseif theme=="zday1"then BG.setDefault("lanterns") BGM.setDefault("empty") diff --git a/Zframework/timeStr.lua b/Zframework/timeStr.lua deleted file mode 100644 index 328ac096..00000000 --- a/Zframework/timeStr.lua +++ /dev/null @@ -1,11 +0,0 @@ -local int,format=math.floor,string.format -return function(s) - if s<60 then - return format("%.3f\"",s) - elseif s<3600 then - return format("%d'%05.2f\"",int(s/60),s%60) - else - local h=int(s/3600) - return format("%d:%.2d'%05.2f\"",h,int(s/60%60),s%60) - end -end \ No newline at end of file diff --git a/Zframework/upperChar.lua b/Zframework/upperChar.lua index 68de1dee..e69de29b 100644 --- a/Zframework/upperChar.lua +++ b/Zframework/upperChar.lua @@ -1,12 +0,0 @@ -local upper=string.upper -local upperList={ - ["1"]="!",["2"]="@",["3"]="#",["4"]="$",["5"]="%", - ["6"]="^",["7"]="&",["8"]="*",["9"]="(",["0"]=")", - ["`"]="~",["-"]="_",["="]="+", - ["["]="{",["]"]="}",["\\"]="|", - [";"]=":",["'"]="\"", - [","]="<",["."]=">",["/"]="?", -} -return function(c) - return upperList[c]or upper(c) -end \ No newline at end of file diff --git a/Zframework/urlEncode.lua b/Zframework/urlEncode.lua index b6a8188f..e69de29b 100644 --- a/Zframework/urlEncode.lua +++ b/Zframework/urlEncode.lua @@ -1,14 +0,0 @@ -local rshift=bit.rshift -local b16={[0]="0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"} -return function(str) - local out="" - for i=1,#str do - if str:sub(i,i):match("[a-zA-Z0-9]")then - out=out..str:sub(i,i) - else - local b=str:byte(i) - out=out.."%"..b16[rshift(b,4)]..b16[b%16] - end - end - return out -end \ No newline at end of file diff --git a/Zframework/voice.lua b/Zframework/voice.lua index 2f4d32ae..3c15118d 100644 --- a/Zframework/voice.lua +++ b/Zframework/voice.lua @@ -45,7 +45,7 @@ function VOC.init(list) if n==1 then if not loadVoiceFile(list[i],list[i])then - LOG.print("No VOICE file: "..list[i],5,COLOR.orange) + LOG.print("No VOICE file: "..list[i],5,COLOR.O) end end if not Source[list[i]][1]then Source[list[i]]=nil end diff --git a/Zframework/widget.lua b/Zframework/widget.lua index 60209fad..7cfadc70 100644 --- a/Zframework/widget.lua +++ b/Zframework/widget.lua @@ -1,17 +1,18 @@ -local gc=love.graphics local kb=love.keyboard +local gc=love.graphics local int,abs=math.floor,math.abs local max,min=math.max,math.min local sub,format=string.sub,string.format local ins=table.insert +local COLOR=COLOR local setFont,mStr=setFont,mStr +local mDraw_X,mDraw_Y=ADRAW.simpX,ADRAW.simpY -local alignModes={ - M="center", - L="left", - R="right", - F="justify", +local allowNoText={ + image=true, + inputBox=true, + textBox=true, } local WIDGET={} @@ -25,15 +26,7 @@ local text={ type="text", alpha=0, } -function text:reset() - if type(self.text)=="string"then - self.text=gc.newText(getFont(self.font),self.text) - elseif type(self.text)~="userdata"or self.text.type(self.text)~="Text"then - self.text=gc.newText(getFont(self.font),self.name) - self.color=COLOR.dPurple - self.font=self.font-10 - end -end +function text:reset()end function text:update() if self.hideCon and self.hideCon()then if self.alpha>0 then @@ -47,12 +40,13 @@ function text:draw() if self.alpha>0 then local c=self.color gc.setColor(c[1],c[2],c[3],self.alpha) + local obj=self.obj if self.align=="M"then - gc.draw(self.text,self.x-self.text:getWidth()*.5,self.y) + mDraw_X(obj,self.x,self.y) elseif self.align=="L"then - gc.draw(self.text,self.x,self.y) + gc.draw(obj,self.x,self.y) elseif self.align=="R"then - gc.draw(self.text,self.x-self.text:getWidth(),self.y) + gc.draw(obj,self.x-obj:getWidth(),self.y) end end end @@ -63,7 +57,7 @@ function WIDGET.newText(D)--name,x,y[,fText][,color][,font=30][,align="M"][,hide y= D.y, fText= D.fText, - color= D.color and(COLOR[D.color]or D.color)or COLOR.white, + color= D.color and(COLOR[D.color]or D.color)or COLOR.Z, font= D.font or 30, align= D.align or"M", hideCon=D.hide, @@ -109,6 +103,13 @@ local button={ function button:reset() self.ATV=0 end +function button:setObject(obj) + if type(obj)=="string"or type(obj)=="number"then + self.obj=gc.newText(getFont(self.font),obj) + elseif obj then + self.obj=obj + end +end function button:isAbove(x,y) local ATV=self.ATV return @@ -150,21 +151,33 @@ function button:draw() gc.setColor(1,1,1,ATV*.125) gc.rectangle("line",x-ATV+2,y-ATV+2,w+2*ATV-4,h+2*ATV-4) end - local t=self.text - if t then - setFont(self.font) - local y0=y+h*.5-self.font*.7-ATV*.5 - gc.setColor(1,1,1,.2+ATV*.05) - local edge=self.edge - gc.printf(t,x+edge-2,y0-2,w-2*edge,self.align) - gc.printf(t,x+edge-2,y0+2,w-2*edge,self.align) - gc.printf(t,x+edge+2,y0-2,w-2*edge,self.align) - gc.printf(t,x+edge+2,y0+2,w-2*edge,self.align) + local obj=self.obj + local y0=y+h*.5-ATV*.5 + gc.setColor(1,1,1,.2+ATV*.05) + if self.align=="M"then + local x0=x+w*.5 + mDraw(obj,x0-2,y0-2) + mDraw(obj,x0-2,y0+2) + mDraw(obj,x0+2,y0-2) + mDraw(obj,x0+2,y0+2) gc.setColor(r*.5,g*.5,b*.5) - gc.printf(t,x+edge,y0,w-2*edge,self.align) - else - self.text=self.name or"###" - self.color=COLOR.dPurple + mDraw(obj,x0,y0) + elseif self.align=="L"then + local edge=self.edge + mDraw_Y(obj,x+edge-2,y0-2) + mDraw_Y(obj,x+edge-2,y0+2) + mDraw_Y(obj,x+edge+2,y0-2) + mDraw_Y(obj,x+edge+2,y0+2) + gc.setColor(r*.5,g*.5,b*.5) + mDraw_Y(obj,x+edge,y0) + elseif self.align=="R"then + local x0=x+w-self.edge-obj:getWidth() + mDraw_Y(obj,x0-2,y0-2) + mDraw_Y(obj,x0-2,y0+2) + mDraw_Y(obj,x0+2,y0-2) + mDraw_Y(obj,x0+2,y0+2) + gc.setColor(r*.5,g*.5,b*.5) + mDraw_Y(obj,x0,y0) end end function button:getInfo() @@ -194,9 +207,9 @@ function WIDGET.newButton(D)--name,x,y,w[,h][,fText][,color][,font][,align="M"[, }, fText= D.fText, - color= D.color and(COLOR[D.color]or D.color)or COLOR.white, + color= D.color and(COLOR[D.color]or D.color)or COLOR.Z, font= D.font or 30, - align= alignModes[D.align or"M"]or"center", + align= D.align or"M", edge= D.edge or 0, code= D.code, hide= D.hide, @@ -213,6 +226,13 @@ local key={ function key:reset() self.ATV=0 end +function key:setObject(obj) + if type(obj)=="string"or type(obj)=="number"then + self.obj=gc.newText(getFont(self.font),obj) + elseif obj then + self.obj=obj + end +end function key:isAbove(x,y) return x>self.x and @@ -244,14 +264,13 @@ function key:draw() gc.setLineWidth(4) gc.rectangle("line",x,y,w,h) - local t=self.text - if t then - setFont(self.font) - gc.setColor(r,g,b,1.2) - gc.printf(t,x+self.edge,y+h*.5-self.font*.7,w-2*self.edge,self.align) - else - self.text=self.name or"###" - self.color=COLOR.dPurple + gc.setColor(r,g,b,1.2) + if self.align=="M"then + mDraw(self.obj,x+w*.5,y+h*.5) + elseif self.align=="L"then + mDraw_Y(self.obj,x+self.edge,y+h*.5) + elseif self.align=="R"then + mDraw_Y(self.obj,self.x-self.edge-self.obj:getWidth(),y+h*.5) end end function key:getInfo() @@ -279,9 +298,9 @@ function WIDGET.newKey(D)--name,x,y,w[,h][,fText][,color][,font][,align="M"[,edg }, fText= D.fText, - color= D.color and(COLOR[D.color]or D.color)or COLOR.white, + color= D.color and(COLOR[D.color]or D.color)or COLOR.Z, font= D.font or 30, - align= alignModes[D.align or"M"]or"center", + align= D.align or"M", edge= D.edge or 0, code= D.code, hide= D.hide, @@ -336,13 +355,10 @@ function switch:draw() gc.setColor(1,1,1,.6+ATV*.05) gc.rectangle("line",x,y,50,50) - --Text - local t=self.text - if t then - gc.setColor(self.color) - setFont(self.font) - gc.printf(t,x-412-ATV,y+20-self.font*.7,400,"right") - end + --Drawable + local obj=self.obj + gc.setColor(self.color) + mDraw_Y(obj,x-12-ATV-obj:getWidth(),y+25) end function switch:getInfo() return format("x=%d,y=%d,font=%d",self.x,self.y,self.font) @@ -363,7 +379,7 @@ function WIDGET.newSwitch(D)--name,x,y[,fText][,color][,font][,disp],code,hide }, fText= D.fText, - color= D.color and(COLOR[D.color]or D.color)or COLOR.white, + color= D.color and(COLOR[D.color]or D.color)or COLOR.Z, font= D.font or 30, disp= D.disp, code= D.code, @@ -461,13 +477,10 @@ function slider:draw() mStr(self:show(),cx,by-30) end - --Text - local t=self.text - if t then - gc.setColor(self.color) - setFont(self.font) - gc.printf(t,x-312-ATV,y-self.font*.7,300,"right") - end + --Drawable + local obj=self.obj + gc.setColor(self.color) + mDraw_Y(obj,x-12-ATV-obj:getWidth(),y) end function slider:getInfo() return format("x=%d,y=%d,w=%d",self.x,self.y,self.w) @@ -520,7 +533,7 @@ function WIDGET.newSlider(D)--name,x,y,w[,fText][,color][,unit][,smooth][,font][ }, fText= D.fText, - color= D.color and(COLOR[D.color]or D.color)or COLOR.white, + color= D.color and(COLOR[D.color]or D.color)or COLOR.Z, unit= D.unit or 1, smooth= false, font= D.font or 30, @@ -622,14 +635,11 @@ function selector:draw() end end - --Text - setFont(30) - t=self.text - if t then - gc.setColor(self.color) - mStr(self.text,x+w*.5,y+17-21) - end + --Drawable + gc.setColor(self.color) + ADRAW.simpX(self.obj,x+w*.5,y+17-21) gc.setColor(1,1,1) + setFont(30) mStr(self.selText,x+w*.5,y+43-21) end function selector:getInfo() @@ -689,7 +699,8 @@ function WIDGET.newSelector(D)--name,x,y,w[,fText][,color],list,disp,code,hide }, fText= D.fText, - color= D.color and(COLOR[D.color]or D.color)or COLOR.white, + color= D.color and(COLOR[D.color]or D.color)or COLOR.Z, + font= 30, list= D.list, disp= D.disp, code= D.code, @@ -744,11 +755,11 @@ function inputBox:draw() gc.setLineWidth(4) gc.rectangle("line",x,y,w,h) - --Text + --Drawable setFont(self.font) - local t=self.text - if t then - gc.printf(t,x-412,y+h*.5-self.font*.7,400,"right") + local obj=self.obj + if obj then + mDraw_Y(obj,x-12-obj:getWidth(),y+h*.5) end if self.secret then for i=1,#self.value do @@ -1004,7 +1015,15 @@ function WIDGET.setLang(widgetText) for S,L in next,SCN.scenes do if L.widgetList then for _,W in next,L.widgetList do - W.text=W.fText or widgetText[S][W.name] + local t=W.fText or widgetText[S][W.name] + if not t and not allowNoText[W.type]then + t=W.name or"##" + W.color=COLOR.dV + end + if type(t)=="string"and W.font then + t=gc.newText(getFont(W.font),t) + end + W.obj=t end end end diff --git a/document/mode.txt b/document/mode.txt index fbee7782..d63f849f 100644 --- a/document/mode.txt +++ b/document/mode.txt @@ -129,7 +129,7 @@ return{--返回一个table,你也可以在之前定义一些常量或者函数 PLY.draw.drawTargetLine(P,r)--使用自带的境界高度线绘制函数 end, score=function(P)return{P.stat.time,P.stat.piece}end,--游戏结束时需要保存的本局关键信息 - scoreDisp=function(D)return TIMESTR(D[1]).." "..D[2].." Pieces"end,--把score返回的数据显示出来的方法 + scoreDisp=function(D)return STRING.time(D[1]).." "..D[2].." Pieces"end,--把score返回的数据显示出来的方法 comp=function(a,b)return a[1]0 then - if y>height then - height=y +do--function checkWarning() + local max=math.max + function checkWarning() + local P1=PLAYERS[1] + if P1.alive then + if P1.frameRun%26==0 then + local F=P1.field + local height=0--Max height of row 4~7 + for x=4,7 do + for y=#F,1,-1 do + if F[y][x]>0 then + if y>height then + height=y + end + break end - break end end + GAME.warnLVL0=math.log(height-(P1.gameEnv.fieldH-5)+P1.atkBuffer.sum*.8) end - GAME.warnLVL0=math.log(height-(P1.gameEnv.fieldH-5)+P1.atkBuffer.sum*.8) + local _=GAME.warnLVL + if _0 then + _=max(_-.026,0) + end + GAME.warnLVL=_ + elseif GAME.warnLVL>0 then + GAME.warnLVL=max(GAME.warnLVL-.026,0) end - local _=GAME.warnLVL - if _0 then - _=max(_-.026,0) + if GAME.warnLVL>1.126 and P1.frameRun%30==0 then + SFX.fplay("warning",SETTING.sfx_warn) end - GAME.warnLVL=_ - elseif GAME.warnLVL>0 then - GAME.warnLVL=max(GAME.warnLVL-.026,0) - end - if GAME.warnLVL>1.126 and P1.frameRun%30==0 then - SFX.fplay("warning",SETTING.sfx_warn) end end @@ -933,7 +926,7 @@ do--function saveRecording() --Filtering modes that cannot be saved for _,v in next,noRecList do if GAME.curModeName:find(v)then - LOG.print("Cannot save recording of this mode now!",COLOR.sky) + LOG.print("Cannot save recording of this mode now!",COLOR.N) return end end @@ -987,6 +980,7 @@ do--function drawFWM() --等Techmino发展到一定程度之后会解除这个限制 --最后,别把藏在这里的东西截图/复制出去哦~ --感谢您对Techmino的支持!!! + local sin=math.sin local setFont,TIME,mStr=setFont,TIME,mStr function drawFWM() local t=TIME() @@ -995,6 +989,22 @@ do--function drawFWM() mStr(m[_G["\83\69\84\84\73\78\71"]["\108\97\110\103"]or m[1]],240,60+26*sin(t)) end end +do--function drawSelfProfile() + function drawSelfProfile() + local selfAvatar=USERS.getAvatar(USER.uid) + gc_push("transform") + gc_translate(1280,0) + + --Draw avatar + gc_setLineWidth(2) + gc_setColor(.3,.3,.3,.8)gc_rectangle("fill",-260,0,260,80) + gc_setColor(1,1,1)gc_rectangle("line",-260,0,260,80) + gc_rectangle("line",-73,7,66,66,2) + gc_draw(selfAvatar,-72,8,nil,.5) + + gc_pop() + end +end function drawWarning() if SETTING.warn and GAME.warnLVL>0 then gc_push("transform") diff --git a/parts/globalTables.lua b/parts/globalTables.lua index 4ee9d2ec..7a0a391d 100644 --- a/parts/globalTables.lua +++ b/parts/globalTables.lua @@ -4,94 +4,94 @@ local function disableKey(P,key) end MODOPT={--Mod options {no=0,id="NX",name="next", - key="q",x=80,y=230,color="orange", + key="q",x=80,y=230,color="O", list={0,1,2,3,4,5,6}, func=function(P,O)P.gameEnv.nextCount=O end, }, {no=1,id="HL",name="hold", - key="w",x=200,y=230,color="orange", + key="w",x=200,y=230,color="O", list={0,1,2,3,4,5,6}, func=function(P,O)P.gameEnv.holdCount=O end, unranked=true, }, {no=2,id="FL",name="hideNext", - key="e",x=320,y=230,color="aqua", + key="e",x=320,y=230,color="A", list={1,2,3,4,5}, func=function(P,O)P.gameEnv.nextStartPos=O +1 end, }, {no=3,id="IH",name="infHold", - key="r",x=440,y=230,color="aqua", + key="r",x=440,y=230,color="A", func=function(P)P.gameEnv.infHold=true end, unranked=true, }, {no=4,id="HB",name="hideBlock", - key="y",x=680,y=230,color="purple", + key="y",x=680,y=230,color="V", func=function(P)P.gameEnv.block=false end, }, {no=5,id="HG",name="hideGhost", - key="u",x=800,y=230,color="purple", + key="u",x=800,y=230,color="V", func=function(P)P.gameEnv.ghost=false end, }, {no=6,id="HD",name="hidden", - key="i",x=920,y=230,color="grape", + key="i",x=920,y=230,color="P", list={"easy","slow","medium","fast","none"}, func=function(P,O)P.gameEnv.visible=O end, unranked=true, }, {no=7,id="HB",name="hideBoard", - key="o",x=1040,y=230,color="grape", + key="o",x=1040,y=230,color="P", list={"down","up","all"}, func=function(P,O)P.gameEnv.hideBoard=O end, }, {no=8,id="FB",name="flipBoard", - key="p",x=1160,y=230,color="grass", + key="p",x=1160,y=230,color="J", list={"U-D","L-R","180"}, func=function(P,O)P.gameEnv.flipBoard=O end, }, {no=9,id="DT",name="dropDelay", - key="a",x=140,y=350,color="red", + key="a",x=140,y=350,color="R", list={0,.125,.25,.5,1,2,3,4,5,6,7,8,9,10,12,14,16,18,20,25,30,40,60,180,1e99}, func=function(P,O)P.gameEnv.drop=O end, unranked=true, }, {no=10,id="LT",name="lockDelay", - key="s",x=260,y=350,color="red", + key="s",x=260,y=350,color="R", list={0,1,2,3,4,5,6,7,8,9,10,12,14,16,18,20,25,30,40,60,180,1e99}, func=function(P,O)P.gameEnv.lock=O end, unranked=true, }, {no=11,id="ST",name="waitDelay", - key="d",x=380,y=350,color="red", + key="d",x=380,y=350,color="R", list={0,1,2,3,4,5,6,7,8,10,15,20,30,60}, func=function(P,O)P.gameEnv.wait=O end, unranked=true, }, {no=12,id="CT",name="fallDelay", - key="f",x=500,y=350,color="red", + key="f",x=500,y=350,color="R", list={0,1,2,3,4,5,6,7,8,10,15,20,30,60}, func=function(P,O)P.gameEnv.fall=O end, unranked=true, }, {no=13,id="LF",name="life", - key="j",x=860,y=350,color="yellow", + key="j",x=860,y=350,color="Y", list={0,1,2,3,5,10,15,26,42,87,500}, func=function(P,O)P.gameEnv.life=O end, unranked=true, }, {no=14,id="FB",name="forceB2B", - key="k",x=980,y=350,color="yellow", + key="k",x=980,y=350,color="Y", func=function(P)P.gameEnv.b2bKill=true end, unranked=true, }, {no=15,id="PF",name="forceFinesse", - key="l",x=1100,y=350,color="yellow", + key="l",x=1100,y=350,color="Y", func=function(P)P.gameEnv.fineKill=true end, unranked=true, }, {no=16,id="TL",name="tele", - key="z",x=200,y=470,color="lGray", + key="z",x=200,y=470,color="lH", func=function(P) P.gameEnv.das,P.gameEnv.arr=0,0 P.gameEnv.sddas,P.gameEnv.sdarr=0,0 @@ -99,7 +99,7 @@ MODOPT={--Mod options unranked=true, }, {no=17,id="FX",name="noRotation", - key="x",x=320,y=470,color="lGray", + key="x",x=320,y=470,color="lH", func=function(P) disableKey(P,3) disableKey(P,4) @@ -108,7 +108,7 @@ MODOPT={--Mod options unranked=true, }, {no=18,id="GL",name="noMove", - key="c",x=440,y=470,color="lGray", + key="c",x=440,y=470,color="lH", func=function(P) disableKey(P,1)disableKey(P,2) disableKey(P,11)disableKey(P,12) @@ -118,19 +118,19 @@ MODOPT={--Mod options unranked=true, }, {no=19,id="CS",name="customSeq", - key="b",x=680,y=470,color="blue", + key="b",x=680,y=470,color="B", list={"bag","his4","c2","rnd","mess","reverb"}, func=function(P,O)P.gameEnv.sequence=O end, unranked=true, }, {no=20,id="PS",name="pushSpeed", - key="n",x=800,y=470,color="blue", + key="n",x=800,y=470,color="B", list={.5,1,2,3,5,15,1e99}, func=function(P,O)P.gameEnv.pushSpeed=O end, unranked=true, }, {no=21,id="BN",name="boneBlock", - key="m",x=920,y=470,color="blue", + key="m",x=920,y=470,color="B", list={"on","off"}, func=function(P,O)P.gameEnv.bone=O=="on"end, }, @@ -148,44 +148,6 @@ PLY_NET={} FIELD={}--Field(s) for custom game BAG={}--Sequence for custom game MISSION={}--Clearing mission for custom game -CUSTOMENV={--gameEnv for cutsom game - --Basic - drop=60, - lock=60, - wait=0, - fall=0, - - --Control - nextCount=6, - holdCount=1, - infHold=false, - phyHold=false, - - --Visual - bone=false, - - --Rule - sequence="bag", - fieldH=20, - - ospin=true, - fineKill=false, - b2bKill=false, - easyFresh=true, - deepDrop=false, - visible="show", - freshLimit=1e99, - - - opponent="X", - life=0, - pushSpeed=3, - missionKill=false, - - --Else - bg="none", - bgm="race", -} GAME={--Global game data init=false, --If need initializing game when enter scene-play net=false, --If play net game @@ -227,6 +189,47 @@ USER=FILE.load("conf/user")or{--User infomation --Local data xp=0,lv=1, } +CUSTOMENV=FILE.load("conf/customEnv") +if not CUSTOMENV or CUSTOMENV.version~=VERSION.code then CUSTOMENV={--gameEnv for cutsom game + version=VERSION.code, + + --Basic + drop=1e99, + lock=1e99, + wait=0, + fall=0, + + --Control + nextCount=6, + holdCount=1, + infHold=true, + phyHold=false, + + --Visual + bone=false, + + --Rule + sequence="bag", + fieldH=20, + + ospin=true, + fineKill=false, + b2bKill=false, + easyFresh=true, + deepDrop=false, + visible="show", + freshLimit=1e99, + + + opponent="X", + life=0, + pushSpeed=3, + missionKill=false, + + --Else + bg="none", + bgm="infinite", +}end SETTING={--Settings --Tuning das=10,arr=2,dascut=0, @@ -331,26 +334,26 @@ keyMap=FILE.load("conf/key")or{--Key setting }, } VK_org=FILE.load("conf/virtualkey")or{--Virtualkey layout, refresh all VKs' position with this before each game - {ava=true, x=80, y=720-200, r=80,color=COLOR.lime},--moveLeft - {ava=true, x=320, y=720-200, r=80,color=COLOR.lime},--moveRight - {ava=true, x=1280-80, y=720-200, r=80,color=COLOR.red},--rotRight - {ava=true, x=1280-200, y=720-80, r=80,color=COLOR.orange},--rotLeft - {ava=true, x=1280-200, y=720-320, r=80,color=COLOR.magenta},--rot180 - {ava=true, x=200, y=720-320, r=80,color=COLOR.cyan},--hardDrop - {ava=true, x=200, y=720-80, r=80,color=COLOR.sea},--softDrop - {ava=true, x=1280-320, y=720-200, r=80,color=COLOR.yellow},--hold - {ava=true, x=1280-80, y=280, r=80,color=COLOR.lRed},--func1 - {ava=true, x=80, y=280, r=80,color=COLOR.lMagenta},--func2 - {ava=false, x=100, y=50, r=80,color=COLOR.aqua},--insLeft - {ava=false, x=200, y=50, r=80,color=COLOR.aqua},--insRight + {ava=true, x=80, y=720-200, r=80,color=COLOR.L},--moveLeft + {ava=true, x=320, y=720-200, r=80,color=COLOR.L},--moveRight + {ava=true, x=1280-80, y=720-200, r=80,color=COLOR.R},--rotRight + {ava=true, x=1280-200, y=720-80, r=80,color=COLOR.O},--rotLeft + {ava=true, x=1280-200, y=720-320, r=80,color=COLOR.M},--rot180 + {ava=true, x=200, y=720-320, r=80,color=COLOR.C},--hardDrop + {ava=true, x=200, y=720-80, r=80,color=COLOR.S},--softDrop + {ava=true, x=1280-320, y=720-200, r=80,color=COLOR.Y},--hold + {ava=true, x=1280-80, y=280, r=80,color=COLOR.lR},--func1 + {ava=true, x=80, y=280, r=80,color=COLOR.lM},--func2 + {ava=false, x=100, y=50, r=80,color=COLOR.A},--insLeft + {ava=false, x=200, y=50, r=80,color=COLOR.A},--insRight {ava=false, x=300, y=50, r=80,color={COLOR.rainbow(3.5)}},--insDown {ava=false, x=400, y=50, r=80,color={COLOR.rainbow(3.3)}},--down1 {ava=false, x=500, y=50, r=80,color={COLOR.rainbow(3.1)}},--down4 {ava=false, x=600, y=50, r=80,color={COLOR.rainbow(2.9)}},--down10 - {ava=false, x=700, y=50, r=80,color=COLOR.lLime},--dropLeft - {ava=false, x=800, y=50, r=80,color=COLOR.lLime},--dropRight - {ava=false, x=900, y=50, r=80,color=COLOR.laqua},--addToLeft - {ava=false, x=1000, y=50, r=80,color=COLOR.laqua},--addToRight + {ava=false, x=700, y=50, r=80,color=COLOR.lL},--dropLeft + {ava=false, x=800, y=50, r=80,color=COLOR.lL},--dropRight + {ava=false, x=900, y=50, r=80,color=COLOR.lA},--addToLeft + {ava=false, x=1000, y=50, r=80,color=COLOR.lA},--addToRight } virtualkey={}for i=1,#VK_org do virtualkey[i]={}end--In-game virtualkey layout REPLAY=FILE.load("conf/replay")or{} \ No newline at end of file diff --git a/parts/language/dict_en.lua b/parts/language/dict_en.lua index c720acc1..22595737 100644 --- a/parts/language/dict_en.lua +++ b/parts/language/dict_en.lua @@ -47,19 +47,19 @@ return{ "ttt tetris trainer tres bien", "game", "*Web-based, no mobile support | Single player*\nTetris Trainer Tres-Bien. A hands-on tutorial of advanced techniques in modern Tetris.\nRecommended for players that can complete a 40-line Sprint with all Tetris line clears and no hold.\nCovered topics include T-Spin, finesse, SRS, and some battle setups.\nLinked is translated to Simplified Chinese; original in Japanese.", - "http://121.4.147.128/ttt", + "http://teatube.ltd/ttt", }, {"TTPC", "ttpc tetris perfect clear challenge", "game", "*Web-based, no mobile support | Single player*\nTetris Perfect Clear Challenge. The PC opener tutorial for SRS+bag7.\nRecommended for players that have completed TTT. You need to know SRS to play this.\nIncludes only the basic PC opener.\nLinked is translated to Simplified Chinese; original in Japanese.", - "http://121.4.147.128/ttpc", + "http://teatube.ltd/ttpc", }, {"NAZO", "nazo", "game", "*Web-based, no mobile support | Single player*\nAll sorts of SRS puzzles. Recommended for players that have completed TTT.\nHas T-Spin and all spin puzzles of all difficulties.\nLinked is translated to Simplified Chinese; original in Japanese.", - "http://121.4.147.128/nazo", + "http://teatube.ltd/nazo", }, {"King of Stackers", @@ -228,9 +228,9 @@ return{ "Dig/Defend per minute\n\tSometimes can reflect how well a player can survive garbage.", }, {"ADPM", - "adpm attackdigperminute", + "adpm attackdigperminute vs", "term", - "Attack&Dig per minute\n\tUsed to compare skill differences between the two players within one match; slightly more accurate than APM.", + "Attack&Dig per minute\n\tUsed to compare skill differences between the two players within one match; slightly more accurate than APM.\n\"vs\" in TETR.IO is Atk+Dig per 100s", }, {"APL", "apl attackperline efficiency", @@ -772,7 +772,7 @@ return{ "tetrisonline servers", "other", "Google \"Tetris Online Poland\" for the Poland server.\nClick \"Open URL\" for information about the Tetris Online Study server.", - "http://121.4.147.128/tos", + "http://teatube.ltd/tos", }, {"Github Repository", "githubrepository sourcecode", diff --git a/parts/language/dict_zh.lua b/parts/language/dict_zh.lua index 65a96201..e15b88d5 100644 --- a/parts/language/dict_zh.lua +++ b/parts/language/dict_zh.lua @@ -42,19 +42,19 @@ return{ "教程 ttt", "game", "现代方块特殊操作手把手教程(推荐使用电脑,移动设备需要外接键盘)\n\t推荐能无hold纯消四完成40行挑战的人学习\n\t内含T-spin、极简、SRS、部分对战定式介绍等教程\n\t完全吃透了话就可以成为教练啦!\n注:提供的链接是翻译后挂在茶服的版本", - "http://121.4.147.128/ttt", + "http://teatube.ltd/ttt", }, {"TTPC", "pc教程 ttpc", "game", "SRS+bag7方块游戏开局PC教程(推荐使用电脑,移动设备需要外接键盘)\n\t推荐完成了ttt的人学习(必须先学会SRS)\n\t(不包括六巧板等其它PC定式)\n\n注:提供的链接是翻译后挂在茶服的版本", - "http://121.4.147.128/ttpc", + "http://teatube.ltd/ttpc", }, {"NAZO", "题库 nazo", "game", "各类SRS试题(手机触屏玩不了)\n\t推荐能通过ttt的玩家尝试。\n\t内含各种t-spin/all-spin题目,简单到极难题目都有。\n\n注:提供的链接是翻译后挂在茶服的版本", - "http://121.4.147.128/nazo", + "http://teatube.ltd/nazo", }, --游戏(网页) @@ -106,7 +106,7 @@ return{ "俄罗斯方块大师 tgm tetrisgrandmaster", "game", "一个街机平台方块系列,S13/GM等称号出自该系列,可以在win平台运行\n\n其中TGM3目前玩得最普遍,部分模式说明:\nMaster:大师模式,有段位评价,拿到更高段位点的要求:非消一的连击和消四,字幕战中消除和通关,每100的前70小于【标准时间,上一个0~70秒数+2】中小的一个,每100总用时不能超过限定值(不然取消上一个方法的加分并反扣点数);到500若没有进标准时间会强制结束游戏(称为铁门);字幕战有两个难度,半隐和全隐,后者必须拿到几乎全部的段位点才能进,消除奖励的段位点也更多。\nShirase:死亡模式,类似于techmino中的20G-极限,开局就是高速20G,500和1000有铁门,500开始底下开始涨垃圾行,1000开始出现骨块,1300通关进入大方块字幕战;段位结算:每通100加1段从S1到S13,如果通关了字幕战就会有金色的S13\n\n更多内容详见链接", - "http://121.4.147.128/TGMGUIDE/", + "http://teatube.ltd/TGMGUIDE/", }, {"DTET", "dtet", @@ -228,9 +228,9 @@ return{ "Dig/Defend per Minute\n挖掘每分,即玩家每分钟向下挖掘的垃圾行数。\n某些时候可以体现玩家生存能力\n\n或:防御(抵消+挖掘)每分", }, {"ADPM", - "adpm attack defend", + "adpm attack defend vs", "term", - "Atk+Dig per Minute\n攻击+挖掘每分,用于在同一局游戏内对比玩家间水平差距,比apm更准确一些。\n在TETR.IO中有一个叫vs的数据就是ADPM(调整了比例)",--TODO + "Atk+Dig per Minute\n攻击+挖掘每分,用于在同一局游戏内对比玩家间水平差距,比apm更准确一些。\n在TETR.IO中叫vs的数据就是ADPM(调整过比例,具体是Atk+Dig per 100s)", }, {"APL", "apl xiaolv", @@ -262,7 +262,7 @@ return{ {"Tetris", "tetris xiaosi", "term", - "商标,Tetris游戏名,同时也是别的方块游戏里消四行的名字。\n含义是Tetra(古希腊语 四)+Tennis(游戏原作者喜欢的运动)。", + "商标,Tetris游戏名,同时也是别的方块游戏里消四行的名字。\n含义是Tetra(古希腊语 四)+Tennis(游戏原作者喜欢的运动)。\n现在版权在TTC(The Tetris Company)手上,任天堂和世嘉开发游戏是TTC授权的,本身并没有版权。", }, {"PC", "pc perfectclear ac allclear quanxiao quanqing", @@ -523,12 +523,12 @@ return{ {"DAS & ARR", "灵敏度 das arr", "term", - "DAS(Delay-auto-shift,延迟自动移动)系统。\n\nDAS,自动移动延迟,指从<按下移动键时动了一格>到<开始自动移动>之间的时间\nARR(Auto-repeat-rate),自动重复速率,指<每次自动移动>之间的时间\n\n单位都是f(帧,1帧=1/60秒)\n新人不会调的话推荐用das=8~10,arr=1~2\n对自己能力比较自信或者是已经有一定水平想提速推荐用das=4~6,arr=0\n(如果是别的游戏单位是ms(毫秒),那么乘16.7就可算出对应的数值)\n\n最佳调整方法:das越小越好,小到玩家依然能精准区分单点/长按为止;arr能0就0,游戏不允许的话就能拉多小拉多小\n\n这套系统也被叫作DAS系统", + "DAS(Delay-auto-shift,自动加速延迟)系统。\n\nDAS,具体指从<按下移动键时动了一格>到<开始自动移动>之间的时间\nARR(Auto-repeat-rate),自动重复速率,指<每次自动移动>之间的时间\n\n单位都是f(帧,1帧=1/60秒)\n新人不会调的话推荐用das=8~10,arr=1~2\n对自己能力比较自信或者是已经有一定水平想提速推荐用das=4~6,arr=0\n(如果是别的游戏单位是ms(毫秒),那么乘16.7就可算出对应的数值)\n\n最佳调整方法:das越小越好,小到依然能准确区分单点/长按为止;arr能0就0,游戏不允许的话就能拉多小拉多小\n\n这套系统也被叫作DAS系统", }, {"DAS通俗", "das arr", "term", - "打字时按住o,你会看到:Ooooooooooo\n在时间轴上:O-----------o-o-o-o-o-o-o-o-o-o\n-----------就是das长度,-就是arr长度", + "打字时按住o,你会看到:ooooooooooo\n在时间轴上:o-----------o-o-o-o-o-o-o-o-o-o\n-----------就是das长度,-就是arr长度", }, {"DAS打断", "dascut", @@ -781,7 +781,7 @@ return{ "茶服 chafu study", "other", "TO-S的添加方法、说明等关于茶服的一切", - "http://121.4.147.128/tos", + "http://teatube.ltd/tos", }, {"Github仓库", "源代码 github sourcecode yuandaima", diff --git a/parts/language/lang_en.lua b/parts/language/lang_en.lua index a8160af0..15037a7a 100644 --- a/parts/language/lang_en.lua +++ b/parts/language/lang_en.lua @@ -1,4 +1,4 @@ -local c=COLOR +local C=COLOR return{ back="Back", anykey="Press a key!", @@ -219,7 +219,6 @@ return{ music="Music & SE", about="About", dict="Zictionary", - lang="言/A", manual="Manual", quit="Exit", }, @@ -852,30 +851,30 @@ return{ "You can perform a spin with 28 of the 29 minoes in this game; the exception being O1.", "You can set the spawning orientation for each tetromino.", "ZS JL T O I", - {c.C,"Also try 15puzzle!"}, - {c.C,"Also try Minecraft!"}, - {c.C,"Also try Minesweeper!"}, - {c.C,"Also try osu!"}, - {c.C,"Also try Phigros!"}, - {c.C,"Also try Rubic's cube!"}, - {c.C,"Also try Terraria!"}, - {c.C,"Also try VVVVVV!"}, - {c.fire,"Also try Cultris II!"}, - {c.fire,"Also try Jstris"}, - {c.fire,"Also try NullpoMino!"}, - {c.fire,"Also try TETR.IO!"}, - {c.fire,"Also try Tetr.js!"}, - {c.fire,"Also try Tetra Legends!"}, - {c.grape,"T-spin!"}, - {c.gray,"REGRET!!"}, - {c.lR,"Z ",c.lG,"S ",c.lSea,"J ",c.lOrange,"L ",c.lGrape,"T ",c.lY,"O ",c.lC,"I"}, - {c.lY,"COOL!!"}, - {c.R,"\"DMCA abusing\""}, - {c.R,"\"Intellectual property law\""}, - {c.R,"DT",c.W," Cannon=",c.grape,"TS",c.R,"D",c.W,"+",c.grape,"TS",c.R,"T",c.W," Cannon"}, - {c.R,"LrL ",c.G,"RlR ",c.B,"LLr ",c.orange,"RRl ",c.grape,"RRR ",c.grape,"LLL ",c.C,"FFF ",c.Y,"RfR ",c.Y,"RRf ",c.Y,"rFF"}, - {c.sky,"Lua",c.W," No.1"}, - {c.W,"What is an ",c.lC,"X-Spin"?}, - {c.Y,"O-Spin Triple!"}, + {C.C,"Also try 15puzzle!"}, + {C.C,"Also try Minecraft!"}, + {C.C,"Also try Minesweeper!"}, + {C.C,"Also try osu!"}, + {C.C,"Also try Phigros!"}, + {C.C,"Also try Rubic's cube!"}, + {C.C,"Also try Terraria!"}, + {C.C,"Also try VVVVVV!"}, + {C.fire,"Also try Cultris II!"}, + {C.fire,"Also try Jstris"}, + {C.fire,"Also try NullpoMino!"}, + {C.fire,"Also try TETR.IO!"}, + {C.fire,"Also try Tetr.js!"}, + {C.fire,"Also try Tetra Legends!"}, + {C.purple,"T-spin!"}, + {C.H,"REGRET!!"}, + {C.lR,"Z ",C.lG,"S ",C.lS,"J ",C.lO,"L ",C.lP,"T ",C.lY,"O ",C.lC,"I"}, + {C.lY,"COOL!!"}, + {C.R,"\"DMCA abusing\""}, + {C.R,"\"Intellectual property law\""}, + {C.R,"DT",C.Z," Cannon=",C.purple,"TS",C.R,"D",C.Z,"+",C.purple,"TS",C.R,"T",C.Z," Cannon"}, + {C.R,"LrL ",C.G,"RlR ",C.B,"LLr ",C.orange,"RRl ",C.purple,"RRR ",C.purple,"LLL ",C.C,"FFF ",C.Y,"RfR ",C.Y,"RRf ",C.Y,"rFF"}, + {C.navy,"Lua",C.Z," No.1"}, + {C.Z,"What is an ",c.lC,"X-Spin"?}, + {C.Y,"O-Spin Triple!"}, } } diff --git a/parts/language/lang_fr.lua b/parts/language/lang_fr.lua index 11e5dcd3..d790e7c3 100644 --- a/parts/language/lang_fr.lua +++ b/parts/language/lang_fr.lua @@ -196,7 +196,6 @@ return{ -- music="Music & SE", -- about="About", dict="Zictionary", - lang="言/A", manual="Manuel", quit="Quitter", }, diff --git a/parts/language/lang_pt.lua b/parts/language/lang_pt.lua index 55f7890e..c054bfed 100644 --- a/parts/language/lang_pt.lua +++ b/parts/language/lang_pt.lua @@ -1,3 +1,4 @@ +local C=COLOR return{ fallback=4, back="Voltar", @@ -219,7 +220,6 @@ return{ -- music="Music & SE", -- about="About", dict="Zictionary", - lang="言/A", manual="Manual", quit="Saída", }, @@ -609,7 +609,7 @@ return{ }, app_15p={ reset="Embaralhar", - color="Cor", + C="Cor", blind="Cego", slide="Deslizar", pathVis="Mostrar caminho", @@ -843,37 +843,37 @@ return{ "Você pode abrir o diretório de save na pagina de Stats.", "Você pode escolher uma orientação pra cada blococan.", "ZS JL T O I", - {COLOR.cyan,"Tente também 15puzzle"}, - {COLOR.cyan,"Tente também Minecraft"}, - {COLOR.cyan,"Tente também Minesweeper"}, - {COLOR.cyan,"Tente também osu!"}, - {COLOR.cyan,"Tente também Phigros"}, - {COLOR.cyan,"Tente também Rubic's cube"}, - {COLOR.cyan,"Tente também Terraria"}, - {COLOR.cyan,"Tente também VVVVVV"}, - {COLOR.fire,"Tente também Cultris II"}, - {COLOR.fire,"Tente também Jstris"}, - {COLOR.fire,"Tente também Nullpomino"}, - {COLOR.fire,"Tente também Tetr.io"}, - {COLOR.fire,"Tente também Tetr.js"}, - {COLOR.fire,"Tente também Tetralegends"}, - {COLOR.grape,"T-spin!"}, - {COLOR.gray,"暫定段位:9"}, - {COLOR.gray,"REGRET!!"}, - {COLOR.lR,"Z ",COLOR.lG,"S ",COLOR.lSea,"J ",COLOR.lOrange,"L ",COLOR.lGrape,"T ",COLOR.lY,"O ",COLOR.lC,"I"}, - {COLOR.lY,"LEGAL!!"}, - {COLOR.R,"\"DMCA abusing\""}, - {COLOR.R,"\"Intellectual property law\""}, - {COLOR.R,"DT",COLOR.W," Cannon=",COLOR.grape,"TS",COLOR.R,"D",COLOR.W,"+",COLOR.grape,"TS",COLOR.R,"T",COLOR.W," Cannon"}, - {COLOR.R,"LrL ",COLOR.G,"RlR ",COLOR.B,"LLr ",COLOR.orange,"RRl ",COLOR.grape,"RRR ",COLOR.grape,"LLL ",COLOR.C,"FFF ",COLOR.Y,"RfR ",COLOR.Y,"RRf ",COLOR.Y,"rFF"}, - {COLOR.sky,"Lua",COLOR.W," No.1"}, - {COLOR.W,"What is ",COLOR.lC,"Xspin"}, - {COLOR.Y,"暫定段位:GM"}, - {COLOR.Y,"暫定段位:M"}, - {COLOR.Y,"暫定段位:MK"}, - {COLOR.Y,"暫定段位:MM"}, - {COLOR.Y,"暫定段位:MO"}, - {COLOR.Y,"暫定段位:MV"}, - {COLOR.Y,"O-spin Triple!"}, + {C.C,"Tente também 15puzzle"}, + {C.C,"Tente também Minecraft"}, + {C.C,"Tente também Minesweeper"}, + {C.C,"Tente também osu!"}, + {C.C,"Tente também Phigros"}, + {C.C,"Tente também Rubic's cube"}, + {C.C,"Tente também Terraria"}, + {C.C,"Tente também VVVVVV"}, + {C.F,"Tente também Cultris II"}, + {C.F,"Tente também Jstris"}, + {C.F,"Tente também Nullpomino"}, + {C.F,"Tente também Tetr.io"}, + {C.F,"Tente também Tetr.js"}, + {C.F,"Tente também Tetralegends"}, + {C.H,"暫定段位:9"}, + {C.H,"REGRET!!"}, + {C.lR,"Z ",C.lG,"S ",C.lS,"J ",C.lO,"L ",C.lP,"T ",C.lY,"O ",C.lC,"I"}, + {C.lY,"LEGAL!!"}, + {C.N,"Lua",C.Z," No.1"}, + {C.P,"T-spin!"}, + {C.R,"\"DMCA abusing\""}, + {C.R,"\"Intellectual property law\""}, + {C.R,"DT",C.Z," Cannon=",C.P,"TS",C.R,"D",C.Z,"+",C.P,"TS",C.R,"T",C.Z," Cannon"}, + {C.R,"LrL ",C.G,"RlR ",C.B,"LLr ",C.O,"RRl ",C.P,"RRR ",C.P,"LLL ",C.C,"FFF ",C.Y,"RfR ",C.Y,"RRf ",C.Y,"rFF"}, + {C.Z,"What is ",C.lC,"Xspin"}, + {C.Y,"暫定段位:GM"}, + {C.Y,"暫定段位:M"}, + {C.Y,"暫定段位:MK"}, + {C.Y,"暫定段位:MM"}, + {C.Y,"暫定段位:MO"}, + {C.Y,"暫定段位:MV"}, + {C.Y,"O-spin Triple!"}, } } diff --git a/parts/language/lang_sp.lua b/parts/language/lang_sp.lua index 9914cec9..f8898f61 100644 --- a/parts/language/lang_sp.lua +++ b/parts/language/lang_sp.lua @@ -197,7 +197,6 @@ return{ music="Música y SFX", about="Acerca del Juego", dict="Zictionary", - lang="言/A", manual="Manual", quit="Salir", }, diff --git a/parts/language/lang_symbol.lua b/parts/language/lang_symbol.lua index 5f3e33ba..ba7a7675 100644 --- a/parts/language/lang_symbol.lua +++ b/parts/language/lang_symbol.lua @@ -101,7 +101,6 @@ return{ music="~~~ & =><=", about="?", dict="z", - lang="言/A", manual="???", quit="X", }, diff --git a/parts/language/lang_zh.lua b/parts/language/lang_zh.lua index 3a4df2d5..df175f18 100644 --- a/parts/language/lang_zh.lua +++ b/parts/language/lang_zh.lua @@ -1,4 +1,4 @@ -local c=COLOR +local C=COLOR return{ back="返回", anykey="按任意键继续", @@ -219,7 +219,6 @@ return{ music="音乐&音效", about="关于", dict="小Z词典", - lang="言/A", manual="说明书", quit="退出", }, @@ -1013,91 +1012,91 @@ return{ "Z酱累了,Z酱不想更新", "Z酱只是个写代码的,懂什么方块", "Z块等身抱枕来一个(x", - {c.aqua,"AQUA"}, - {c.B,"BLUE"}, - {c.C,""}, - {c.C,"15puzzle好玩!"}, - {c.C,"魔方好玩!"}, - {c.C,"扫雷好玩!"}, - {c.C,"泰拉瑞亚好玩!"}, - {c.C,"我的世界好玩!"}, - {c.C,"CYAN"}, - {c.C,"Orzmic好玩!"}, - {c.C,"Osu!好玩!"}, - {c.C,"Phigros好玩!"}, - {c.C,"VVVVVV好玩!"}, - {c.fire,"Cultris II也很好玩!"}, - {c.fire,"FIRE"}, - {c.fire,"Jstris也很好玩!"}, - {c.fire,"Nullpomino也很好玩!"}, - {c.fire,"Tetr.io也很好玩!"}, - {c.fire,"Tetr.js也很好玩!"}, - {c.fire,"Tetralegends也很好玩!"}, - {c.G,"快捷键: Alt+F4=关闭当前窗口"}, - {c.G,"快捷键: Alt+Tab=切换窗口"}, - {c.G,"快捷键: backspace=返回上一个文件目录"}, - {c.G,"快捷键: Ctrl+鼠标滚轮=缩放"}, - {c.G,"快捷键: Ctrl+A=全选"}, - {c.G,"快捷键: Ctrl+Alt+Z=查看所有qq消息"}, - {c.G,"快捷键: Ctrl+D=复制一份"}, - {c.G,"快捷键: Ctrl+F=查找"}, - {c.G,"快捷键: Ctrl+Tab=切换标签页"}, - {c.G,"快捷键: Ctrl+W=关闭当前标签页"}, - {c.G,"快捷键: shift+del=永久删除文件 (技术人员别杠)"}, - {c.G,"GREEN"}, - {c.grape,"GRAPE"}, - {c.grape,"T-spin!"}, - {c.grass,"GRASS"}, - {c.gray,"感谢Phigros提供部分tip模板("}, - {c.gray,"暂定段位:9"}, - {c.gray,"REGRET!!"}, - {c.lime,"LIME"}, - {c.lC,"26连T2来一个?"}, - {c.lC,"Xspin",c.W,"是啥"}, - {c.lGrape,"Naki",c.W," 可爱!"}, - {c.lGray,"腱鞘炎警告"}, - {c.lGray,"看起来是个计算器,其实…"}, - {c.lGray,"没学过编曲,音乐都是自己瞎写的,觉得不好听就去设置关了吧"}, - {c.lGray,"秘密数字:626"}, - {c.lGray,"你有一个好"}, - {c.lGray,"STSD必死"}, - {c.lGray,"Techmino没有抽卡没有氪金,太良心了"}, - {c.lR,"Z ",c.lG,"S ",c.lSea,"J ",c.lOrange,"L ",c.lGrape,"T ",c.lY,"O ",c.lC,"I"}, - {c.lSea,"茶娘",c.W," 可爱!"}, - {c.lY,"COOL!!"}, - {c.magenta,"MAGENTA"}, - {c.orange,"ORANGE"}, - {c.pink,"PINK"}, - {c.pink,"uid:225238922"}, - {c.purple,"PURPLE"}, - {c.R,"《滥用DMCA》"}, - {c.R,"《知识产权法》"}, - {c.R,"本游戏难度上限很高,做好心理准备。"}, - {c.R,"不要向不感兴趣的路人推荐!!!!!!!!"}, - {c.R,"不要在上课时玩游戏!"}, - {c.R,"光敏性癫痫警告"}, - {c.R,"请在有一定游戏基础之后再学Tspin!不然副作用非常大!"}, - {c.R,"新人请千万记住,打好基础,不要太早学那些花里胡哨的。"}, - {c.R,"长时间游戏状态会越来越差!玩久了记得放松一下~"}, - {c.R,"DD",c.W,"炮=",c.grape,"TS",c.R,"D",c.W,"+",c.grape,"TS",c.R,"D",c.W,"炮"}, - {c.R,"DT",c.W,"炮=",c.grape,"TS",c.R,"D",c.W,"+",c.grape,"TS",c.R,"T",c.W,"炮"}, - {c.R,"LrL ",c.G,"RlR ",c.B,"LLr ",c.orange,"RRl ",c.grape,"RRR LLL ",c.C,"FFF ",c.Y,"RfR RRf rFF"}, - {c.R,"RED"}, - {c.sea,"SEA"}, - {c.sky,"Lua",c.W,"天下第一"}, - {c.sky,"SKY"}, - {c.W,"1, 2, ",c.C,"⑨",c.W,"!!!!!"}, - {c.W,"效率药水",c.gray," 效率提升 (8:00)"}, - {c.W,"协调药水",c.gray," MD减少 II(1:30)"}, - {c.Y,"暂定段位:GM"}, - {c.Y,"暂定段位:M"}, - {c.Y,"暂定段位:MK"}, - {c.Y,"暂定段位:MM"}, - {c.Y,"暂定段位:MO"}, - {c.Y,"暂定段位:MV"}, - {c.Y,"Miya",c.W," 可爱!"}, - {c.Y,"O-spin Triple!"}, - {c.Y,"YELLOW"}, + {C.A,"AQUA"}, + {C.B,"BLUE"}, + {C.C,""}, + {C.C,"15puzzle好玩!"}, + {C.C,"魔方好玩!"}, + {C.C,"扫雷好玩!"}, + {C.C,"泰拉瑞亚好玩!"}, + {C.C,"我的世界好玩!"}, + {C.C,"CYAN"}, + {C.C,"Orzmic好玩!"}, + {C.C,"Osu!好玩!"}, + {C.C,"Phigros好玩!"}, + {C.C,"VVVVVV好玩!"}, + {C.F,"Cultris II也很好玩!"}, + {C.F,"FIRE"}, + {C.F,"Jstris也很好玩!"}, + {C.F,"Nullpomino也很好玩!"}, + {C.F,"Tetr.io也很好玩!"}, + {C.F,"Tetr.js也很好玩!"}, + {C.F,"Tetralegends也很好玩!"}, + {C.G,"快捷键: Alt+F4=关闭当前窗口"}, + {C.G,"快捷键: Alt+Tab=切换窗口"}, + {C.G,"快捷键: backspace=返回上一个文件目录"}, + {C.G,"快捷键: Ctrl+鼠标滚轮=缩放"}, + {C.G,"快捷键: Ctrl+A=全选"}, + {C.G,"快捷键: Ctrl+Alt+Z=查看所有qq消息"}, + {C.G,"快捷键: Ctrl+D=复制一份"}, + {C.G,"快捷键: Ctrl+F=查找"}, + {C.G,"快捷键: Ctrl+Tab=切换标签页"}, + {C.G,"快捷键: Ctrl+W=关闭当前标签页"}, + {C.G,"快捷键: shift+del=永久删除文件 (技术人员别杠)"}, + {C.G,"GREEN"}, + {C.H,"感谢Phigros提供部分tip模板("}, + {C.H,"暂定段位:9"}, + {C.H,"REGRET!!"}, + {C.jade,"JADE"}, + {C.lC,"26连T2来一个?"}, + {C.lC,"Xspin",C.Z,"是啥"}, + {C.lH,"腱鞘炎警告"}, + {C.lH,"看起来是个计算器,其实…"}, + {C.lH,"没学过编曲,音乐都是自己瞎写的,觉得不好听就去设置关了吧"}, + {C.lH,"秘密数字:626"}, + {C.lH,"你有一个好"}, + {C.lH,"STSD必死"}, + {C.lH,"Techmino没有抽卡没有氪金,太良心了"}, + {C.L,"LIME"}, + {C.lP,"Naki",C.Z," 可爱!"}, + {C.lR,"Z ",C.lG,"S ",C.lS,"J ",C.lO,"L ",C.lP,"T ",C.lY,"O ",C.lC,"I"}, + {C.lS,"茶娘",C.Z," 可爱!"}, + {C.lY,"COOL!!"}, + {C.M,"MAGENTA"}, + {C.N,"Lua",C.Z,"天下第一"}, + {C.N,"NAVY"}, + {C.O,"ORANGE"}, + {C.P,"PURPLE"}, + {C.P,"T-spin!"}, + {C.R,"《滥用DMCA》"}, + {C.R,"《知识产权法》"}, + {C.R,"本游戏难度上限很高,做好心理准备。"}, + {C.R,"不要向不感兴趣的路人推荐!!!!!!!!"}, + {C.R,"不要在上课时玩游戏!"}, + {C.R,"光敏性癫痫警告"}, + {C.R,"请在有一定游戏基础之后再学Tspin!不然副作用非常大!"}, + {C.R,"新人请千万记住,打好基础,不要太早学那些花里胡哨的。"}, + {C.R,"长时间游戏状态会越来越差!玩久了记得放松一下~"}, + {C.R,"DD",C.Z,"炮=",C.purple,"TS",C.R,"D",C.Z,"+",C.purple,"TS",C.R,"D",C.Z,"炮"}, + {C.R,"DT",C.Z,"炮=",C.purple,"TS",C.R,"D",C.Z,"+",C.purple,"TS",C.R,"T",C.Z,"炮"}, + {C.R,"LrL ",C.G,"RlR ",C.B,"LLr ",C.orange,"RRl ",C.purple,"RRR LLL ",C.C,"FFF ",C.Y,"RfR RRf rFF"}, + {C.R,"RED"}, + {C.S,"SEA"}, + {C.V,"VIOLET"}, + {C.W,"uid:225238922"}, + {C.W,"WINE"}, + {C.Y,"暂定段位:GM"}, + {C.Y,"暂定段位:M"}, + {C.Y,"暂定段位:MK"}, + {C.Y,"暂定段位:MM"}, + {C.Y,"暂定段位:MO"}, + {C.Y,"暂定段位:MV"}, + {C.Y,"Miya",C.Z," 可爱!"}, + {C.Y,"O-spin Triple!"}, + {C.Y,"YELLOW"}, + {C.Z,"1, 2, ",C.C,"⑨",C.Z,"!!!!!"}, + {C.Z,"效率药水",C.H," 效率提升 (8:00)"}, + {C.Z,"协调药水",C.H," MD减少 II(1:30)"}, -- "Z酱 可爱!", } } \ No newline at end of file diff --git a/parts/language/manual_en.lua b/parts/language/manual_en.lua index 3e105d43..b122f45c 100644 --- a/parts/language/manual_en.lua +++ b/parts/language/manual_en.lua @@ -1,4 +1,4 @@ -return SPLITSTR([=[ +return STRING.split([=[ Gameplay: The system will provide you with tetrominoes (4-block pieces), with a total of 7 types, and the player needs to control them diff --git a/parts/language/manual_zh.lua b/parts/language/manual_zh.lua index 37d0902a..a8715d26 100644 --- a/parts/language/manual_zh.lua +++ b/parts/language/manual_zh.lua @@ -1,4 +1,4 @@ -return SPLITSTR([=[ +return STRING.split([=[ 游戏方法: 系统会提供的一个个四连骨牌("方块",总共7种) 玩家需要控制(左右移动和旋转90,180,270度)这些骨牌直到下落到场地底部,锁定 diff --git a/parts/list.lua b/parts/list.lua index 23c92c35..6f57d123 100644 --- a/parts/list.lua +++ b/parts/list.lua @@ -302,7 +302,7 @@ rankColor={ } minoColor={ - COLOR.red, COLOR.fire, COLOR.orange, COLOR.yellow, COLOR.lime, COLOR.grass, COLOR.green, COLOR.aqua, - COLOR.cyan, COLOR.sky, COLOR.sea, COLOR.blue, COLOR.purple, COLOR.grape, COLOR.magenta, COLOR.pink, - COLOR.dGray,COLOR.black,COLOR.lYellow, COLOR.gray, COLOR.lGray, COLOR.dPurple, COLOR.dRed, COLOR.dGreen, + COLOR.R,COLOR.F,COLOR.O,COLOR.Y,COLOR.L,COLOR.J,COLOR.G,COLOR.A, + COLOR.C,COLOR.N,COLOR.S,COLOR.B,COLOR.V,COLOR.P,COLOR.M,COLOR.W, + COLOR.dH,COLOR.D,COLOR.lY,COLOR.H,COLOR.lH,COLOR.dV,COLOR.dR,COLOR.dG, } \ No newline at end of file diff --git a/parts/modes/attacker_h.lua b/parts/modes/attacker_h.lua index 0c8d1c69..9f07f1df 100644 --- a/parts/modes/attacker_h.lua +++ b/parts/modes/attacker_h.lua @@ -49,7 +49,7 @@ return{ mText(drawableText.nextWave,69,380) end, score=function(P)return{P.modeData.wave,P.stat.time}end, - scoreDisp=function(D)return D[1].." Waves "..TIMESTR(D[2])end, + scoreDisp=function(D)return D[1].." Waves "..STRING.time(D[2])end, comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]b[1]or a[1]==b[1]and a[2]b[1]or a[1]==b[1]and a[2]b[1]or a[1]==b[1]and a[2]b[1]or a[1]==b[1]and a[2]b[1]or a[1]==b[1]and a[2]b[1]or a[1]==b[1]and a[2]b[1]or a[1]==b[1]and a[2]b[1]or a[1]==b[1]and a[2]b[1]or a[1]==b[1]and a[2]b[1]or a[1]==b[1]and a[2]b[1]or a[1]==b[1]and a[2]b[1]or a[1]==b[1]and a[2]b[1]or a[1]==b[1]and a[2]b[1]or a[1]==b[1]and a[2]b[1]or a[1]==b[1]and a[2]=0 and R or 0,69,265) end, score=function(P)return{math.min(P.stat.row,100),P.stat.time}end, - scoreDisp=function(D)return D[1].." Lines "..TIMESTR(D[2])end, + scoreDisp=function(D)return D[1].." Lines "..STRING.time(D[2])end, comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]=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 "..TIMESTR(D[2])end, + scoreDisp=function(D)return D[1].." Lines "..STRING.time(D[2])end, comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]b[1]or a[1]==b[1]and a[2]b[1]or a[1]==b[1]and a[2]b[1]or(a[1]==b[1]and a[2]b[1]or(a[1]==b[1]and a[2]b[1]or a[1]==b[1]and a[2]b[1]or a[1]==b[1]and a[2]b[1]or a[1]==b[1]and a[2]b[1]or a[1]==b[1]and a[2]b[1]or a[1]==b[1]and a[2]b[1]or a[1]==b[1]and a[2]b[1]or a[1]==b[1]and a[2]b[1]or a[1]==b[1]and a[2]b[1]or a[1]==b[1]and a[2]b[1]or a[1]==b[1]and a[2]=1000 then P:win("finish")end end, bg="rainbow",bgm="push", @@ -15,7 +15,7 @@ return{ PLY.draw.drawTargetLine(P,r) end, score=function(P)return{P.stat.time,P.stat.piece}end, - scoreDisp=function(D)return TIMESTR(D[1]).." "..D[2].." Pieces"end, + scoreDisp=function(D)return STRING.time(D[1]).." "..D[2].." Pieces"end, comp=function(a,b)return a[1]b[1]or a[1]==b[1]and a[2]b[1]or a[1]==b[1]and a[2]b[1]or a[1]==b[1]and a[2]b[1]or a[1]==b[1]and a[2]b[1]or a[1]==b[1]and a[2]b[1]or a[1]==b[1]and a[2]b[1]or a[1]==b[1]and a[2]b[1]or a[1]==b[1]and a[2]b[1]or a[1]==b[1]and a[2]b[1]or a[1]==b[1]and a[2]b[1]or a[1]==b[1]and a[2]b[1]or a[1]==b[1]and a[2]b[1]or a[1]==b[1]and a[2]b[1]or a[1]==b[1]and a[2]b[1]or a[1]==b[1]and a[2]b[1]or a[1]==b[1]and a[2]b then a,b=b,a end gc_setColor(.8,1,.2) gc_rectangle("fill",-14,599,11,-b*.6) - gc_setColor(P.b2b<40 and COLOR.white or P.b2b<=800 and COLOR.lRed or COLOR.lBlue) + gc_setColor(P.b2b<40 and COLOR.Z or P.b2b<=800 and COLOR.lR or COLOR.lB) gc_rectangle("fill",-14,599,11,-a*.6) if TIME()%.5<.3 then gc_setColor(1,1,1) @@ -684,8 +684,8 @@ function draw.norm(P) gc_setColor(0,0,0,.3) gc_print(P.score1,18,509) gc_print(tm,18,539) - gc_setColor(COLOR.lYellow)gc_print(P.score1,20,510) - gc_setColor(COLOR.sky)gc_print(tm,20,540) + gc_setColor(COLOR.lY)gc_print(P.score1,20,510) + gc_setColor(COLOR.N)gc_print(tm,20,540) drawFinesseCombo_norm(P) drawLife(P.life) @@ -825,8 +825,8 @@ function draw.norm_remote(P) gc_setColor(0,0,0,.3) gc_print(P.score1,18,509) gc_print(tm,18,539) - gc_setColor(COLOR.lYellow)gc_print(P.score1,20,510) - gc_setColor(COLOR.sky)gc_print(tm,20,540) + gc_setColor(COLOR.lY)gc_print(P.score1,20,510) + gc_setColor(COLOR.N)gc_print(tm,20,540) drawFinesseCombo_remote(P) drawLife(P.life) diff --git a/parts/scenes/app_15p.lua b/parts/scenes/app_15p.lua index 2906e68c..5dc1a9e8 100644 --- a/parts/scenes/app_15p.lua +++ b/parts/scenes/app_15p.lua @@ -117,16 +117,16 @@ local function tapBoard(x,y,key) if checkBoard(b)then state=2 time=TIME()-startTime - if time<1 then LOG.print("不是人",COLOR.lBlue) - elseif time<2 then LOG.print("还是人",COLOR.lBlue) - elseif time<3 then LOG.print("神仙",COLOR.lBlue) - elseif time<5 then LOG.print("太强了",COLOR.lBlue) - elseif time<7.5 then LOG.print("很强",COLOR.lBlue) - elseif time<10 then LOG.print("可以的",COLOR.lBlue) - elseif time<20 then LOG.print("马上入门了",COLOR.lBlue) - elseif time<30 then LOG.print("入门不远了",COLOR.lBlue) - elseif time<60 then LOG.print("多加练习",COLOR.lBlue) - else LOG.print("第一次玩?加油",COLOR.lBlue) + if time<1 then LOG.print("不是人",COLOR.lB) + elseif time<2 then LOG.print("还是人",COLOR.lB) + elseif time<3 then LOG.print("神仙",COLOR.lB) + elseif time<5 then LOG.print("太强了",COLOR.lB) + elseif time<7.5 then LOG.print("很强",COLOR.lB) + elseif time<10 then LOG.print("可以的",COLOR.lB) + elseif time<20 then LOG.print("马上入门了",COLOR.lB) + elseif time<30 then LOG.print("入门不远了",COLOR.lB) + elseif time<60 then LOG.print("多加练习",COLOR.lB) + else LOG.print("第一次玩?加油",COLOR.lB) end SFX.play("win") return @@ -201,66 +201,66 @@ end local frontColor={ [0]={ - COLOR.lRed,COLOR.lRed,COLOR.lRed,COLOR.lRed, - COLOR.lGreen,COLOR.lBlue,COLOR.lBlue,COLOR.lBlue, - COLOR.lGreen,COLOR.lYellow,COLOR.lPurple,COLOR.lPurple, - COLOR.lGreen,COLOR.lYellow,COLOR.lPurple,COLOR.lPurple, + COLOR.lR,COLOR.lR,COLOR.lR,COLOR.lR, + COLOR.lG,COLOR.lB,COLOR.lB,COLOR.lB, + COLOR.lG,COLOR.lY,COLOR.lV,COLOR.lV, + COLOR.lG,COLOR.lY,COLOR.lV,COLOR.lV, },--Colored(rank) { - COLOR.lRed,COLOR.lRed,COLOR.lRed,COLOR.lRed, - COLOR.lOrange,COLOR.lYellow,COLOR.lYellow,COLOR.lYellow, - COLOR.lOrange,COLOR.lGreen,COLOR.lBlue,COLOR.lBlue, - COLOR.lOrange,COLOR.lGreen,COLOR.lBlue,COLOR.lBlue, + COLOR.lR,COLOR.lR,COLOR.lR,COLOR.lR, + COLOR.lO,COLOR.lY,COLOR.lY,COLOR.lY, + COLOR.lO,COLOR.lG,COLOR.lB,COLOR.lB, + COLOR.lO,COLOR.lG,COLOR.lB,COLOR.lB, },--Rainbow(rank) { - COLOR.lRed,COLOR.lRed,COLOR.lRed,COLOR.lRed, - COLOR.lBlue,COLOR.lBlue,COLOR.lBlue,COLOR.lBlue, - COLOR.lGreen,COLOR.lYellow,COLOR.lPurple,COLOR.lPurple, - COLOR.lGreen,COLOR.lYellow,COLOR.lPurple,COLOR.lPurple, + COLOR.lR,COLOR.lR,COLOR.lR,COLOR.lR, + COLOR.lB,COLOR.lB,COLOR.lB,COLOR.lB, + COLOR.lG,COLOR.lY,COLOR.lV,COLOR.lV, + COLOR.lG,COLOR.lY,COLOR.lV,COLOR.lV, },--Colored(row) { - COLOR.white,COLOR.white,COLOR.white,COLOR.white, - COLOR.white,COLOR.white,COLOR.white,COLOR.white, - COLOR.white,COLOR.white,COLOR.white,COLOR.white, - COLOR.white,COLOR.white,COLOR.white,COLOR.white, + COLOR.Z,COLOR.Z,COLOR.Z,COLOR.Z, + COLOR.Z,COLOR.Z,COLOR.Z,COLOR.Z, + COLOR.Z,COLOR.Z,COLOR.Z,COLOR.Z, + COLOR.Z,COLOR.Z,COLOR.Z,COLOR.Z, },--Gray { - COLOR.white,COLOR.white,COLOR.white,COLOR.white, - COLOR.white,COLOR.white,COLOR.white,COLOR.white, - COLOR.white,COLOR.white,COLOR.white,COLOR.white, - COLOR.white,COLOR.white,COLOR.white,COLOR.white, + COLOR.Z,COLOR.Z,COLOR.Z,COLOR.Z, + COLOR.Z,COLOR.Z,COLOR.Z,COLOR.Z, + COLOR.Z,COLOR.Z,COLOR.Z,COLOR.Z, + COLOR.Z,COLOR.Z,COLOR.Z,COLOR.Z, },--Black } local backColor={ [0]={ - COLOR.dRed,COLOR.dRed,COLOR.dRed,COLOR.dRed, - COLOR.dGreen,COLOR.dBlue,COLOR.dBlue,COLOR.dBlue, - COLOR.dGreen,COLOR.dYellow,COLOR.dPurple,COLOR.dPurple, - COLOR.dGreen,COLOR.dYellow,COLOR.dPurple,COLOR.dPurple, + COLOR.dR,COLOR.dR,COLOR.dR,COLOR.dR, + COLOR.dG,COLOR.dB,COLOR.dB,COLOR.dB, + COLOR.dG,COLOR.dY,COLOR.dV,COLOR.dV, + COLOR.dG,COLOR.dY,COLOR.dV,COLOR.dV, },--Colored(rank) { - COLOR.dRed,COLOR.dRed,COLOR.dRed,COLOR.dRed, - COLOR.dOrange,COLOR.dYellow,COLOR.dYellow,COLOR.dYellow, - COLOR.dOrange,COLOR.dGreen,COLOR.dBlue,COLOR.dBlue, - COLOR.dOrange,COLOR.dGreen,COLOR.dBlue,COLOR.dBlue, + COLOR.dR,COLOR.dR,COLOR.dR,COLOR.dR, + COLOR.dO,COLOR.dY,COLOR.dY,COLOR.dY, + COLOR.dO,COLOR.dG,COLOR.dB,COLOR.dB, + COLOR.dO,COLOR.dG,COLOR.dB,COLOR.dB, },--Rainbow(rank) { - COLOR.dRed,COLOR.dRed,COLOR.dRed,COLOR.dRed, - COLOR.dBlue,COLOR.dBlue,COLOR.dBlue,COLOR.dBlue, - COLOR.dGreen,COLOR.dYellow,COLOR.dPurple,COLOR.dPurple, - COLOR.dGreen,COLOR.dYellow,COLOR.dPurple,COLOR.dPurple, + COLOR.dR,COLOR.dR,COLOR.dR,COLOR.dR, + COLOR.dB,COLOR.dB,COLOR.dB,COLOR.dB, + COLOR.dG,COLOR.dY,COLOR.dV,COLOR.dV, + COLOR.dG,COLOR.dY,COLOR.dV,COLOR.dV, },--Colored(row) { - COLOR.dGray,COLOR.dGray,COLOR.dGray,COLOR.dGray, - COLOR.dGray,COLOR.dGray,COLOR.dGray,COLOR.dGray, - COLOR.dGray,COLOR.dGray,COLOR.dGray,COLOR.dGray, - COLOR.dGray,COLOR.dGray,COLOR.dGray,COLOR.dGray, + COLOR.dH,COLOR.dH,COLOR.dH,COLOR.dH, + COLOR.dH,COLOR.dH,COLOR.dH,COLOR.dH, + COLOR.dH,COLOR.dH,COLOR.dH,COLOR.dH, + COLOR.dH,COLOR.dH,COLOR.dH,COLOR.dH, },--Gray { - COLOR.black,COLOR.black,COLOR.black,COLOR.black, - COLOR.black,COLOR.black,COLOR.black,COLOR.black, - COLOR.black,COLOR.black,COLOR.black,COLOR.black, - COLOR.black,COLOR.black,COLOR.black,COLOR.black, + COLOR.D,COLOR.D,COLOR.D,COLOR.D, + COLOR.D,COLOR.D,COLOR.D,COLOR.D, + COLOR.D,COLOR.D,COLOR.D,COLOR.D, + COLOR.D,COLOR.D,COLOR.D,COLOR.D, },--Black } function scene.draw() @@ -316,7 +316,7 @@ end local function Gaming()return state==1 end scene.widgetList={ - WIDGET.newButton{name="reset", x=160,y=100,w=180,h=100,color="lGreen",font=40,code=pressKey"space"}, + WIDGET.newButton{name="reset", x=160,y=100,w=180,h=100,color="lG", font=40,code=pressKey"space"}, WIDGET.newSlider{name="color", x=110,y=250,w=170,unit=4,show=false,font=30,disp=function()return color end, code=function(v)if state~=1 then color=v end end,hide=Gaming}, WIDGET.newSwitch{name="blind", x=240,y=330,w=60, font=40,disp=function()return blind end, code=pressKey"w", hide=Gaming}, WIDGET.newSwitch{name="slide", x=240,y=420,w=60, font=40,disp=function()return slide end, code=pressKey"e", hide=Gaming}, diff --git a/parts/scenes/app_2048.lua b/parts/scenes/app_2048.lua index 3fa5abe7..e5f617dd 100644 --- a/parts/scenes/app_2048.lua +++ b/parts/scenes/app_2048.lua @@ -38,7 +38,7 @@ local score 1/2/3/...: 2/4/8/... tile ]] local tileColor={ - [-1]=COLOR.black, + [-1]=COLOR.D, [0]={.5,.3,.3}, {.93,.89,.85}, {.93,.88,.78}, @@ -370,8 +370,8 @@ function scene.draw() "Y" )or( repeater.seq[i]==repeater.last[i]and - "gray"or - "white" + "H"or + "Z" ) ]) rectangle("line",990,305+60*i,220,50) @@ -405,16 +405,16 @@ function scene.draw() local N=board[i] if i~=prevPos or prevSpawnTime==1 then if not blind or i==prevPos then - setColor(tileColor[N]or COLOR.black) + setColor(tileColor[N]or COLOR.D) rectangle("fill",x*160+163,y*160-117,154,154,15) if N>=0 then - setColor(N<3 and COLOR.black or COLOR.W) + setColor(N<3 and COLOR.D or COLOR.Z) local fontSize=tileFont[N] setFont(fontSize) mStr(tileName[N],320+(x-.5)*160,40+(y-.5)*160-fontSize*.7) end else - setColor(COLOR.gray) + setColor(COLOR.H) rectangle("fill",x*160+163,y*160-117,154,154,15) end else @@ -480,19 +480,19 @@ function scene.draw() end scene.widgetList={ - WIDGET.newButton{name="reset", x=155,y=100,w=180,h=100,color="lGreen",font=40,code=pressKey"r"}, + WIDGET.newButton{name="reset", x=155,y=100,w=180,h=100,color="lG",font=40,code=pressKey"r"}, WIDGET.newSwitch{name="blind", x=240,y=300,w=60, font=40,disp=function()return blind end, code=pressKey"q",hide=function()return state==1 end}, WIDGET.newSwitch{name="tapControl", x=240,y=370,w=60, font=40,disp=function()return tapControl end, code=pressKey"w",hide=function()return state==1 end}, - WIDGET.newKey{name="up", x=155,y=460,w=100,fText="↑",font=50,color="yellow",code=pressKey"up",hide=function()return tapControl end}, - WIDGET.newKey{name="down", x=155,y=660,w=100,fText="↓",font=50,color="yellow",code=pressKey"down",hide=function()return tapControl end}, - WIDGET.newKey{name="left", x=55,y=560,w=100,fText="←",font=50,color="yellow",code=pressKey"left",hide=function()return tapControl end}, - WIDGET.newKey{name="right", x=255,y=560,w=100,fText="→",font=50,color="yellow",code=pressKey"right",hide=function()return tapControl end}, - WIDGET.newKey{name="skip", x=155,y=400,w=100,font=20,color="yellow",code=pressKey"space",hide=function()return state~=1 or not skipper.cd or skipper.cd>0 end}, - WIDGET.newKey{name="record1", x=1100,y=390,w=220,h=50,fText="",color="gray",code=pressKey"1",hide=function()return state==2 end}, - WIDGET.newKey{name="record2", x=1100,y=450,w=220,h=50,fText="",color="gray",code=pressKey"2",hide=function()return state==2 end}, - WIDGET.newKey{name="replay1", x=1245,y=390,w=50,fText="!",color="green",code=pressKey"c1",hide=function()return state==2 or #repeater.seq[1]==0 end}, - WIDGET.newKey{name="replay2", x=1245,y=450,w=50,fText="!",color="green",code=pressKey"c2",hide=function()return state==2 or #repeater.seq[2]==0 end}, + WIDGET.newKey{name="up", x=155,y=460,w=100,fText="↑",font=50,color="Y",code=pressKey"up",hide=function()return tapControl end}, + WIDGET.newKey{name="down", x=155,y=660,w=100,fText="↓",font=50,color="Y",code=pressKey"down",hide=function()return tapControl end}, + WIDGET.newKey{name="left", x=55,y=560,w=100,fText="←",font=50,color="Y",code=pressKey"left",hide=function()return tapControl end}, + WIDGET.newKey{name="right", x=255,y=560,w=100,fText="→",font=50,color="Y",code=pressKey"right",hide=function()return tapControl end}, + WIDGET.newKey{name="skip", x=155,y=400,w=100,font=20,color="Y",code=pressKey"space",hide=function()return state~=1 or not skipper.cd or skipper.cd>0 end}, + WIDGET.newKey{name="record1", x=1100,y=390,w=220,h=50,fText="",color="H",code=pressKey"1",hide=function()return state==2 end}, + WIDGET.newKey{name="record2", x=1100,y=450,w=220,h=50,fText="",color="H",code=pressKey"2",hide=function()return state==2 end}, + WIDGET.newKey{name="replay1", x=1245,y=390,w=50,fText="!",color="G",code=pressKey"c1",hide=function()return state==2 or #repeater.seq[1]==0 end}, + WIDGET.newKey{name="replay2", x=1245,y=450,w=50,fText="!",color="G",code=pressKey"c2",hide=function()return state==2 or #repeater.seq[2]==0 end}, WIDGET.newButton{name="back", x=1140,y=640,w=170,h=80,font=40,code=backScene}, } diff --git a/parts/scenes/app_AtoZ.lua b/parts/scenes/app_AtoZ.lua index 0cac840e..8b4691fb 100644 --- a/parts/scenes/app_AtoZ.lua +++ b/parts/scenes/app_AtoZ.lua @@ -118,7 +118,7 @@ end scene.widgetList={ WIDGET.newSelector{name="level", x=640,y=640,w=200,list={"A_Z","Z_A","Tech1","Tech2","KeyTest1","KeyTest2","Hello","Roll1","Roll2","Roll3","ZZZ","ZXZX","ZMZM","Stair","Stair2","Stair3","BPW"},disp=function()return levelName end,code=function(i)levelName=i;targetString=levels[i]end,hide=function()return state>0 end}, - WIDGET.newButton{name="reset", x=160,y=100,w=180,h=100,color="lGreen",font=40,code=pressKey"space"}, + WIDGET.newButton{name="reset", x=160,y=100,w=180,h=100,color="lG",font=40,code=pressKey"space"}, WIDGET.newButton{name="keyboard", x=160,y=210,w=180,h=100,code=function()love.keyboard.setTextInput(true,0,select(2,SCR.xOy:transformPoint(0,500)),1,1)end,hide=not MOBILE}, WIDGET.newButton{name="back", x=1140,y=640,w=170,h=80,font=40,code=backScene}, } diff --git a/parts/scenes/app_UTTT.lua b/parts/scenes/app_UTTT.lua index b1d3019f..0a4255a9 100644 --- a/parts/scenes/app_UTTT.lua +++ b/parts/scenes/app_UTTT.lua @@ -235,7 +235,7 @@ function scene.mouseDown(x,y) end scene.widgetList={ - WIDGET.newButton{name="reset",x=1140,y=540,w=170,h=80,font=40,color="lGreen",code=restart}, + WIDGET.newButton{name="reset",x=1140,y=540,w=170,h=80,font=40,color="lG",code=restart}, WIDGET.newButton{name="back",x=1140,y=640,w=170,h=80,font=40,code=backScene}, } diff --git a/parts/scenes/app_cannon.lua b/parts/scenes/app_cannon.lua index 4ec26a0d..05974bfd 100644 --- a/parts/scenes/app_cannon.lua +++ b/parts/scenes/app_cannon.lua @@ -83,15 +83,15 @@ end local scoreColor={ "white",--0 "aqua",--20 - "sky",--40 + "navy",--40 "blue",--60 - "grape",--80 - "pink",--100 + "purple",--80 + "wine",--100 "red","fire","orange","yellow","lAqua",--200 - "lSky","lBlue","lGrape","lPink","lRed",--300 - "lFire","lOrange","lYellow","dAqua","dSky",--400 - "dBlue","dGrape","dPink","dRed","dFire",--500 - "dYellow","lGray","gray","dGray",--before 600, black after + "lNavy","lBlue","lPurple","lWine","lRed",--300 + "lFire","lOrange","lYellow","dAqua","dNavy",--400 + "dBlue","dPurple","dWine","dRed","dFire",--500 + "dYellow","lH","H","dH",--before 600, black after } function scene.draw() --Spawn area diff --git a/parts/scenes/app_cmd.lua b/parts/scenes/app_cmd.lua index cc70af9e..0cc2db2e 100644 --- a/parts/scenes/app_cmd.lua +++ b/parts/scenes/app_cmd.lua @@ -6,9 +6,9 @@ local C=COLOR local inputBox=WIDGET.newInputBox{name="input",x=40,y=650,w=1200,h=50} local outputBox=WIDGET.newTextBox{name="output",x=40,y=30,w=1200,h=600,font=25,lineH=25,fix=true} local function log(str)outputBox:push(str)end -log{C.lGrape,"Techmino Console"} -log{C.lBlue,"©2020 26F Studio some rights reserved"} -log{C.dRed,"DO NOT RUN ANY CODE YOU DON'T UNDERSTAND"} +log{C.lP,"Techmino Console"} +log{C.lB,"©2020 26F Studio some rights reserved"} +log{C.dR,"DO NOT RUN ANY CODE YOU DON'T UNDERSTAND"} local history,hisPtr={"?"} local the_secret=(14^2*10)..(2*11) @@ -196,7 +196,7 @@ do--commands.help(arg) details={ "Set background.", "", - "Usage: setbg ", + "Usage: setbg [bgName]", }, }, theme={ @@ -272,10 +272,10 @@ do--commands.help(arg) log"Use help [page] to view more commands," log"or help [command_name] for details of a command." log"" - log{C.lPink,"Page ",C.lG,page,C.lPink," of ",C.lG,maxPage} + log{C.lW,"Page ",C.lG,page,C.lW," of ",C.lG,maxPage} for i=pageSize*(page-1)+1,math.min(pageSize*page,#command_help_list)do local cmd=command_help_list[i] - log{C.W,cmd,C.gray," "..command_help_messages[cmd].description} + log{C.Z,cmd,C.H," "..command_help_messages[cmd].description} end else log{C.R,"Invalid page number. Must be between 1 and "..maxPage.." (inclusive)."} @@ -313,7 +313,7 @@ function commands.url(url) if url~=""then local res,err=pcall(love.system.openURL,url) if not res then - log{C.R,"[ERR] ",C.W,err} + log{C.R,"[ERR] ",C.Z,err} end else log{C.aqua,"Usage: url [url]"} @@ -631,14 +631,14 @@ function scene.keyDown(k) setfenv(code,userG) code,err=pcall(code) if not code then - log{C.R,"[ERR] ",C.W,err} + log{C.R,"[ERR] ",C.Z,err} end else - log{C.R,"[SYNTAX ERR] ",C.W,err} + log{C.R,"[SYNTAX ERR] ",C.Z,err} end else --Execute builtin command - log{C.lSea,"> "..input} + log{C.lS,"> "..input} local p=input:find(" ") local cmd,arg if p then @@ -689,7 +689,7 @@ function scene.keyDown(k) log(">Commands start with '"..str.."' :") table.sort(res) for i=1,#res do - log{COLOR.lGray,res[i]} + log{COLOR.lH,res[i]} end elseif #res==1 then inputBox.value=res[1] diff --git a/parts/scenes/app_dropper.lua b/parts/scenes/app_dropper.lua index ba284c71..85b42276 100644 --- a/parts/scenes/app_dropper.lua +++ b/parts/scenes/app_dropper.lua @@ -174,12 +174,12 @@ setmetatable(backColor,backColor) function scene.draw() --Background local lv,height=int(camY/700),camY%700 - gc.setColor(backColor[lv+1]or COLOR.black) + gc.setColor(backColor[lv+1]or COLOR.D) gc.rectangle("fill",0,720,1280,height-700) - gc.setColor(backColor[lv+2]or COLOR.black) + gc.setColor(backColor[lv+2]or COLOR.D) gc.rectangle("fill",0,height+20,1280,-height-20) if height-680>0 then - gc.setColor(backColor[lv+3]or COLOR.black) + gc.setColor(backColor[lv+3]or COLOR.D) gc.rectangle("fill",0,height-680,1280,680-height) end diff --git a/parts/scenes/app_dtw.lua b/parts/scenes/app_dtw.lua index f89d6be6..68e5902f 100644 --- a/parts/scenes/app_dtw.lua +++ b/parts/scenes/app_dtw.lua @@ -277,7 +277,7 @@ function scene.draw() end scene.widgetList={ - WIDGET.newButton{name="reset", x=155,y=100,w=180,h=100,color="lGreen",font=40,code=pressKey"r"}, + WIDGET.newButton{name="reset", x=155,y=100,w=180,h=100,color="lG",font=40,code=pressKey"r"}, WIDGET.newButton{name="mode", x=155,y=220,w=180,h=100,font=40,code=pressKey"q",hide=function()return state~=0 end}, WIDGET.newSwitch{name="arcade", x=230,y=330,font=40,disp=function()return arcade end,code=pressKey"w",hide=function()return state~=0 end}, WIDGET.newButton{name="back", x=1140,y=640,w=170,h=80,font=40,code=backScene}, diff --git a/parts/scenes/app_polyforge.lua b/parts/scenes/app_polyforge.lua index 0cb874be..9d122b15 100644 --- a/parts/scenes/app_polyforge.lua +++ b/parts/scenes/app_polyforge.lua @@ -165,7 +165,7 @@ function scene.draw() end scene.widgetList={ - WIDGET.newKey{name="back",x=1140,y=60,w=170,h=80,color="black",font=40,code=pressKey"escape"}, + WIDGET.newKey{name="back",x=1140,y=60,w=170,h=80,color="D",font=40,code=pressKey"escape"}, } return scene \ No newline at end of file diff --git a/parts/scenes/app_schulteG.lua b/parts/scenes/app_schulteG.lua index d08760b4..222407a1 100644 --- a/parts/scenes/app_schulteG.lua +++ b/parts/scenes/app_schulteG.lua @@ -168,7 +168,7 @@ function scene.draw() end scene.widgetList={ - WIDGET.newButton{name="reset", x=160,y=100,w=180,h=100,color="lGreen",font=40,code=pressKey"space",hide=function()return state==0 end}, + WIDGET.newButton{name="reset", x=160,y=100,w=180,h=100,color="lG",font=40,code=pressKey"space",hide=function()return state==0 end}, WIDGET.newSlider{name="rank", x=130,y=250,w=150,unit=3,show=false,font=40,disp=function()return rank-3 end,code=function(v)rank=v+3 end,hide=function()return state>0 end}, WIDGET.newSwitch{name="blind", x=240,y=330,w=60, font=40,disp=function()return blind end, code=pressKey"q",hide=function()return state==1 end}, WIDGET.newSwitch{name="disappear", x=240,y=420,w=60, font=40,disp=function()return disappear end,code=pressKey"w",hide=function()return state==1 end}, diff --git a/parts/scenes/app_tap.lua b/parts/scenes/app_tap.lua index 6cec4407..9f86409a 100644 --- a/parts/scenes/app_tap.lua +++ b/parts/scenes/app_tap.lua @@ -73,7 +73,7 @@ function scene.draw() end scene.widgetList={ - WIDGET.newKey{name="tap", x=640,y=540,w=626,h=260,fText="TAP",color="white",font=100,code=pressKey"button"}, + WIDGET.newKey{name="tap", x=640,y=540,w=626,h=260,fText="TAP",color="Z",font=100,code=pressKey"button"}, WIDGET.newButton{name="back", x=1140,y=640,w=170,h=80,font=40,code=backScene}, } diff --git a/parts/scenes/app_ten.lua b/parts/scenes/app_ten.lua index fcd24d1d..215a4aaa 100644 --- a/parts/scenes/app_ten.lua +++ b/parts/scenes/app_ten.lua @@ -269,7 +269,7 @@ function scene.draw() local N=board[i][j] if N>0 then if hide and N>maxNew then - setColor(COLOR.dGray) + setColor(COLOR.dH) rectangle("fill",320+j*128-128,40+i*128-128,128,128) setColor(1,1,1,.3) mStr("?",j*128+256,i*128-75) @@ -299,7 +299,7 @@ function scene.draw() end scene.widgetList={ - WIDGET.newButton{name="reset", x=160,y=100,w=180,h=100,color="lGreen",font=40,code=pressKey"r"}, + WIDGET.newButton{name="reset", x=160,y=100,w=180,h=100,color="lG",font=40,code=pressKey"r"}, WIDGET.newSwitch{name="next", x=240,y=235,font=40,disp=function()return nexts end,code=pressKey"q",hide=function()return state==1 end}, WIDGET.newSwitch{name="blind", x=240,y=305,font=40,disp=function()return blind end,code=pressKey"w",hide=function()return state==1 end}, WIDGET.newSwitch{name="fast", x=240,y=375,font=30,disp=function()return fast end,code=pressKey"e",hide=function()return state==1 end}, diff --git a/parts/scenes/customGame.lua b/parts/scenes/customGame.lua index 3d1a100b..28512d2d 100644 --- a/parts/scenes/customGame.lua +++ b/parts/scenes/customGame.lua @@ -48,9 +48,11 @@ function scene.keyDown(key) end if key=="return2"or kb.isDown("lalt","lctrl","lshift")then if initField then + FILE.save(CUSTOMENV,"conf/customEnv","q") loadGame("custom_puzzle",true) end else + FILE.save(CUSTOMENV,"conf/customEnv","q") loadGame("custom_clear",true) end elseif key=="f"then @@ -67,10 +69,10 @@ function scene.keyDown(key) str=str.."!" if #MISSION>0 then str=str..copyMission()end sys.setClipboardText(str.."!"..copyBoards().."!") - LOG.print(text.exportSuccess,COLOR.green) + LOG.print(text.exportSuccess,COLOR.G) 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=STRING.split(str:sub((str:find(":")or 0)+1),"!") if #args<4 then goto THROW_fail end if not( pasteQuestArgs(args[1])and @@ -83,10 +85,11 @@ function scene.keyDown(key) if not pasteBoard(args[i],i-3)and i<#args then goto THROW_fail end end freshMiniFieldVisible() - LOG.print(text.importSuccess,COLOR.green) + LOG.print(text.importSuccess,COLOR.G) do return end - ::THROW_fail::LOG.print(text.dataCorrupted,COLOR.red) + ::THROW_fail::LOG.print(text.dataCorrupted,COLOR.R) elseif key=="escape"then + FILE.save(CUSTOMENV,"conf/customEnv","q") SCN.back() else WIDGET.keyPressed(key) @@ -144,34 +147,34 @@ end scene.widgetList={ WIDGET.newText{name="title", x=520, y=5,font=70,align="R"}, - WIDGET.newText{name="subTitle", x=530, y=50,font=35,align="L",color="gray"}, - WIDGET.newText{name="defSeq", x=330, y=550,align="L",color="gray",hide=function()return BAG[1]end}, - WIDGET.newText{name="noMsn", x=610, y=550,align="L",color="gray",hide=function()return MISSION[1]end}, + WIDGET.newText{name="subTitle", x=530, y=50,font=35,align="L",color="H"}, + WIDGET.newText{name="defSeq", x=330, y=550,align="L",color="H",hide=function()return BAG[1]end}, + WIDGET.newText{name="noMsn", x=610, y=550,align="L",color="H",hide=function()return MISSION[1]end}, --Basic - WIDGET.newSelector{name="drop", x=170, y=150,w=220,color="orange", list={0,.125,.25,.5,1,2,3,4,5,6,7,8,9,10,12,14,16,18,20,25,30,40,60,180,1e99},disp=CUSval("drop"),code=CUSsto("drop")}, - WIDGET.newSelector{name="lock", x=170, y=230,w=220,color="red", list={0,1,2,3,4,5,6,7,8,9,10,12,14,16,18,20,25,30,40,60,180,1e99}, disp=CUSval("lock"),code=CUSsto("lock")}, - WIDGET.newSelector{name="wait", x=410, y=150,w=220,color="green", list={0,1,2,3,4,5,6,7,8,10,15,20,30,60}, disp=CUSval("wait"),code=CUSsto("wait")}, - WIDGET.newSelector{name="fall", x=410, y=230,w=220,color="yellow", list={0,1,2,3,4,5,6,7,8,10,15,20,30,60}, disp=CUSval("fall"),code=CUSsto("fall")}, + WIDGET.newSelector{name="drop", x=170, y=150,w=220,color="O",list={0,.125,.25,.5,1,2,3,4,5,6,7,8,9,10,12,14,16,18,20,25,30,40,60,180,1e99},disp=CUSval("drop"),code=CUSsto("drop")}, + WIDGET.newSelector{name="lock", x=170, y=230,w=220,color="R",list={0,1,2,3,4,5,6,7,8,9,10,12,14,16,18,20,25,30,40,60,180,1e99}, disp=CUSval("lock"),code=CUSsto("lock")}, + WIDGET.newSelector{name="wait", x=410, y=150,w=220,color="G",list={0,1,2,3,4,5,6,7,8,10,15,20,30,60}, disp=CUSval("wait"),code=CUSsto("wait")}, + WIDGET.newSelector{name="fall", x=410, y=230,w=220,color="Y",list={0,1,2,3,4,5,6,7,8,10,15,20,30,60}, disp=CUSval("fall"),code=CUSsto("fall")}, --Else - WIDGET.newSelector{name="bg", x=1070, y=150,w=250,color="yellow",list=BG.getList(),disp=CUSval("bg"), code=function(i)CUSTOMENV.bg=i BG.set(i)end}, - WIDGET.newSelector{name="bgm", x=1070, y=230,w=250,color="yellow", list=BGM.getList(), disp=CUSval("bgm"), code=function(i)CUSTOMENV.bgm=i BGM.play(i)end}, + WIDGET.newSelector{name="bg", x=1070, y=150,w=250,color="Y",list=BG.getList(),disp=CUSval("bg"), code=function(i)CUSTOMENV.bg=i BG.set(i)end}, + WIDGET.newSelector{name="bgm", x=1070, y=230,w=250,color="Y",list=BGM.getList(), disp=CUSval("bgm"), code=function(i)CUSTOMENV.bgm=i BGM.play(i)end}, --Copy/Paste/Start - WIDGET.newButton{name="copy", x=1070, y=310,w=310,h=70,color="lRed", font=25,code=pressKey"cC"}, - WIDGET.newButton{name="paste", x=1070, y=390,w=310,h=70,color="lBlue", font=25,code=pressKey"cV"}, - WIDGET.newButton{name="clear", x=1070, y=470,w=310,h=70,color="lYellow",font=35,code=pressKey"return"}, - WIDGET.newButton{name="puzzle",x=1070, y=550,w=310,h=70,color="lMagenta",font=35,code=pressKey"return2",hide=function()return not initField end}, + WIDGET.newButton{name="copy", x=1070, y=310,w=310,h=70,color="lR",font=25,code=pressKey"cC"}, + WIDGET.newButton{name="paste", x=1070, y=390,w=310,h=70,color="lB",font=25,code=pressKey"cV"}, + WIDGET.newButton{name="clear", x=1070, y=470,w=310,h=70,color="lY",font=35,code=pressKey"return"}, + WIDGET.newButton{name="puzzle",x=1070, y=550,w=310,h=70,color="lM",font=35,code=pressKey"return2",hide=function()return not initField end}, --More - WIDGET.newKey{name="advance", x=730, y=190,w=220,h=90,color="red", font=35,code=goScene"custom_advance"}, - WIDGET.newKey{name="mod", x=730, y=310,w=220,h=90,color="white", font=35,code=goScene"mod"}, - WIDGET.newKey{name="field", x=170, y=640,w=240,h=80,color="aqua", font=25,code=goScene"custom_field"}, - WIDGET.newKey{name="sequence", x=450, y=640,w=240,h=80,color="pink", font=25,code=goScene"custom_sequence"}, - WIDGET.newKey{name="mission", x=730, y=640,w=240,h=80,color="sky", font=25,code=goScene"custom_mission"}, + WIDGET.newKey{name="advance", x=730, y=190,w=220,h=90,color="R",font=35,code=goScene"custom_advance"}, + WIDGET.newKey{name="mod", x=730, y=310,w=220,h=90,color="Z",font=35,code=goScene"mod"}, + WIDGET.newKey{name="field", x=170, y=640,w=240,h=80,color="A",font=25,code=goScene"custom_field"}, + WIDGET.newKey{name="sequence", x=450, y=640,w=240,h=80,color="W",font=25,code=goScene"custom_sequence"}, + WIDGET.newKey{name="mission", x=730, y=640,w=240,h=80,color="N",font=25,code=goScene"custom_mission"}, - WIDGET.newButton{name="back", x=1140, y=640, w=170,h=80,font=40,code=backScene}, + WIDGET.newButton{name="back", x=1140, y=640, w=170,h=80,font=40,code=pressKey"escape"}, } return scene \ No newline at end of file diff --git a/parts/scenes/custom_advance.lua b/parts/scenes/custom_advance.lua index ef9132ab..a6cdb735 100644 --- a/parts/scenes/custom_advance.lua +++ b/parts/scenes/custom_advance.lua @@ -11,7 +11,7 @@ local scene={} scene.widgetList={ WIDGET.newText{name="title", x=520,y=5,font=70,align="R"}, - WIDGET.newText{name="subTitle", x=530,y=50,font=35,align="L",color="gray"}, + WIDGET.newText{name="subTitle", x=530,y=50,font=35,align="L",color="H"}, --Control WIDGET.newSlider{name="nextCount", x=200, y=150, w=200,unit=6,disp=CUSval("nextCount"),code=CUSsto("nextCount")}, @@ -20,16 +20,16 @@ scene.widgetList={ WIDGET.newSwitch{name="phyHold", x=350, y=430, disp=CUSval("phyHold"), code=CUSrev("phyHold"),hide=function()return CUSTOMENV.holdCount==0 end}, --Rule - WIDGET.newSelector{name="fieldH", x=270, y=520, w=260,color="sky", list=sList.fieldH, disp=CUSval("fieldH"),code=CUSsto("fieldH")}, - WIDGET.newSelector{name="visible", x=840, y=60, w=260,color="lBlue",list=sList.visible, disp=CUSval("visible"),code=CUSsto("visible")}, - WIDGET.newSelector{name="freshLimit",x=840, y=160, w=260,color="purple",list=sList.freshLimit, disp=CUSval("freshLimit"),code=CUSsto("freshLimit")}, - WIDGET.newSelector{name="opponent", x=1120, y=60, w=260,color="red", list=sList.opponent, disp=CUSval("opponent"),code=CUSsto("opponent")}, - WIDGET.newSelector{name="life", x=1120, y=160, w=260,color="red", list=sList.life, disp=CUSval("life"),code=CUSsto("life")}, - WIDGET.newSelector{name="pushSpeed",x=1120, y=260, w=260,color="red", list=sList.pushSpeed, disp=CUSval("pushSpeed"),code=CUSsto("pushSpeed")}, + WIDGET.newSelector{name="fieldH", x=270, y=520, w=260,color="N",list=sList.fieldH, disp=CUSval("fieldH"),code=CUSsto("fieldH")}, + WIDGET.newSelector{name="visible", x=840, y=60, w=260,color="lB",list=sList.visible, disp=CUSval("visible"),code=CUSsto("visible")}, + WIDGET.newSelector{name="freshLimit",x=840, y=160, w=260,color="V",list=sList.freshLimit, disp=CUSval("freshLimit"),code=CUSsto("freshLimit")}, + WIDGET.newSelector{name="opponent", x=1120, y=60, w=260,color="R",list=sList.opponent, disp=CUSval("opponent"),code=CUSsto("opponent")}, + WIDGET.newSelector{name="life", x=1120, y=160, w=260,color="R",list=sList.life, disp=CUSval("life"),code=CUSsto("life")}, + WIDGET.newSelector{name="pushSpeed",x=1120, y=260, w=260,color="R",list=sList.pushSpeed, disp=CUSval("pushSpeed"),code=CUSsto("pushSpeed")}, WIDGET.newSwitch{name="ospin", x=870, y=350, font=30,disp=CUSval("ospin"), code=CUSrev("ospin")}, - WIDGET.newSwitch{name="fineKill", x=870, y=530, font=20,disp=CUSval("fineKill"),code=CUSrev("fineKill")}, - WIDGET.newSwitch{name="b2bKill", x=870, y=620, font=20,disp=CUSval("b2bKill"), code=CUSrev("b2bKill")}, + WIDGET.newSwitch{name="fineKill", x=870, y=440, font=20,disp=CUSval("fineKill"),code=CUSrev("fineKill")}, + WIDGET.newSwitch{name="b2bKill", x=870, y=530, font=20,disp=CUSval("b2bKill"), code=CUSrev("b2bKill")}, WIDGET.newSwitch{name="easyFresh", x=1160, y=350, font=20,disp=CUSval("easyFresh"),code=CUSrev("easyFresh")}, WIDGET.newSwitch{name="deepDrop", x=1160, y=440, font=30,disp=CUSval("deepDrop"),code=CUSrev("deepDrop")}, WIDGET.newSwitch{name="bone", x=1160, y=530, disp=CUSval("bone"), code=CUSrev("bone")}, diff --git a/parts/scenes/custom_field.lua b/parts/scenes/custom_field.lua index 14d00f73..51eed5ff 100644 --- a/parts/scenes/custom_field.lua +++ b/parts/scenes/custom_field.lua @@ -227,15 +227,15 @@ function scene.keyDown(key) SFX.play("fall",.8) elseif key=="c"and kb.isDown("lctrl","rctrl")or key=="cC"then sys.setClipboardText("Techmino Field:"..copyBoard(page)) - LOG.print(text.exportSuccess,COLOR.green) + LOG.print(text.exportSuccess,COLOR.G) elseif key=="v"and kb.isDown("lctrl","rctrl")or key=="cV"then local str=sys.getClipboardText() local p=string.find(str,":")--ptr* if p then str=sub(str,p+1)end if pasteBoard(str,page)then - LOG.print(text.importSuccess,COLOR.green) + LOG.print(text.importSuccess,COLOR.G) else - LOG.print(text.dataCorrupted,COLOR.red) + LOG.print(text.dataCorrupted,COLOR.R) end elseif key=="tab"or key=="sTab"then if key=="sTab"or kb.isDown("lshift","rshift")then @@ -424,50 +424,50 @@ end local function setPen(i)return function()penType=i end end scene.widgetList={ WIDGET.newText{name="title", x=1020,y=5,font=70,align="R"}, - WIDGET.newText{name="subTitle", x=1030,y=50,font=35,align="L",color="gray"}, + WIDGET.newText{name="subTitle", x=1030,y=50,font=35,align="L",color="H"}, - WIDGET.newButton{name="b1", x=580, y=130,w=75,fText="",color=COLOR.red, code=setPen(1)},--B1 - WIDGET.newButton{name="b2", x=660, y=130,w=75,fText="",color=COLOR.fire, code=setPen(2)},--B2 - WIDGET.newButton{name="b3", x=740, y=130,w=75,fText="",color=COLOR.orange, code=setPen(3)},--B3 - WIDGET.newButton{name="b4", x=820, y=130,w=75,fText="",color=COLOR.yellow, code=setPen(4)},--B4 - WIDGET.newButton{name="b5", x=900, y=130,w=75,fText="",color=COLOR.lime, code=setPen(5)},--B5 - WIDGET.newButton{name="b6", x=980, y=130,w=75,fText="",color=COLOR.grass, code=setPen(6)},--B6 - WIDGET.newButton{name="b7", x=1060, y=130,w=75,fText="",color=COLOR.green, code=setPen(7)},--B7 - WIDGET.newButton{name="b8", x=1140, y=130,w=75,fText="",color=COLOR.aqua, code=setPen(8)},--B8 + WIDGET.newButton{name="b1", x=580, y=130,w=75,fText="",color="R",code=setPen(1)},--B1 + WIDGET.newButton{name="b2", x=660, y=130,w=75,fText="",color="F",code=setPen(2)},--B2 + WIDGET.newButton{name="b3", x=740, y=130,w=75,fText="",color="O",code=setPen(3)},--B3 + WIDGET.newButton{name="b4", x=820, y=130,w=75,fText="",color="Y",code=setPen(4)},--B4 + WIDGET.newButton{name="b5", x=900, y=130,w=75,fText="",color="L",code=setPen(5)},--B5 + WIDGET.newButton{name="b6", x=980, y=130,w=75,fText="",color="J",code=setPen(6)},--B6 + WIDGET.newButton{name="b7", x=1060, y=130,w=75,fText="",color="G",code=setPen(7)},--B7 + WIDGET.newButton{name="b8", x=1140, y=130,w=75,fText="",color="A",code=setPen(8)},--B8 - WIDGET.newButton{name="b9", x=580, y=210,w=75,fText="",color=COLOR.cyan, code=setPen(9)},--B9 - WIDGET.newButton{name="b10", x=660, y=210,w=75,fText="",color=COLOR.sky, code=setPen(10)},--B10 - WIDGET.newButton{name="b11", x=740, y=210,w=75,fText="",color=COLOR.sea, code=setPen(11)},--B11 - WIDGET.newButton{name="b12", x=820, y=210,w=75,fText="",color=COLOR.blue, code=setPen(12)},--B12 - WIDGET.newButton{name="b13", x=900, y=210,w=75,fText="",color=COLOR.purple, code=setPen(13)},--B13 - WIDGET.newButton{name="b14", x=980, y=210,w=75,fText="",color=COLOR.grape, code=setPen(14)},--B14 - WIDGET.newButton{name="b15", x=1060, y=210,w=75,fText="",color=COLOR.magenta,code=setPen(15)},--B15 - WIDGET.newButton{name="b16", x=1140, y=210,w=75,fText="",color=COLOR.pink, code=setPen(16)},--B16 + WIDGET.newButton{name="b9", x=580, y=210,w=75,fText="",color="C",code=setPen(9)},--B9 + WIDGET.newButton{name="b10", x=660, y=210,w=75,fText="",color="N",code=setPen(10)},--B10 + WIDGET.newButton{name="b11", x=740, y=210,w=75,fText="",color="S",code=setPen(11)},--B11 + WIDGET.newButton{name="b12", x=820, y=210,w=75,fText="",color="B",code=setPen(12)},--B12 + WIDGET.newButton{name="b13", x=900, y=210,w=75,fText="",color="V",code=setPen(13)},--B13 + WIDGET.newButton{name="b14", x=980, y=210,w=75,fText="",color="P",code=setPen(14)},--B14 + WIDGET.newButton{name="b15", x=1060, y=210,w=75,fText="",color="M",code=setPen(15)},--B15 + WIDGET.newButton{name="b16", x=1140, y=210,w=75,fText="",color="W",code=setPen(16)},--B16 - WIDGET.newButton{name="b17", x=580, y=290,w=75,fText="[ ]",color="dGray", code=setPen(17)},--BONE - WIDGET.newButton{name="b18", x=660, y=290,w=75,fText="N", color="black", code=setPen(18)},--HIDE - WIDGET.newButton{name="b19", x=740, y=290,w=75,fText="B", color="lYellow",code=setPen(19)},--BOMB - WIDGET.newButton{name="b20", x=820, y=290,w=75,fText="_", color="gray", code=setPen(20)},--GB1 - WIDGET.newButton{name="b21", x=900, y=290,w=75,fText="_", color="lGray", code=setPen(21)},--GB2 - WIDGET.newButton{name="b22", x=980, y=290,w=75,fText="_", color="dPurple",code=setPen(22)},--GB3 - WIDGET.newButton{name="b23", x=1060, y=290,w=75,fText="_", color="dRed", code=setPen(23)},--GB4 - WIDGET.newButton{name="b24", x=1140, y=290,w=75,fText="_", color="dGreen", code=setPen(24)},--GB5 + WIDGET.newButton{name="b17", x=580, y=290,w=75,fText="[ ]",color="dH", code=setPen(17)},--BONE + WIDGET.newButton{name="b18", x=660, y=290,w=75,fText="N", color="D", code=setPen(18)},--HIDE + WIDGET.newButton{name="b19", x=740, y=290,w=75,fText="B", color="lY", code=setPen(19)},--BOMB + WIDGET.newButton{name="b20", x=820, y=290,w=75,fText="_", color="H", code=setPen(20)},--GB1 + WIDGET.newButton{name="b21", x=900, y=290,w=75,fText="_", color="lH", code=setPen(21)},--GB2 + WIDGET.newButton{name="b22", x=980, y=290,w=75,fText="_", color="dV", code=setPen(22)},--GB3 + WIDGET.newButton{name="b23", x=1060, y=290,w=75,fText="_", color="dR", code=setPen(23)},--GB4 + WIDGET.newButton{name="b24", x=1140, y=290,w=75,fText="_", color="dG", code=setPen(24)},--GB5 - WIDGET.newButton{name="any", x=600, y=400,w=120,color="lGray", font=40,code=setPen(0)}, - WIDGET.newButton{name="space", x=730, y=400,w=120,color="gray", font=65,code=setPen(-1)}, - WIDGET.newButton{name="smartPen", x=860, y=400,w=120,color="lGreen", font=30,code=setPen(-2)}, - WIDGET.newButton{name="pushLine", x=990, y=400,w=120,h=120,color="lYellow",font=20,code=pressKey"k"}, - WIDGET.newButton{name="delLine", x=1120, y=400,w=120,h=120,color="lYellow",font=20,code=pressKey"l"}, + WIDGET.newButton{name="any", x=600, y=400,w=120,color="lH", font=40,code=setPen(0)}, + WIDGET.newButton{name="space", x=730, y=400,w=120,color="H", font=65,code=setPen(-1)}, + WIDGET.newButton{name="smartPen", x=860, y=400,w=120,color="lG", font=30,code=setPen(-2)}, + WIDGET.newButton{name="pushLine", x=990, y=400,w=120,h=120,color="lY",font=20,code=pressKey"k"}, + WIDGET.newButton{name="delLine", x=1120, y=400,w=120,h=120,color="lY",font=20,code=pressKey"l"}, - WIDGET.newButton{name="copy", x=730, y=530,w=120,color="lRed", font=35,code=pressKey"cC"}, - WIDGET.newButton{name="paste", x=860, y=530,w=120,color="lBlue", font=35,code=pressKey"cV"}, - WIDGET.newButton{name="clear", x=990, y=530,w=120,color="white", font=40,code=pressKey"delete"}, + WIDGET.newButton{name="copy", x=730, y=530,w=120,color="lR", font=35,code=pressKey"cC"}, + WIDGET.newButton{name="paste", x=860, y=530,w=120,color="lB", font=35,code=pressKey"cV"}, + WIDGET.newButton{name="clear", x=990, y=530,w=120,color="Z", font=40,code=pressKey"delete"}, WIDGET.newSwitch{name="demo", x=755, y=640,disp=function()return demo end,code=function()demo=not demo end}, - WIDGET.newButton{name="newPage", x=100, y=110,w=160,h=110,color="sky",font=20,code=pressKey"n"}, - WIDGET.newButton{name="delPage", x=100, y=230,w=160,h=110,color="lRed",font=20,code=pressKey"m"}, - WIDGET.newButton{name="prevPage", x=100, y=350,w=160,h=110,color="lGreen",font=20,code=pressKey"sTab",hide=function()return page==1 end}, - WIDGET.newButton{name="nextPage", x=100, y=470,w=160,h=110,color="lGreen",font=20,code=pressKey"tab",hide=function()return page==#FIELD end}, + WIDGET.newButton{name="newPage", x=100, y=110,w=160,h=110,color="N",font=20,code=pressKey"n"}, + WIDGET.newButton{name="delPage", x=100, y=230,w=160,h=110,color="lR",font=20,code=pressKey"m"}, + WIDGET.newButton{name="prevPage", x=100, y=350,w=160,h=110,color="lG",font=20,code=pressKey"sTab",hide=function()return page==1 end}, + WIDGET.newButton{name="nextPage", x=100, y=470,w=160,h=110,color="lG",font=20,code=pressKey"tab",hide=function()return page==#FIELD end}, WIDGET.newButton{name="back", x=1140, y=640, w=170,h=80,font=40,code=backScene}, } diff --git a/parts/scenes/custom_mission.lua b/parts/scenes/custom_mission.lua index 78ba8218..99659e74 100644 --- a/parts/scenes/custom_mission.lua +++ b/parts/scenes/custom_mission.lua @@ -73,17 +73,17 @@ function scene.keyDown(key) elseif key=="c"and kb.isDown("lctrl","rctrl")or key=="cC"then if #MISSION>0 then sys.setClipboardText("Techmino Target:"..copyMission()) - LOG.print(text.exportSuccess,COLOR.green) + LOG.print(text.exportSuccess,COLOR.G) end elseif key=="v"and kb.isDown("lctrl","rctrl")or key=="cV"then local str=sys.getClipboardText() local p=string.find(str,":")--ptr* if p then str=sub(str,p+1)end if pasteMission(str)then - LOG.print(text.importSuccess,COLOR.green) + LOG.print(text.importSuccess,COLOR.G) cur=#MISSION else - LOG.print(text.dataCorrupted,COLOR.red) + LOG.print(text.dataCorrupted,COLOR.R) end elseif key=="escape"then SCN.back() @@ -160,7 +160,7 @@ function scene.draw() elseif L[i]>4 then gc.setColor(COLOR.rainbow(i+TIME()*6.26)) else - gc.setColor(COLOR.gray) + gc.setColor(COLOR.H) end gc.print(missionEnum[L[i]],x,y-25) x=x+56 @@ -185,7 +185,7 @@ end scene.widgetList={ WIDGET.newText{name="title", x=520,y=5,font=70,align="R"}, - WIDGET.newText{name="subTitle", x=530,y=50,font=35,align="L",color="gray"}, + WIDGET.newText{name="subTitle", x=530,y=50,font=35,align="L",color="H"}, WIDGET.newKey{name="_1", x=800, y=540, w=90, font=50,code=pressKey(01)}, WIDGET.newKey{name="_2", x=900, y=540, w=90, font=50,code=pressKey(02)}, @@ -224,13 +224,13 @@ scene.widgetList={ WIDGET.newKey{name="O4", x=600, y=640, w=90, font=50,code=pressKey(64)}, WIDGET.newKey{name="I4", x=700, y=640, w=90, font=50,code=pressKey(74)}, - WIDGET.newKey{name="left", x=800, y=440, w=90, color="lGreen", font=55,code=pressKey"left"}, - WIDGET.newKey{name="right", x=900, y=440, w=90, color="lGreen", font=55,code=pressKey"right"}, - WIDGET.newKey{name="ten", x=1000, y=440, w=90, color="lGreen", font=40,code=pressKey"ten"}, - WIDGET.newKey{name="backsp", x=1000, y=540, w=90, color="lYellow",font=50,code=pressKey"backspace"}, - WIDGET.newKey{name="reset", x=1000, y=640, w=90, color="lYellow",font=50,code=pressKey"delete"}, - WIDGET.newButton{name="copy", x=1140, y=440, w=170,h=80, color="lRed", font=40,code=pressKey"cC",hide=function()return #MISSION==0 end}, - WIDGET.newButton{name="paste", x=1140, y=540, w=170,h=80, color="lBlue", font=40,code=pressKey"cV"}, + WIDGET.newKey{name="left", x=800, y=440, w=90, color="lG",font=55,code=pressKey"left"}, + WIDGET.newKey{name="right", x=900, y=440, w=90, color="lG",font=55,code=pressKey"right"}, + WIDGET.newKey{name="ten", x=1000, y=440, w=90, color="lG",font=40,code=pressKey"ten"}, + WIDGET.newKey{name="backsp", x=1000, y=540, w=90, color="lY",font=50,code=pressKey"backspace"}, + WIDGET.newKey{name="reset", x=1000, y=640, w=90, color="lY",font=50,code=pressKey"delete"}, + WIDGET.newButton{name="copy", x=1140, y=440, w=170,h=80, color="lR",font=40,code=pressKey"cC",hide=function()return #MISSION==0 end}, + WIDGET.newButton{name="paste", x=1140, y=540, w=170,h=80, color="lB",font=40,code=pressKey"cV"}, WIDGET.newSwitch{name="mission",x=1150, y=350, disp=CUSval("missionKill"),code=CUSrev("missionKill")}, WIDGET.newButton{name="back", x=1140, y=640, w=170,h=80, font=40,code=backScene}, diff --git a/parts/scenes/custom_sequence.lua b/parts/scenes/custom_sequence.lua index 061711a0..bc07fc72 100644 --- a/parts/scenes/custom_sequence.lua +++ b/parts/scenes/custom_sequence.lua @@ -88,17 +88,17 @@ function scene.keyDown(key) elseif key=="c"and kb.isDown("lctrl","rctrl")or key=="cC"then if #BAG>0 then sys.setClipboardText("Techmino SEQ:"..copySequence()) - LOG.print(text.exportSuccess,COLOR.green) + LOG.print(text.exportSuccess,COLOR.G) end elseif key=="v"and kb.isDown("lctrl","rctrl")or key=="cV"then local str=sys.getClipboardText() local p=string.find(str,":")--ptr* if p then str=sub(str,p+1)end if pasteSequence(str)then - LOG.print(text.importSuccess,COLOR.green) + LOG.print(text.importSuccess,COLOR.G) cur=#BAG else - LOG.print(text.dataCorrupted,COLOR.red) + LOG.print(text.dataCorrupted,COLOR.R) end elseif key=="escape"then SCN.back() @@ -186,10 +186,10 @@ end scene.widgetList={ WIDGET.newText{name="title", x=520,y=5,font=70,align="R"}, - WIDGET.newText{name="subTitle",x=530,y=50,font=35,align="L",color="gray"}, + WIDGET.newText{name="subTitle",x=530,y=50,font=35,align="L",color="H"}, WIDGET.newSelector{name="sequence", - x=1080,y=60,w=200,color="yellow", + x=1080,y=60,w=200,color="Y", list={"bag","his4","c2","rnd","mess","reverb","loop","fixed"}, disp=CUSval("sequence"), code=CUSsto("sequence") @@ -202,41 +202,41 @@ scene.widgetList={ WIDGET.newKey{name="T", x=440,y=460,w=80,font=50,code=pressKey(5)}, WIDGET.newKey{name="O", x=520,y=460,w=80,font=50,code=pressKey(6)}, WIDGET.newKey{name="I", x=600,y=460,w=80,font=50,code=pressKey(7)}, - WIDGET.newKey{name="left", x=680,y=460,w=80,color="lGreen",font=55,code=pressKey"left"}, - WIDGET.newKey{name="right", x=760,y=460,w=80,color="lGreen",font=55,code=pressKey"right"}, - WIDGET.newKey{name="ten", x=840,y=460,w=80,color="lGreen",font=40,code=pressKey"ten"}, - WIDGET.newKey{name="backsp",x=920,y=460,w=80,color="lYellow",font=50,code=pressKey"backspace"}, - WIDGET.newKey{name="reset", x=1000,y=460,w=80,color="lYellow",font=25,code=pressKey"delete"}, + WIDGET.newKey{name="left", x=680,y=460,w=80,color="lG",font=55,code=pressKey"left"}, + WIDGET.newKey{name="right", x=760,y=460,w=80,color="lG",font=55,code=pressKey"right"}, + WIDGET.newKey{name="ten", x=840,y=460,w=80,color="lG",font=40,code=pressKey"ten"}, + WIDGET.newKey{name="backsp",x=920,y=460,w=80,color="lY",font=50,code=pressKey"backspace"}, + WIDGET.newKey{name="reset", x=1000,y=460,w=80,color="lY",font=25,code=pressKey"delete"}, - WIDGET.newKey{name="Z5", x=120,y=540,w=80,color="lGray",font=50,code=pressKey(8)}, - WIDGET.newKey{name="S5", x=200,y=540,w=80,color="lGray",font=50,code=pressKey(9)}, - WIDGET.newKey{name="P", x=280,y=540,w=80,color="lGray",font=50,code=pressKey(10)}, - WIDGET.newKey{name="Q", x=360,y=540,w=80,color="lGray",font=50,code=pressKey(11)}, - WIDGET.newKey{name="F", x=440,y=540,w=80,color="lGray",font=50,code=pressKey(12)}, - WIDGET.newKey{name="E", x=520,y=540,w=80,color="lGray",font=50,code=pressKey(13)}, - WIDGET.newKey{name="T5", x=600,y=540,w=80,color="lGray",font=50,code=pressKey(14)}, - WIDGET.newKey{name="U", x=680,y=540,w=80,color="lGray",font=50,code=pressKey(15)}, - WIDGET.newKey{name="V", x=760,y=540,w=80,color="lGray",font=50,code=pressKey(16)}, - WIDGET.newKey{name="I3", x=840,y=540,w=80,color="gray",font=50,code=pressKey(26)}, - WIDGET.newKey{name="C", x=920,y=540,w=80,color="gray",font=50,code=pressKey(27)}, - WIDGET.newKey{name="rnd", x=1000,y=540,w=80,color="red",font=25,code=pressKey"="}, + WIDGET.newKey{name="Z5", x=120,y=540,w=80,color="lH",font=50,code=pressKey(8)}, + WIDGET.newKey{name="S5", x=200,y=540,w=80,color="lH",font=50,code=pressKey(9)}, + WIDGET.newKey{name="P", x=280,y=540,w=80,color="lH",font=50,code=pressKey(10)}, + WIDGET.newKey{name="Q", x=360,y=540,w=80,color="lH",font=50,code=pressKey(11)}, + WIDGET.newKey{name="F", x=440,y=540,w=80,color="lH",font=50,code=pressKey(12)}, + WIDGET.newKey{name="E", x=520,y=540,w=80,color="lH",font=50,code=pressKey(13)}, + WIDGET.newKey{name="T5", x=600,y=540,w=80,color="lH",font=50,code=pressKey(14)}, + WIDGET.newKey{name="U", x=680,y=540,w=80,color="lH",font=50,code=pressKey(15)}, + WIDGET.newKey{name="V", x=760,y=540,w=80,color="lH",font=50,code=pressKey(16)}, + WIDGET.newKey{name="I3", x=840,y=540,w=80,color="H",font=50,code=pressKey(26)}, + WIDGET.newKey{name="C", x=920,y=540,w=80,color="H",font=50,code=pressKey(27)}, + WIDGET.newKey{name="rnd", x=1000,y=540,w=80,color="R",font=25,code=pressKey"="}, - WIDGET.newKey{name="W", x=120,y=620,w=80,color="lGray",font=50,code=pressKey(17)}, - WIDGET.newKey{name="X", x=200,y=620,w=80,color="lGray",font=50,code=pressKey(18)}, - WIDGET.newKey{name="J5", x=280,y=620,w=80,color="lGray",font=50,code=pressKey(19)}, - WIDGET.newKey{name="L5", x=360,y=620,w=80,color="lGray",font=50,code=pressKey(20)}, - WIDGET.newKey{name="R", x=440,y=620,w=80,color="lGray",font=50,code=pressKey(21)}, - WIDGET.newKey{name="Y", x=520,y=620,w=80,color="lGray",font=50,code=pressKey(22)}, - WIDGET.newKey{name="N", x=600,y=620,w=80,color="lGray",font=50,code=pressKey(23)}, - WIDGET.newKey{name="H", x=680,y=620,w=80,color="lGray",font=50,code=pressKey(24)}, - WIDGET.newKey{name="I5", x=760,y=620,w=80,color="lGray",font=50,code=pressKey(25)}, - WIDGET.newKey{name="I2", x=840,y=620,w=80,color="dGray",font=50,code=pressKey(28)}, - WIDGET.newKey{name="O1", x=920,y=620,w=80,color="dGray",font=50,code=pressKey(29)}, + WIDGET.newKey{name="W", x=120,y=620,w=80,color="lH",font=50,code=pressKey(17)}, + WIDGET.newKey{name="X", x=200,y=620,w=80,color="lH",font=50,code=pressKey(18)}, + WIDGET.newKey{name="J5", x=280,y=620,w=80,color="lH",font=50,code=pressKey(19)}, + WIDGET.newKey{name="L5", x=360,y=620,w=80,color="lH",font=50,code=pressKey(20)}, + WIDGET.newKey{name="R", x=440,y=620,w=80,color="lH",font=50,code=pressKey(21)}, + WIDGET.newKey{name="Y", x=520,y=620,w=80,color="lH",font=50,code=pressKey(22)}, + WIDGET.newKey{name="N", x=600,y=620,w=80,color="lH",font=50,code=pressKey(23)}, + WIDGET.newKey{name="H", x=680,y=620,w=80,color="lH",font=50,code=pressKey(24)}, + WIDGET.newKey{name="I5", x=760,y=620,w=80,color="lH",font=50,code=pressKey(25)}, + WIDGET.newKey{name="I2", x=840,y=620,w=80,color="dH",font=50,code=pressKey(28)}, + WIDGET.newKey{name="O1", x=920,y=620,w=80,color="dH",font=50,code=pressKey(29)}, - WIDGET.newButton{name="copy", x=1140, y=460,w=170,h=80,color="lRed", font=40,code=pressKey"cC",hide=function()return #BAG==0 end}, - WIDGET.newButton{name="paste", x=1140, y=550,w=170,h=80,color="lBlue", font=40,code=pressKey"cV"}, - WIDGET.newButton{name="back", x=1140, y=640, w=170,h=80, font=40,code=backScene}, + WIDGET.newButton{name="copy",x=1140,y=460,w=170,h=80,color="lR",font=40,code=pressKey"cC",hide=function()return #BAG==0 end}, + WIDGET.newButton{name="paste",x=1140,y=550,w=170,h=80,color="lB",font=40,code=pressKey"cV"}, + WIDGET.newButton{name="back",x=1140,y=640,w=170,h=80,font=40,code=backScene}, } return scene \ No newline at end of file diff --git a/parts/scenes/dict.lua b/parts/scenes/dict.lua index b0141b37..287aa465 100644 --- a/parts/scenes/dict.lua +++ b/parts/scenes/dict.lua @@ -21,13 +21,13 @@ local lastSearch--Last searched string local typeColor={ help=COLOR.Y, - other=COLOR.lOrange, + other=COLOR.lO, game=COLOR.lC, term=COLOR.lR, setup=COLOR.lY, - pattern=COLOR.lGrass, + pattern=COLOR.lJ, english=COLOR.B, - name=COLOR.lPurple, + name=COLOR.lV, } local function getList()return result[1]and result or dict end local function clearResult() diff --git a/parts/scenes/intro.lua b/parts/scenes/intro.lua index 99b57890..5645473c 100644 --- a/parts/scenes/intro.lua +++ b/parts/scenes/intro.lua @@ -18,7 +18,7 @@ function scene.mouseDown(_,_,k) if newVersionLaunch then SCN.push(SETTING.simpMode and"main_simple"or"main") SCN.swapTo("history","fade") - LOG.print(text.newVersion,"warn",COLOR.lBlue) + LOG.print(text.newVersion,"warn",COLOR.lB) else SCN.go(SETTING.simpMode and"main_simple"or"main") end diff --git a/parts/scenes/load.lua b/parts/scenes/load.lua index 5b9372e2..d75f3410 100644 --- a/parts/scenes/load.lua +++ b/parts/scenes/load.lua @@ -103,7 +103,8 @@ local loadingThread=coroutine.wrap(function() {"fRect",7,41,16,16}, {"fRect",41,41,16,16}, {"trans",.5,.5}, - {"fPoly",7,24,56,24,56,39,39,39,39,56,24,56,24,39,7,39}, + {"setLW",1}, + {"dPoly",7,24,56,24,56,39,39,39,39,56,24,56,24,39,7,39}, }YIELD() modeIcons.t49=DOGC{64,64, {"setLW",2}, @@ -174,8 +175,8 @@ local loadingThread=coroutine.wrap(function() DAILYLAUNCH=freshDate("q") if DAILYLAUNCH then - logoColor1=COLOR.sea - logoColor2=COLOR.lSea + logoColor1=COLOR.S + logoColor2=COLOR.lS else local r=math.random()*6.2832 logoColor1={COLOR.rainbow(r)} @@ -363,7 +364,7 @@ function scene.draw() setFont(25) for i=0,26 do local x,y=light[3*i+1],light[3*i+2] - gc.setColor(COLOR[i==progress and"gray"or light[3*i+3]and"dOrange"or"dGray"]) + gc.setColor(COLOR[i==progress and"H"or light[3*i+3]and"dO"or"dH"]) gc.circle("fill",x,y,23) gc.setColor(.16,.16,.16) gc.circle("line",x,y,23) diff --git a/parts/scenes/login.lua b/parts/scenes/login.lua index 6d2d0dd2..8fe8c03e 100644 --- a/parts/scenes/login.lua +++ b/parts/scenes/login.lua @@ -1,7 +1,7 @@ local function login() local email= WIDGET.active.email.value local password= WIDGET.active.password.value - if not legalEmail(email)then + if not STRING.simpEmailCheck(email)then LOG.print(text.wrongEmail)return elseif #password==0 then LOG.print(text.noPassword)return diff --git a/parts/scenes/main.lua b/parts/scenes/main.lua index 4a223d0d..30256c5e 100644 --- a/parts/scenes/main.lua +++ b/parts/scenes/main.lua @@ -31,7 +31,7 @@ function scene.sceneInit() cmdEntryThread() --Set quick-play-button text - scene.widgetList[2].text=text.WidgetText.main.qplay..": "..text.modes[STAT.lastPlay][1] + scene.widgetList[2]:setObject(text.WidgetText.main.qplay..": "..text.modes[STAT.lastPlay][1]) quickSure=false --Create demo player @@ -168,23 +168,33 @@ function scene.draw() --Player PLAYERS[1]:draw() + + --Profile + drawSelfProfile() end scene.widgetList={ - WIDGET.newButton{name="offline",x=-1200,y=210,w=800,h=100, color="lR", font=45,align="R",edge=30, code=pressKey"1"}, - WIDGET.newButton{name="qplay", x=-1200,y=330,w=800,h=100, color="lM", font=40,align="R",edge=30, code=pressKey"q"}, - WIDGET.newButton{name="online", x=-1200,y=450,w=800,h=100, color="lPurple",font=45,align="R",edge=30, code=pressKey"a"}, - WIDGET.newButton{name="custom", x=-1200,y=570,w=800,h=100, color="lSea", font=45,align="R",edge=30, code=pressKey"z"}, + WIDGET.newButton{name="offline",x=-1200,y=210,w=800,h=100, color="lR",font=45,align="R",edge=30,code=pressKey"1"}, + WIDGET.newButton{name="qplay", x=-1200,y=330,w=800,h=100, color="lM",font=40,align="R",edge=30,code=pressKey"q"}, + WIDGET.newButton{name="online", x=-1200,y=450,w=800,h=100, color="lV",font=45,align="R",edge=30,code=pressKey"a"}, + WIDGET.newButton{name="custom", x=-1200,y=570,w=800,h=100, color="lS",font=45,align="R",edge=30,code=pressKey"z"}, - WIDGET.newButton{name="setting",x=2480,y=210,w=800,h=100, color="lOrange",font=40,align="L",edge=30, code=pressKey"-"}, - WIDGET.newButton{name="stat", x=2480,y=330,w=800,h=100, color="lLime", font=40,align="L",edge=30, code=pressKey"p"}, - WIDGET.newButton{name="dict", x=2480,y=450,w=800,h=100, color="lGreen", font=40,align="L",edge=30, code=pressKey"l"}, - WIDGET.newButton{name="manual", x=2480,y=570,w=800,h=100, color="lC", font=40,align="L",edge=30, code=pressKey","}, + WIDGET.newButton{name="setting",x=2480,y=210,w=800,h=100, color="lO",font=40,align="L",edge=30,code=pressKey"-"}, + WIDGET.newButton{name="stat", x=2480,y=330,w=800,h=100, color="lL",font=40,align="L",edge=30,code=pressKey"p"}, + WIDGET.newButton{name="dict", x=2480,y=450,w=800,h=100, color="lG",font=40,align="L",edge=30,code=pressKey"l"}, + WIDGET.newButton{name="manual", x=2480,y=570,w=800,h=100, color="lC",font=40,align="L",edge=30,code=pressKey","}, - WIDGET.newButton{name="music", x=160,y=80,w=200,h=90, color="lOrange",font=35, code=pressKey"2"}, - WIDGET.newButton{name="lang", x=1120,y=80,w=200,h=90, color="lY", font=40, code=pressKey"0"}, - WIDGET.newButton{name="about", x=-110,y=670,w=600,h=70, color="lB", font=35,align="R",edge=30, code=pressKey"x"}, - WIDGET.newButton{name="quit", x=1390,y=670,w=600,h=70, color="lR", font=40,align="L",edge=30, code=function()VOC.play("bye")SCN.swapTo("quit","slowFade")end}, + WIDGET.newButton{name="music", x=160,y=80,w=200,h=90, color="lO",font=35,code=pressKey"2"}, + WIDGET.newButton{name="lang", x=960,y=80,w=90,h=90, color="lY",font=40,code=pressKey"0",fText=DOGC{64,64, + {"setLW",4}, + {"dCirc",32,32,30}, + {"dLine",2,31,62,31}, + {"dLine",31,2,31,62}, + {"doArc",10,31,40,-.8,.8}, + {"doArc",53,31,40,2.3,3.9}, + }}, + WIDGET.newButton{name="about", x=-110,y=670,w=600,h=70, color="lB",font=35,align="R",edge=30,code=pressKey"x"}, + WIDGET.newButton{name="quit", x=1390,y=670,w=600,h=70, color="lR",font=40,align="L",edge=30,code=function()VOC.play("bye")SCN.swapTo("quit","slowFade")end}, } return scene \ No newline at end of file diff --git a/parts/scenes/main_simple.lua b/parts/scenes/main_simple.lua index 8d6982f9..93fedebb 100644 --- a/parts/scenes/main_simple.lua +++ b/parts/scenes/main_simple.lua @@ -16,8 +16,8 @@ function scene.draw() end scene.widgetList={ - WIDGET.newText{name="system", x=750,y=280,fText=SYSTEM,color="white",font=30,align="L"}, - WIDGET.newText{name="version", x=950,y=280,fText=VERSION.string,color="white",font=30,align="L"}, + WIDGET.newText{name="system", x=750,y=280,fText=SYSTEM,color="Z",font=30,align="L"}, + WIDGET.newText{name="version", x=950,y=280,fText=VERSION.string,color="Z",font=30,align="L"}, WIDGET.newButton{name="sprint", x=260,y=480,w=260,font=50,code=function()loadGame("sprint_40l",true)end}, WIDGET.newButton{name="marathon",x=640,y=480,w=260,font=50,code=function()loadGame("marathon_n",true)end}, WIDGET.newButton{name="setting",x=1000,y=400,w=120,fText="...",font=50,code=goScene"setting_game"}, diff --git a/parts/scenes/mod.lua b/parts/scenes/mod.lua index 8678e341..7fe9b630 100644 --- a/parts/scenes/mod.lua +++ b/parts/scenes/mod.lua @@ -155,7 +155,7 @@ end scene.widgetList={ WIDGET.newText{name="title", x=80,y=50,font=70,align="L"}, - WIDGET.newText{name="unranked", x=1200,y=60,color="yellow",font=50,align="R",hide=function()return scoreValid()end}, + WIDGET.newText{name="unranked", x=1200,y=60,color="Y",font=50,align="R",hide=function()return scoreValid()end}, WIDGET.newButton{name="reset", x=1140,y=540,w=170,h=80,font=25,code=pressKey"tab"}, WIDGET.newButton{name="back", x=1140,y=640,w=170,h=80,font=40,code=backScene}, } diff --git a/parts/scenes/music.lua b/parts/scenes/music.lua index b98f7bcd..3f87abc2 100644 --- a/parts/scenes/music.lua +++ b/parts/scenes/music.lua @@ -2,6 +2,7 @@ local gc=love.graphics local sin=math.sin local author={ + battle="Aether", empty="ERM", ["how feeling"]="????", } diff --git a/parts/scenes/net_chat.lua b/parts/scenes/net_chat.lua index f3d45d45..0a509573 100644 --- a/parts/scenes/net_chat.lua +++ b/parts/scenes/net_chat.lua @@ -47,7 +47,7 @@ function scene.keyDown(k) SCN.back() else escapeTimer=TIME() - LOG.print(text.sureQuit,COLOR.orange) + LOG.print(text.sureQuit,COLOR.O) end else WIDGET.keyPressed(k) @@ -56,7 +56,7 @@ end function scene.socketRead(mes) local cmd=mes:sub(1,1) - local args=SPLITSTR(mes:sub(2),";") + local args=STRING.split(mes:sub(2),";") if cmd=="J"or cmd=="L"then textBox:push{ COLOR.lR,args[1], @@ -68,12 +68,12 @@ function scene.socketRead(mes) local _,text=pcall(data.decode,"string","base64",args[3]) if not _ then text=args[3]end textBox:push{ - COLOR.W,args[1], + COLOR.Z,args[1], COLOR.dY,"#"..args[2].." ", - COLOR.sky,text + COLOR.N,text } else - LOG.print("Illegal message: "..mes,30,COLOR.green) + LOG.print("Illegal message: "..mes,30,COLOR.G) return end end diff --git a/parts/scenes/net_game.lua b/parts/scenes/net_game.lua index 744dcc57..760f7384 100644 --- a/parts/scenes/net_game.lua +++ b/parts/scenes/net_game.lua @@ -79,7 +79,7 @@ function scene.keyDown(key) NET.signal_quit() else lastBackTime=TIME() - LOG.print(text.sureQuit,COLOR.orange) + LOG.print(text.sureQuit,COLOR.O) end elseif key=="\\"then textBox.hide=not textBox.hide @@ -109,7 +109,7 @@ function scene.gamepadDown(key) SCN.back() else lastBackTime=TIME() - LOG.print(text.sureQuit,COLOR.orange) + LOG.print(text.sureQuit,COLOR.O) end else if noKey then return end @@ -147,9 +147,9 @@ function scene.socketRead(cmd,d) } elseif cmd=="Talk"then textBox:push{ - COLOR.W,d.username, + COLOR.Z,d.username, COLOR.dY,"#"..d.uid.." ", - COLOR.sky,d.message or"[_]", + COLOR.N,d.message or"[_]", } elseif cmd=="Go"then if not playing then @@ -161,7 +161,7 @@ function scene.socketRead(cmd,d) upstreamProgress=1 resetGameData("n",d.seed) else - LOG.print("Redundant [Go]",30,COLOR.green) + LOG.print("Redundant [Go]",30,COLOR.G) end elseif cmd=="Finish"then playing=false @@ -257,6 +257,9 @@ function scene.draw() gc.setColor(.5,.5,.5) gc.print("#"..p.uid,50,60+50*i) end + + --Profile + drawSelfProfile() end --New message if textBox.new and textBox.hide then @@ -275,7 +278,7 @@ scene.widgetList={ PLY_NET[1].ready or NET.getlock("ready") end}, - WIDGET.newKey{name="cancel",x=900,y=560,w=400,h=100,color="gray",font=40,code=pressKey"space", + WIDGET.newKey{name="cancel",x=900,y=560,w=400,h=100,color="H",font=40,code=pressKey"space", hide=function() return playing or diff --git a/parts/scenes/net_menu.lua b/parts/scenes/net_menu.lua index 5cb229d9..820e106e 100644 --- a/parts/scenes/net_menu.lua +++ b/parts/scenes/net_menu.lua @@ -10,11 +10,15 @@ function scene.sceneBack() NET.wsclose_play() end +function scene.draw() + drawSelfProfile() +end + scene.widgetList={ WIDGET.newButton{name="ffa", x=640, y=200,w=350,h=120,font=40,code=function()NET.enterRoom("ffa")end}, WIDGET.newButton{name="rooms", x=640, y=360,w=350,h=120,font=40,code=goScene"net_rooms"}, - WIDGET.newButton{name="chat", x=640, y=540,w=350,h=120,color="black",font=40,code=NULL}, - WIDGET.newButton{name="logout", x=1140, y=70,w=180,h=70,color="dR", + WIDGET.newButton{name="chat", x=640, y=540,w=350,h=120,color="D",font=40,code=NULL}, + WIDGET.newButton{name="logout", x=1180, y=130,w=180,h=70,color="dR", code=function() if TIME()-lastLogoutTime<1 then if USER.uid then @@ -26,7 +30,7 @@ scene.widgetList={ SCN.back() end else - LOG.print(text.sureQuit,COLOR.orange) + LOG.print(text.sureQuit,COLOR.O) lastLogoutTime=TIME() end end}, diff --git a/parts/scenes/net_rooms.lua b/parts/scenes/net_rooms.lua index dcaf454a..11b6a5c8 100644 --- a/parts/scenes/net_rooms.lua +++ b/parts/scenes/net_rooms.lua @@ -115,6 +115,9 @@ function scene.draw() gc.print(R.count.."/"..R.capacity,1100,66+40*i) end end + + --Profile + drawSelfProfile() end local function hide_noRoom()return #NET.roomList==0 end diff --git a/parts/scenes/pause.lua b/parts/scenes/pause.lua index ccc88685..bae049de 100644 --- a/parts/scenes/pause.lua +++ b/parts/scenes/pause.lua @@ -5,14 +5,14 @@ local format=string.format local SCR,setFont,mStr=SCR,setFont,mStr local fnsRankColor={ - Z=COLOR.lYellow, - S=COLOR.lGray, - A=COLOR.sky, - B=COLOR.lGreen, - C=COLOR.magenta, - D=COLOR.dGreen, - E=COLOR.red, - F=COLOR.dRed, + Z=COLOR.lY, + S=COLOR.lG, + A=COLOR.N, + B=COLOR.lG, + C=COLOR.M, + D=COLOR.dG, + E=COLOR.R, + F=COLOR.dR, } local scene={} @@ -38,7 +38,7 @@ function scene.sceneInit(org) local frameLostRate=(S.frame/S.time/60-1)*100 form={ - {COLOR.white,TIMESTR(S.time),COLOR[frameLostRate>10 and"red"or frameLostRate>3 and"yellow"or"gray"],format(" (%.2f%%)",frameLostRate)}, + {COLOR.Z,STRING.time(S.time),COLOR[frameLostRate>10 and"R"or frameLostRate>3 and"Y"or"H"],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), @@ -103,10 +103,10 @@ function scene.sceneInit(org) "F" if acc==1 then trophy=text.finesse_ap - trophyColor=COLOR.yellow + trophyColor=COLOR.Y elseif P.stat.maxFinesseCombo==P.stat.piece then trophy=text.finesse_fc - trophyColor=COLOR.lCyan + trophyColor=COLOR.lC else trophy=nil end @@ -309,11 +309,11 @@ function scene.draw() end scene.widgetList={ - WIDGET.newButton{name="setting", x=1120, y=70, w=240,h=90, color="lBlue", font=35,code=pressKey"s"}, - WIDGET.newButton{name="replay", x=535, y=250, w=200,h=100,color="lYellow",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="green", 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="lGreen", font=30,code=pressKey"escape"}, - WIDGET.newButton{name="restart", x=640, y=483, w=240,h=100,color="lRed", font=35,code=pressKey"r"}, + 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="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="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}, } diff --git a/parts/scenes/quit.lua b/parts/scenes/quit.lua index efdafeb2..0d17e89e 100644 --- a/parts/scenes/quit.lua +++ b/parts/scenes/quit.lua @@ -1,11 +1,11 @@ local scene={} function scene.sceneInit() - if math.random()>.000626 then + if math.random()>.0000626 then love.timer.sleep(.26) love.event.quit() else - error("So lucky! 0.0626 precent to get this!!! You can quit the game now.") + error("So lucky! 0.00626% to get this!! You can quit the game now.") end end diff --git a/parts/scenes/register.lua b/parts/scenes/register.lua index 1a6f0007..bd998b92 100644 --- a/parts/scenes/register.lua +++ b/parts/scenes/register.lua @@ -7,7 +7,7 @@ local function register() local password2=WIDGET.active.password2.value if #username==0 then LOG.print(text.noUsername)return - elseif not legalEmail(email)then + elseif not STRING.simpEmailCheck(email)then LOG.print(text.wrongEmail)return elseif #password==0 or #password2==0 then LOG.print(text.noPassword)return diff --git a/parts/scenes/savedata.lua b/parts/scenes/savedata.lua index ace832b8..7824ce91 100644 --- a/parts/scenes/savedata.lua +++ b/parts/scenes/savedata.lua @@ -6,7 +6,7 @@ local function dumpCB(T) "string","base64", love.data.compress( "string","zlib", - DUMPTABLE(T) + TABLE.dump(T) ) ) ) @@ -18,9 +18,9 @@ local function parseCB() --Decode _,s=pcall(love.data.decode,"string","base64",s) - if not _ then LOG.print(text.dataCorrupted,COLOR.red)return end + if not _ then LOG.print(text.dataCorrupted,COLOR.R)return end _,s=pcall(love.data.decompress,"string","zlib",s) - if not _ then LOG.print(text.dataCorrupted,COLOR.red)return end + if not _ then LOG.print(text.dataCorrupted,COLOR.R)return end s=loadstring(s) if s then @@ -29,12 +29,12 @@ local function parseCB() end end scene.widgetList={ - WIDGET.newButton{name="exportUnlock", x=190,y=150,w=280,h=100,color="lGreen",font=25,code=function()dumpCB(RANKS)end}, - WIDGET.newButton{name="exportData", x=490,y=150,w=280,h=100,color="lGreen",font=25,code=function()dumpCB(STAT)end}, - WIDGET.newButton{name="exportSetting", x=790,y=150,w=280,h=100,color="lGreen",font=25,code=function()dumpCB(SETTING)end}, - WIDGET.newButton{name="exportVK", x=1090,y=150,w=280,h=100,color="lGreen",font=25,code=function()dumpCB(VK_org)end}, + WIDGET.newButton{name="exportUnlock", x=190,y=150,w=280,h=100,color="lG",font=25,code=function()dumpCB(RANKS)end}, + WIDGET.newButton{name="exportData", x=490,y=150,w=280,h=100,color="lG",font=25,code=function()dumpCB(STAT)end}, + WIDGET.newButton{name="exportSetting", x=790,y=150,w=280,h=100,color="lG",font=25,code=function()dumpCB(SETTING)end}, + WIDGET.newButton{name="exportVK", x=1090,y=150,w=280,h=100,color="lG",font=25,code=function()dumpCB(VK_org)end}, - WIDGET.newButton{name="importUnlock", x=190,y=300,w=280,h=100,color="lBlue",font=25, + WIDGET.newButton{name="importUnlock", x=190,y=300,w=280,h=100,color="lB",font=25, code=function() local D=parseCB() if D then @@ -45,7 +45,7 @@ scene.widgetList={ LOG.print(text.dataCorrupted,"warn") end end}, - WIDGET.newButton{name="importData", x=490,y=300,w=280,h=100,color="lBlue",font=25, + WIDGET.newButton{name="importData", x=490,y=300,w=280,h=100,color="lB",font=25, code=function() local D=parseCB() if D and D.version==STAT.version then @@ -56,7 +56,7 @@ scene.widgetList={ LOG.print(text.dataCorrupted,"warn") end end}, - WIDGET.newButton{name="importSetting", x=790,y=300,w=280,h=100,color="lBlue",font=25, + WIDGET.newButton{name="importSetting", x=790,y=300,w=280,h=100,color="lB",font=25, code=function() local D=parseCB() if D then @@ -67,7 +67,7 @@ scene.widgetList={ LOG.print(text.dataCorrupted,"warn") end end}, - WIDGET.newButton{name="importVK", x=1090,y=300,w=280,h=100,color="lBlue",font=25, + WIDGET.newButton{name="importVK", x=1090,y=300,w=280,h=100,color="lB",font=25, code=function() local D=parseCB() if D then @@ -78,14 +78,14 @@ scene.widgetList={ LOG.print(text.dataCorrupted,"warn") end end}, - WIDGET.newButton{name="reset", x=640,y=460,w=280,h=100,color="lRed",font=40, + WIDGET.newButton{name="reset", x=640,y=460,w=280,h=100,color="lR",font=40, code=function() scene.widgetList.reset.hide=true scene.widgetList.resetUnlock.hide=false scene.widgetList.resetRecord.hide=false scene.widgetList.resetData.hide=false end}, - WIDGET.newButton{name="resetUnlock", x=340,y=460,w=280,h=100,color="red", + WIDGET.newButton{name="resetUnlock", x=340,y=460,w=280,h=100,color="R", code=function() love.filesystem.remove("conf/unlock") SFX.play("finesseError_long") @@ -93,7 +93,7 @@ scene.widgetList={ LOG.print("effected after restart game","message") LOG.print("fresh a rank to get data back","message") end,hide=true}, - WIDGET.newButton{name="resetRecord", x=640,y=460,w=280,h=100,color="red", + WIDGET.newButton{name="resetRecord", x=640,y=460,w=280,h=100,color="R", code=function() for _,name in next,love.filesystem.getDirectoryItems("record")do love.filesystem.remove("record/"..name) @@ -102,7 +102,7 @@ scene.widgetList={ TEXT.show("record data resetted",640,300,60,"stretch",.4) LOG.print("fresh a record list to get one list back","message") end,hide=true}, - WIDGET.newButton{name="resetData", x=940,y=460,w=280,h=100,color="red", + WIDGET.newButton{name="resetData", x=940,y=460,w=280,h=100,color="R", code=function() love.filesystem.remove("conf/data") SFX.play("finesseError_long") diff --git a/parts/scenes/setting_control.lua b/parts/scenes/setting_control.lua index 4bb3f3a0..2c4427d6 100644 --- a/parts/scenes/setting_control.lua +++ b/parts/scenes/setting_control.lua @@ -89,7 +89,7 @@ scene.widgetList={ WIDGET.newSwitch{name="ihs", x=1100, y=260, disp=SETval("ihs"), code=SETrev("ihs")}, WIDGET.newSwitch{name="irs", x=1100, y=330, disp=SETval("irs"), code=SETrev("irs")}, WIDGET.newSwitch{name="ims", x=1100, y=400, disp=SETval("ims"), code=SETrev("ims")}, - WIDGET.newButton{name="reset", x=160, y=580,w=200,h=100,color="lRed",font=40, + WIDGET.newButton{name="reset", x=160, y=580,w=200,h=100,color="lR",font=40, code=function() local _=SETTING _.das,_.arr,_.dascut=10,2,0 diff --git a/parts/scenes/setting_game.lua b/parts/scenes/setting_game.lua index 7a7f0eef..1e915bf3 100644 --- a/parts/scenes/setting_game.lua +++ b/parts/scenes/setting_game.lua @@ -21,15 +21,15 @@ end scene.widgetList={ WIDGET.newText{name="title", x=640,y=15,font=80}, - WIDGET.newButton{name="graphic", x=200, y=80, w=240,h=80, color="lCyan", font=35,code=swapScene"setting_video","swipeR"}, - WIDGET.newButton{name="sound", x=1080, y=80, w=240,h=80, color="lCyan", font=35,code=swapScene"setting_sound","swipeL"}, + WIDGET.newButton{name="graphic", x=200, y=80, w=240,h=80, color="lC",font=35,code=swapScene"setting_video","swipeR"}, + WIDGET.newButton{name="sound", x=1080, y=80, w=240,h=80, color="lC",font=35,code=swapScene"setting_sound","swipeL"}, - WIDGET.newButton{name="ctrl", x=290, y=220, w=320,h=80, color="lYellow",font=35,code=goScene"setting_control"}, - WIDGET.newButton{name="key", x=640, y=220, w=320,h=80, color="lGreen", font=35,code=goScene"setting_key"}, - WIDGET.newButton{name="touch", x=990, y=220, w=320,h=80, color="lBlue", font=35,code=goScene"setting_touch"}, + WIDGET.newButton{name="ctrl", x=290, y=220, w=320,h=80, color="lY",font=35,code=goScene"setting_control"}, + WIDGET.newButton{name="key", x=640, y=220, w=320,h=80, color="lG",font=35,code=goScene"setting_key"}, + WIDGET.newButton{name="touch", x=990, y=220, w=320,h=80, color="lB",font=35,code=goScene"setting_touch"}, WIDGET.newSlider{name="reTime", x=350, y=340, w=300,unit=10,disp=SETval("reTime"),code=SETsto("reTime"),show=function(S)return(.5+S.disp()*.25).."s"end}, - WIDGET.newSelector{name="RS", x=500, y=420, w=300,color="sea",list={"TRS","SRS","C2","C2sym","Classic","None"},disp=SETval("RS"),code=SETsto("RS")}, - WIDGET.newButton{name="layout", x=550, y=540, w=200,h=70, font=35,code=goScene"setting_skin"}, + WIDGET.newSelector{name="RS", x=500, y=420, w=300,color="S",list={"TRS","SRS","C2","C2sym","Classic","None"},disp=SETval("RS"),code=SETsto("RS")}, + WIDGET.newButton{name="layout", x=550, y=540, w=200,h=70,font=35, code=goScene"setting_skin"}, WIDGET.newSwitch{name="autoPause", x=1060, y=310, font=20,disp=SETval("autoPause"),code=SETrev("autoPause")}, WIDGET.newSwitch{name="swap", x=1060, y=370, font=20,disp=SETval("swap"), code=SETrev("swap")}, WIDGET.newSwitch{name="fine", x=1060, y=430, font=20,disp=SETval("fine"), code=function()SETTING.fine=not SETTING.fine if SETTING.fine then SFX.play("finesseError",.6) end end}, diff --git a/parts/scenes/setting_skin.lua b/parts/scenes/setting_skin.lua index 1e29d732..8134cce4 100644 --- a/parts/scenes/setting_skin.lua +++ b/parts/scenes/setting_skin.lua @@ -85,12 +85,12 @@ scene.widgetList={ --WIDGET.newButton{name="spin6",x=825,y=540,w=90,h=65,code=function()nextDir(6)end},--Cannot rotate O WIDGET.newButton{name="spin7", x=970,y=540,w=90,h=65,code=function()nextDir(7)end}, - WIDGET.newButton{name="skinR", x=200,y=640,w=220,h=80,color="lPurple",font=35, + WIDGET.newButton{name="skinR", x=200,y=640,w=220,h=80,color="lV",font=35, code=function() SETTING.skin={1,7,11,3,14,4,9,1,7,2,6,10,2,13,5,9,15,10,11,3,10,2,16,8,4,10,13,2,8} SFX.play("rotate") end}, - WIDGET.newButton{name="faceR", x=480,y=640,w=220,h=80,color="lRed",font=35, + WIDGET.newButton{name="faceR", x=480,y=640,w=220,h=80,color="lR",font=35, code=function() for i=1,29 do SETTING.face[i]=0 diff --git a/parts/scenes/setting_sound.lua b/parts/scenes/setting_sound.lua index 390a28c7..d9afc4e2 100644 --- a/parts/scenes/setting_sound.lua +++ b/parts/scenes/setting_sound.lua @@ -57,8 +57,8 @@ end scene.widgetList={ WIDGET.newText{name="title", x=640,y=15,font=80}, - WIDGET.newButton{name="game", x=200, y=80,w=240,h=80,color="lCyan",font=35,code=swapScene"setting_game","swipeR"}, - WIDGET.newButton{name="graphic",x=1080, y=80,w=240,h=80,color="lCyan",font=35,code=swapScene"setting_video","swipeL"}, + WIDGET.newButton{name="game", x=200, y=80,w=240,h=80,color="lC",font=35,code=swapScene"setting_game","swipeR"}, + WIDGET.newButton{name="graphic",x=1080, y=80,w=240,h=80,color="lC",font=35,code=swapScene"setting_video","swipeL"}, WIDGET.newSlider{name="sfx", x=180, y=200,w=400, font=35,change=function()SFX.play("blip_1")end, disp=SETval("sfx"),code=SETsto("sfx")}, WIDGET.newSlider{name="spawn", x=180, y=300,w=400, font=30,change=function()SFX.fplay("spawn_"..math.random(7),SETTING.sfx_spawn)end,disp=SETval("sfx_spawn"),code=SETsto("sfx_spawn")}, diff --git a/parts/scenes/setting_touch.lua b/parts/scenes/setting_touch.lua index 9099e197..5e17d3a7 100644 --- a/parts/scenes/setting_touch.lua +++ b/parts/scenes/setting_touch.lua @@ -194,7 +194,7 @@ scene.widgetList={ defaultSetSelect=defaultSetSelect%5+1 selected=false 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}, + WIDGET.newSelector{name="snap", x=760,y=90,w=200,h=80,color="Y",list={1,10,20,40,60,80},disp=function()return snapUnit end,code=function(i)snapUnit=i end}, WIDGET.newButton{name="option", x=520,y=190,w=200,h=80,font=40, code=function() SCN.go("setting_touchSwitch") diff --git a/parts/scenes/setting_video.lua b/parts/scenes/setting_video.lua index 5a69ea1a..0e6f0cec 100644 --- a/parts/scenes/setting_video.lua +++ b/parts/scenes/setting_video.lua @@ -10,8 +10,8 @@ end scene.widgetList={ WIDGET.newText{name="title", x=640, y=15,font=80}, - WIDGET.newButton{name="sound", x=200, y=80,w=240,h=80,color="lCyan",font=35,code=swapScene"setting_sound","swipeR"}, - WIDGET.newButton{name="game", x=1080, y=80,w=240,h=80,color="lCyan",font=35,code=swapScene"setting_game","swipeL"}, + WIDGET.newButton{name="sound", x=200, y=80,w=240,h=80,color="lC",font=35,code=swapScene"setting_sound","swipeR"}, + WIDGET.newButton{name="game", x=1080, y=80,w=240,h=80,color="lC",font=35,code=swapScene"setting_game","swipeL"}, WIDGET.newSwitch{name="block", x=290, y=165, disp=SETval("block"), code=SETrev("block")}, WIDGET.newSwitch{name="smooth", x=290, y=215, disp=SETval("smooth"), code=SETrev("smooth")}, diff --git a/parts/scenes/stat.lua b/parts/scenes/stat.lua index 75b26a62..db64a90a 100644 --- a/parts/scenes/stat.lua +++ b/parts/scenes/stat.lua @@ -29,7 +29,7 @@ function scene.sceneInit() item={ S.run, S.game, - TIMESTR(S.time), + STRING.time(S.time), S.key.." "..S.rotate.." "..S.hold, S.piece.." "..S.row.." "..int(S.atk), S.recv.." "..S.off.." "..S.pend, diff --git a/parts/scenes/test.lua b/parts/scenes/test.lua index 3a520bdd..77d50694 100644 --- a/parts/scenes/test.lua +++ b/parts/scenes/test.lua @@ -24,13 +24,13 @@ function scene.gamepadDown(key) push("[gamepadDown] <"..key..">") end function scene.gamepadUp(key) - push{COLOR.gray,"[gamepadUp] <"..key..">"} + push{COLOR.H,"[gamepadUp] <"..key..">"} end function scene.keyDown(key) push("[keyDown] <"..key..">") end function scene.keyUp(key) - push{COLOR.gray,"[keyUp] <"..key..">"} + push{COLOR.H,"[keyUp] <"..key..">"} end function scene.mouseDown(x,y,k) push(("[mouseDown] <%d: %d, %d>"):format(k,x,y)) @@ -40,7 +40,7 @@ function scene.mouseMove(x,y) end function scene.mouseUp(x,y,k) SYSFX.newRectRipple(1,x-10,y-10,21,21) - push{COLOR.gray,"[mouseUp] <"..k..">"} + push{COLOR.H,"[mouseUp] <"..k..">"} end function scene.touchClick(x,y) SYSFX.newRipple(.5,x,y,50) @@ -55,7 +55,7 @@ function scene.touchMove(x,y) end function scene.touchUp(x,y) SYSFX.newRipple(.5,x,y,50) - push{COLOR.gray,"[touchUp]"} + push{COLOR.H,"[touchUp]"} end function scene.wheelMoved(dx,dy) push(("[wheelMoved] <%d, %d>"):format(dx,dy)) diff --git a/parts/texture.lua b/parts/texture.lua index ac70d6a5..5778785e 100644 --- a/parts/texture.lua +++ b/parts/texture.lua @@ -33,6 +33,7 @@ for i=1,29 do end --Texture of puzzle mode +gc.setLineWidth(2) TEXTURE.puzzleMark={} for i=1,17 do TEXTURE.puzzleMark[i]=NSC(30,30) @@ -107,14 +108,14 @@ for i=1,8 do end TEXTURE.title_color=NSC(1160,236) local titleColor={ - COLOR.lGrape, - COLOR.lCyan, - COLOR.lBlue, - COLOR.lOrange, - COLOR.lFire, - COLOR.lMagenta, - COLOR.lGreen, - COLOR.lYellow, + COLOR.lP, + COLOR.lC, + COLOR.lB, + COLOR.lO, + COLOR.lF, + COLOR.lM, + COLOR.lG, + COLOR.lY, } for i=1,8 do gc.translate(12*i,i==1 and 8 or 14) diff --git a/parts/updateLog.lua b/parts/updateLog.lua index c9b8b533..11eb6b22 100644 --- a/parts/updateLog.lua +++ b/parts/updateLog.lua @@ -1,4 +1,4 @@ -return SPLITSTR([=[ +return STRING.split([=[ 未来模式: 无尽PC挑战; 简单极简练习; 任务生存; 对称; 无摩擦; 连击练习; 拼方形 极简教程/考试; 大爆炸; 音游模式; 跑酷; 术语问答; 养成玩法; 收集向抽奖玩法 @@ -16,7 +16,7 @@ return SPLITSTR([=[ 自适应UI; 重做模式选择UI和MOD的UI; 高级自定义序列 区分各种消除(隔断/架空/混合/彩色/穿墙) 更复杂的垃圾行(数量/等待时间/抵消倍率/洞数/连接/炸弹) - 可调场地宽度; 手势操作; 特殊控件(虚拟摇杆等); 切换高低镜头的按键 + 可调场地宽度; 左右三按键; 手势操作; 特殊控件(虚拟摇杆等); 切换高低镜头的按键 DAS系统和Deepdrop系统更细节的选项; spike计数器; 攻击总缓冲显示 成就系统; 更强的主题系统; 多方块; 3D背景 可选虚拟按键颜色; 工程编译到字节码; task-Z(新AI) @@ -25,6 +25,8 @@ return SPLITSTR([=[ 0.14.5: 晨 Morn 新增: 新增BGM:Empty(用于节日主题,by ERM) + 新增BGM:Battle(用于单挑L/U难度,by Aether) + 增加玩家个人信息显示框 音乐室显示音乐作者 新增开5人房的按钮 小程序dtw增加街机模式 @@ -33,16 +35,20 @@ return SPLITSTR([=[ 加强消四,增加b2b点数(100→150) 增强hpc攻击力(2→4) 修改pc和hpc对b2b点数的影响 + 自定义游戏设置会自动保存,默认设置为无重力科研 调低竞速模式部分评价要求,科研模式通关条件改为100攻击(原200) 调整master-ph命数奖励 对战背景改为主题默认背景 + 主菜单语言按钮改为地球图标 修改硬降音效 词典修改部分词条,调整词条顺序(意见来自群友 库德里尔) 移除词典中两个不必要的个人词条 词典支持左右键翻页,添加触屏可用的翻页按钮 "命令行"改名控制台 + 更新词典中的茶服域名 代码: - file模块升级 + 文件模块升级 + 控件系统升级,部分控件的text属性改为任意可绘制对象 新增users模块用来管理网络用户缓存信息 play场景改名game 重构GAME.frame相关内容 diff --git a/parts/users.lua b/parts/users.lua index c0af85d0..b6d14155 100644 --- a/parts/users.lua +++ b/parts/users.lua @@ -1,31 +1,40 @@ -local loadImage=love.graphics.newImage -local fs=love.filesystem - -local texture_noImage=DOGC{32,32, - {"setCL",0,0,0}, - {"fRect",0,0,32,32}, - {"setCL",1,1,1}, - {"setLW",3}, - {"dLine",0,0,31,31}, - {"dLine",0,31,31,0}, -} - -local function _getEmptyUser() - return{ - username="[X]", - motto="Techmino haowan", - hash="", - new=false, - } +local gc,fs=love.graphics,love.filesystem +local function loadAvatar(path) + local img=gc.newImage(path) + local canvas=gc.newCanvas(128,128) + gc.push() + gc.origin() + gc.setColor(1,1,1) + gc.setCanvas(canvas) + mDraw(img,64,64,nil,128/math.max(img:getWidth(),img:getHeight())) + gc.setCanvas() + gc.pop() + return canvas end +local texture_noImage=DOGC{120,120, + {"setCL",0,0,0}, + {"fRect",0,0,120,120}, + {"setCL",1,1,1}, + {"setLW",6}, + {"dLine",9,9,110,110}, + {"dLine",9,110,110,9}, +} + local db_img={} local db=setmetatable({},{__index=function(self,k) local file="cache/user"..k..".dat" - local d=fs.getInfo(file)and JSON.decode(fs.read(file))or _getEmptyUser() + local d= + fs.getInfo(file)and JSON.decode(fs.read(file))or + { + username="[X]", + motto="Techmino haowan", + hash="", + new=false, + } rawset(self,k,d) - if type(d.hash)=="string"and #d.hash>0 and fs.getInfo(d.hash)then - db_img[k].avatar=loadImage(d.hash) + if type(d.hash)=="string"and #d.hash>0 and fs.getInfo("cache/"..d.hash)then + db_img[k]=loadAvatar("cache/"..d.hash) end return d end}) @@ -39,12 +48,12 @@ function USERS.updateUserData(data) fs.write("cache/user"..uid..".dat",JSON.encode{ username=data.username, motto=data.motto, - hash=data.hash, + hash=data.hash or db[uid].hash, }) if data.avatar then - fs.write("cache/"..data.hash,data.avatar:sub(data.avatar:find","+1)) - db_img[uid].avatar=loadImage("cache/"..data.hash) - db[uid].hash=type(data.hash)=="string"and data.hash>0 and data.hash + fs.write("cache/"..data.hash,love.data.decode("string","base64",data.avatar:sub(data.avatar:find","+1))) + db_img[uid]=loadAvatar("cache/"..data.hash) + db[uid].hash=type(data.hash)=="string"and #data.hash>0 and data.hash db[uid].new=true end end