From 2233507667c6030cc86d9e66a3746b2ed828d8ba Mon Sep 17 00:00:00 2001 From: capslockapocalypse <140287230+capslockapocalypse@users.noreply.github.com> Date: Fri, 24 May 2024 23:08:21 +1000 Subject: [PATCH] Added "Hops away" on display (#3934) * Added "Hops away" on display Added in logic that displays "hops away" instead of signal strength when the node is more than 0 hops away. * Added comment * Update extensions.json to same as master * attempt 2 at reverting extensions JSON * Attempt 3 at getting extensions right * Take 4. should be reverting to before my edits --------- Co-authored-by: Ben Meadors --- src/graphics/Screen.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index 9ffec9845..9758e97fd 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -1459,7 +1459,18 @@ static void drawNodeInfo(OLEDDisplay *display, OLEDDisplayUiState *state, int16_ const char *username = node->has_user ? node->user.long_name : "Unknown Name"; static char signalStr[20]; - snprintf(signalStr, sizeof(signalStr), "Signal: %d%%", clamp((int)((node->snr + 10) * 5), 0, 100)); + + //section here to choose whether to display hops away rather than signal strength if more than 0 hops away. + if(node->hops_away>0) + { + snprintf(signalStr, sizeof(signalStr), "Hops Away: %d", node->hops_away); + } + else + { + snprintf(signalStr, sizeof(signalStr), "Signal: %d%%", clamp((int)((node->snr + 10) * 5), 0, 100)); + } + + uint32_t agoSecs = sinceLastSeen(node); static char lastStr[20];