Titlr: arreglat showControllers()
This commit is contained in:
@@ -345,28 +345,12 @@ void Title::swapKeyboard() {
|
||||
|
||||
// Muestra información sobre los controles y los jugadores
|
||||
void Title::showControllers() {
|
||||
/* // Crea vectores de texto vacíos para un número máximo de mandos
|
||||
constexpr size_t NUM_CONTROLLERS = 2;
|
||||
std::vector<std::string> text(NUM_CONTROLLERS);
|
||||
std::vector<int> player_controller_index(NUM_CONTROLLERS, -1);
|
||||
|
||||
// Obtiene de cada jugador el índice del mando que tiene asignado
|
||||
for (size_t i = 0; i < NUM_CONTROLLERS; ++i) {
|
||||
// Ejemplo: el jugador 1 tiene el mando 2
|
||||
player_controller_index.at(Options::controllers.at(i)->player_id - 1) = i;
|
||||
}
|
||||
|
||||
// Genera el texto correspondiente
|
||||
for (size_t i = 0; i < NUM_CONTROLLERS; ++i) {
|
||||
const size_t INDEX = player_controller_index.at(i);
|
||||
if (Options::controllers.at(INDEX).plugged) {
|
||||
text.at(i) = Lang::getText("[DEFINE_BUTTONS] PLAYER") + std::to_string(i + 1) + ": " + Options::controllers.at(INDEX).name;
|
||||
}
|
||||
}
|
||||
|
||||
// Muestra la notificación
|
||||
Notifier::get()->show({text.at(0), text.at(1)});
|
||||
*/
|
||||
// Crea los textos
|
||||
std::string text1 = Lang::getText("[DEFINE_BUTTONS] PLAYER") + std::to_string(static_cast<int>(Player::Id::PLAYER1)) + ": " + Options::gamepad_manager.getGamepad(Player::Id::PLAYER1).name;
|
||||
std::string text2 = Lang::getText("[DEFINE_BUTTONS] PLAYER") + std::to_string(static_cast<int>(Player::Id::PLAYER2)) + ": " + Options::gamepad_manager.getGamepad(Player::Id::PLAYER2).name;
|
||||
|
||||
// Muestra la notificación
|
||||
Notifier::get()->show({text1, text2});
|
||||
}
|
||||
|
||||
// Actualiza el fade
|
||||
|
||||
Reference in New Issue
Block a user