Restore selection after votes list update.
It allows to choose vote from list even if someone is spamming with random track button.
This commit is contained in:
parent
a0b3bdd4c2
commit
19b0bc7fa9
@ -764,6 +764,9 @@ void TracksScreen::updatePlayerVotes()
|
|||||||
auto cl = LobbyProtocol::get<ClientLobby>();
|
auto cl = LobbyProtocol::get<ClientLobby>();
|
||||||
if (GUIEngine::getCurrentScreen() != this || !cl || !m_vote_list)
|
if (GUIEngine::getCurrentScreen() != this || !cl || !m_vote_list)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
std::string selected_name = m_vote_list->getSelectionInternalName();
|
||||||
|
|
||||||
m_vote_list->clear();
|
m_vote_list->clear();
|
||||||
for (unsigned i = 0; i < m_index_to_hostid.size(); i++)
|
for (unsigned i = 0; i < m_index_to_hostid.size(); i++)
|
||||||
{
|
{
|
||||||
@ -828,6 +831,12 @@ void TracksScreen::updatePlayerVotes()
|
|||||||
StringUtils::toString(m_index_to_hostid[i]), row);
|
StringUtils::toString(m_index_to_hostid[i]), row);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!selected_name.empty())
|
||||||
|
{
|
||||||
|
int id = m_vote_list->getItemID(selected_name);
|
||||||
|
m_vote_list->setSelectionID(id);
|
||||||
|
}
|
||||||
} // updatePlayerVotes
|
} // updatePlayerVotes
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user