More player database improvements (#1725)

This commit is contained in:
maybegreat48
2023-07-15 20:37:20 +00:00
committed by GitHub
parent c161ee9413
commit 2b6cb52986
19 changed files with 501 additions and 39 deletions

View File

@ -190,6 +190,15 @@ namespace big
notes_dirty = true;
}
ImGui::Checkbox("Join Redirect", &current_player->join_redirect);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("Anyone trying to join you will join this player instead if they are active. The preference slider will control redirect priority if multiple players with join redirect are active");
if (current_player->join_redirect)
{
ImGui::SliderInt("Preference", &current_player->join_redirect_preference, 1, 10);
}
components::button("JOIN_SESSION"_T, [] {
session::join_by_rockstar_id(current_player->rockstar_id);
});
@ -208,6 +217,30 @@ namespace big
});
};
ImGui::Text("Session Type: %s", player_database_service::get_session_type_str(selected->session_type));
if (selected->session_type != GSType::Invalid && selected->session_type != GSType::Unknown)
{
ImGui::Text("Is Host Of Session: %s", selected->is_host_of_session ? "Yes" : "No");
ImGui::Text("Is Spectating: %s", selected->is_spectating ? "Yes" : "No");
ImGui::Text("In Job Lobby: %s", selected->transition_session_id != -1 ? "Yes" : "No");
ImGui::Text("Is Host Of Job Loby: %s", selected->is_host_of_transition_session ? "Yes" : "No");
ImGui::Text("Current Mission Type: %s", player_database_service::get_game_mode_str(selected->game_mode));
if (selected->game_mode != GameMode::None && player_database_service::can_fetch_name(selected->game_mode))
{
ImGui::Text("Current Mission Name: %s", selected->game_mode_name.c_str());
if ((selected->game_mode_name == "Unknown" || selected->game_mode_name.empty())
&& !selected->game_mode_id.empty())
{
ImGui::SameLine();
components::button("Fetch", [] {
current_player->game_mode_name =
player_database_service::get_name_by_content_id(current_player->game_mode_id);
});
}
}
}
if (ImGui::Button("SAVE"_T.data()))
{
if (current_player->rockstar_id != selected->rockstar_id)
@ -269,6 +302,10 @@ namespace big
ImGui::Checkbox("Notify When Offline", &g.player_db.notify_when_offline);
ImGui::Checkbox("Notify On Session Type Change", &g.player_db.notify_on_session_type_change);
ImGui::Checkbox("Notify On Session Change", &g.player_db.notify_on_session_change);
ImGui::Checkbox("Notify On Spectator Change", &g.player_db.notify_on_spectator_change);
ImGui::Checkbox("Notify On Become Host", &g.player_db.notify_on_become_host);
ImGui::Checkbox("Notify On Job Lobby Change", &g.player_db.notify_on_transition_change);
ImGui::Checkbox("Notify On Mission Change", &g.player_db.notify_on_mission_change);
ImGui::TreePop();
}