From b232d0026a8fd62a0582b5c94f428a6c95ec9755 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Wed, 20 Nov 2019 07:42:34 +0800 Subject: [PATCH] Reduce logging --- code/nel/include/nel/gui/widget_manager.h | 2 ++ code/nel/src/gui/widget_manager.cpp | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/code/nel/include/nel/gui/widget_manager.h b/code/nel/include/nel/gui/widget_manager.h index 518c5be16..5d7644d61 100644 --- a/code/nel/include/nel/gui/widget_manager.h +++ b/code/nel/include/nel/gui/widget_manager.h @@ -636,6 +636,8 @@ namespace NLGUI bool _GroupSelection; bool multiSelection; uint32 _WidgetCount; + + std::set m_LoggedMissingElement; }; } diff --git a/code/nel/src/gui/widget_manager.cpp b/code/nel/src/gui/widget_manager.cpp index 95a63e5d4..5d48842a9 100644 --- a/code/nel/src/gui/widget_manager.cpp +++ b/code/nel/src/gui/widget_manager.cpp @@ -431,10 +431,23 @@ namespace NLGUI CWidgetManager::SMasterGroup &rMG = _MasterGroups[nMasterGroup]; CInterfaceElement *pIEL = rMG.Group->getElement (sEltId); if (pIEL != NULL) + { +#if !FINAL_VERSION + if (m_LoggedMissingElement.find(sEltId) != m_LoggedMissingElement.end()) + { + m_LoggedMissingElement.erase(sEltId); + nlwarning("Previously missing UI element with Id '%s' was now found!", sEltId.c_str()); + } +#endif return pIEL; + } } - nlwarning("Could not find UI element from Id '%s'", sEltId.c_str()); + if (m_LoggedMissingElement.find(sEltId) == m_LoggedMissingElement.end()) + { + m_LoggedMissingElement.insert(sEltId); + nlwarning("Could not find UI element from Id '%s'...", sEltId.c_str()); + } return NULL; }