feat(PlayerDB): Added search button (#1579)

This commit is contained in:
Andreas Maerten 2023-07-02 22:55:06 +02:00 committed by GitHub
parent b44b2f04e6
commit 71960eddbb

View File

@ -241,5 +241,20 @@ namespace big
current_player = g_player_database_service->add_player(new_rockstar_id, new_name);
g_player_database_service->save();
}
ImGui::SameLine();
if (ImGui::Button("SEARCH"_T.data()))
{
g_thread_pool->push([]{
if (!g_api_service->get_rid_from_username(new_name, *(uint64_t*)&new_rockstar_id))
{
g_notification_service->push_error("New Player DB Entry", std::format("No user '{}' called could be found.", new_name));
new_rockstar_id = 0;
}
});
}
if (ImGui::IsItemHovered())
{
ImGui::SetTooltip("Do you know only the name of someone and not their Rockstar ID? Just fill in the username and click \"search\".");
}
}
}