From ad9b680e9182a1d1d14221ae8d452c2e3dcce062 Mon Sep 17 00:00:00 2001 From: kervala Date: Mon, 27 Feb 2012 22:42:30 +0100 Subject: [PATCH] Changed: #1433 Merge changes from patch 1.13 --- code/ryzom/client/src/cdb_branch.cpp | 2 +- code/ryzom/client/src/cdb_branch.h | 2 +- code/ryzom/client/src/character_cl.cpp | 1 - code/ryzom/client/src/client_chat_manager.cpp | 4 ++-- code/ryzom/client/src/entity_cl.cpp | 8 ++++---- .../client/src/interface_v3/chat_text_manager.cpp | 2 +- code/ryzom/client/src/interface_v3/chat_window.cpp | 2 +- code/ryzom/client/src/interface_v3/group_compas.cpp | 10 ++++++++++ .../client/src/interface_v3/group_html_webig.cpp | 2 +- code/ryzom/client/src/interface_v3/lua_ihm.cpp | 12 ++++++------ code/ryzom/client/src/interface_v3/people_list.cpp | 6 +++--- code/ryzom/client/src/string_manager_client.h | 2 +- 12 files changed, 31 insertions(+), 22 deletions(-) diff --git a/code/ryzom/client/src/cdb_branch.cpp b/code/ryzom/client/src/cdb_branch.cpp index 60c6b63f4..351203493 100644 --- a/code/ryzom/client/src/cdb_branch.cpp +++ b/code/ryzom/client/src/cdb_branch.cpp @@ -628,7 +628,7 @@ void CCDBNodeBranch::display (const std::string &prefix) } } -void CCDBNodeBranch::removeNode (CTextId& id) +void CCDBNodeBranch::removeNode (const CTextId& id) { // Look for the node CCDBNodeBranch *pNode = dynamic_cast(getNode(id,false)); diff --git a/code/ryzom/client/src/cdb_branch.h b/code/ryzom/client/src/cdb_branch.h index 405c7c479..74e085ca4 100644 --- a/code/ryzom/client/src/cdb_branch.h +++ b/code/ryzom/client/src/cdb_branch.h @@ -165,7 +165,7 @@ public: virtual void display (const std::string &prefix); - void removeNode (CTextId& id); + void removeNode (const CTextId& id); /** * add an observer to a property diff --git a/code/ryzom/client/src/character_cl.cpp b/code/ryzom/client/src/character_cl.cpp index 694ed9b16..c0e6d1104 100644 --- a/code/ryzom/client/src/character_cl.cpp +++ b/code/ryzom/client/src/character_cl.cpp @@ -1877,7 +1877,6 @@ void CCharacterCL::updateVisualPropertyPvpMode(const NLMISC::TGameCycle &/* game void CCharacterCL::updateVisualPropertyPvpClan(const NLMISC::TGameCycle &/* gameCycle */, const sint64 &prop) { _LeagueId = uint32(prop); - buildInSceneInterface(); if (isUser()) { diff --git a/code/ryzom/client/src/client_chat_manager.cpp b/code/ryzom/client/src/client_chat_manager.cpp index e7ef54d02..59b72cedb 100644 --- a/code/ryzom/client/src/client_chat_manager.cpp +++ b/code/ryzom/client/src/client_chat_manager.cpp @@ -1174,7 +1174,7 @@ class CHandlerTell : public IActionHandler ucstring finalMsg; CChatWindow::encodeColorTag(prop.getRGBA(), finalMsg, false); - ucstring csr = CHARACTER_TITLE::isCsrTitle(UserEntity->getTitleRaw()) ? "(CSR) " : ""; + ucstring csr(CHARACTER_TITLE::isCsrTitle(UserEntity->getTitleRaw()) ? "(CSR) " : ""); finalMsg += csr + CI18N::get("youTell") + ": "; prop.readRGBA("UI:SAVE:CHAT:COLORS:TELL"," "); CChatWindow::encodeColorTag(prop.getRGBA(), finalMsg, true); @@ -1182,7 +1182,7 @@ class CHandlerTell : public IActionHandler // display msg with good color // TDataSetIndex dsi; // not used .... PeopleInterraction.ChatInput.Tell.displayTellMessage(/*dsi, */finalMsg, receiver, prop.getRGBA()); - + ucstring s = CI18N::get("youTellPlayer"); strFindReplace(s, "%name", receiver); strFindReplace(finalMsg, CI18N::get("youTell"), s); diff --git a/code/ryzom/client/src/entity_cl.cpp b/code/ryzom/client/src/entity_cl.cpp index 421faad47..7cefa69d7 100644 --- a/code/ryzom/client/src/entity_cl.cpp +++ b/code/ryzom/client/src/entity_cl.cpp @@ -2539,7 +2539,7 @@ NLMISC::CRGBA CEntityCL::getColor () const if (isEnemy()) { if (getPvpMode()&PVP_MODE::PvpFaction) - return CRGBA::CRGBA(min(255, _PvpEnemyColor.R+150), min(255, _PvpEnemyColor.G+150), min(255, _PvpEnemyColor.B+150),_PvpEnemyColor.A); + return CRGBA(min(255, _PvpEnemyColor.R+150), min(255, _PvpEnemyColor.G+150), min(255, _PvpEnemyColor.B+150),_PvpEnemyColor.A); else return _PvpEnemyColor; } @@ -2551,8 +2551,8 @@ NLMISC::CRGBA CEntityCL::getColor () const if (getPvpMode() & PVP_MODE::PvpFactionFlagged) { if(isInSameLeague()) - return CRGBA::CRGBA(max(0, _PvpAllyColor.R-100), max(0, _PvpAllyColor.G-100), max(0, _PvpAllyColor.B-100),_PvpAllyColor.A); - return CRGBA::CRGBA(max(0, _PvpAllyInTeamColor.R-100), max(0, _PvpAllyInTeamColor.G-100), max(0, _PvpAllyInTeamColor.B-100),_PvpAllyInTeamColor.A); + return CRGBA(max(0, _PvpAllyColor.R-100), max(0, _PvpAllyColor.G-100), max(0, _PvpAllyColor.B-100),_PvpAllyColor.A); + return CRGBA(max(0, _PvpAllyInTeamColor.R-100), max(0, _PvpAllyInTeamColor.G-100), max(0, _PvpAllyInTeamColor.B-100),_PvpAllyInTeamColor.A); } else { @@ -2572,7 +2572,7 @@ NLMISC::CRGBA CEntityCL::getColor () const // neutral if (isInSameLeague()) - return CRGBA::CRGBA(min(255, _GroupColor.R+50), min(255, _GroupColor.G+50), min(255, _GroupColor.B+50),_GroupColor.A); + return CRGBA(min(255, _GroupColor.R+50), min(255, _GroupColor.G+50), min(255, _GroupColor.B+50),_GroupColor.A); if (isInSameGuild()) return _GuildColor; diff --git a/code/ryzom/client/src/interface_v3/chat_text_manager.cpp b/code/ryzom/client/src/interface_v3/chat_text_manager.cpp index d1488b4dd..9b5113a55 100644 --- a/code/ryzom/client/src/interface_v3/chat_text_manager.cpp +++ b/code/ryzom/client/src/interface_v3/chat_text_manager.cpp @@ -148,7 +148,7 @@ CViewBase *CChatTextManager::createMsgText(const ucstring &cstMsg, NLMISC::CRGBA vt->setMultiLineSpace(getTextMultiLineSpace()); vt->setModulateGlobalColor(false); - ucstring cur_time = ""; + ucstring cur_time; static CCDBNodeLeaf* node = CInterfaceManager::getInstance()->getDbProp("UI:SAVE:CHAT:SHOW_TIMES_IN_CHAT_CB", false); if (node) { diff --git a/code/ryzom/client/src/interface_v3/chat_window.cpp b/code/ryzom/client/src/interface_v3/chat_window.cpp index 773992fc3..18be552e9 100644 --- a/code/ryzom/client/src/interface_v3/chat_window.cpp +++ b/code/ryzom/client/src/interface_v3/chat_window.cpp @@ -473,7 +473,7 @@ void CChatWindow::displayLocalPlayerTell(const ucstring &receiver, const ucstrin prop.readRGBA("UI:SAVE:CHAT:COLORS:SPEAKER"," "); encodeColorTag(prop.getRGBA(), finalMsg, false); - ucstring csr = CHARACTER_TITLE::isCsrTitle(UserEntity->getTitleRaw()) ? "(CSR) " : ""; + ucstring csr(CHARACTER_TITLE::isCsrTitle(UserEntity->getTitleRaw()) ? "(CSR) " : ""); finalMsg += csr + CI18N::get("youTell") + ": "; prop.readRGBA("UI:SAVE:CHAT:COLORS:TELL"," "); encodeColorTag(prop.getRGBA(), finalMsg, true); diff --git a/code/ryzom/client/src/interface_v3/group_compas.cpp b/code/ryzom/client/src/interface_v3/group_compas.cpp index 0fa2b30e7..fa7655591 100644 --- a/code/ryzom/client/src/interface_v3/group_compas.cpp +++ b/code/ryzom/client/src/interface_v3/group_compas.cpp @@ -587,6 +587,12 @@ bool CGroupCompasMenu::parse(xmlNodePtr cur, CInterfaceGroup *parent /*=NULL*/) return true; } +// Helper for sorting landmarks +static inline bool UserLandMarksSortPredicate(const CUserLandMark& lm1, const CUserLandMark& lm2) +{ + return toLower(lm1.Title) < toLower(lm2.Title); +} + // *************************************************************************** // Called when we activate the compass menu void CGroupCompasMenu::setActive (bool state) @@ -803,6 +809,10 @@ void CGroupCompasMenu::setActive (bool state) } // User landmarks uint nbUserLandMarks = std::min( uint(currCont->UserLandMarks.size()), CContinent::getMaxNbUserLandMarks() ); + + // Sort the landmarks + std::sort(currCont->UserLandMarks.begin(), currCont->UserLandMarks.end(), UserLandMarksSortPredicate); + for(k = 0; k < nbUserLandMarks; ++k) { if (currCont->UserLandMarks[k].Type < CUserLandMark::UserLandMarkTypeCount) diff --git a/code/ryzom/client/src/interface_v3/group_html_webig.cpp b/code/ryzom/client/src/interface_v3/group_html_webig.cpp index e4a55ab48..0e17c47d3 100644 --- a/code/ryzom/client/src/interface_v3/group_html_webig.cpp +++ b/code/ryzom/client/src/interface_v3/group_html_webig.cpp @@ -74,6 +74,7 @@ void addWebIGParams (string &url, bool trustedDomain) string("shardid=") + toString(CharacterHomeSessionId) + string("&name=") + UserEntity->getLoginName().toUtf8() + string("&lang=") + CI18N::getCurrentLanguageCode() + + string("&datasetid=") + toString(UserEntity->dataSetId()) + string("&ig=1"); if (trustedDomain) { @@ -82,7 +83,6 @@ void addWebIGParams (string &url, bool trustedDomain) if (url.find('$') != string::npos) { - strFindReplace(url, "$datasetid$", toString(UserEntity->dataSetId())); strFindReplace(url, "$gender$", GSGENDER::toString(UserEntity->getGender())); strFindReplace(url, "$displayName$", UserEntity->getDisplayName().toString()); strFindReplace(url, "$posx$", toString(UserEntity->pos().x)); diff --git a/code/ryzom/client/src/interface_v3/lua_ihm.cpp b/code/ryzom/client/src/interface_v3/lua_ihm.cpp index 44e9a3ba7..08b128b66 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm.cpp +++ b/code/ryzom/client/src/interface_v3/lua_ihm.cpp @@ -1944,12 +1944,12 @@ static sint32 getTargetSlotNr() const char *dbPath = "UI:VARIABLES:TARGET:SLOT"; CInterfaceManager *im = CInterfaceManager::getInstance(); CCDBNodeLeaf *node = im->getDbProp(dbPath, false); - if (!node) return NULL; + if (!node) return 0; if ((uint8) node->getValue32() == (uint8) CLFECOMMON::INVALID_SLOT) { - return NULL; + return 0; } - return node->getValue32(); + return node->getValue32(); } // *************************************************************************** @@ -1963,13 +1963,13 @@ static CEntityCL *getTargetEntity() { return NULL; } - return EntitiesMngr.entity((uint) node->getValue32()); + return EntitiesMngr.entity((uint) node->getValue32()); } // *************************************************************************** static CEntityCL *getSlotEntity(uint slot) { - return EntitiesMngr.entity(slot); + return EntitiesMngr.entity(slot); } // *************************************************************************** @@ -2032,7 +2032,7 @@ sint32 CLuaIHM::getTargetLevel() ucstring CLuaIHM::getTargetSheet() { CEntityCL *target = getTargetEntity(); - if (!target) return ""; + if (!target) return ucstring(); return target->sheetId().toString(); } diff --git a/code/ryzom/client/src/interface_v3/people_list.cpp b/code/ryzom/client/src/interface_v3/people_list.cpp index c9b95a14a..395935aab 100644 --- a/code/ryzom/client/src/interface_v3/people_list.cpp +++ b/code/ryzom/client/src/interface_v3/people_list.cpp @@ -468,12 +468,12 @@ void CPeopleList::displayLocalPlayerTell(const ucstring &receiver, uint index, c return; } - ucstring csr = CHARACTER_TITLE::isCsrTitle(UserEntity->getTitleRaw()) ? "(CSR) " : ""; + ucstring csr(CHARACTER_TITLE::isCsrTitle(UserEntity->getTitleRaw()) ? "(CSR) " : ""); ucstring finalMsg = csr + CI18N::get("youTell") + ": " + msg; // display msg with good color CInterfaceProperty prop; prop.readRGBA("UI:SAVE:CHAT:COLORS:TELL"," "); - + ucstring s = CI18N::get("youTellPlayer"); strFindReplace(s, "%name", receiver); strFindReplace(finalMsg, CI18N::get("youTell"), s); @@ -935,7 +935,7 @@ class CHandlerContactEntry : public IActionHandler ucstring final; CChatWindow::encodeColorTag(prop.getRGBA(), final, false); - ucstring csr = CHARACTER_TITLE::isCsrTitle(UserEntity->getTitleRaw()) ? "(CSR) " : ""; + ucstring csr(CHARACTER_TITLE::isCsrTitle(UserEntity->getTitleRaw()) ? "(CSR) " : ""); final += csr + CI18N::get("youTell")+": "; prop.readRGBA("UI:SAVE:CHAT:COLORS:TELL"," "); CChatWindow::encodeColorTag(prop.getRGBA(), final, true); diff --git a/code/ryzom/client/src/string_manager_client.h b/code/ryzom/client/src/string_manager_client.h index e5842a9f6..13f8188bb 100644 --- a/code/ryzom/client/src/string_manager_client.h +++ b/code/ryzom/client/src/string_manager_client.h @@ -107,7 +107,7 @@ public: // Get the Localized Title name static const ucchar *getTitleLocalizedName(const std::string &titleId, bool women); - static std::vector CStringManagerClient::getTitleInfos(const std::string &titleId, bool women); + static std::vector getTitleInfos(const std::string &titleId, bool women); // Get the Localized name of a classification type static const ucchar *getClassificationTypeLocalizedName(EGSPD::CClassificationType::TClassificationType type);