diff --git a/Zframework/bgm.lua b/Zframework/bgm.lua index 3b238766..f24325ec 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,'warn') + MES.new("No BGM file: "..list[i],5) end if not skip and i~=count then coroutine.yield() diff --git a/Zframework/file.lua b/Zframework/file.lua index e64b6cbb..103c0c94 100644 --- a/Zframework/file.lua +++ b/Zframework/file.lua @@ -21,7 +21,7 @@ function FILE.load(name) return s end end - LOG.print(name.." "..text.loadError,'error') + MES.new(name.." "..text.loadError) end end function FILE.save(data,name,mode) @@ -30,13 +30,13 @@ function FILE.save(data,name,mode) if mode:find'l'then data=TABLE.dump(data) if not data then - LOG.print(name.." "..text.saveError.."dump error",'error') + MES.new(name.." "..text.saveError.."dump error") return end else data=JSON.encode(data) if not data then - LOG.print(name.." "..text.saveError.."json error",'error') + MES.new(name.." "..text.saveError.."json error") return end end @@ -50,11 +50,11 @@ function FILE.save(data,name,mode) F:flush()F:close() if success then if not mode:find'q'then - LOG.print(text.saveDone,'message') + MES.new(text.saveDone) end else - LOG.print(text.saveError..(mes or"unknown error"),'error') - LOG.print(debug.traceback(),'error') + MES.new(text.saveError..(mes or"unknown error")) + MES.new(debug.traceback()) end end function FILE.clear(path) diff --git a/Zframework/init.lua b/Zframework/init.lua index 05290242..7e3a3ba8 100644 --- a/Zframework/init.lua +++ b/Zframework/init.lua @@ -11,7 +11,6 @@ ADRAW=require"Zframework.aDraw" SCR= require"Zframework.screen" COLOR= require"Zframework.color" -LOG= require"Zframework.log" SCN= require"Zframework.scene" WS= require"Zframework.websocket" @@ -31,6 +30,7 @@ BG= require"Zframework.background" WIDGET= require"Zframework.widget" TEXT= require"Zframework.text" SYSFX= require"Zframework.sysFX" +MES= require"Zframework.message" IMG= require"Zframework.image" BGM= require"Zframework.bgm" @@ -208,7 +208,7 @@ local function noDevkeyPressed(key) if key=="f1"then PROFILE.switch() elseif key=="f2"then - LOG.print(("System:%s[%s]\nluaVer:%s\njitVer:%s\njitVerNum:%s"):format(SYSTEM,jit.arch,_VERSION,jit.version,jit.version_num),'message') + MES.new(("System:%s[%s]\nluaVer:%s\njitVer:%s\njitVerNum:%s"):format(SYSTEM,jit.arch,_VERSION,jit.version,jit.version_num)) elseif key=="f3"then for _=1,8 do local P=PLY_ALIVE[rnd(#PLY_ALIVE)] @@ -218,7 +218,7 @@ local function noDevkeyPressed(key) end end elseif key=="f4"and not kb.isDown("lalt","ralt")then - LOG.copy() + MES.new.copy() elseif key=="f5"then print(WIDGET.isFocus()or"no widget selected") elseif key=="f6"then @@ -226,15 +226,15 @@ local function noDevkeyPressed(key) elseif key=="f7"and love._openConsole then love._openConsole() elseif key=="f8"then - devMode=nil LOG.print("DEBUG OFF",10) + devMode=nil MES.new("DEBUG OFF",.2) elseif key=="f9"then - devMode=1 LOG.print("DEBUG 1") + devMode=1 MES.new("DEBUG 1") elseif key=="f10"then - devMode=2 LOG.print("DEBUG 2") + devMode=2 MES.new("DEBUG 2") elseif key=="f11"then - devMode=3 LOG.print("DEBUG 3") + devMode=3 MES.new("DEBUG 3") elseif key=="f12"then - devMode=4 LOG.print("DEBUG 4") + devMode=4 MES.new("DEBUG 4") elseif devMode==2 then local W=WIDGET.sel if W then @@ -263,7 +263,7 @@ function love.keypressed(key) return elseif key=="f8"then devMode=1 - LOG.print("DEBUG ON",10) + MES.new("DEBUG ON",.2) elseif key=="f11"then if kb.isDown("lctrl","rctrl")then _G["\100\114\97\119\70\87\77"]=NULL @@ -272,7 +272,7 @@ function love.keypressed(key) end elseif not SCN.swapping then if SCN.keyDown then - SCN.keyDown(key) + if #EDITING==0 then SCN.keyDown(key)end elseif key=="escape"then SCN.back() else @@ -294,13 +294,13 @@ end function love.joystickadded(JS) ins(joysticks,JS) - LOG.print("Joystick added",'message') + MES.new("Joystick added") end function love.joystickremoved(JS) local i=TABLE.find(joysticks,JS) if i then rem(joysticks,i) - LOG.print("Joystick removed",'message') + MES.new("Joystick removed") end end local keyMirror={ @@ -359,7 +359,7 @@ function love.lowmemory() if TIME()-lastGCtime>6.26 then collectgarbage() lastGCtime=TIME() - LOG.print("[auto GC] low MEM 设备内存过低",'warn') + MES.new("[auto GC] low MEM 设备内存过低") end end function love.resize(w,h) @@ -369,7 +369,6 @@ function love.resize(w,h) WIDGET.resize(w,h) SHADER.warning:send("w",w*SCR.dpi) - SHADER.warning:send("h",h*SCR.dpi) end function love.focus(f) if f then @@ -520,7 +519,7 @@ function love.run() local love=love local VOC,BG,SYSFX=VOC,BG,SYSFX - local TASK,LOG,TEXT=TASK,LOG,TEXT + local TASK,TEXT=TASK,TEXT local TEXTURE,TIME=TEXTURE,TIME local SETTING,VERSION=SETTING,VERSION @@ -571,7 +570,7 @@ function love.run() if SCN.update then SCN.update(dt)end if SCN.swapping then SCN.swapUpdate()end TEXT.update() - LOG.update() + MES.update(dt) --DRAW if not MINI()then @@ -598,9 +597,8 @@ function love.run() gc_setColor(1,1,1) gc_draw(ms.isDown(1)and cursor_holdImg or cursorImg,mx,my,nil,nil,nil,8,8) end - gc_replaceTransform(SCR.xOy_ul) - LOG.draw() gc_replaceTransform(SCR.origin) + MES.draw() --Draw power info. if SETTING.powerInfo then gc_setColor(1,1,1) @@ -613,7 +611,7 @@ function love.run() _=SCN.stat _.draw(_.time) end - gc_replaceTransform(SCR.xOy_dm) + gc_replaceTransform(SCR.xOy_d) --Draw Version string gc_setColor(.8,.8,.8,.4) setFont(20) diff --git a/Zframework/json.lua b/Zframework/json.lua index 230dc276..7124c72d 100644 --- a/Zframework/json.lua +++ b/Zframework/json.lua @@ -118,8 +118,8 @@ function json.encode(val) local a,b=pcall(encode,val) if a then return b - elseif LOG then - LOG.print(text.jsonError..": "..(b or"uknErr"),'warn') + elseif MES.new then + MES.new(text.jsonError..": "..(b or"uknErr")) end end @@ -348,8 +348,8 @@ function json.decode(str) local a,b=pcall(decode,str) if a then return b - elseif LOG then - LOG.print(text.jsonError..": "..(b or"uknErr"),'warn') + elseif MES.new then + MES.new(text.jsonError..": "..(b or"uknErr")) end end return json \ No newline at end of file diff --git a/Zframework/loadLib.lua b/Zframework/loadLib.lua index 97ebaa25..80a9a337 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') + MES.new("Cannot load "..name..": "..(r2 or r3)) end elseif SYSTEM=="Android"then local fs=love.filesystem @@ -17,25 +17,25 @@ return function(name,libName) if success then libFunc,mes2=package.loadlib(SAVEDIR.."/lib/"..libName.Android,libName.libFunc) if libFunc then - LOG.print(name.." lib loaded",'message') + MES.new(name.." lib loaded") break else - LOG.print("Cannot load "..name..": "..mes2,'error') + MES.new("Cannot load "..name..": "..mes2) end else - LOG.print(("Write %s-%s to saving failed: %s"):format(name,platform[i],mes2),'error') + MES.new(("Write %s-%s to saving failed: %s"):format(name,platform[i],mes2)) end else - LOG.print(("Read %s-%s to saving failed: %s"):format(name,platform[i],mes1),'error') + MES.new(("Read %s-%s to saving failed: %s"):format(name,platform[i],mes1)) end end if not libFunc then - LOG.print("Cannot load "..name,'error') + MES.new("Cannot load "..name) return end return libFunc() else - LOG.print("No "..name.." for "..SYSTEM,'error') + MES.new("No "..name.." for "..SYSTEM) return end return true diff --git a/Zframework/log.lua b/Zframework/log.lua deleted file mode 100644 index aa37a7e9..00000000 --- a/Zframework/log.lua +++ /dev/null @@ -1,64 +0,0 @@ -local utf8=require"utf8" -local gc=love.graphics -local gc_setColor,gc_print=gc.setColor,gc.print -local int,min=math.floor,math.min -local ins,rem=table.insert,table.remove -local setFont=setFont - -local mesList={} -local mesHistory={ - "Version: "..VERSION.string, - os.date("Launched at %Y/%m/%d %H:%M"), -} -local LOG={} -function LOG.update() - if mesList[1]then - for i=#mesList,1,-1 do - local M=mesList[i] - if M.blink>0 then - M.blink=M.blink-1 - else - M.time=M.time-1 - if M.time==0 then - rem(mesList,i) - end - end - end - end -end -function LOG.draw() - if mesList[1]then - setFont(20) - for i=1,#mesList do - local M=mesList[i] - M.rgba[4]=M.blink>0 and int(M.blink/3)%2 or min(M.time/26,1) - gc_setColor(M.rgba) - gc_print(M.text,10+(20-min(M.time,20))^1.5/4,25*i) - end - end -end -function LOG.print(text,T)--text,type/time - local color=COLOR.Z - local his,time - if T=='message'then - color=COLOR.N - his,time=true,180 - elseif T=='warn'then - color=COLOR.Y - his,time=true,180 - elseif T=='error'then - color=COLOR.R - his,time=true,210 - elseif type(T)=='number'then - time=T - end - text=tostring(text) - assert(utf8.len(text),"Error UTF-8 coding") - if his then ins(mesHistory,SCN.cur..": "..text)end - ins(mesList,{text=text,rgba={color[1],color[2],color[3],nil},blink=30,time=time or 120}) -end -function LOG.copy() - love.system.setClipboardText(table.concat(mesHistory,"\n")) - LOG.print("Log copied",'message') -end -return LOG \ No newline at end of file diff --git a/Zframework/message.lua b/Zframework/message.lua new file mode 100644 index 00000000..f283969b --- /dev/null +++ b/Zframework/message.lua @@ -0,0 +1,70 @@ +local gc=love.graphics +local gc_push,gc_pop=gc.push,gc.pop +local gc_replaceTransform=gc.replaceTransform +local gc_translate,gc_setColor,gc_draw=gc.translate,gc.setColor,gc.draw + +local ins,rem=table.insert,table.remove + +local mesList={} + +local MES={} + +function MES.new(...) + local icon,str,time=... + if type(icon)~='userdata'then + icon,str,time=false,icon,str + else + end + local t=gc.newText(getFont(30),str) + local w=math.max(t:getWidth()+(icon and 45 or 5),200) + local L={w+20,48, + {'setCL',.5,.5,.5,.7}, + {'fRect',0,0,w+20,48}, + {'setCL',.9,.9,.9}, + {'setLW',2}, + {'dRect',1,1,w+18,46}, + {'setCL',1,1,1}, + } + if icon then + ins(L,{'draw',icon,4,4,nil,40/icon:getWidth(),40/icon:getHeight()}) + end + ins(L,{'draw',t,icon and 50 or 10,2}) + + ins(mesList,{ + startTime=.5, + endTime=.5, + time=time or 3, + canvas=DOGC(L), + }) +end + +function MES.update(dt) + for i=#mesList,1,-1 do + local m=mesList[i] + if m.startTime>0 then + m.startTime=m.startTime-dt + elseif m.time>0 then + m.time=m.time-dt + elseif m.endTime>0 then + m.endTime=m.endTime-dt + else + rem(mesList,i) + end + end +end + +function MES.draw() + gc_push('transform') + if #mesList>0 then + gc_translate(0,25) + for i=1,#mesList do + local m=mesList[i] + gc_setColor(1,1,1,2*(m.endTime-m.startTime)) + gc_draw(m.canvas,40-80*(m.endTime+m.startTime)) + gc_translate(0,52) + end + gc_replaceTransform(SCR.xOy) + end + gc_pop() +end +return MES \ No newline at end of file diff --git a/Zframework/profile.lua b/Zframework/profile.lua index df443f2f..11837f67 100644 --- a/Zframework/profile.lua +++ b/Zframework/profile.lua @@ -141,10 +141,10 @@ function profile.switch() profile.stop() love.system.setClipboardText(PROFILE.report()) PROFILE.reset() - LOG.print("profile report copied!",'message') + MES.new("profile report copied!") else PROFILE.start() - LOG.print("profile start!",'message') + MES.new("profile start!") end switch=not switch end diff --git a/Zframework/scene.lua b/Zframework/scene.lua index 5f7558d6..bd084b09 100644 --- a/Zframework/scene.lua +++ b/Zframework/scene.lua @@ -150,7 +150,7 @@ function SCN.swapTo(tar,style)--Parallel scene swapping, cannot back S.time,S.mid,S.draw=s[1],s[2],s[3] end else - LOG.print("No Scene: "..tar,'warn') + MES.new("No Scene: "..tar) end end function SCN.go(tar,style)--Normal scene swapping, can back @@ -158,7 +158,7 @@ function SCN.go(tar,style)--Normal scene swapping, can back SCN.push() SCN.swapTo(tar,style) else - LOG.print("No Scene: "..tar,'warn') + MES.new("No Scene: "..tar) end end function SCN.back() diff --git a/Zframework/screen.lua b/Zframework/screen.lua index 583f3e5b..84169ac4 100644 --- a/Zframework/screen.lua +++ b/Zframework/screen.lua @@ -16,12 +16,12 @@ local SCR={ xOy_m=love.math.newTransform(), xOy=love.math.newTransform(), xOy_ul=love.math.newTransform(), - xOy_um=love.math.newTransform(), + xOy_u=love.math.newTransform(), xOy_ur=love.math.newTransform(), - xOy_ml=love.math.newTransform(), - xOy_mr=love.math.newTransform(), + xOy_l=love.math.newTransform(), + xOy_r=love.math.newTransform(), xOy_dl=love.math.newTransform(), - xOy_dm=love.math.newTransform(), + xOy_d=love.math.newTransform(), xOy_dr=love.math.newTransform(), } function SCR.setSize(w,h) @@ -49,12 +49,12 @@ function SCR.resize(w,h) SCR.xOy:setTransformation(SCR.x,SCR.y,0,SCR.k) SCR.xOy_m:setTransformation(w/2,h/2,0,SCR.k) SCR.xOy_ul:setTransformation(0,0,0,SCR.k) - SCR.xOy_um:setTransformation(w/2,0,0,SCR.k) + SCR.xOy_u:setTransformation(w/2,0,0,SCR.k) SCR.xOy_ur:setTransformation(w,0,0,SCR.k) - SCR.xOy_ml:setTransformation(0,h/2,0,SCR.k) - SCR.xOy_mr:setTransformation(w,h/2,0,SCR.k) + SCR.xOy_l:setTransformation(0,h/2,0,SCR.k) + SCR.xOy_r:setTransformation(w,h/2,0,SCR.k) SCR.xOy_dl:setTransformation(0,h,0,SCR.k) - SCR.xOy_dm:setTransformation(w/2,h,0,SCR.k) + SCR.xOy_d:setTransformation(w/2,h,0,SCR.k) SCR.xOy_dr:setTransformation(w,h,0,SCR.k) end function SCR.info() diff --git a/Zframework/sfx.lua b/Zframework/sfx.lua index 730487b3..1a095f68 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) + MES.new("No SFX file: "..N,.1) end if not skip and i~=count then coroutine.yield() diff --git a/Zframework/theme.lua b/Zframework/theme.lua index 27edf2cc..5cdcc750 100644 --- a/Zframework/theme.lua +++ b/Zframework/theme.lua @@ -52,18 +52,18 @@ function THEME.set(theme) elseif theme=='xmas'then BG.setDefault('snow') BGM.setDefault('xmas') - LOG.print("==============") - LOG.print("Merry Christmas!") - LOG.print("==============") + MES.new("==============") + MES.new("Merry Christmas!") + MES.new("==============") elseif theme=='birth'then BG.setDefault('firework') BGM.setDefault('magicblock') elseif theme=='sprfes'then BG.setDefault('firework') BGM.setDefault("spring festival") - LOG.print(" ★☆☆★") - LOG.print("新年快乐!") - LOG.print(" ★☆☆★") + MES.new(" ★☆☆★") + MES.new("新年快乐!") + MES.new(" ★☆☆★") elseif theme=='zday1'then BG.setDefault('lanterns') BGM.setDefault("empty") diff --git a/Zframework/voice.lua b/Zframework/voice.lua index ce1cae27..48868c3c 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) + MES.new("No VOICE file: "..list[i],.1) end end if not Source[list[i]][1]then Source[list[i]]=nil end diff --git a/Zframework/websocket.lua b/Zframework/websocket.lua index 7825c7ff..aa1f0864 100644 --- a/Zframework/websocket.lua +++ b/Zframework/websocket.lua @@ -349,7 +349,7 @@ function WS.update(dt) ws.pongTimer=1 else ws.status='dead' - LOG.print(text.wsFailed..": "..(mes=="timeout"and text.netTimeout or mes),'warn') + MES.new(text.wsFailed..": "..(mes=="timeout"and text.netTimeout or mes)) end end elseif ws.status=='running'then diff --git a/Zframework/widget.lua b/Zframework/widget.lua index 025a1370..3a444a09 100644 --- a/Zframework/widget.lua +++ b/Zframework/widget.lua @@ -617,7 +617,7 @@ function selector:reset() self.selText=self.list[i] else self.hide=true - LOG.print("Selector "..self.name.." dead, disp= "..tostring(V),'warn') + MES.new("Selector "..self.name.." dead, disp= "..tostring(V)) end end function selector:isAbove(x,y) @@ -771,7 +771,7 @@ function inputBox:addText(str) if type(str)=='string'then self.value=self.value..str else - LOG.print("inputBox "..self.name.." dead, addText("..type(str)..")",'warn') + MES.new("inputBox "..self.name.." dead, addText("..type(str)..")") end end function inputBox:clear() @@ -1093,7 +1093,10 @@ function WIDGET.isFocus(W) end function WIDGET.focus(W) if WIDGET.sel==W then return end - if WIDGET.sel and WIDGET.sel.type=='inputBox'then kb.setTextInput(false)end + if WIDGET.sel and WIDGET.sel.type=='inputBox'then + kb.setTextInput(false) + EDITING="" + end WIDGET.sel=W if W and W.type=='inputBox'then local _,y1=xOy:transformPoint(0,W.y+W.h) @@ -1103,7 +1106,10 @@ end function WIDGET.unFocus(force) local W=WIDGET.sel if W and(force or not W.keepFocus)then - if W.type=='inputBox'then kb.setTextInput(false)end + if W.type=='inputBox'then + kb.setTextInput(false) + EDITING="" + end WIDGET.sel=false end end diff --git a/main.lua b/main.lua index 9013e537..f3030b38 100644 --- a/main.lua +++ b/main.lua @@ -161,7 +161,7 @@ SFX.init((function() if fs.getRealDirectory("media/SFX/"..v)~=SAVEDIR then table.insert(L,v:sub(1,-5)) else - LOG.print("Dangerous file : %SAVE%/media/SFX/"..v,'warn') + MES.new("Dangerous file : %SAVE%/media/SFX/"..v) end end return L @@ -172,7 +172,7 @@ BGM.init((function() if fs.getRealDirectory("media/BGM/"..v)~=SAVEDIR then table.insert(L,v:sub(1,-5)) else - LOG.print("Dangerous file : %SAVE%/media/BGM/"..v,'warn') + MES.new("Dangerous file : %SAVE%/media/BGM/"..v) end end return L diff --git a/parts/data.lua b/parts/data.lua index 57f7c8ea..33b29030 100644 --- a/parts/data.lua +++ b/parts/data.lua @@ -1,4 +1,4 @@ -local data=love.data +local loveCompress=love.data.compress local int=math.floor local char,byte=string.char,string.byte @@ -352,7 +352,7 @@ do--function DATA.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!",'warn') + MES.new("Cannot save recording of this mode now!") return end end @@ -371,12 +371,12 @@ do--function DATA.saveRecording() JSON.encode(getModList()).."\n".. DATA.dumpRecording(GAME.rep) - love.filesystem.write(fileName,fileHead.."\n"..data.compress('string','zlib',fileBody)) + love.filesystem.write(fileName,fileHead.."\n"..loveCompress('string','zlib',fileBody)) ins(REPLAY,fileName) FILE.save(REPLAY,'conf/replay') return true else - LOG.print("Save failed: File already exists",'error') + MES.new("Save failed: File already exists") end end end diff --git a/parts/gametoolfunc.lua b/parts/gametoolfunc.lua index a58c5d1f..0276e875 100644 --- a/parts/gametoolfunc.lua +++ b/parts/gametoolfunc.lua @@ -127,7 +127,7 @@ function freshDate(mode) STAT.date=date STAT.todayTime=0 if not mode:find'q'then - LOG.print(text.newDay,'message') + MES.new(text.newDay) end return true end @@ -141,10 +141,10 @@ function legalGameTime()--Check if today's playtime is legal if STAT.todayTime<14400 then return true elseif STAT.todayTime<21600 then - LOG.print(text.playedLong,'warn') + MES.new(text.playedLong) return true else - LOG.print(text.playedTooMuch,'warn') + MES.new(text.playedTooMuch) return false end end @@ -484,7 +484,7 @@ do--function resetGameData(args) end end else - LOG.print("Wrong task type",'warn') + MES.new("Wrong task type") end end BG.set(GAME.modeEnv.bg) @@ -574,8 +574,8 @@ do--function drawSelfProfile() --Draw avatar gc_setLineWidth(2) - gc_setColor(.3,.3,.3,.8)gc_rectangle('fill',-300,0,300,80) - gc_setColor(1,1,1)gc_rectangle('line',-300,0,300,80) + gc_setColor(.3,.3,.3,.8)gc_rectangle('fill',0,0,-300,80) + gc_setColor(1,1,1)gc_rectangle('line',0,0,-300,80) gc_rectangle('line',-73,7,66,66,2) gc_draw(selfAvatar,-72,8,nil,.5) diff --git a/parts/globalTables.lua b/parts/globalTables.lua index c8ccc3ba..107fa7c0 100644 --- a/parts/globalTables.lua +++ b/parts/globalTables.lua @@ -164,7 +164,7 @@ GAME={--Global game data modeEnv=false, --Current gamemode environment setting={}, --Game settings rep={}, --Recording list, key,time,key,time... - statSaved=false, --If recording saved + statSaved=true, --If recording saved recording=false, --If recording replaying=false, --If replaying saved=false, --If recording saved diff --git a/parts/language/lang_en.lua b/parts/language/lang_en.lua index f2b6539f..a51862cc 100644 --- a/parts/language/lang_en.lua +++ b/parts/language/lang_en.lua @@ -256,7 +256,7 @@ return{ join="Join", }, net_newRoom={ - title="Custom room config", + title="Room config", roomName="Room name(default to username's room)", roomDescription="Room description", @@ -863,8 +863,8 @@ return{ "Online mode is planned - please be patient.", "Play single-handedly!", "Playing good takes some time!", - "Powered by Love2D", - "Powered by Un..Love2D", + "Powered by LÖVE", + "Powered by Un..LÖVE", "pps-0.01", "REGRET!!", "Secret number: 626", diff --git a/parts/language/lang_fr.lua b/parts/language/lang_fr.lua index 7299a357..bb342d46 100644 --- a/parts/language/lang_fr.lua +++ b/parts/language/lang_fr.lua @@ -154,7 +154,7 @@ return{ }, staff={ "Author: MrZ E-mail: 1046101471@qq.com", - "Powered by LOVE2D", + "Powered by LÖVE", "", "Programme : MrZ, Particle_G, [FinnTenzor]", "Art : MrZ, ScF, [Gnyar, 旋律星萤, T0722]", @@ -227,7 +227,7 @@ return{ join="Rejoindre", }, net_newRoom={ - -- title="Custom room config", + -- title="Room config", -- roomName="Room name(default to username's room)", -- roomDescription="Room description", diff --git a/parts/language/lang_pt.lua b/parts/language/lang_pt.lua index 6212bf4c..5d650a33 100644 --- a/parts/language/lang_pt.lua +++ b/parts/language/lang_pt.lua @@ -178,7 +178,7 @@ return{ }, staff={ "Author: MrZ E-mail: 1046101471@qq.com", - "Powered by LOVE2D", + "Powered by LÖVE", "", "Programa: MrZ, Particle_G, [FinnTenzor]", "Art: MrZ, ScF, [Gnyar, 旋律星萤, T0722]", @@ -255,7 +255,7 @@ return{ -- join="Join", }, net_newRoom={ - -- title="Custom room config", + -- title="Room config", -- roomName="Room name(default to username's room)", -- roomDescription="Room description", @@ -855,7 +855,7 @@ return{ "Apenas 2 triminoes", "Pirataria não é legal!", "Jogue com uma mão!", - "Powered by Love2D", + "Powered by LÖVE", "pps-0.01", "REGRET!!", "Número secreto: 626", diff --git a/parts/language/lang_sp.lua b/parts/language/lang_sp.lua index 8ae8ea43..ea71f579 100644 --- a/parts/language/lang_sp.lua +++ b/parts/language/lang_sp.lua @@ -33,8 +33,8 @@ return{ combo="Combo",maxcmb="Combo Máx.", pc="Perfect Clear",ko="KO", - -- win="Win", - -- lose="Lose", + win="Victoria", + lose="Derrota", finish="Fin", gamewin="Victoria", gameover="Fin del Juego", @@ -58,8 +58,8 @@ return{ exportSuccess="Exportado con éxito", importSuccess="Importado con éxito", dataCorrupted="Los datos están corruptos.", - -- pasteWrongPlace="Paste at wrong place?", - -- noFile="File not found", + pasteWrongPlace="¿Pegaste en la carpeta correcta?", + noFile="Archivo no encontrado", VKTchW="Sens. al tacto", VKOrgW="Sens. al origen", @@ -71,8 +71,8 @@ return{ getNoticeFail="Error al buscar novedades.", oldVersion="¡Está disponible la nueva versión $1!", - -- versionNotMatch="Version do not match!", - -- needUpdate="¡Nueva versión requerida!", + versionNotMatch="¡Las versiones no coinciden!", + needUpdate="¡Nueva versión requerida!", notFinished="Próximamente", jsonError="Error en Json", @@ -88,21 +88,21 @@ return{ accessSuccessed="¡Autorizado exitoso!", accessFailed="Error al autorizar", - -- wsConnecting="Websocket: Connecting", + wsConnecting="Websocket: Conectando", wsFailed="WebSocket: conexión fallida", wsClose="WebSocket cerrado: ", - -- netTimeout="Network connection timeout", + netTimeout="Tiempo de conexión agotado", - -- onlinePlayerCount="Online", + onlinePlayerCount="En línea", createRoomSuccessed="¡Sala creada con éxito!", - -- started="Playing", + started="En juego", joinRoom="entró a la sala.", leaveRoom="salió de la sala.", - -- ready="READY", - -- connStream="CONNECTING", - -- waitStream="WAITING", - -- spectating="Spectating", + ready="LISTO", + connStream="CONECTANDO", + waitStream="ESPERANDO", + spectating="Especteando", chatRemain="Usuarios en línea: ", chatStart="------Comienzo del historial------", chatHistory="------Nuevos mensajes------", @@ -145,7 +145,7 @@ return{ "Este es simplemente un juego de puzzle ordinario, no pienses de él como un juego promedio.", "Está inspirado en otros como C2/IO/JS/WWC/KOS.", "", - "Creado con LOVE2D", + "Creado con LÖVE", "Puedes reportar errores o enviar sugerencias al grupo de testeo del autor o por email ~", "Descarga disponible únicamente vía el grupo de testeo y discord.gg/f9pUvkh", "Descargas desde otros sitios pueden contener malware/viruses, y en smartphones sólo requiere permisos de internet y vibración.", @@ -154,7 +154,7 @@ return{ }, staff={ "Autor:MrZ Email: 1046101471@qq.com", - "Creado con LOVE2D", + "Creado con LÖVE", "", "Programación: MrZ, Particle_G, [FinnTenzor]", "Artistas: MrZ, ScF, [Gnyar, 旋律星萤, T0722]", @@ -184,7 +184,7 @@ return{ WidgetText={ main={ offline="1 Jugador", - qplay="Juego rápido", + qplay="Jgo. Ráp.", online="Multijugador", custom="Personalizado", setting="Opciones", @@ -215,43 +215,43 @@ return{ quit="Finalizar (Q)", }, net_menu={ - -- league="Tech League", + league="Liga Tech", ffa="FFA", rooms="Salas", - -- logout="Log out", + logout="Desconec.", }, net_league={ - -- match="Find Match", + match="Buscar Match", }, net_rooms={ - -- refreshing="Refreshing Rooms", + refreshing="Refrescando Salas", noRoom="No Hay Salas Actualmente", refresh="Refrescar", - -- new="New Room", + new="Nueva Sala", join="Unirse", }, net_newRoom={ - -- title="Custom room config", - -- roomName="Room name(default to username's room)", - -- roomDescription="Room description", + title="Ajustes de sala", + roomName="Nombre (Por defecto: *usuario*'s room)", + roomDescription="Descripción", life="Vida", - -- pushSpeed="Garbage Speed", + pushSpeed="Velocidad de Subida", garbageSpeed="Velocidad de Basura", visible="Visibilidad", freshLimit="Límite de Reinicio LD", fieldH="Altura del tablero", - -- bufferLimit="Buffer Limit", - -- heightLimit="Height Limit", + bufferLimit="Buffer Límite", + heightLimit="Altura Límite", drop="Retraso de Caída", lock="Retraso de Bloqueo", wait="Retraso de Spawneo", fall="Retraso de Línea", - -- capacity="Capacity", - -- create="Create", + capacity="Capacidad", + create="Crear", ospin="O-Spin", fineKill="100% Finesse", @@ -270,8 +270,8 @@ return{ }, net_game={ ready="Estoy Listo", - -- spectate="Spectate", - -- cancel="Cancel", + spectate="Espectear", + cancel="Cancelar", }, setting_game={ title="Ajustes del Juego", @@ -314,13 +314,13 @@ return{ text="Texto de Acciones", score="Puntaje en Pantalla", - -- bufferWarn="Buffer Alert", - -- showSpike="Spike Counter", + bufferWarn="Alerta de Búfer", + showSpike="Contador de Spike", nextPos="Ver Spawn de Pza. Sig.", highCam="Cám. Vista Aérea", warn="Alerta de Peligro", - -- clickFX="Click FX", + clickFX="FX de Clickeo", power="Inf. de Batería", clean="Fast Draw", fullscreen="Pant. Completa", @@ -381,12 +381,12 @@ return{ setting_touch={ default="Por Defecto", snap="Snap", - -- save1="Save1", - -- load1="Load1", - -- save2="Save2", - -- load2="Load2", + save1="Save1", + load1="Load1", + save2="Save2", + load2="Load2", size="Tamaño", - -- shape="Shape", + shape="Forma", }, setting_touchSwitch={ b1= "Mover Izq.:",b2="Mover Der.:",b3="Rotar Der.:",b4="Rotar Izq.:", @@ -425,7 +425,7 @@ return{ clear="Inicio-Fin", puzzle="Inicio-Puzzle", - -- reset="Reset (Del)", + reset="Reiniciar (Supr)", advance="Más opciones (A)", mod="Mods (F1)", field="Editar Tablero (F)", @@ -442,11 +442,11 @@ return{ freshLimit="Límite de Reinicio LD", opponent="Oponente", life="Vida", - -- pushSpeed="Garbage Speed", + pushSpeed="Velocidad de Subida", garbageSpeed="Velocidad de Basura", - -- bufferLimit="Buffer Limit", - -- heightLimit="Height Limit", + bufferLimit="Búfer Límite", + heightLimit="Altura Límite", ospin="O-Spin", fineKill="100% Finesse", b2bKill="No Romper B2B ", @@ -541,7 +541,7 @@ return{ register="Registrarse", email="Correo Elec.", password="Contraseña", - -- keepPW="Remember me", + keepPW="Recordar credenciales", login="Entrar", }, register={ @@ -593,24 +593,24 @@ return{ }, app_dtw={ reset="Reiniciar", - -- arcade="Arcade", + arcade="Arcade", mode="Modo", }, savedata={ - -- export="Export to clipboard", - -- import="Import from clipboard", - -- unlock="Progress", - -- data="Stats", - -- setting="Settings", - -- vk="Virtual Key Layout", + export="Exportar al portapapeles", + import="Importar de portapapeles", + unlock="Progreso", + data="Estads.", + setting="Ajustes", + vk="Diseño de Tecl. Virtual", - -- couldSave="Cloud Save (need login) (CAUTION: TESTING)", - -- notLogin="[Login to access cloud save]", - -- upload="Upload to cloud", - -- download="Download from cloud", + couldSave="Guardado en la nube (requiere iniciar sesión) (PRECAUCIÓN: EN TESTEO)", + notLogin="[Inicia sesión para acceder al guardado en la nube]", + upload="Subir a la nube", + download="Descargar de la nube", }, error={ - console="Console", + console="Consola", quit="Salir", }, }, @@ -660,7 +660,7 @@ return{ ['blind_h']= {"A Ciegas", "Inmediato", "Para jugadores experimentados"}, ['blind_l']= {"A Ciegas", "Inmediato+", "Para profesionales."}, ['blind_u']= {"A Ciegas", "?", "¿Estás preparado?"}, - ['blind_wtf']= {"A Ciegas", "Guat de Foc", "No, no lo estás."}, + ['blind_wtf']= {"A Ciegas", "ELFUF", "No, no lo estás."}, ['classic_fast']= {"Clásico", "CTWC", "Modo clásico con alta velocidad."}, ['survivor_e']= {"Supervivencia", "Fácil", "¿Cuánto tiempo podrás sobrevivir?"}, ['survivor_n']= {"Supervivencia", "Normal", "¿Cuánto tiempo podrás sobrevivir?"}, @@ -681,7 +681,7 @@ return{ ['pc_n']= {"Desafío de PCs", "Normal", "¡Consigue los PCs que puedas en 100 líneas!"}, ['pc_h']= {"Desafío de PCs", "Difícil", "¡Consigue los PCs que puedas en 100 líneas!"}, ['pc_l']= {"Desafío de PCs", "Lunático", "¡Consigue los PCs que puedas en 100 líneas!"}, - -- ['pc_inf']= {"Inf. PC Challenge","", "Get PCs as much as you can"}, + ['pc_inf']= {"Desafío de PCs Infinito","", "Consigue todos los PCs que puedas."}, ['tech_n']= {"Tech", "Normal", "¡Mantén el B2B!"}, ['tech_n_plus']= {"Tech", "Normal+", "¡Sólo se permiten Spins y PCs!"}, ['tech_h']= {"Tech", "Difícil", "¡Mantén el B2B!"}, @@ -703,9 +703,9 @@ return{ ['infinite_dig']= {"Infinito: Queso", "", "Limpia, limpia, más limpia que tú."}, ['sprintFix']= {"Sprint", "Sin mover a Izq./Der."}, ['sprintLock']= {"Sprint", "Sin rotar"}, - -- ['sprintSmooth']= {"Sprint", "NO FRICTION"}, + ['sprintSmooth']= {"Sprint", "SIN FRICCIÓN"}, ['marathon_bfmax']= {"Maratón", "Supremo"}, ['custom_clear']= {"Personalizado", "Normal"}, ['custom_puzzle']= {"Personalizado", "Puzzle"}, }, -} \ No newline at end of file +} diff --git a/parts/language/lang_zh.lua b/parts/language/lang_zh.lua index 7a31a4ce..e1cffe78 100644 --- a/parts/language/lang_zh.lua +++ b/parts/language/lang_zh.lua @@ -170,16 +170,16 @@ return{ "这只是一个普通的方块游戏,请勿将此与某带国家名的事物强行联系", "从C2/IO/JS/WWC/KOS等方块获得过灵感", "", - "使用LOVE2D引擎", + "使用LÖVE引擎", "错误或者建议请附带截图发送到内测群或者作者邮箱~", "仅通过内测qq群/discord群进行免费下载/更新", "其他渠道获得游戏皆有被修改/加广告/植入病毒的风险,程序只申请了振动&联网权限!", "若由于被修改的本游戏产生的各种损失作者不负责(我怎么负责啊跟我有啥关系)", - "请从正规途径获得最新版,游戏现为免费,不过有打赏当然感谢啦~", + "请从正规途径获得最新版,游戏现为免费,不过有打赏当然感谢啦~记得备注id,方便记录!", }, staff={ "作者:MrZ 邮箱:1046101471@qq.com", - "使用LOVE2D引擎", + "使用LÖVE引擎", "", "程序: MrZ, Particle_G, [FinnTenzor]", "美术: MrZ, ScF, [Gnyar, 旋律星萤, T0722]", @@ -256,8 +256,8 @@ return{ join="加入", }, net_newRoom={ - title="自定义房间参数", - roomName="房间名(留空默认 用户名's room)", + title="房间参数", + roomName="房间名 (留空默认 用户名's room)", roomDescription="房间描述", life="命数", @@ -276,7 +276,7 @@ return{ fall="消行延迟", capacity="房间容量", - create="创建房间", + create="创建", ospin="O-spin", fineKill="强制极简", diff --git a/parts/modes/blind_wtf.lua b/parts/modes/blind_wtf.lua index 71bd66cc..2c98cc21 100644 --- a/parts/modes/blind_wtf.lua +++ b/parts/modes/blind_wtf.lua @@ -16,7 +16,7 @@ return{ load=function() PLY.newPlayer(1) if SETTING.sfx_spawn==0 then - LOG.print(text.switchSpawnSFX,'warn') + MES.new(text.switchSpawnSFX) end end, mesDisp=function(P) diff --git a/parts/modes/master_extra.lua b/parts/modes/master_extra.lua index 93b0076b..54ae7d20 100644 --- a/parts/modes/master_extra.lua +++ b/parts/modes/master_extra.lua @@ -1,11 +1,11 @@ local sectionName={"D","C","B","A","A+","S-","S","S+","S+","SS","SS","U","U","X","X+"} local passPoint=16 local function score(P) - if P.modeData.rankPoint<130 then--If Less then X + if P.modeData.rankPoint<140-passPoint then--If Less then X local R=#P.clearedRow if R>0 then if R==4 then R=10 end--Techrash +10 - P.modeData.rankPoint=math.min(P.modeData.rankPoint+R,130-passPoint) + P.modeData.rankPoint=math.min(P.modeData.rankPoint+R,140-passPoint) P.modeData.rankName=sectionName[math.floor(P.modeData.rankPoint/10)+1] end end @@ -24,13 +24,13 @@ return{ freshLimit=15, dropPiece=score, task=function(P) - P.modeData.rankScore=0 + P.modeData.rankPoint=0 P.modeData.rankName=sectionName[1] while true do YIELD() if P.stat.frame>=3600 then - P.modeData.rankScore=math.min(P.modeData.rankScore+passPoint,130) - P.modeData.rankName=sectionName[math.floor(P.modeData.rankScore*.1)+1] + P.modeData.rankPoint=math.min(P.modeData.rankPoint+passPoint,140) + P.modeData.rankName=sectionName[math.floor(P.modeData.rankPoint/10)+1] P:win('finish') return end @@ -52,11 +52,11 @@ return{ mStr(P.stat.row,69,220) mStr(P.stat.clears[4],69,340) end, - score=function(P)return{P.modeData.rankScore,P.stat.score}end, + score=function(P)return{P.modeData.rankPoint,P.stat.score}end, scoreDisp=function(D)return sectionName[math.floor(D[1]/10)+1].." "..D[2]end, comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]>b[2]end, getRank=function(P) - P=P.modeData.rankScore + P=P.modeData.rankPoint return P==140 and 5 or P>=110 and 4 or diff --git a/parts/net.lua b/parts/net.lua index ebf5fd8c..b4a27fad 100644 --- a/parts/net.lua +++ b/parts/net.lua @@ -1,4 +1,4 @@ -local data=love.data +local loveEncode,loveDecode=love.data.encode,love.data.decode local rem=table.remove local WS,TIME=WS,TIME @@ -66,6 +66,11 @@ function NET.getlock(name) return TIME()1 then if ENV.sdarr>0 then if d%ENV.sdarr==0 then @@ -411,13 +411,12 @@ end function update.remote_alive(P,dt) local frameRate=(P.stream[#P.stream-1]or 0)-P.frameRun frameRate= - frameRate<20 and 1 or - frameRate<30 and rnd(2)or - frameRate<60 and 2 or - frameRate<90 and 3 or + frameRate<26 and 1 or + frameRate<50 and 2 or + frameRate<80 and 3 or frameRate<120 and 5 or - frameRate<150 and 7 or - frameRate<180 and 10 or + frameRate<160 and 7 or + frameRate<200 and 10 or 20 for _=1,frameRate do local eventTime=P.stream[P.streamProgress] @@ -460,6 +459,7 @@ function update.remote_alive(P,dt) P.streamProgress=P.streamProgress+2 else--No event now, run one frame update.alive(P,dt/frameRate) + P.stat.time=P.frameRun/60 end else--Pause state, no actions, quit loop break diff --git a/parts/scenes/app_15p.lua b/parts/scenes/app_15p.lua index 25f75283..db7fbf2f 100644 --- a/parts/scenes/app_15p.lua +++ b/parts/scenes/app_15p.lua @@ -116,16 +116,16 @@ local function tapBoard(x,y,key) if checkBoard(b)then state=2 time=TIME()-startTime - if time<1 then LOG.print("不是人") - elseif time<2 then LOG.print("还是人") - elseif time<3 then LOG.print("神仙") - elseif time<5 then LOG.print("太强了") - elseif time<7.5 then LOG.print("很强") - elseif time<10 then LOG.print("可以的") - elseif time<20 then LOG.print("马上入门了") - elseif time<30 then LOG.print("入门不远了") - elseif time<60 then LOG.print("多加练习") - else LOG.print("第一次玩?加油") + if time<1 then MES.new("不是人") + elseif time<2 then MES.new("还是人") + elseif time<3 then MES.new("神仙") + elseif time<5 then MES.new("太强了") + elseif time<7.5 then MES.new("很强") + elseif time<10 then MES.new("可以的") + elseif time<20 then MES.new("马上入门了") + elseif time<30 then MES.new("入门不远了") + elseif time<60 then MES.new("多加练习") + else MES.new("第一次玩?加油") end SFX.play('win') return diff --git a/parts/scenes/app_UTTT.lua b/parts/scenes/app_UTTT.lua index 94bd88e1..9aaa125e 100644 --- a/parts/scenes/app_UTTT.lua +++ b/parts/scenes/app_UTTT.lua @@ -218,6 +218,8 @@ function scene.mouseMove(x,y) x,y=int((x-280)/80),int(y/80) curX,curx=int(x/3)+int(y/3)*3+1,x%3+y%3*3+1 if + x<0 or x>8 or + y<0 or y>8 or curX<1 or curX>9 or curx<1 or curx>9 or score[curX]or diff --git a/parts/scenes/app_console.lua b/parts/scenes/app_console.lua index 373be948..bde44046 100644 --- a/parts/scenes/app_console.lua +++ b/parts/scenes/app_console.lua @@ -544,12 +544,13 @@ local commands={}do log(APPs[i].code..": "..APPs[i].description) end elseif name~=""then - local i=TABLE.find(APPs,name) - if i then - SCN.go(APPs[i].scene) - else - log{C.A,"No this applet"} + for i=1,#APPs do + if APPs[i].code==name then + SCN.go(APPs[i].scene) + return + end end + log{C.A,"No this applet"} else log{C.A,"Usage:"} log{C.A,"app -list"} diff --git a/parts/scenes/customGame.lua b/parts/scenes/customGame.lua index fa0c8cfe..d40c882c 100644 --- a/parts/scenes/customGame.lua +++ b/parts/scenes/customGame.lua @@ -51,13 +51,13 @@ function scene.keyDown(key) if key=="return"or key=="return2"then if CUSTOMENV.opponent~="X"then if CUSTOMENV.opponent:sub(1,2)=='CC'and CUSTOMENV.sequence=="fixed"then - LOG.print(text.ai_fixed,'warn') + MES.new(text.ai_fixed) return elseif #BAG>0 then - LOG.print(text.ai_prebag,'warn') + MES.new(text.ai_prebag) return elseif #MISSION>0 then - LOG.print(text.ai_mission,'warn') + MES.new(text.ai_mission) return end end @@ -95,7 +95,7 @@ function scene.keyDown(key) str=str.."!" if #MISSION>0 then str=str..DATA.copyMission()end sys.setClipboardText(str.."!"..DATA.copyBoards().."!") - LOG.print(text.exportSuccess,'message') + MES.new(text.exportSuccess) elseif key=="v"and kb.isDown("lctrl","rctrl")or key=="cV"then local str=sys.getClipboardText() local args=STRING.split(str:sub((str:find(":")or 0)+1),"!") @@ -111,9 +111,9 @@ function scene.keyDown(key) if args[i]:find("%S")and not DATA.pasteBoard(args[i],i-3)and i<#args then goto THROW_fail end end freshMiniFieldVisible() - LOG.print(text.importSuccess,'message') + MES.new(text.importSuccess) do return end - ::THROW_fail::LOG.print(text.dataCorrupted,'error') + ::THROW_fail::MES.new(text.dataCorrupted) elseif key=="escape"then FILE.save(CUSTOMENV,'conf/customEnv','q') SCN.back() diff --git a/parts/scenes/custom_field.lua b/parts/scenes/custom_field.lua index ff4e9be1..1cb8ac92 100644 --- a/parts/scenes/custom_field.lua +++ b/parts/scenes/custom_field.lua @@ -216,20 +216,20 @@ function scene.keyDown(key) SFX.play('fall',.8) elseif key=="c"and kb.isDown("lctrl","rctrl")or key=="cC"then sys.setClipboardText("Techmino Field:"..DATA.copyBoard(page)) - LOG.print(text.exportSuccess,'message') + MES.new(text.exportSuccess) elseif key=="v"and kb.isDown("lctrl","rctrl")or key=="cV"then local str=sys.getClipboardText() local p=str:find(":")--ptr* if p then if not str:sub(1,p-1):find("Field")then - LOG.print(text.pasteWrongPlace,'warn') + MES.new(text.pasteWrongPlace) end str=str:sub(p+1) end if DATA.pasteBoard(str,page)then - LOG.print(text.importSuccess,'message') + MES.new(text.importSuccess) else - LOG.print(text.dataCorrupted,'error') + MES.new(text.dataCorrupted) end elseif key=="pageup"then page=max(page-1,1) diff --git a/parts/scenes/custom_mission.lua b/parts/scenes/custom_mission.lua index f1becb62..3cf1e80c 100644 --- a/parts/scenes/custom_mission.lua +++ b/parts/scenes/custom_mission.lua @@ -71,22 +71,22 @@ function scene.keyDown(key) elseif key=="c"and kb.isDown("lctrl","rctrl")or key=="cC"then if #MISSION>0 then sys.setClipboardText("Techmino Target:"..DATA.copyMission()) - LOG.print(text.exportSuccess,'message') + MES.new(text.exportSuccess) end elseif key=="v"and kb.isDown("lctrl","rctrl")or key=="cV"then local str=sys.getClipboardText() local p=str:find(":")--ptr* if p then if not str:sub(1,p-1):find("Target")then - LOG.print(text.pasteWrongPlace,'warn') + MES.new(text.pasteWrongPlace) end str=str:sub(p+1) end if DATA.pasteMission(str)then - LOG.print(text.importSuccess,'message') + MES.new(text.importSuccess) cur=#MISSION else - LOG.print(text.dataCorrupted,'error') + MES.new(text.dataCorrupted) end elseif key=="escape"then SCN.back() diff --git a/parts/scenes/custom_sequence.lua b/parts/scenes/custom_sequence.lua index 1f0286ec..82456f7e 100644 --- a/parts/scenes/custom_sequence.lua +++ b/parts/scenes/custom_sequence.lua @@ -85,22 +85,22 @@ function scene.keyDown(key) elseif key=="c"and kb.isDown("lctrl","rctrl")or key=="cC"then if #BAG>0 then sys.setClipboardText("Techmino SEQ:"..DATA.copySequence()) - LOG.print(text.exportSuccess,'message') + MES.new(text.exportSuccess) end elseif key=="v"and kb.isDown("lctrl","rctrl")or key=="cV"then local str=sys.getClipboardText() local p=str:find(":")--ptr* if p then if not str:sub(1,p-1):find("SEQ")then - LOG.print(text.pasteWrongPlace,'warn') + MES.new(text.pasteWrongPlace) end str=str:sub(p+1) end if DATA.pasteSequence(str)then - LOG.print(text.importSuccess,'message') + MES.new(text.importSuccess) cur=#BAG else - LOG.print(text.dataCorrupted,'error') + MES.new(text.dataCorrupted) end elseif key=="escape"then SCN.back() diff --git a/parts/scenes/login.lua b/parts/scenes/login.lua index 364a1482..5e0b38b2 100644 --- a/parts/scenes/login.lua +++ b/parts/scenes/login.lua @@ -6,9 +6,9 @@ local savePW=false local function login() local email,password=emailBox:getText(),passwordBox:getText() if not STRING.simpEmailCheck(email)then - LOG.print(text.wrongEmail,'warn')return + MES.new(text.wrongEmail)return elseif #password==0 then - LOG.print(text.noPassword,'warn')return + MES.new(text.noPassword)return end NET.wsconn_user_pswd(email,password) if savePW then diff --git a/parts/scenes/main.lua b/parts/scenes/main.lua index 643526a6..eb75b6df 100644 --- a/parts/scenes/main.lua +++ b/parts/scenes/main.lua @@ -67,7 +67,7 @@ function scene.keyDown(key) NET.tryLogin(false) else NET.wsconn_app() - LOG.print(text.wsConnecting,'message') + MES.new(text.wsConnecting) SFX.play('connect') end end diff --git a/parts/scenes/net_game.lua b/parts/scenes/net_game.lua index 7cc34933..1243277d 100644 --- a/parts/scenes/net_game.lua +++ b/parts/scenes/net_game.lua @@ -35,7 +35,7 @@ local function _quit() NET.signal_quit() else lastBackTime=TIME() - LOG.print(text.sureQuit,'warn') + MES.new(text.sureQuit) end end local function _switchChat() @@ -133,7 +133,7 @@ function scene.keyDown(key) if #mes>0 then NET.sendMessage(mes) inputBox:clear() - elseif #EDITING==0 then + else _switchChat() end else @@ -220,7 +220,7 @@ function scene.socketRead(cmd,d) resetGameData('n',NET.seed) netPLY.mouseMove(0,0) else - LOG.print("Redundant [Go]",'warn') + MES.new("Redundant [Go]") end elseif cmd=='finish'then playing=false diff --git a/parts/scenes/net_league.lua b/parts/scenes/net_league.lua index 239ee37d..37005136 100644 --- a/parts/scenes/net_league.lua +++ b/parts/scenes/net_league.lua @@ -16,7 +16,7 @@ function scene.draw() end scene.widgetList={ WIDGET.newKey{name="setting",fText=TEXTURE.setting,x=1200,y=160,w=90,h=90,code=goScene'setting_game'}, - WIDGET.newKey{name="match",x=640,y=500,w=760,h=140,font=60,code=function()LOG.print("Coming soon 开发中,敬请期待")end}, + WIDGET.newKey{name="match",x=640,y=500,w=760,h=140,font=60,code=function()MES.new("Coming soon 开发中,敬请期待")end}, WIDGET.newButton{name="back",x=1140,y=640,w=170,h=80,fText=TEXTURE.back,code=backScene}, } diff --git a/parts/scenes/net_menu.lua b/parts/scenes/net_menu.lua index b0da57a0..e80915c4 100644 --- a/parts/scenes/net_menu.lua +++ b/parts/scenes/net_menu.lua @@ -18,7 +18,7 @@ end scene.widgetList={ WIDGET.newKey{name="setting",fText=TEXTURE.setting,x=1200,y=160,w=90,h=90,code=goScene'setting_game'}, WIDGET.newButton{name="league", x=640, y=180,w=350,h=120,font=40,color='D',code=goScene'net_league'}, - WIDGET.newButton{name="ffa", x=640, y=360,w=350,h=120,font=40,color='D',code=function()LOG.print("Coming soon 开发中,敬请期待")--[[NET.enterRoom({name="ffa"})]]end}, + WIDGET.newButton{name="ffa", x=640, y=360,w=350,h=120,font=40,color='D',code=function()MES.new("Coming soon 开发中,敬请期待")--[[NET.enterRoom({name="ffa"})]]end}, WIDGET.newButton{name="rooms", x=640, y=540,w=350,h=120,font=40,code=goScene'net_rooms'}, WIDGET.newButton{name="logout", x=880, y=40,w=180,h=60,color='dR', code=function() @@ -32,7 +32,7 @@ scene.widgetList={ SCN.back() end else - LOG.print(text.sureQuit,'warn') + MES.new(text.sureQuit) lastLogoutTime=TIME() end end}, diff --git a/parts/scenes/net_newRoom.lua b/parts/scenes/net_newRoom.lua index 3234da3d..5f1d2457 100644 --- a/parts/scenes/net_newRoom.lua +++ b/parts/scenes/net_newRoom.lua @@ -43,10 +43,10 @@ function scene.sceneBack() end function scene.keyDown(k) - if k=="return"and #EDITING==0 then + if k=="return"then createRoom() elseif k=="escape"then - SCN.go('net_rooms') + SCN.back() else WIDGET.keyPressed(k) end @@ -85,11 +85,11 @@ scene.widgetList={ ROOMENV.capacity=i WIDGET.active.capacity.color=COLOR.lY else - LOG.print("没有权限 Permission Denied",'warn') + MES.new("没有权限 Permission Denied") WIDGET.active.capacity.color=COLOR.R end end}, - WIDGET.newButton{name="create", x=1070,y=480,w=310,h=140,color='lY',font=40,code=pressKey"return"}, + WIDGET.newButton{name="create", x=1070,y=480,w=310,h=140,color='lN',font=40,code=pressKey"return"}, WIDGET.newButton{name="back", x=1140,y=640,w=170,h=80,fText=TEXTURE.back,code=backScene}, --Special rules diff --git a/parts/scenes/net_rooms.lua b/parts/scenes/net_rooms.lua index 2544aba4..63fa7b4d 100644 --- a/parts/scenes/net_rooms.lua +++ b/parts/scenes/net_rooms.lua @@ -61,8 +61,8 @@ function scene.keyDown(k) elseif k=="return"then if NET.getlock('fetchRoom')or not NET.roomList[selected]then return end local R=NET.roomList[selected] - if R.roomInfo.version~=VERSION.short then LOG.print("Version doesn't match",'message')return end - if R.private then LOG.print("Can't enter private room now",'message')return end + if R.roomInfo.version~=VERSION.short then MES.new("Version doesn't match")return end + if R.private then MES.new("Can't enter private room now")return end NET.enterRoom(R)--,password end end diff --git a/parts/scenes/register.lua b/parts/scenes/register.lua index 46527d86..6b5aa727 100644 --- a/parts/scenes/register.lua +++ b/parts/scenes/register.lua @@ -6,13 +6,13 @@ local function register() local password= WIDGET.active.password:getText() local password2=WIDGET.active.password2:getText() if #username==0 then - LOG.print(text.noUsername,'warn')return + MES.new(text.noUsername)return elseif not STRING.simpEmailCheck(email)then - LOG.print(text.wrongEmail,'warn')return + MES.new(text.wrongEmail)return elseif #password==0 or #password2==0 then - LOG.print(text.noPassword,'warn')return + MES.new(text.noPassword)return elseif password~=password2 then - LOG.print(text.diffPassword,'warn')return + MES.new(text.diffPassword)return end NET.register(username,email,password) end diff --git a/parts/scenes/savedata.lua b/parts/scenes/savedata.lua index fda429f1..9c191fd5 100644 --- a/parts/scenes/savedata.lua +++ b/parts/scenes/savedata.lua @@ -2,7 +2,7 @@ local scene={} local function dumpCB(T) love.system.setClipboardText(STRING.packText(TABLE.dump(T))) - LOG.print(text.exportSuccess,'message') + MES.new(text.exportSuccess) end local function parseCB() local _ @@ -10,7 +10,7 @@ local function parseCB() --Decode s=STRING.unpackText(s) - if not s then LOG.print(text.dataCorrupted,'error')return end + if not s then MES.new(text.dataCorrupted)return end s=loadstring(s) if s then @@ -32,9 +32,9 @@ scene.widgetList={ if D then TABLE.update(D,RANKS) FILE.save(RANKS,'conf/unlock') - LOG.print(text.importSuccess,'message') + MES.new(text.importSuccess) else - LOG.print(text.dataCorrupted,'warn') + MES.new(text.dataCorrupted) end end}, WIDGET.newButton{name="data", x=490,y=390,w=280,h=100,color='lR', @@ -43,9 +43,9 @@ scene.widgetList={ if D and D.version==STAT.version then TABLE.update(D,STAT) FILE.save(STAT,'conf/data') - LOG.print(text.importSuccess,'message') + MES.new(text.importSuccess) else - LOG.print(text.dataCorrupted,'warn') + MES.new(text.dataCorrupted) end end}, WIDGET.newButton{name="setting", x=790,y=390,w=280,h=100,color='lR', @@ -54,9 +54,9 @@ scene.widgetList={ if D then TABLE.update(D,SETTING) FILE.save(SETTING,'conf/settings') - LOG.print(text.importSuccess,'message') + MES.new(text.importSuccess) else - LOG.print(text.dataCorrupted,'warn') + MES.new(text.dataCorrupted) end end}, WIDGET.newButton{name="vk", x=1090,y=390,w=280,h=100,color='lR', @@ -65,9 +65,9 @@ scene.widgetList={ if D then TABLE.update(D,VK_org) FILE.save(VK_org,'conf/virtualkey') - LOG.print(text.importSuccess,'message') + MES.new(text.importSuccess) else - LOG.print(text.dataCorrupted,'warn') + MES.new(text.dataCorrupted) end end}, diff --git a/parts/scenes/setting_touch.lua b/parts/scenes/setting_touch.lua index 3abae973..880cb4b2 100644 --- a/parts/scenes/setting_touch.lua +++ b/parts/scenes/setting_touch.lua @@ -16,7 +16,7 @@ local function load1() if D then TABLE.update(D,VK_org) else - LOG.print(text.noFile,'message') + MES.new(text.noFile) end end local function save2() @@ -27,7 +27,7 @@ local function load2() if D then TABLE.update(D,VK_org) else - LOG.print(text.noFile,'message') + MES.new(text.noFile) end end @@ -188,7 +188,7 @@ scene.widgetList={ B.x,B.y,B.r=T[2],T[3],T[4] end end - LOG.print(("==[ %d ]=="):format(defaultSetSelect)) + MES.new(("==[ %d ]=="):format(defaultSetSelect)) defaultSetSelect=defaultSetSelect%5+1 selected=false end}, diff --git a/parts/scenes/test.lua b/parts/scenes/test.lua index 37393fb7..2872f4a5 100644 --- a/parts/scenes/test.lua +++ b/parts/scenes/test.lua @@ -35,7 +35,7 @@ function scene.keyDown(key) if backCounter==0 then SCN.back() else - LOG.print(backCounter) + MES.new(backCounter) end end end diff --git a/parts/shaders/lighter.glsl b/parts/shaders/lighter.glsl index 73346bfa..689c4e94 100644 --- a/parts/shaders/lighter.glsl +++ b/parts/shaders/lighter.glsl @@ -4,6 +4,6 @@ vec4 effect(vec4 color,Image tex,vec2 tex_coords,vec2 scr_coords){ pow(texcolor.r+.26,.7023), pow(texcolor.g+.26,.7023), pow(texcolor.b+.26,.7023), - texcolor.a + texcolor.a*color.a ); } \ No newline at end of file diff --git a/parts/shaders/warning.glsl b/parts/shaders/warning.glsl index 5936245b..3ab18946 100644 --- a/parts/shaders/warning.glsl +++ b/parts/shaders/warning.glsl @@ -1,8 +1,7 @@ -extern float w,h; +extern float w; extern float level; vec4 effect(vec4 color,Image tex,vec2 tex_coords,vec2 scr_coords){ float dx=abs(scr_coords.x/w-0.5); - float dy=abs(scr_coords.y/h-0.5); - float a=(max(dx*2.6,dy*1.8)-.626)*level; + float a=(dx*2.6-.626)*level; return vec4(1.,0.,0.,a); } \ No newline at end of file diff --git a/parts/skin.lua b/parts/skin.lua index d274e370..dde1b6f8 100644 --- a/parts/skin.lua +++ b/parts/skin.lua @@ -32,7 +32,7 @@ function SKIN.init(list) I=gc.newImage(N) else I=gc.newImage("media/image/skin/"..list[1]..".png") - LOG.print("No skin file: "..list[i],'warn') + MES.new("No skin file: "..list[i]) end gc.setDefaultFilter('linear','linear') for y=0,2 do