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

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