//  SuperTux
//  Copyright (C) 2021 A. Semphris <semphris@protonmail.com>
//
//  This program is free software: you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation, either version 3 of the License, or
//  (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with this program.  If not, see <http://www.gnu.org/licenses/>.

#include "supertux/menu/multiplayer_menu.hpp"

#include "gui/item_toggle.hpp"
#include "supertux/gameconfig.hpp"
#include "supertux/globals.hpp"
#include "supertux/menu/menu_storage.hpp"
#include "util/gettext.hpp"

MultiplayerMenu::MultiplayerMenu()
{
  add_label(_("Multiplayer"));
  add_hl();

  add_toggle(-1, _("Auto-manage Players"), &g_config->multiplayer_auto_manage_players)
    .set_help(_("Automatically add and remove players when controllers are plugged or unplugged"));

  add_toggle(-2, _("Allow Multibind"), &g_config->multiplayer_multibind)
    .set_help(_("Allow binding multiple joysticks to a single player"));

  add_toggle(-3, _("Unlock player limit"), &g_config->multiplayer_no_limit)
    .set_help(_("Allow having more than 4 players. Some interface elements may overflow out of the screen."));

  add_submenu(_("Manage Players"), MenuStorage::MULTIPLAYER_PLAYERS_MENU);

  add_hl();
  add_back(_("Back"));
}
