Fix issue where Wormhole server's script messages could not be decoded

Fix issue where dashboard item for parallel peer would not report line number correctly
Closes #1011
This commit is contained in:
Alexander Bock
2020-10-19 17:48:16 +02:00
parent 09e0a55efb
commit 811a84df0f
5 changed files with 102 additions and 86 deletions

View File

@@ -121,6 +121,8 @@ void DashboardItemParallelConnection::render(glm::vec2& penPosition) {
const size_t nConnections = global::parallelPeer.nConnections();
const std::string& hostName = global::parallelPeer.hostName();
int nLines = 1;
std::string connectionInfo;
int nClients = static_cast<int>(nConnections);
if (status == ParallelConnection::Status::Host) {
@@ -158,11 +160,13 @@ void DashboardItemParallelConnection::render(glm::vec2& penPosition) {
else if (nClients == 1) {
connectionInfo += "You are the only client";
}
nLines = 2;
}
if (!connectionInfo.empty()) {
RenderFont(*_font, penPosition, connectionInfo);
penPosition.y -= _font->height();
penPosition.y -= _font->height() * nLines;
}
}