修复房间列表输密码的时候部分按键还会有其他功能

This commit is contained in:
MrZ626
2021-08-03 15:48:35 +08:00
parent 5b31e3eb87
commit 47af067c03

View File

@@ -59,23 +59,27 @@ function scene.sceneInit()
end
function scene.keyDown(key)
if key=="r"then
if fetchTimer<=7 then
fetchRoom()
end
elseif key=="s"then
SCN.go('setting_game')
elseif key=="n"then
SCN.go('net_newRoom')
elseif key=="escape"then
SCN.back()
elseif roomList:getLen()>0 and key=="return"then
local R=roomList:getSel()
if NET.getlock('fetchRoom')or not R then return end
if R.roomInfo.version==VERSION.room then
NET.enterRoom(R,passwordBox.value)
if WIDGET.sel~=passwordBox then
if key=="r"then
if fetchTimer<=7 then
fetchRoom()
end
elseif key=="s"then
SCN.go('setting_game')
elseif key=="n"then
SCN.go('net_newRoom')
elseif key=="escape"then
SCN.back()
elseif roomList:getLen()>0 and key=="return"then
local R=roomList:getSel()
if NET.getlock('fetchRoom')or not R then return end
if R.roomInfo.version==VERSION.room then
NET.enterRoom(R,passwordBox.value)
else
MES.new('error',"Version doesn't compatible 版本不兼容")
end
else
MES.new('error',"Version doesn't compatible 版本不兼容")
WIDGET.keyPressed(key)
end
else
WIDGET.keyPressed(key)