//============================================================================================================= void CChatInputFilter::displayTellMessage(/*TDataSetIndex &receiverIndex, */const ucstring &msg, const ucstring &sender, NLMISC::CRGBA col, uint numBlinks /*=0*/,bool *windowVisible /*=NULL*/) { ucstring senderLwr; senderLwr.fromUtf8(NLMISC::toLower(sender.toUtf8())); // look in people lists std::vector<CPeopleList *>::iterator peopleListIt; for(peopleListIt = _ListeningPeopleList.begin(); peopleListIt != _ListeningPeopleList.end(); ++peopleListIt) { CPeopleList *pPList = *peopleListIt; if (pPList != NULL) { sint peopleIndex = pPList->getIndexFromName(senderLwr); if (peopleIndex != -1) { // We found a player in this list pPList->displayMessage(peopleIndex, msg, col, numBlinks); if (windowVisible) *windowVisible = true; return; } } } // People not found in team or friend list so create/search among free teller (main_chat) // If at least one window is visible, no need to make the window blink. std::vector<CChatWindow *>::iterator peopleIt; for(peopleIt = _ListeningWindows.begin(); peopleIt != _ListeningWindows.end(); ++peopleIt) { (*peopleIt)->displayTellMessage(msg, col, sender); } if (windowVisible) *windowVisible = true; }
std::string convert(const ucstring &str) { if (useUtf8) return str.toUtf8(); return str.toString(); }
ucstring CConfiguration::getValue(const string &varName, const ucstring &defaultValue) { if (m_ConfigFile.exists(varName)) return ucstring::makeFromUtf8(m_ConfigFile.getVar(varName).asString()); CConfigFile::CVar varToCopy; varToCopy.forceAsString(defaultValue.toUtf8()); m_ConfigFile.insertVar(varName, varToCopy); return defaultValue; }
void COXml::serial(ucstring &b) { nlassert( ! isReading() ); // convert ucstring to utf-8 std::string std::string output = b.toUtf8(); // Serial this string serial (output); }
void CDBStringUpdater::setStringLeaf(CCDBSynchronised *clientDB, ICDBStructNode *node, const ucstring &str, bool forceSending) { setStringLeaf(clientDB, node, str.toUtf8(), forceSending); }