mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 09:09:52 -06:00
Add imgui golf mode overlay
This commit is contained in:
@ -2108,15 +2108,19 @@ void NetPlayClient::RequestGolfControl()
|
||||
RequestGolfControl(m_local_player->pid);
|
||||
}
|
||||
|
||||
// called from ---GUI--- thread
|
||||
std::string NetPlayClient::GetCurrentGolfer()
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> lkp(m_crit.players);
|
||||
if (m_players.count(m_current_golfer))
|
||||
return m_players[m_current_golfer].name;
|
||||
return "";
|
||||
}
|
||||
|
||||
// called from ---GUI--- thread
|
||||
bool NetPlayClient::LocalPlayerHasControllerMapped() const
|
||||
{
|
||||
const auto mapping_matches_player_id = [this](const PlayerId& mapping) {
|
||||
return mapping == m_local_player->pid;
|
||||
};
|
||||
|
||||
return std::any_of(m_pad_map.begin(), m_pad_map.end(), mapping_matches_player_id) ||
|
||||
std::any_of(m_wiimote_map.begin(), m_wiimote_map.end(), mapping_matches_player_id);
|
||||
return PlayerHasControllerMapped(m_local_player->pid);
|
||||
}
|
||||
|
||||
bool NetPlayClient::IsFirstInGamePad(int ingame_pad) const
|
||||
@ -2169,6 +2173,19 @@ int NetPlayClient::LocalPadToInGamePad(int local_pad) const
|
||||
return ingame_pad;
|
||||
}
|
||||
|
||||
bool NetPlayClient::PlayerHasControllerMapped(const PlayerId pid) const
|
||||
{
|
||||
const auto mapping_matches_player_id = [pid](const PlayerId& mapping) { return mapping == pid; };
|
||||
|
||||
return std::any_of(m_pad_map.begin(), m_pad_map.end(), mapping_matches_player_id) ||
|
||||
std::any_of(m_wiimote_map.begin(), m_wiimote_map.end(), mapping_matches_player_id);
|
||||
}
|
||||
|
||||
bool NetPlayClient::IsLocalPlayer(const PlayerId pid) const
|
||||
{
|
||||
return pid == m_local_player->pid;
|
||||
}
|
||||
|
||||
void NetPlayClient::SendTimeBase()
|
||||
{
|
||||
std::lock_guard<std::mutex> lk(crit_netplay_client);
|
||||
|
Reference in New Issue
Block a user