Compare commits

..

11 Commits

Author SHA1 Message Date
MrZ_26
da716ea5c5 版本推进 2022-11-05 23:07:54 +08:00
MrZ_26
c6f92a3030 略微降低客户端发言频率限制
发言id和文本之间加一个空格
框架跟进,修复textBox控件和listBox控件显示范围问题
2022-11-05 22:59:21 +08:00
MrZ_26
267e2dc544 修复其他玩家进房check是否已存在的时候因为访问不存在的玩家而报错 2022-11-05 22:59:21 +08:00
MrZ_26
cb7d3afdfb 删除服务端的playerManager.noPassword消息 2022-11-05 22:59:21 +08:00
MrZ_26
b57e863c28 联网游戏可以用键盘ctrl+0123456切换队伍 2022-11-05 22:59:21 +08:00
MrZ_26
7aed15fd4f 修正其他玩家的结束游戏消息处理太早导致录像没放完出问题 2022-11-05 22:59:21 +08:00
MrZ_26
6d71b26595 自定义游戏菜单微调 2022-11-05 22:59:21 +08:00
sakurw
1df5406cb3 Update lang_ja.lua (#768) 2022-11-05 15:47:36 +08:00
MrZ_26
a2b762dcbc 添加几个房间内命令
添加房间被解散的语言文本
把一处神秘写法改正常一点
2022-11-05 02:14:51 +08:00
MrZ_26
c2d29c3d6a 联网游戏界面添加选队伍按钮,加一个没卵用的退出房间命令 2022-11-04 17:15:36 +08:00
MrZ_26
da602eb693 两个输入验证码的地方添加粘贴按钮
整理代码
2022-11-04 16:45:51 +08:00
31 changed files with 139 additions and 61 deletions

View File

@@ -60,7 +60,7 @@ BGM.setMaxSources(5)
VOC.setDiversion(.62)
WIDGET.setOnChange(function()
if SCN.cur~='custom_field' then
if SCN.cur~='net_game' and SCN.cur~='custom_field' then
local colorList=THEME.getThemeColor()
if colorList then
for _,W in next,SCN.scenes[SCN.cur].widgetList do

View File

@@ -51,7 +51,7 @@ do-- function tryDelete()
end
end
do-- function loadFile(name,args), function saveFile(data,name,args)
local t=setmetatable({},{__index=function() return"'$1' loading failed: $2" end})
local t=setmetatable({},{__index=function() return "'$1' loading failed: $2" end})
function loadFile(name,args)
local text=text or t
if not args then args='' end

View File

@@ -23,8 +23,8 @@ RANK_COLORS={
GROUP_COLORS={
[0]=COLOR.Z,
[1]={STRING.hexColor'e57373'},
[2]={STRING.hexColor'aed581'},
[3]={STRING.hexColor'42a5f5'},
[2]={STRING.hexColor"4caf50"},
[3]={STRING.hexColor'5c6bc0'},
[4]={STRING.hexColor'ffe082'},
[5]={STRING.hexColor'ba68c8'},
[6]={STRING.hexColor'80deea'},

View File

@@ -141,7 +141,6 @@ return {
invalidCode="Invalid code",
invalidEmail="Invalid email",
playerNotFound="Player not found",
noPassword="No password",
invalidEmailPass="Invalid email or password",
emailExists="Email exists",
emailSendError="Email send error",
@@ -186,6 +185,7 @@ return {
started="Playing",
joinRoom="$1 has entered the room.",
leaveRoom="$1 has left the room.",
roomRemoved="Room was removed",
ready="Ready",
spectating="Spectating",

View File

@@ -140,7 +140,6 @@ return {
-- invalidCode="Invalid code",
-- invalidEmail="Invalid email",
-- playerNotFound="Player not found",
-- noPassword="No password",
-- invalidEmailPass="Invalid email or password",
-- emailExists="Email exists",
-- emailSendError="Email send error",
@@ -185,6 +184,7 @@ return {
started="En juego",
joinRoom="$1 entró a la sala.",
leaveRoom="$1 salió de la sala.",
-- roomRemoved="Room was removed",
ready="LISTO",
spectating="Espectando",

View File

@@ -131,7 +131,6 @@ return {
-- invalidCode="Invalid code",
-- invalidEmail="Invalid email",
-- playerNotFound="Player not found",
-- noPassword="No password",
-- invalidEmailPass="Invalid email or password",
-- emailExists="Email exists",
-- emailSendError="Email send error",
@@ -177,13 +176,12 @@ return {
-- started="Playing",
joinRoom="$1 a rejoint le salon.",
leaveRoom="$1 a quitté le salon.",
-- roomRemoved="Room was removed",
-- ready="READY",
-- connStream="CONNECTING",
-- waitStream="WAITING",
-- spectating="Spectating",
-- keySettingInstruction="Press to bind key\nescape: cancel\nbackspace: delete",
-- customBGhelp="Drop image file here to apply custom background",
-- customBGloadFailed="Unsupport image format for custom background",

View File

@@ -142,7 +142,6 @@ return {
-- invalidCode="Invalid code",
-- invalidEmail="Invalid email",
-- playerNotFound="Player not found",
-- noPassword="No password",
-- invalidEmailPass="Invalid email or password",
-- emailExists="Email exists",
-- emailSendError="Email send error",
@@ -187,6 +186,7 @@ return {
started="Bermain",
joinRoom="$1 telah memasuki ruangan.",
leaveRoom="$1 telah keluar dari ruangan.",
-- roomRemoved="Room was removed",
ready="Siap",
spectating="Menonton",

View File

@@ -142,7 +142,6 @@ return {
invalidCode="無効なコード",
invalidEmail="無効なEメールアドレス",
playerNotFound="プレイヤーが見つかりませんでした",
noPassword="パスワードがありません",
invalidEmailPass="Eメールアドレスもしくはパスワードが違います",
emailExists="Eメールアドレスは存在します",
emailSendError="送信できませんでした",
@@ -161,7 +160,7 @@ return {
},
},
tooFrequent="リクエストの頻度が高すぎます",
tooFrequent="リクエストが多すぎます",
roomPasswordChanged="部屋のパスワードを変更しました",
oldVersion="バージョン$1のダウンロードが可能になりました",
versionNotMatch="バージョンが一致しません",
@@ -177,7 +176,7 @@ return {
wsFailed="ウェブソケットとの通信に失敗しました: $1",
wsClose="ウェブソケットとの通信を終了: $1",
netTimeout="接続がタイムアウトしました",
serverDown="うわ! サーバーが落ちました",
serverDown="うわ! サーバーが落ちています...",
requestFailed="リクエスト失敗",
onlinePlayerCount="オンライン人数: $1",
@@ -186,6 +185,7 @@ return {
started="プレイ中",
joinRoom="$1 が入室しました",
leaveRoom="$1 が退出しました",
roomRemoved="部屋が撤去されました",
ready="準備OK",
spectating="観戦中",
@@ -195,7 +195,7 @@ return {
customBGhelp="カスタム背景にする画像ファイルをドロップ",
customBGloadFailed="サポートされていないフォーマットのファイルです",
errorMsg="問題が発生! ゲームを再起動してください、できるならエラーログを開発者に送ってください",
errorMsg="問題が発生! ゲームを再起動しエラーログを開発者に送ってください",
tryAnotherBuild="[Invalid UTF-8]使用しているOSがMicrosoft WindowsであればTechmino-win32かTechmino-win64をダウンロードしてください! (現在使用しているソフトは違うバージョンです)",
modInstruction="Modを選択してください!\nModはゲームの中身を変えます\nしかしゲームが破損することもあります\nModを使用した場合スコアは保存されません",
@@ -413,8 +413,8 @@ return {
},
net_menu={
league="テクリーグ",
ffa="自由乱闘戦",
rooms="ルーム・プライベート戦",
ffa="",
rooms="ルーム",
resetPW="パスワード再設定",
logout="ログアウト",
},
@@ -879,9 +879,9 @@ return {
['blind_e']= {"目隠し", "HALF", "初心者用"},
['blind_n']= {"目隠し", "ALL", "中級者用"},
['blind_h']= {"目隠し", "SUDDEN", "上級者用"},
['blind_l']= {"目隠し", "SUDDEN+", "プロフェッショナル用!"},
['blind_l']= {"目隠し", "SUDDEN+", "プロフェッショナル用"},
['blind_u']= {"目隠し", "?", "覚悟は良いかい?"},
['blind_wtf']= {"目隠し", "WTF", "まだ覚悟が足りない!"},
['blind_wtf']= {"目隠し", "WTF", "まだ覚悟が足りない"},
['classic_e']= {"クラシック", "EASY", "低速クラシック"},
['classic_h']= {"クラシック", "HARD", "通常速度クラシック"},
['classic_l']= {"クラシック", "LUNATIC", "中高速度クラシック"},
@@ -901,9 +901,9 @@ return {
['c4wtrain_l']= {"C4Wトレーニング", "LUNATIC", "無限中開け"},
['pctrain_n']= {"パフェトレーニング", "NORMAL", "パフェの練習!"},
['pctrain_l']= {"パフェトレーニング", "LUNATIC", "もっと難しいパフェの練習!"},
['pc_n']= {"パフェチャレンジ", "NORMAL", "100 Line以内でパフェをできるだけたくさん取れ!"},
['pc_h']= {"パフェチャレンジ", "HARD", "100 Line以内でパフェをできるだけたくさん取れ!"},
['pc_l']= {"パフェチャレンジ", "LUNATIC", "100 Line以内でパフェをできるだけたくさん取れ!"},
['pc_n']= {"パフェチャレンジ", "NORMAL", "100Line以内で パフェをできるだけたくさん取れ!"},
['pc_h']= {"パフェチャレンジ", "HARD", "100Line以内で パフェをできるだけたくさん取れ!"},
['pc_l']= {"パフェチャレンジ", "LUNATIC", "100Line以内で パフェをできるだけたくさん取れ!"},
['pc_inf']= {"無限パフェチャレンジ", "", "できる限りたくさんのパフェを取れ!"},
['tech_n']= {"テクニック", "NORMAL", "B2Bを繋げ続けよう!"},
['tech_n_plus']= {"テクニック", "NORMAL+", "回転入れとパフェだけ!"},
@@ -1015,7 +1015,7 @@ getTip={refuseCopy=true,
"ゲーム内にはモード選択マップからじゃ入れない隠しモードがいくつかあります!",
"このゲームでは全てのSpinに火力補正があります!",
"このゲームのほとんどの楽曲はBeepboxを用いて作曲されました!",
"サーバーが不規則にダウンします",
"サーバーが不規則に落ちます",
"スタッフロールの背景に流れている名前はスポンサーの名前です!",
"タブレットやスマホでもキーボードを接続できます!(iOSにはそんな機能ないと思うけど)",
"なにかアイデアがありますか? Discordで提案してください!",

View File

@@ -129,7 +129,6 @@ return {
-- invalidCode="Invalid code",
-- invalidEmail="Invalid email",
-- playerNotFound="Player not found",
-- noPassword="No password",
-- invalidEmailPass="Invalid email or password",
-- emailExists="Email exists",
-- emailSendError="Email send error",
@@ -174,9 +173,8 @@ return {
-- started="Playing",
joinRoom="$1 Entrou a sala.",
leaveRoom="$1 Saiu da sala.",
-- roomRemoved="Room was removed",
-- ready="READY",
-- connStream="CONNECTING",
-- waitStream="WAITING",
-- spectating="Spectating",

View File

@@ -141,7 +141,6 @@ return {
invalidCode="无效验证码",
invalidEmail="无效邮箱",
playerNotFound="找不到玩家",
noPassword="未输入密码",
invalidEmailPass="邮箱或密码无效",
emailExists="邮箱存在",
emailSendError="邮箱发送错误",
@@ -186,6 +185,7 @@ return {
started="游戏中",
joinRoom="$1 进入房间",
leaveRoom="$1 离开房间",
roomRemoved="房间被解散",
ready="各就各位!",
spectating="观战中",

View File

@@ -118,7 +118,6 @@ return {
noUsername="Error.NoUsername();",
wrongEmail="Error.WrongEmail();",
wrongCode="Error.WrongVerificationCode();",
noPassword="Error.NoPassword();",
diffPassword="Error.DiffPassword();",
checkEmail="register.RequestSent=true",
@@ -135,6 +134,7 @@ return {
started="Room.Playing();",
joinRoom="Room.Join($1);",
leaveRoom="Room.Leave($1);",
roomRemoved="Room.Removed();",
ready="Ready();",
spectating="Room.Spectating();",

View File

@@ -141,7 +141,6 @@ return {
invalidCode="無效驗證碼",
invalidEmail="無效郵箱",
playerNotFound="找不到玩家",
noPassword="未輸入密碼",
invalidEmailPass="郵箱或密碼無效",
emailExists="郵箱存在",
emailSendError="郵箱發送錯誤",
@@ -186,6 +185,7 @@ return {
started="遊戲中",
joinRoom="$1 進入房間",
leaveRoom="$1 離開房間",
roomRemoved="房間被解散",
ready="準備!",
spectating="旁觀中",

View File

@@ -40,7 +40,7 @@ return {
end end
end,
score=function(P) return {P.modeData.place,P.modeData.ko} end,
scoreDisp=function(D) return"NO."..D[1].." KO:"..D[2] end,
scoreDisp=function(D) return "NO."..D[1].." KO:"..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)
local R=P.modeData.place

View File

@@ -40,7 +40,7 @@ return {
end end
end,
score=function(P) return {P.modeData.place,P.modeData.ko} end,
scoreDisp=function(D) return"NO."..D[1].." KO:"..D[2] end,
scoreDisp=function(D) return "NO."..D[1].." KO:"..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)
local R=P.modeData.place

View File

@@ -40,7 +40,7 @@ return {
end end
end,
score=function(P) return {P.modeData.place,P.modeData.ko} end,
scoreDisp=function(D) return"NO."..D[1].." KO:"..D[2] end,
scoreDisp=function(D) return "NO."..D[1].." KO:"..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)
local R=P.modeData.place

View File

@@ -40,7 +40,7 @@ return {
end end
end,
score=function(P) return {P.modeData.place,P.modeData.ko} end,
scoreDisp=function(D) return"NO."..D[1].." KO:"..D[2] end,
scoreDisp=function(D) return "NO."..D[1].." KO:"..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)
local R=P.modeData.place

View File

@@ -40,7 +40,7 @@ return {
end end
end,
score=function(P) return {P.modeData.place,P.modeData.ko} end,
scoreDisp=function(D) return"NO."..D[1].." KO:"..D[2] end,
scoreDisp=function(D) return "NO."..D[1].." KO:"..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)
local R=P.modeData.place

View File

@@ -40,7 +40,7 @@ return {
end end
end,
score=function(P) return {P.modeData.place,P.modeData.ko} end,
scoreDisp=function(D) return"NO."..D[1].." KO:"..D[2] end,
scoreDisp=function(D) return "NO."..D[1].." KO:"..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)
local R=P.modeData.place

View File

@@ -474,7 +474,7 @@ end
-- Room
function NET.room_chat(msg,rid)
if not TASK.lock('chatLimit',1.626) then
if not TASK.lock('chatLimit',1.26) then
MES.new('warn',text.tooFrequent)
elseif #msg>0 then
wsSend(1300,{
@@ -590,7 +590,7 @@ function NET.wsCallBack.room_chat(body)
TASK.unlock('receiveMessage')
TASK.lock('receiveMessage',1)
NET.textBox:push{
COLOR.Z,_getFullName(body.data.playerId),
COLOR.Z,_getFullName(body.data.playerId).." ",
COLOR.N,body.data.message,
}
end
@@ -650,7 +650,7 @@ function NET.wsCallBack.room_enter(body)
end
else
local p=body.data
if NETPLY.map[p.playerId] then _playerLeaveRoom(p.playerId) end
if NETPLY.exist(p.playerId) then _playerLeaveRoom(p.playerId) end
NETPLY.add{
uid=p.playerId,
group=p.group,
@@ -704,7 +704,6 @@ function NET.wsCallBack.player_finish(body)
if P.uid==body.data.playerId then
NETPLY.setPlace(P.uid,#PLY_ALIVE)
P.loseTimer=26
P:lose(true)
break
end
end

View File

@@ -138,6 +138,9 @@ function NETPLY.remove(uid)
end
end
end
function NETPLY.exist(uid)
return rawget(PLYmap,uid) and true or false
end
function NETPLY.setPlace(uid,place) PLYmap[uid].place=place end
function NETPLY.setStat(uid,S)

View File

@@ -2707,7 +2707,12 @@ function Player:update(dt)
end
if frameDelta then
for _=1,
self.loseTimer and 6 or
self.loseTimer and min(frameDelta,
self.loseTimer>16 and 2 or
self.loseTimer>6.2 and 12 or
self.loseTimer>2.6 and 260 or
2600
) or
frameDelta<26 and 1 or
frameDelta<50 and 2 or
frameDelta<80 and 3 or

View File

@@ -1000,7 +1000,7 @@ local fleg={
pw=the_secret,
supw=7126,
second_box="Coming soon",
}setmetatable(fleg,{__tostring=function() return"The fl\97g." end})
}setmetatable(fleg,{__tostring=function() return "The fl\97g." end})
function userG.the_box(k)
if k~=first_key then
log"Usage:"log"*The box is locked*"

View File

@@ -216,13 +216,13 @@ scene.widgetList={
WIDGET.newSelector{name='eventSet', x=1050,y=760,w=340,color='H',list=sList.eventSet,disp=CUSval('eventSet'),code=CUSsto('eventSet')},
-- Special rules
WIDGET.newSwitch{name='ospin', x=850, y=830, lim=210,disp=CUSval('ospin'), code=CUSrev('ospin')},
WIDGET.newSwitch{name='fineKill', x=850, y=890, lim=210,disp=CUSval('fineKill'), code=CUSrev('fineKill')},
WIDGET.newSwitch{name='b2bKill', x=850, y=950, lim=210,disp=CUSval('b2bKill'), code=CUSrev('b2bKill')},
WIDGET.newSwitch{name='lockout', x=850, y=1010,lim=210,disp=CUSval('lockout'), code=CUSrev('lockout')},
WIDGET.newSwitch{name='easyFresh', x=1170,y=830, lim=250,disp=CUSval('easyFresh'),code=CUSrev('easyFresh')},
WIDGET.newSwitch{name='deepDrop', x=1170,y=890, lim=250,disp=CUSval('deepDrop'), code=CUSrev('deepDrop')},
WIDGET.newSwitch{name='bone', x=1170,y=950, lim=250,disp=CUSval('bone'), code=CUSrev('bone')},
WIDGET.newSwitch{name='ospin', x=850, y=850, lim=210,disp=CUSval('ospin'), code=CUSrev('ospin')},
WIDGET.newSwitch{name='fineKill', x=850, y=910, lim=210,disp=CUSval('fineKill'), code=CUSrev('fineKill')},
WIDGET.newSwitch{name='b2bKill', x=850, y=970, lim=210,disp=CUSval('b2bKill'), code=CUSrev('b2bKill')},
WIDGET.newSwitch{name='lockout', x=850, y=1030,lim=210,disp=CUSval('lockout'), code=CUSrev('lockout')},
WIDGET.newSwitch{name='easyFresh', x=1170,y=850, lim=250,disp=CUSval('easyFresh'),code=CUSrev('easyFresh')},
WIDGET.newSwitch{name='deepDrop', x=1170,y=910, lim=250,disp=CUSval('deepDrop'), code=CUSrev('deepDrop')},
WIDGET.newSwitch{name='bone', x=1170,y=970, lim=250,disp=CUSval('bone'), code=CUSrev('bone')},
-- Next & Hold
WIDGET.newSelector{name='holdMode', x=310, y=890, w=300,color='lY',list=sList.holdMode,disp=CUSval('holdMode'),code=CUSsto('holdMode'),hideF=function() return CUSTOMENV.holdCount==0 end},
@@ -232,8 +232,8 @@ scene.widgetList={
WIDGET.newSwitch{name='phyHold', x=560, y=1030,lim=200, disp=CUSval('phyHold'),code=CUSrev('phyHold'),hideF=function() return CUSTOMENV.holdCount==0 end},
-- BG & BGM
WIDGET.newSelector{name='bg', x=840, y=1090,w=250,color='Y',list=BG.getList(),disp=CUSval('bg'),code=function(i) CUSTOMENV.bg=i BG.set(i) end},
WIDGET.newSelector{name='bgm', x=1120,y=1090,w=250,color='Y',list=BGM.getList(),disp=CUSval('bgm'),code=function(i) CUSTOMENV.bgm=i BGM.play(i) end},
WIDGET.newSelector{name='bg', x=840, y=1100,w=250,color='Y',list=BG.getList(),disp=CUSval('bg'),code=function(i) CUSTOMENV.bg=i BG.set(i) end},
WIDGET.newSelector{name='bgm', x=1120,y=1100,w=250,color='Y',list=BGM.getList(),disp=CUSval('bgm'),code=function(i) CUSTOMENV.bgm=i BGM.play(i) end},
}
return scene

View File

@@ -107,7 +107,7 @@ local loadingThread=coroutine.wrap(function()
LOADED=true
saveStats()
Z.setPowerInfo(SETTING.powerInfo)
return'finish'
return 'finish'
end)
function scene.sceneInit()

View File

@@ -9,7 +9,6 @@ local function _getCode()
NET.getCode(email)
end
end
local function _codeLogin()
local code=scene.widgetList.code:getText():upper()
if #code~=8 then
@@ -18,6 +17,17 @@ local function _codeLogin()
NET.codeLogin(USER.email,code)
end
end
local function _paste()
local t=love.system.getClipboardText()
if t then
t=STRING.trim(t)
if #t==8 and t:match("[0-9]+") then
scene.widgetList.code:setText(t)
return
end
end
MES.new('warn',text.wrongCode)
end
function scene.sceneInit()
scene.widgetList.email:setText(USER.email or "")
@@ -33,6 +43,8 @@ function scene.keyDown(key,rep)
else
_codeLogin()
end
elseif key=='v' and love.keyboard.isDown('lctrl','rctrl') then
_paste()
else
return true
end
@@ -45,8 +57,9 @@ scene.widgetList={
WIDGET.newInputBox{name='email', x=380, y=200,w=626,h=60,limit=128},
WIDGET.newKey{name='send', x=640, y=330,w=300,h=80,font=40,code=_getCode},
WIDGET.newInputBox{name='code', x=380, y=400,w=626 ,h=60,limit=8},
WIDGET.newInputBox{name='code', x=380, y=400,w=626,h=60,regex="[0-9a-zA-Z]",limit=8},
WIDGET.newKey{name='verify', x=640, y=530,w=300,h=80,font=40,code=_codeLogin},
WIDGET.newKey{name='paste', x=850, y=530,w=80,font=40,fText=CHAR.icon.import,code=_paste},
WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,sound='back',font=60,fText=CHAR.icon.back,code=pressKey'escape'},
}

View File

@@ -23,8 +23,12 @@ function scene.sceneInit()
end
function scene.keyDown(key,rep)
if key~='return' or rep then return true end
_login()
if rep then return true end
if key=='return' then
_login()
else
return true
end
end
scene.widgetList={

View File

@@ -127,19 +127,42 @@ function scene.keyDown(key,isRep)
else
_quit()
end
elseif key=='/' then
if inputBox.hide then
_switchChat()
local mes=STRING.trim(inputBox:getText())
if #mes==0 then
inputBox:setText("/")
end
end
elseif key=='return' or key=='kpenter' then
local mes=STRING.trim(inputBox:getText())
if not inputBox.hide and #mes>0 then
if mes:sub(1,1)=='/' then
local cmd=STRING.split(mes,' ')
-- Common commands
if cmd[1]=='/kick' then
if tonumber(cmd[2]) then NET.room_kick(tonumber(cmd[2])) end
elseif cmd[1]=='/pw' then
if cmd[2] then NET.room_setPW(cmd[2]) end
elseif cmd[1]=='/host' then
if tonumber(cmd[2]) then NET.player_setHost(tonumber(cmd[2])) end
elseif cmd[1]=='/group' then
if tonumber(cmd[2]) and tonumber(cmd[2])%1==0 and tonumber(cmd[2])>=0 and tonumber(cmd[2])<=6 then
NET.player_joinGroup(tonumber(cmd[2]))
end
elseif cmd[1]=='/exit' or cmd[1]=='/quit' then
_quit()
-- Admin commands
elseif cmd[1]=='/fkick' then
if tonumber(cmd[2]) then NET.room_kick(tonumber(cmd[2]),NET.roomState.roomId) end
elseif cmd[1]=='/fpw' then
if cmd[2] then NET.room_setPW(cmd[2],NET.roomState.roomId) end
elseif cmd[1]=='/fexit' or cmd[1]=='/fquit' then
NET.room_remove(NET.roomState.roomId)
else
NET.textBox:push{COLOR.R,'Invalid command'}
end
@@ -150,6 +173,8 @@ function scene.keyDown(key,isRep)
else
_switchChat()
end
elseif #key==1 and key:find("^[0-6]$") and kb.isDown('lctrl','rctrl') then
NET.player_joinGroup(tonumber(key))
elseif not inputBox.hide then
WIDGET.focus(inputBox)
inputBox:keypress(key)
@@ -343,6 +368,15 @@ scene.widgetList={
WIDGET.newKey{name='ready', x=1060,y=510,w=360,h=90,color='lG',font=35, code=_setReady,hideF=_hideF_ready},
WIDGET.newKey{name='spectate',x=1060,y=610,w=360,h=90,color='lO',font=35, code=_setSpectate,hideF=_hideF_ready},
WIDGET.newKey{name='cancel', x=1060,y=560,w=360,h=120,color='lH',font=40,code=_setCancel,hideF=_hideF_standby},
WIDGET.newButton{x=320,y=45,w=40,color='Z', fText="",code=function() NET.player_joinGroup(0) end,hideF=_hideF_ready},
WIDGET.newButton{x=190,y=25,w=30,color='lR',fText="",code=function() NET.player_joinGroup(1) end,hideF=_hideF_ready},
WIDGET.newButton{x=230,y=25,w=30,color='lG',fText="",code=function() NET.player_joinGroup(2) end,hideF=_hideF_ready},
WIDGET.newButton{x=270,y=25,w=30,color='lB',fText="",code=function() NET.player_joinGroup(3) end,hideF=_hideF_ready},
WIDGET.newButton{x=190,y=65,w=30,color='lY',fText="",code=function() NET.player_joinGroup(4) end,hideF=_hideF_ready},
WIDGET.newButton{x=230,y=65,w=30,color='lM',fText="",code=function() NET.player_joinGroup(5) end,hideF=_hideF_ready},
WIDGET.newButton{x=270,y=65,w=30,color='lC',fText="",code=function() NET.player_joinGroup(6) end,hideF=_hideF_ready},
WIDGET.newKey{name='chat', x=390,y=45,w=60,fText="···", code=_switchChat},
WIDGET.newKey{name='quit', x=890,y=45,w=60,font=30,fText=CHAR.icon.cross_thick,code=_quit},
}

View File

@@ -14,6 +14,17 @@ local function _setPW()
NET.setPW(code,password)
end
end
local function _paste()
local t=love.system.getClipboardText()
if t then
t=STRING.trim(t)
if #t==8 and t:match("[0-9]+") then
scene.widgetList.code:setText(t)
return
end
end
MES.new('warn',text.wrongCode)
end
function scene.enter()
if SCN.args[1] then
@@ -29,6 +40,8 @@ function scene.keyDown(key,rep)
else
_setPW()
end
elseif key=='v' and love.keyboard.isDown('lctrl','rctrl') then
_paste()
else
return true
end
@@ -37,11 +50,13 @@ end
scene.widgetList={
WIDGET.newText{name='title', x=80, y=50,font=70,align='L'},
WIDGET.newInputBox{name='code', x=380, y=170,w=626,h=60,regex="[0-9a-zA-Z]",limit=8},
WIDGET.newKey{name='send', x=640, y=300,w=300,h=80,font=40,code=function() NET.getCode(USER.email) end},
WIDGET.newInputBox{name='code', x=380, y=170,w=626,h=60,limit=8},
WIDGET.newInputBox{name='password', x=380, y=370,w=626,h=60,secret=true,regex="[ -~]",limit=64},
WIDGET.newInputBox{name='password2',x=380, y=470,w=626,h=60,secret=true,regex="[ -~]",limit=64},
WIDGET.newKey{name='setPW', x=640, y=600,w=350,h=80,font=40,code=_setPW},
WIDGET.newKey{name='paste', x=850, y=300,w=80,font=40,fText=CHAR.icon.import,code=_paste},
WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,sound='back',font=60,fText=CHAR.icon.back,code=pressKey'escape'},
}

View File

@@ -2,6 +2,15 @@ return[=[
未来计划:
正在点亮科技树...
0.17.8: 暂停 Break
新增:
联网游戏房间菜单添加选队伍按钮键盘可以用ctrl+数字切换
粘贴验证码按钮
修复:
联网游戏死亡前打出攻击会导致其他人不同步
联网游戏聊天框看不全
其他玩家进房check是否已存在的时候因为访问不存在的玩家而报错
0.17.7: 暂停 Break
新增:
联网能玩了

View File

@@ -1,7 +1,7 @@
return {
["apkCode"]=451,
["code"]=1707,
["string"]="V0.17.7",
["room"]="ver A-7",
["apkCode"]=452,
["code"]=1708,
["string"]="V0.17.8",
["room"]="ver A-8",
["name"]="暂停 Break",
}