完全移除不再需要的聊天室场景代码,移除更新版本后自动跳转更新历史页面的功能

This commit is contained in:
MrZ626
2021-05-10 02:26:20 +08:00
parent 8893c7da3e
commit dd682a4e6a
11 changed files with 15 additions and 143 deletions

View File

@@ -275,7 +275,6 @@ do
for _,v in next,VK_org do v.color=nil end
if STAT.version~=VERSION.code then
newVersionLaunch=true
STAT.version=VERSION.code
CLEAR("lib")
needSave=true

View File

@@ -249,7 +249,6 @@ return{
net_menu={
ffa="FFA",
rooms="Rooms",
chat="Chat",
logout="Log out",
},
net_rooms={
@@ -264,9 +263,6 @@ return{
ready="Ready",
cancel="Cancel",
},
net_chat={
send="Send",
},
setting_game={
title="Game Settings",
graphic="←Video",

View File

@@ -222,7 +222,6 @@ return{
net_menu={
ffa="FFA",
rooms="Salons",
chat="Chat",
-- logout="Log out",
},
net_rooms={
@@ -235,9 +234,6 @@ return{
-- ready="Ready",
-- cancel="Cancel",
},
net_chat={
send="Envoyer",
},
setting_game={
title="Paramètres du jeu",

View File

@@ -250,7 +250,6 @@ return{
net_menu={
ffa="FFA",
rooms="Salas",
chat="Chat",
-- logout="Log out",
},
net_rooms={
@@ -265,9 +264,6 @@ return{
-- ready="Ready",
-- cancel="Cancel",
},
net_chat={
send="Mandar",
},
setting_game={
title="Config. de jogo",
graphic="←Video",

View File

@@ -227,7 +227,6 @@ return{
net_menu={
ffa="FFA",
rooms="Salas",
chat="Chat",
-- logout="Log out",
},
net_rooms={
@@ -242,9 +241,6 @@ return{
ready="Estoy Listo",
-- cancel="Cancel",
},
net_chat={
send="Enviar",
},
setting_game={
title="Ajustes del Juego",
graphic="←Video",

View File

@@ -249,7 +249,6 @@ return{
net_menu={
ffa="FFA",
rooms="房间列表",
chat="聊天室",
logout="退出登录",
},
net_rooms={
@@ -264,9 +263,6 @@ return{
ready="准备",
cancel="取消",
},
net_chat={
send="发送",
},
setting_game={
title="游戏设置",
graphic="←画面设置",

View File

@@ -3,9 +3,6 @@ local scene={}
function scene.sceneInit()
BG.set('cubes')
WIDGET.active.texts:setTexts(require"parts.updateLog")
if newVersionLaunch then
newVersionLaunch=false
end
end
function scene.wheelMoved(_,y)

View File

@@ -14,13 +14,7 @@ function scene.sceneInit()
end
function scene.mouseDown()
if newVersionLaunch then
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
SCN.go(SETTING.simpMode and"main_simple"or"main")
end
function scene.touchDown()
scene.mouseDown()

View File

@@ -147,24 +147,22 @@ local loadingThread=coroutine.wrap(function()
upFloor()
SKIN.change(SETTING.skinSet)
if newVersionLaunch then--Delete old ranks & Unlock modes which should be locked
for name,rank in next,RANKS do
local M=MODES[name]
if type(rank)~='number'then
RANKS[name]=nil
elseif M and M.unlock and rank>0 then
for _,unlockName in next,M.unlock do
if not RANKS[unlockName]then
RANKS[unlockName]=0
end
for name,rank in next,RANKS do
local M=MODES[name]
if type(rank)~='number'then
RANKS[name]=nil
elseif M and M.unlock and rank>0 then
for _,unlockName in next,M.unlock do
if not RANKS[unlockName]then
RANKS[unlockName]=0
end
end
if not(M and M.score)then
RANKS[name]=nil
end
end
FILE.save(RANKS,'conf/unlock','q')
if not(M and M.score)then
RANKS[name]=nil
end
end
FILE.save(RANKS,'conf/unlock','q')
DAILYLAUNCH=freshDate'q'
if DAILYLAUNCH then

View File

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

View File

@@ -16,9 +16,8 @@ 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="ffa", x=640, y=200,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="chat", x=640, y=540,w=350,h=120,color='D',font=40,code=NULL},
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=460,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()
if TIME()-lastLogoutTime<1 then