File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2323#include " control/input_manager.hpp"
2424#include " control/joystick_manager.hpp"
2525#include " gui/dialog.hpp"
26+ #include " gui/item_toggle.hpp"
2627#include " object/player.hpp"
2728#include " supertux/game_session.hpp"
2829#include " supertux/gameconfig.hpp"
@@ -37,7 +38,8 @@ MultiplayerPlayerMenu::MultiplayerPlayerMenu(int player_id)
3738 add_label (fmt::format (_ (" Player {}" ), player_id + 1 ));
3839 add_hl ();
3940
40- add_toggle (-1 , _ (" Play with the keyboard" ), &InputManager::current ()->m_uses_keyboard [player_id]);
41+ add_toggle (-1 , _ (" Play with the keyboard" ), &InputManager::current ()->m_uses_keyboard [player_id])
42+ .set_help (_ (" Don't automatically bind controllers to this player, and spawn it even if it has no controller." ));
4143
4244 if (player_id != 0 && GameSession::current ()
4345 && !GameSession::current ()->get_savegame ().is_title_screen ())
Original file line number Diff line number Diff line change @@ -45,7 +45,19 @@ MultiplayerPlayersMenu::MultiplayerPlayersMenu()
4545
4646 if (InputManager::current ()->can_add_user ())
4747 {
48- add_entry (_ (" Add Player" ), [] {
48+ add_entry (_ (" Add Player (Keyboard)" ), [] {
49+ InputManager::current ()->push_user ();
50+ InputManager::current ()->m_uses_keyboard [InputManager::current ()->get_num_users () - 1 ] = true ;
51+
52+ if (GameSession::current () && GameSession::current ()->get_savegame ().get_player_status ().m_num_players < InputManager::current ()->get_num_users ())
53+ {
54+ GameSession::current ()->get_savegame ().get_player_status ().add_player ();
55+ }
56+
57+ MenuManager::instance ().set_menu (std::make_unique<MultiplayerPlayersMenu>());
58+ });
59+
60+ add_entry (_ (" Add Player (Controller)" ), [] {
4961 InputManager::current ()->push_user ();
5062
5163 if (GameSession::current () && GameSession::current ()->get_savegame ().get_player_status ().m_num_players < InputManager::current ()->get_num_users ())
You can’t perform that action at this time.
0 commit comments