feat(UserSideBar): Added friend/player counters
This commit is contained in:
parent
4e5756a818
commit
728d32378b
@ -37,12 +37,19 @@ namespace big
|
|||||||
|
|
||||||
std::sort(std::begin(players), std::end(players));
|
std::sort(std::begin(players), std::end(players));
|
||||||
|
|
||||||
|
g_temp.friend_count = 0;
|
||||||
|
g_temp.player_count = 0;
|
||||||
g_players.clear();
|
g_players.clear();
|
||||||
for (uint8_t i = 0; i < 32; i++)
|
for (uint8_t i = 0; i < 32; i++)
|
||||||
{
|
{
|
||||||
player player = players[i];
|
player player = players[i];
|
||||||
|
|
||||||
if (player.id == PLAYER::PLAYER_ID()) g_player = player;
|
if (player.id == PLAYER::PLAYER_ID()) g_player = player;
|
||||||
|
else if (player.is_online)
|
||||||
|
if (player.is_friend)
|
||||||
|
g_temp.friend_count++;
|
||||||
|
else
|
||||||
|
g_temp.player_count++;
|
||||||
|
|
||||||
g_players.emplace(player.id, player);
|
g_players.emplace(player.id, player);
|
||||||
}
|
}
|
||||||
|
@ -24,13 +24,15 @@ namespace big
|
|||||||
|
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
|
|
||||||
if (ImGui::TreeNode("Friends"))
|
char title[64];
|
||||||
|
sprintf(title, "Friends (%d)###friend_lists", g_temp.friend_count);
|
||||||
|
if (ImGui::TreeNode(title))
|
||||||
{
|
{
|
||||||
ImGui::Unindent();
|
ImGui::Unindent();
|
||||||
|
|
||||||
bool friendInLobby = false;
|
bool friendInLobby = false;
|
||||||
|
|
||||||
for (auto pair : g_players)
|
for (auto& pair : g_players)
|
||||||
{
|
{
|
||||||
player player = pair.second;
|
player player = pair.second;
|
||||||
|
|
||||||
@ -56,11 +58,12 @@ namespace big
|
|||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImGui::TreeNode("Players"))
|
sprintf(title, "Players (%d)###player_lists", g_temp.player_count);
|
||||||
|
if (ImGui::TreeNode(title))
|
||||||
{
|
{
|
||||||
ImGui::Unindent();
|
ImGui::Unindent();
|
||||||
|
|
||||||
for (auto pair : g_players)
|
for (auto& pair : g_players)
|
||||||
{
|
{
|
||||||
player player = pair.second;
|
player player = pair.second;
|
||||||
|
|
||||||
|
@ -21,6 +21,9 @@ namespace big
|
|||||||
|
|
||||||
int character_slot = 0;
|
int character_slot = 0;
|
||||||
|
|
||||||
|
int friend_count = 0;
|
||||||
|
int player_count = 0;
|
||||||
|
|
||||||
int set_level = 0;
|
int set_level = 0;
|
||||||
int spoofed_rank = 0;
|
int spoofed_rank = 0;
|
||||||
int teleport_location = 0;
|
int teleport_location = 0;
|
||||||
|
Reference in New Issue
Block a user