Allow showing or hiding soccer player list with F7 in artist debug mode

This commit is contained in:
Benau 2020-04-29 01:09:33 +08:00
parent 5dffc8cfa1
commit 1bd34e338e
4 changed files with 15 additions and 0 deletions

View File

@ -477,6 +477,9 @@ namespace UserConfigParams
PARAM_PREFIX BoolUserConfigParam m_karts_powerup_gui
PARAM_DEFAULT( BoolUserConfigParam(false, "karts-powerup-gui",
&m_race_setup_group, "Show other karts' held powerups in race gui.") );
PARAM_PREFIX BoolUserConfigParam m_soccer_player_list
PARAM_DEFAULT( BoolUserConfigParam(false, "soccer-player-list",
&m_race_setup_group, "Show player list icon in soccer mode.") );
// ---- Wiimote data
PARAM_PREFIX GroupUserConfigParam m_wiimote_group

View File

@ -1101,6 +1101,8 @@ Vec3 SoccerWorld::getBallAimPosition(KartTeam team, bool reverse) const
void SoccerWorld::getKartsDisplayInfo(
std::vector<RaceGUIBase::KartIconDisplayInfo> *info)
{
if (!UserConfigParams::m_soccer_player_list)
return;
const unsigned int kart_amount = getNumKarts();
for (unsigned int i = 0; i < kart_amount ; i++)
{

View File

@ -764,6 +764,10 @@ void RaceGUIBase::drawGlobalPlayerIcons(int bottom_margin)
{
#ifndef SERVER_ONLY
const RaceManager::MinorRaceModeType minor_mode = RaceManager::get()->getMinorMode();
if (!UserConfigParams::m_soccer_player_list &&
minor_mode == RaceManager::MINOR_MODE_SOCCER)
return;
int x_base = 10;
if (irr_driver->getDevice()->getLeftPadding() > 0)
x_base += irr_driver->getDevice()->getLeftPadding();

View File

@ -1089,6 +1089,12 @@ bool handleStaticAction(int key)
Camera::getActiveCamera()->setKart(World::getWorld()->getKart(kart_num));
return true;
}
else if (key == IRR_KEY_F7)
{
bool prev_val = UserConfigParams::m_soccer_player_list;
UserConfigParams::m_soccer_player_list = !prev_val;
return true;
}
// TODO: create more keyboard shortcuts
return false;