完全移除不再需要的聊天室场景代码,移除更新版本后自动跳转更新历史页面的功能
This commit is contained in:
1
main.lua
1
main.lua
@@ -275,7 +275,6 @@ do
|
|||||||
for _,v in next,VK_org do v.color=nil end
|
for _,v in next,VK_org do v.color=nil end
|
||||||
|
|
||||||
if STAT.version~=VERSION.code then
|
if STAT.version~=VERSION.code then
|
||||||
newVersionLaunch=true
|
|
||||||
STAT.version=VERSION.code
|
STAT.version=VERSION.code
|
||||||
CLEAR("lib")
|
CLEAR("lib")
|
||||||
needSave=true
|
needSave=true
|
||||||
|
|||||||
@@ -249,7 +249,6 @@ return{
|
|||||||
net_menu={
|
net_menu={
|
||||||
ffa="FFA",
|
ffa="FFA",
|
||||||
rooms="Rooms",
|
rooms="Rooms",
|
||||||
chat="Chat",
|
|
||||||
logout="Log out",
|
logout="Log out",
|
||||||
},
|
},
|
||||||
net_rooms={
|
net_rooms={
|
||||||
@@ -264,9 +263,6 @@ return{
|
|||||||
ready="Ready",
|
ready="Ready",
|
||||||
cancel="Cancel",
|
cancel="Cancel",
|
||||||
},
|
},
|
||||||
net_chat={
|
|
||||||
send="Send",
|
|
||||||
},
|
|
||||||
setting_game={
|
setting_game={
|
||||||
title="Game Settings",
|
title="Game Settings",
|
||||||
graphic="←Video",
|
graphic="←Video",
|
||||||
|
|||||||
@@ -222,7 +222,6 @@ return{
|
|||||||
net_menu={
|
net_menu={
|
||||||
ffa="FFA",
|
ffa="FFA",
|
||||||
rooms="Salons",
|
rooms="Salons",
|
||||||
chat="Chat",
|
|
||||||
-- logout="Log out",
|
-- logout="Log out",
|
||||||
},
|
},
|
||||||
net_rooms={
|
net_rooms={
|
||||||
@@ -235,9 +234,6 @@ return{
|
|||||||
-- ready="Ready",
|
-- ready="Ready",
|
||||||
-- cancel="Cancel",
|
-- cancel="Cancel",
|
||||||
},
|
},
|
||||||
net_chat={
|
|
||||||
send="Envoyer",
|
|
||||||
},
|
|
||||||
setting_game={
|
setting_game={
|
||||||
title="Paramètres du jeu",
|
title="Paramètres du jeu",
|
||||||
|
|
||||||
|
|||||||
@@ -250,7 +250,6 @@ return{
|
|||||||
net_menu={
|
net_menu={
|
||||||
ffa="FFA",
|
ffa="FFA",
|
||||||
rooms="Salas",
|
rooms="Salas",
|
||||||
chat="Chat",
|
|
||||||
-- logout="Log out",
|
-- logout="Log out",
|
||||||
},
|
},
|
||||||
net_rooms={
|
net_rooms={
|
||||||
@@ -265,9 +264,6 @@ return{
|
|||||||
-- ready="Ready",
|
-- ready="Ready",
|
||||||
-- cancel="Cancel",
|
-- cancel="Cancel",
|
||||||
},
|
},
|
||||||
net_chat={
|
|
||||||
send="Mandar",
|
|
||||||
},
|
|
||||||
setting_game={
|
setting_game={
|
||||||
title="Config. de jogo",
|
title="Config. de jogo",
|
||||||
graphic="←Video",
|
graphic="←Video",
|
||||||
|
|||||||
@@ -227,7 +227,6 @@ return{
|
|||||||
net_menu={
|
net_menu={
|
||||||
ffa="FFA",
|
ffa="FFA",
|
||||||
rooms="Salas",
|
rooms="Salas",
|
||||||
chat="Chat",
|
|
||||||
-- logout="Log out",
|
-- logout="Log out",
|
||||||
},
|
},
|
||||||
net_rooms={
|
net_rooms={
|
||||||
@@ -242,9 +241,6 @@ return{
|
|||||||
ready="Estoy Listo",
|
ready="Estoy Listo",
|
||||||
-- cancel="Cancel",
|
-- cancel="Cancel",
|
||||||
},
|
},
|
||||||
net_chat={
|
|
||||||
send="Enviar",
|
|
||||||
},
|
|
||||||
setting_game={
|
setting_game={
|
||||||
title="Ajustes del Juego",
|
title="Ajustes del Juego",
|
||||||
graphic="←Video",
|
graphic="←Video",
|
||||||
|
|||||||
@@ -249,7 +249,6 @@ return{
|
|||||||
net_menu={
|
net_menu={
|
||||||
ffa="FFA",
|
ffa="FFA",
|
||||||
rooms="房间列表",
|
rooms="房间列表",
|
||||||
chat="聊天室",
|
|
||||||
logout="退出登录",
|
logout="退出登录",
|
||||||
},
|
},
|
||||||
net_rooms={
|
net_rooms={
|
||||||
@@ -264,9 +263,6 @@ return{
|
|||||||
ready="准备",
|
ready="准备",
|
||||||
cancel="取消",
|
cancel="取消",
|
||||||
},
|
},
|
||||||
net_chat={
|
|
||||||
send="发送",
|
|
||||||
},
|
|
||||||
setting_game={
|
setting_game={
|
||||||
title="游戏设置",
|
title="游戏设置",
|
||||||
graphic="←画面设置",
|
graphic="←画面设置",
|
||||||
|
|||||||
@@ -3,9 +3,6 @@ local scene={}
|
|||||||
function scene.sceneInit()
|
function scene.sceneInit()
|
||||||
BG.set('cubes')
|
BG.set('cubes')
|
||||||
WIDGET.active.texts:setTexts(require"parts.updateLog")
|
WIDGET.active.texts:setTexts(require"parts.updateLog")
|
||||||
if newVersionLaunch then
|
|
||||||
newVersionLaunch=false
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function scene.wheelMoved(_,y)
|
function scene.wheelMoved(_,y)
|
||||||
|
|||||||
@@ -14,13 +14,7 @@ function scene.sceneInit()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function scene.mouseDown()
|
function scene.mouseDown()
|
||||||
if newVersionLaunch then
|
SCN.go(SETTING.simpMode and"main_simple"or"main")
|
||||||
SCN.push(SETTING.simpMode and"main_simple"or"main")
|
|
||||||
SCN.swapTo('history','fade')
|
|
||||||
LOG.print(text.newVersion,'warn',COLOR.lB)
|
|
||||||
else
|
|
||||||
SCN.go(SETTING.simpMode and"main_simple"or"main")
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
function scene.touchDown()
|
function scene.touchDown()
|
||||||
scene.mouseDown()
|
scene.mouseDown()
|
||||||
|
|||||||
@@ -147,24 +147,22 @@ local loadingThread=coroutine.wrap(function()
|
|||||||
|
|
||||||
upFloor()
|
upFloor()
|
||||||
SKIN.change(SETTING.skinSet)
|
SKIN.change(SETTING.skinSet)
|
||||||
if newVersionLaunch then--Delete old ranks & Unlock modes which should be locked
|
for name,rank in next,RANKS do
|
||||||
for name,rank in next,RANKS do
|
local M=MODES[name]
|
||||||
local M=MODES[name]
|
if type(rank)~='number'then
|
||||||
if type(rank)~='number'then
|
RANKS[name]=nil
|
||||||
RANKS[name]=nil
|
elseif M and M.unlock and rank>0 then
|
||||||
elseif M and M.unlock and rank>0 then
|
for _,unlockName in next,M.unlock do
|
||||||
for _,unlockName in next,M.unlock do
|
if not RANKS[unlockName]then
|
||||||
if not RANKS[unlockName]then
|
RANKS[unlockName]=0
|
||||||
RANKS[unlockName]=0
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if not(M and M.score)then
|
|
||||||
RANKS[name]=nil
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
FILE.save(RANKS,'conf/unlock','q')
|
if not(M and M.score)then
|
||||||
|
RANKS[name]=nil
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
FILE.save(RANKS,'conf/unlock','q')
|
||||||
|
|
||||||
DAILYLAUNCH=freshDate'q'
|
DAILYLAUNCH=freshDate'q'
|
||||||
if DAILYLAUNCH then
|
if DAILYLAUNCH then
|
||||||
|
|||||||
@@ -1,95 +0,0 @@
|
|||||||
local gc=love.graphics
|
|
||||||
local data=love.data
|
|
||||||
|
|
||||||
local textBox=WIDGET.newTextBox{name="texts",x=40,y=50,w=1200,h=430}
|
|
||||||
local remain--People in chat room
|
|
||||||
local escapeTimer=0
|
|
||||||
|
|
||||||
local function sendMessage()
|
|
||||||
local W=WIDGET.active.input
|
|
||||||
if #W.value>0 then
|
|
||||||
NET.sendChatMes(W.value)
|
|
||||||
W.value=""
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local scene={}
|
|
||||||
|
|
||||||
function scene.sceneInit()
|
|
||||||
remain=false
|
|
||||||
|
|
||||||
local texts=textBox.texts
|
|
||||||
if #texts==0 then
|
|
||||||
textBox:push{COLOR.dG,text.chatStart}
|
|
||||||
elseif #texts>1 and texts[#texts][1]~=COLOR.dG then
|
|
||||||
textBox:push{COLOR.dG,text.chatHistory}
|
|
||||||
end
|
|
||||||
textBox:scroll(1)
|
|
||||||
TASK.new(function()YIELD()WIDGET.sel=WIDGET.active.input end)
|
|
||||||
BG.set('none')
|
|
||||||
end
|
|
||||||
function scene.sceneBack()
|
|
||||||
NET.quitChat()
|
|
||||||
end
|
|
||||||
|
|
||||||
function scene.wheelMoved(_,y)
|
|
||||||
WHEELMOV(y)
|
|
||||||
end
|
|
||||||
function scene.keyDown(k)
|
|
||||||
if k=="up"then
|
|
||||||
textBox:scroll(-1)
|
|
||||||
elseif k=="down"then
|
|
||||||
textBox:scroll(1)
|
|
||||||
elseif k=="return"then
|
|
||||||
sendMessage()
|
|
||||||
elseif k=="escape"then
|
|
||||||
if TIME()-escapeTimer<.6 then
|
|
||||||
SCN.back()
|
|
||||||
else
|
|
||||||
escapeTimer=TIME()
|
|
||||||
LOG.print(text.sureQuit,COLOR.O)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
WIDGET.keyPressed(k)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function scene.socketRead(mes)
|
|
||||||
local cmd=mes:sub(1,1)
|
|
||||||
local args=STRING.split(mes:sub(2),";")
|
|
||||||
if cmd=="J"or cmd=="L"then
|
|
||||||
textBox:push{
|
|
||||||
COLOR.lR,args[1],
|
|
||||||
COLOR.dY,"#"..args[2].." ",
|
|
||||||
COLOR.Y,text[cmd=="J"and"joinRoom"or"leaveRoom"]
|
|
||||||
}
|
|
||||||
remain=tonumber(args[3])
|
|
||||||
elseif cmd=="T"then
|
|
||||||
local _,text=pcall(data.decode,'string','base64',args[3])
|
|
||||||
if not _ then text=args[3]end
|
|
||||||
textBox:push{
|
|
||||||
COLOR.Z,args[1],
|
|
||||||
COLOR.dY,"#"..args[2].." ",
|
|
||||||
COLOR.N,text
|
|
||||||
}
|
|
||||||
else
|
|
||||||
LOG.print("Illegal message: "..mes,30,COLOR.G)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function scene.draw()
|
|
||||||
setFont(25)
|
|
||||||
gc.setColor(1,1,1)
|
|
||||||
gc.printf(text.chatRemain,800,10,400,'right')
|
|
||||||
gc.print(remain or"?",1205,10)
|
|
||||||
end
|
|
||||||
|
|
||||||
scene.widgetList={
|
|
||||||
textBox,
|
|
||||||
WIDGET.newInputBox{name="input",x=40,y=500,w=980,h=180,font=40},
|
|
||||||
WIDGET.newButton{name="send",x=1140,y=540,w=170,h=80,font=40,code=sendMessage},
|
|
||||||
WIDGET.newButton{name="back",x=1140,y=640,w=170,h=80,font=40,code=backScene},
|
|
||||||
}
|
|
||||||
|
|
||||||
return scene
|
|
||||||
@@ -16,9 +16,8 @@ end
|
|||||||
|
|
||||||
scene.widgetList={
|
scene.widgetList={
|
||||||
WIDGET.newKey{name="setting",fText=TEXTURE.setting,x=1200,y=160,w=90,h=90,code=goScene"setting_game"},
|
WIDGET.newKey{name="setting",fText=TEXTURE.setting,x=1200,y=160,w=90,h=90,code=goScene"setting_game"},
|
||||||
WIDGET.newButton{name="ffa", x=640, y=200,w=350,h=120,font=40,code=function()NET.enterRoom({name="ffa"})end},
|
WIDGET.newButton{name="ffa", x=640, y=260,w=350,h=120,font=40,code=function()NET.enterRoom({name="ffa"})end},
|
||||||
WIDGET.newButton{name="rooms", x=640, y=360,w=350,h=120,font=40,code=goScene"net_rooms"},
|
WIDGET.newButton{name="rooms", x=640, y=460,w=350,h=120,font=40,code=goScene"net_rooms"},
|
||||||
WIDGET.newButton{name="chat", x=640, y=540,w=350,h=120,color='D',font=40,code=NULL},
|
|
||||||
WIDGET.newButton{name="logout", x=880, y=40,w=180,h=60,color='dR',
|
WIDGET.newButton{name="logout", x=880, y=40,w=180,h=60,color='dR',
|
||||||
code=function()
|
code=function()
|
||||||
if TIME()-lastLogoutTime<1 then
|
if TIME()-lastLogoutTime<1 then
|
||||||
|
|||||||
Reference in New Issue
Block a user