diff --git a/src/pc/debuglog.h b/src/pc/debuglog.h index b26358d4..4e2ae20c 100644 --- a/src/pc/debuglog.h +++ b/src/pc/debuglog.h @@ -4,6 +4,7 @@ #include #include #include "pc/network/network.h" +#include "pc/djui/djui_console.h" static void _debuglog_print_timestamp(void) { time_t ltime = time(NULL); @@ -51,5 +52,6 @@ static void _debuglog_print_log(char* logType, char* filename) { #define LOG_INFO(...) (configDebugInfo ? ( _debuglog_print_log("INFO", __FILE__), printf(__VA_ARGS__), printf("\n") ) : 0) #define LOG_ERROR(...) (configDebugError ? ( _debuglog_print_log("ERROR", __FILE__), printf(__VA_ARGS__), printf("\n") ) : 0) #endif +#define LOG_CONSOLE(...) { snprintf(gDjuiConsoleTmpBuffer, CONSOLE_MAX_TMP_BUFFER, __VA_ARGS__), djui_console_message_create(gDjuiConsoleTmpBuffer); } #endif diff --git a/src/pc/djui/djui_console.c b/src/pc/djui/djui_console.c index c145892b..f0d7db85 100644 --- a/src/pc/djui/djui_console.c +++ b/src/pc/djui/djui_console.c @@ -60,7 +60,7 @@ static bool djui_console_on_key_down(UNUSED struct DjuiBase* base, int scancode) case SCANCODE_ESCAPE: djui_console_toggle(); break; default: break; } - gDjuiConsole->scrolling = (*yValue != yMax); + gDjuiConsole->scrolling = (*yValue != 0); return true; } diff --git a/src/pc/network/packets/packet_chat.c b/src/pc/network/packets/packet_chat.c index e0c53efe..c1ff5483 100644 --- a/src/pc/network/packets/packet_chat.c +++ b/src/pc/network/packets/packet_chat.c @@ -99,5 +99,9 @@ void network_receive_chat(struct Packet* p) { // add the message djui_chat_message_create_from(globalIndex, remoteMessage); + + if (gNetworkSystem && gNetworkSystem->get_id_str && np && np->name) { + LOG_CONSOLE("[%s] %s: %s", gNetworkSystem->get_id_str(np->localIndex), np->name, remoteMessage); + } LOG_INFO("rx chat: %s", remoteMessage); }