diff --git a/code/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp b/code/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp index 2276eb506..015800173 100644 --- a/code/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp +++ b/code/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp @@ -28,6 +28,7 @@ #include "nel/gui/action_handler.h" #include "../entities.h" #include "nel/gui/group_paragraph.h" // For CCtrlLink +#include "nel/gui/view_bitmap.h" #include "../net_manager.h" #include "../string_manager_client.h" #include "../login.h" @@ -644,14 +645,42 @@ void CGroupInSceneBubbleManager::addMessagePopupCenter (const ucstring &message, "ui:interface", templateParams.empty()?NULL:&(templateParams[0]), (uint)templateParams.size()); if (group) { + ucstring finalMessage = message; + + ucstring::size_type pos = message.find(ucstring("|")); + if (pos != std::string::npos) + { + CViewBitmap *pViewIcon = dynamic_cast(group->getView("iconA")); + if (pViewIcon != NULL) + { + string texture = message.substr(0, pos).toString(); + pViewIcon->setTexture(texture); + } + + ucstring::size_type end = message.find(ucstring("|"), pos+1); + if (end != std::string::npos) + { + CViewBitmap *pViewIcon = dynamic_cast(group->getView("iconZ")); + if (pViewIcon != NULL) + { + string texture = message.substr(end+1).toString(); + pViewIcon->setTexture(texture); + } + finalMessage = message.substr(pos+1, end-pos-1); + } + else + finalMessage = message.substr(pos+1); + } + // Skill name CViewText *pViewName = dynamic_cast(group->getView("name")); if (pViewName != NULL) { - pViewName->setTextFormatTaged(message); + pViewName->setTextFormatTaged(finalMessage); pViewName->setColor (color); } + // Link to the interface CWidgetManager::getInstance()->addWindowToMasterGroup("ui:interface", group); CInterfaceGroup *pRoot = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface")); @@ -865,7 +894,7 @@ void CGroupInSceneBubbleManager::chatOpen (uint32 nUID, const ucstring &ucsText, textSize = endOfOriginal; } } - + // Output the message in a bubble bool show = false; diff --git a/code/ryzom/client/src/interface_v3/interface_manager.cpp b/code/ryzom/client/src/interface_v3/interface_manager.cpp index e81785ea8..5231dc19a 100644 --- a/code/ryzom/client/src/interface_v3/interface_manager.cpp +++ b/code/ryzom/client/src/interface_v3/interface_manager.cpp @@ -2523,6 +2523,17 @@ void CInterfaceManager::displaySystemInfo(const ucstring &str, const string &cat CClientConfig::SSysInfoParam::TMode mode = CClientConfig::SSysInfoParam::Normal; CRGBA color = CRGBA::White; + ucstring cleanStr = str; + ucstring::size_type pos = str.find(ucstring("|")); + if (pos != std::string::npos) + { + ucstring::size_type end = str.find(ucstring("|"), pos+1); + if (end != std::string::npos) + cleanStr = str.substr(pos+1, end-pos-1); + else + cleanStr = str.substr(pos+1); + } + // If broadcast, parse lua code if (toLower(cat) == "bc" && str.size() > 3 && str[0]=='@' && str[1]=='L' && str[2]=='U' && str[3]=='A') { @@ -2542,11 +2553,11 @@ void CInterfaceManager::displaySystemInfo(const ucstring &str, const string &cat if (mode != CClientConfig::SSysInfoParam::OverOnly && mode != CClientConfig::SSysInfoParam::Around) { if (PeopleInterraction.SystemInfo) - PeopleInterraction.ChatInput.SystemInfo.displayMessage(str, color, 2); + PeopleInterraction.ChatInput.SystemInfo.displayMessage(cleanStr, color, 2); else { CPeopleInterraction::CSysMsg sysMsg; - sysMsg.Str = str; + sysMsg.Str = cleanStr; sysMsg.Cat = cat; PeopleInterraction.SystemMessageBuffer.push_back( sysMsg ); } @@ -2557,10 +2568,10 @@ void CInterfaceManager::displaySystemInfo(const ucstring &str, const string &cat // If over popup a string at the bottom of the screen if ((mode == CClientConfig::SSysInfoParam::Over) || (mode == CClientConfig::SSysInfoParam::OverOnly)) - InSceneBubbleManager.addMessagePopup(str, color); + InSceneBubbleManager.addMessagePopup(cleanStr, color); else if ( (mode == CClientConfig::SSysInfoParam::Around || mode == CClientConfig::SSysInfoParam::CenterAround) && PeopleInterraction.AroundMe.Window) - PeopleInterraction.ChatInput.AroundMe.displayMessage(str, color, 2); + PeopleInterraction.ChatInput.AroundMe.displayMessage(cleanStr, color, 2); }