Display list of broadcasting clients.

This commit is contained in:
Bartosz Taudul 2019-06-17 19:45:47 +02:00
parent 36989da2c6
commit 67daff1452

View File

@ -26,6 +26,7 @@
#define STBI_ONLY_PNG
#include "stb_image.h"
#include "../../common/TracyProtocol.hpp"
#include "../../server/tracy_flat_hash_map.hpp"
#include "../../server/tracy_pdqsort.h"
#include "../../server/TracyBadVersion.hpp"
@ -458,6 +459,33 @@ int main( int argc, char** argv )
tracy::BadVersion( badVer );
}
if( !clients.empty() )
{
ImGui::Separator();
ImGui::TextUnformatted( "Available clients:" );
ImGui::Separator();
ImGui::Columns( 2 );
for( auto& v : clients )
{
const bool badProto = v.second.protocolVersion != tracy::ProtocolVersion;
bool sel = false;
ImGuiSelectableFlags flags = ImGuiSelectableFlags_SpanAllColumns;
if( badProto ) flags |= ImGuiSelectableFlags_Disabled;
ImGui::Selectable( v.second.address.c_str(), &sel, flags );
ImGui::NextColumn();
if( badProto )
{
tracy::TextDisabledUnformatted( v.second.procName.c_str() );
}
else
{
ImGui::TextUnformatted( v.second.procName.c_str() );
}
ImGui::NextColumn();
}
ImGui::EndColumns();
}
ImGui::End();
}
else