Commit bf4945f 1 parent 1d886dc commit bf4945f Copy full SHA for bf4945f
File tree 1 file changed +18
-3
lines changed
1 file changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -1111,7 +1111,6 @@ void MultiplayerScreen::OnKeyPressed(SDL_Scancode code)
1111
1111
else if (code == SDL_SCANCODE_ESCAPE)
1112
1112
{
1113
1113
int backScancode = g_gameConfig.GetInt (GameConfigKeys::Key_Back);
1114
- // SDL_Keycode k = SDL_GetKeyFromScancode(g_gameConfig.GetInt(GameConfigKeys::Key_Back));
1115
1114
1116
1115
if (g_gameConfig.GetEnum <Enum_InputDevice>(GameConfigKeys::ButtonInputDevice) != InputDevice::Keyboard
1117
1116
|| backScancode != SDL_SCANCODE_ESCAPE)
@@ -1203,8 +1202,24 @@ void MultiplayerScreen::m_OnButtonPressed(Input::Button buttonCode)
1203
1202
}
1204
1203
break ;
1205
1204
case Input::Button ::Back:
1206
- if (m_returnToMainList ())
1207
- return ;
1205
+ switch (m_screenState)
1206
+ {
1207
+ case MultiplayerScreenState::JOIN_PASSWORD:
1208
+ case MultiplayerScreenState::NEW_ROOM_NAME:
1209
+ case MultiplayerScreenState::NEW_ROOM_PASSWORD:
1210
+ case MultiplayerScreenState::SET_USERNAME:
1211
+ if (g_gameConfig.GetEnum <Enum_InputDevice>(GameConfigKeys::ButtonInputDevice) == InputDevice::Keyboard)
1212
+ {
1213
+ // In this case we want them to hit escape so we don't exit on text inputs
1214
+ break ;
1215
+ }
1216
+ // Otherwise fall though
1217
+ default :
1218
+ if (m_returnToMainList ())
1219
+ return ;
1220
+ break ;
1221
+ }
1222
+ break ;
1208
1223
default :
1209
1224
break ;
1210
1225
}
You can’t perform that action at this time.
0 commit comments