暂时使用未完成的MES模块替换LOG模块

This commit is contained in:
MrZ626
2021-06-13 02:06:38 +08:00
parent 17e67c674b
commit 7075d7d5b2
38 changed files with 211 additions and 206 deletions

View File

@@ -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

View File

@@ -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()

View File

@@ -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)

View File

@@ -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()

View File

@@ -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()

View File

@@ -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

View File

@@ -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

View File

@@ -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()
@@ -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

View File

@@ -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},
}

View File

@@ -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},

View File

@@ -85,7 +85,7 @@ 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},

View File

@@ -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

View File

@@ -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

View File

@@ -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},

View File

@@ -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},

View File

@@ -35,7 +35,7 @@ function scene.keyDown(key)
if backCounter==0 then
SCN.back()
else
LOG.print(backCounter)
MES.new(backCounter)
end
end
end