Al redefinir botons, ja no pots repetir botó. Util per als qui tenim la ma tremolosa i apretem dos voltes sense voler
This commit is contained in:
@@ -216,6 +216,12 @@ void Title::checkEvents()
|
||||
break;
|
||||
}
|
||||
|
||||
case SDLK_4:
|
||||
{
|
||||
showControllers();
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -302,23 +308,21 @@ void Title::reLoadTextures()
|
||||
}
|
||||
|
||||
// Reinicia el contador interno
|
||||
void Title::resetCounter()
|
||||
{
|
||||
counter_ = 0;
|
||||
}
|
||||
void Title::resetCounter() { counter_ = 0; }
|
||||
|
||||
// Intercambia la asignación de mandos a los jugadores
|
||||
void Title::swapControllers()
|
||||
{
|
||||
const auto num_controllers = Input::get()->getNumControllers();
|
||||
|
||||
if (num_controllers == 0)
|
||||
{
|
||||
if (Input::get()->getNumControllers() == 0)
|
||||
return;
|
||||
}
|
||||
|
||||
define_buttons_->swapControllers();
|
||||
showControllers();
|
||||
}
|
||||
|
||||
// Muestra información sobre los controles y los jugadores
|
||||
void Title::showControllers()
|
||||
{
|
||||
// Crea cadenas de texto vacias para un numero máximo de mandos
|
||||
constexpr int MAX_CONTROLLERS = 2;
|
||||
std::string text[MAX_CONTROLLERS];
|
||||
@@ -341,11 +345,10 @@ void Title::swapControllers()
|
||||
const int index = playerControllerIndex[i];
|
||||
if (options.controller[index].plugged)
|
||||
{
|
||||
text[i] = lang::getText(101) + std::to_string(i + 1) + ": " + options.controller[index].name;
|
||||
text[i] = lang::getText(100) + std::to_string(i + 1) + ": " + options.controller[index].name;
|
||||
}
|
||||
}
|
||||
|
||||
Notifier::get()->showText(text[0], text[1]);
|
||||
|
||||
resetCounter();
|
||||
}
|
||||
Reference in New Issue
Block a user