@@ -284,14 +284,18 @@ bool ScenarioActivityConfigGUI::Update(int mouseX, int mouseY) {
284
284
int maxHumanPlayers = m_SelectedActivity->GetMaxPlayerSupport ();
285
285
int minTeamsRequired = m_SelectedActivity->GetMinTeamsRequired ();
286
286
287
+ std::vector humanPlayers = GetHumanPlayers ();
287
288
std::string errorMessage = " " ;
288
289
if (humansInTeams > maxHumanPlayers) {
289
290
errorMessage = " Too many players assigned! Max for this activity is " + std::to_string (maxHumanPlayers);
290
291
} else if (minTeamsRequired > teamsWithPlayers) {
291
292
errorMessage = " Assign players to at least " + std::to_string (minTeamsRequired) + " of the teams!" ;
292
293
} else if (teamWithHumans == 0 ) {
293
294
errorMessage = " Assign human players to at least one team!" ;
295
+ } else if (g_UInputMan.CheckMultiMouseKeyboardEnabled (humanPlayers) && !g_UInputMan.AllPlayerInputDevicesKnown (humanPlayers)) {
296
+ errorMessage = " Some players have not set keyboard or mouse devices. Please go to input settings to configure!" ;
294
297
}
298
+
295
299
m_StartErrorLabel->SetText (errorMessage);
296
300
m_StartErrorLabel->SetVisible (!errorMessage.empty ());
297
301
m_StartGameButton->SetVisible (errorMessage.empty ());
@@ -427,17 +431,10 @@ bool ScenarioActivityConfigGUI::HandleInputEvents() {
427
431
SetEnabled (false );
428
432
} else if (guiEvent.GetControl () == m_StartGameButton) {
429
433
// Make sure all players have known input devices if multimouse is enabled.
430
- std::vector humanPlayers = GetHumanPlayers ();
431
- if (g_UInputMan.CheckMultiMouseKeyboardEnabled (humanPlayers) && g_UInputMan.AllPlayerInputDevicesKnown (humanPlayers)) {
432
- g_GUISound.ButtonPressSound ()->Play ();
433
- StartGame ();
434
- SetEnabled (false );
435
- return true ;
436
- } else {
437
- // TODO: Show message and device selection.
438
- g_GUISound.UserErrorSound ()->Play ();
439
- return false ;
440
- }
434
+ g_GUISound.ButtonPressSound ()->Play ();
435
+ StartGame ();
436
+ SetEnabled (false );
437
+ return true ;
441
438
}
442
439
} else if (guiEvent.GetType () == GUIEvent::Notification) {
443
440
if (guiEvent.GetControl () == m_ActivityDifficultySlider) {
0 commit comments