新增聊天测试场景

This commit is contained in:
MrZ626
2020-12-01 01:23:55 +08:00
parent d342a1d55c
commit f02c0b7d8b
7 changed files with 58 additions and 1 deletions

View File

@@ -202,6 +202,14 @@ return{
restart="Retry (R)",
quit="Quit (Q)",
},
netgame={
ffa="FFA",
rooms="Rooms",
chat="Chat",
},
chat={
send="Send",
},
setting_game={
title="Game Settings",
graphic="←Video",

View File

@@ -204,6 +204,14 @@ return{
restart="Réessayer (R)",
quit="Quitter (Q)",
},
netgame={
-- ffa="FFA",
-- rooms="Rooms",
-- chat="Chat",
},
chat={
-- send="Send",
},
setting_game={
title="Paramètres du jeu",

View File

@@ -208,6 +208,14 @@ return{
restart="Reiniciar (R)",
quit= "Finalizar (Q)",
},
netgame={
-- ffa="FFA",
-- rooms="Rooms",
-- chat="Chat",
},
chat={
-- send="Send",
},
setting_game={
title="Ajustes del Juego",
graphic="←Video",

View File

@@ -228,6 +228,14 @@ return{
restart="重新开始(R)",
quit= "退出(Q)",
},
netgame={
ffa="FFA",
rooms="房间列表",
chat="聊天室",
},
chat={
send="发送",
},
setting_game={
title="游戏设置",
graphic="←画面设置",

15
parts/scenes/chat.lua Normal file
View File

@@ -0,0 +1,15 @@
local function send()
local W=WIDGET.active.text
--sendMessage(W.value)
W.value=""
end
function sceneInit.chat()
BG.set("none")
end
WIDGET.init("chat",{
WIDGET.newTextBox{name="text", 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=send},
WIDGET.newButton{name="back", x=1140, y=640,w=170,h=80,font=40,code=WIDGET.lnk_BACK},
})

View File

@@ -35,7 +35,7 @@ end
WIDGET.init("main",{
WIDGET.newButton{name="offline",x=150,y=220,w=200,h=140,color="lRed", font=40,code=WIDGET.lnk_goScene("mode")},
WIDGET.newButton{name="online", x=370,y=220,w=200,h=140,color="lCyan", font=40,code=WIDGET.lnk_goScene(LOGIN and"netgame"or"login")},
WIDGET.newButton{name="online", x=370,y=220,w=200,h=140,color="lCyan", font=40,code=function()SCN.go(LOGIN and"netgame"or"login")end},
WIDGET.newButton{name="custom", x=590,y=220,w=200,h=140,color="lBlue", font=40,code=WIDGET.lnk_goScene("customGame")},
WIDGET.newButton{name="setting",x=150,y=380,w=200,h=140,color="lOrange",font=40,code=WIDGET.lnk_goScene("setting_game")},
WIDGET.newButton{name="stat", x=370,y=380,w=200,h=140,color="lGreen", font=40,code=WIDGET.lnk_goScene("stat")},

10
parts/scenes/netgame.lua Normal file
View File

@@ -0,0 +1,10 @@
function sceneInit.netgame()
BG.set("matrix")
end
WIDGET.init("netgame",{
WIDGET.newButton{name="ffa", x=640, y=200,w=350,h=120,font=40,code=NULL},
WIDGET.newButton{name="rooms", x=640, y=360,w=350,h=120,font=40,code=NULL},
WIDGET.newButton{name="chat", x=640, y=540,w=350,h=120,font=40,code=WIDGET.lnk_goScene("chat")},
WIDGET.newButton{name="back", x=1140, y=640,w=170,h=80,font=40,code=WIDGET.lnk_BACK},
})