Changed: #1433 Merge changes from patch 1.13

This commit is contained in:
kervala 2012-02-27 22:42:30 +01:00
parent a272d956c2
commit ad9b680e91
12 changed files with 31 additions and 22 deletions

View file

@ -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 // Look for the node
CCDBNodeBranch *pNode = dynamic_cast<CCDBNodeBranch*>(getNode(id,false)); CCDBNodeBranch *pNode = dynamic_cast<CCDBNodeBranch*>(getNode(id,false));

View file

@ -165,7 +165,7 @@ public:
virtual void display (const std::string &prefix); virtual void display (const std::string &prefix);
void removeNode (CTextId& id); void removeNode (const CTextId& id);
/** /**
* add an observer to a property * add an observer to a property

View file

@ -1877,7 +1877,6 @@ void CCharacterCL::updateVisualPropertyPvpMode(const NLMISC::TGameCycle &/* game
void CCharacterCL::updateVisualPropertyPvpClan(const NLMISC::TGameCycle &/* gameCycle */, const sint64 &prop) void CCharacterCL::updateVisualPropertyPvpClan(const NLMISC::TGameCycle &/* gameCycle */, const sint64 &prop)
{ {
_LeagueId = uint32(prop); _LeagueId = uint32(prop);
buildInSceneInterface();
if (isUser()) if (isUser())
{ {

View file

@ -1174,7 +1174,7 @@ class CHandlerTell : public IActionHandler
ucstring finalMsg; ucstring finalMsg;
CChatWindow::encodeColorTag(prop.getRGBA(), finalMsg, false); 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") + ": "; finalMsg += csr + CI18N::get("youTell") + ": ";
prop.readRGBA("UI:SAVE:CHAT:COLORS:TELL"," "); prop.readRGBA("UI:SAVE:CHAT:COLORS:TELL"," ");
CChatWindow::encodeColorTag(prop.getRGBA(), finalMsg, true); CChatWindow::encodeColorTag(prop.getRGBA(), finalMsg, true);

View file

@ -2539,7 +2539,7 @@ NLMISC::CRGBA CEntityCL::getColor () const
if (isEnemy()) if (isEnemy())
{ {
if (getPvpMode()&PVP_MODE::PvpFaction) 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 else
return _PvpEnemyColor; return _PvpEnemyColor;
} }
@ -2551,8 +2551,8 @@ NLMISC::CRGBA CEntityCL::getColor () const
if (getPvpMode() & PVP_MODE::PvpFactionFlagged) if (getPvpMode() & PVP_MODE::PvpFactionFlagged)
{ {
if(isInSameLeague()) if(isInSameLeague())
return CRGBA::CRGBA(max(0, _PvpAllyColor.R-100), max(0, _PvpAllyColor.G-100), max(0, _PvpAllyColor.B-100),_PvpAllyColor.A); return 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, _PvpAllyInTeamColor.R-100), max(0, _PvpAllyInTeamColor.G-100), max(0, _PvpAllyInTeamColor.B-100),_PvpAllyInTeamColor.A);
} }
else else
{ {
@ -2572,7 +2572,7 @@ NLMISC::CRGBA CEntityCL::getColor () const
// neutral // neutral
if (isInSameLeague()) 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()) if (isInSameGuild())
return _GuildColor; return _GuildColor;

View file

@ -148,7 +148,7 @@ CViewBase *CChatTextManager::createMsgText(const ucstring &cstMsg, NLMISC::CRGBA
vt->setMultiLineSpace(getTextMultiLineSpace()); vt->setMultiLineSpace(getTextMultiLineSpace());
vt->setModulateGlobalColor(false); vt->setModulateGlobalColor(false);
ucstring cur_time = ""; ucstring cur_time;
static CCDBNodeLeaf* node = CInterfaceManager::getInstance()->getDbProp("UI:SAVE:CHAT:SHOW_TIMES_IN_CHAT_CB", false); static CCDBNodeLeaf* node = CInterfaceManager::getInstance()->getDbProp("UI:SAVE:CHAT:SHOW_TIMES_IN_CHAT_CB", false);
if (node) if (node)
{ {

View file

@ -473,7 +473,7 @@ void CChatWindow::displayLocalPlayerTell(const ucstring &receiver, const ucstrin
prop.readRGBA("UI:SAVE:CHAT:COLORS:SPEAKER"," "); prop.readRGBA("UI:SAVE:CHAT:COLORS:SPEAKER"," ");
encodeColorTag(prop.getRGBA(), finalMsg, false); 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") + ": "; finalMsg += csr + CI18N::get("youTell") + ": ";
prop.readRGBA("UI:SAVE:CHAT:COLORS:TELL"," "); prop.readRGBA("UI:SAVE:CHAT:COLORS:TELL"," ");
encodeColorTag(prop.getRGBA(), finalMsg, true); encodeColorTag(prop.getRGBA(), finalMsg, true);

View file

@ -587,6 +587,12 @@ bool CGroupCompasMenu::parse(xmlNodePtr cur, CInterfaceGroup *parent /*=NULL*/)
return true; 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 // Called when we activate the compass menu
void CGroupCompasMenu::setActive (bool state) void CGroupCompasMenu::setActive (bool state)
@ -803,6 +809,10 @@ void CGroupCompasMenu::setActive (bool state)
} }
// User landmarks // User landmarks
uint nbUserLandMarks = std::min( uint(currCont->UserLandMarks.size()), CContinent::getMaxNbUserLandMarks() ); 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) for(k = 0; k < nbUserLandMarks; ++k)
{ {
if (currCont->UserLandMarks[k].Type < CUserLandMark::UserLandMarkTypeCount) if (currCont->UserLandMarks[k].Type < CUserLandMark::UserLandMarkTypeCount)

View file

@ -74,6 +74,7 @@ void addWebIGParams (string &url, bool trustedDomain)
string("shardid=") + toString(CharacterHomeSessionId) + string("shardid=") + toString(CharacterHomeSessionId) +
string("&name=") + UserEntity->getLoginName().toUtf8() + string("&name=") + UserEntity->getLoginName().toUtf8() +
string("&lang=") + CI18N::getCurrentLanguageCode() + string("&lang=") + CI18N::getCurrentLanguageCode() +
string("&datasetid=") + toString(UserEntity->dataSetId()) +
string("&ig=1"); string("&ig=1");
if (trustedDomain) if (trustedDomain)
{ {
@ -82,7 +83,6 @@ void addWebIGParams (string &url, bool trustedDomain)
if (url.find('$') != string::npos) if (url.find('$') != string::npos)
{ {
strFindReplace(url, "$datasetid$", toString(UserEntity->dataSetId()));
strFindReplace(url, "$gender$", GSGENDER::toString(UserEntity->getGender())); strFindReplace(url, "$gender$", GSGENDER::toString(UserEntity->getGender()));
strFindReplace(url, "$displayName$", UserEntity->getDisplayName().toString()); strFindReplace(url, "$displayName$", UserEntity->getDisplayName().toString());
strFindReplace(url, "$posx$", toString(UserEntity->pos().x)); strFindReplace(url, "$posx$", toString(UserEntity->pos().x));

View file

@ -1944,10 +1944,10 @@ static sint32 getTargetSlotNr()
const char *dbPath = "UI:VARIABLES:TARGET:SLOT"; const char *dbPath = "UI:VARIABLES:TARGET:SLOT";
CInterfaceManager *im = CInterfaceManager::getInstance(); CInterfaceManager *im = CInterfaceManager::getInstance();
CCDBNodeLeaf *node = im->getDbProp(dbPath, false); CCDBNodeLeaf *node = im->getDbProp(dbPath, false);
if (!node) return NULL; if (!node) return 0;
if ((uint8) node->getValue32() == (uint8) CLFECOMMON::INVALID_SLOT) if ((uint8) node->getValue32() == (uint8) CLFECOMMON::INVALID_SLOT)
{ {
return NULL; return 0;
} }
return node->getValue32(); return node->getValue32();
} }
@ -2032,7 +2032,7 @@ sint32 CLuaIHM::getTargetLevel()
ucstring CLuaIHM::getTargetSheet() ucstring CLuaIHM::getTargetSheet()
{ {
CEntityCL *target = getTargetEntity(); CEntityCL *target = getTargetEntity();
if (!target) return ""; if (!target) return ucstring();
return target->sheetId().toString(); return target->sheetId().toString();
} }

View file

@ -468,7 +468,7 @@ void CPeopleList::displayLocalPlayerTell(const ucstring &receiver, uint index, c
return; return;
} }
ucstring csr = CHARACTER_TITLE::isCsrTitle(UserEntity->getTitleRaw()) ? "(CSR) " : ""; ucstring csr(CHARACTER_TITLE::isCsrTitle(UserEntity->getTitleRaw()) ? "(CSR) " : "");
ucstring finalMsg = csr + CI18N::get("youTell") + ": " + msg; ucstring finalMsg = csr + CI18N::get("youTell") + ": " + msg;
// display msg with good color // display msg with good color
CInterfaceProperty prop; CInterfaceProperty prop;
@ -935,7 +935,7 @@ class CHandlerContactEntry : public IActionHandler
ucstring final; ucstring final;
CChatWindow::encodeColorTag(prop.getRGBA(), final, false); 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")+": "; final += csr + CI18N::get("youTell")+": ";
prop.readRGBA("UI:SAVE:CHAT:COLORS:TELL"," "); prop.readRGBA("UI:SAVE:CHAT:COLORS:TELL"," ");
CChatWindow::encodeColorTag(prop.getRGBA(), final, true); CChatWindow::encodeColorTag(prop.getRGBA(), final, true);

View file

@ -107,7 +107,7 @@ public:
// Get the Localized Title name // Get the Localized Title name
static const ucchar *getTitleLocalizedName(const std::string &titleId, bool women); static const ucchar *getTitleLocalizedName(const std::string &titleId, bool women);
static std::vector<ucstring> CStringManagerClient::getTitleInfos(const std::string &titleId, bool women); static std::vector<ucstring> getTitleInfos(const std::string &titleId, bool women);
// Get the Localized name of a classification type // Get the Localized name of a classification type
static const ucchar *getClassificationTypeLocalizedName(EGSPD::CClassificationType::TClassificationType type); static const ucchar *getClassificationTypeLocalizedName(EGSPD::CClassificationType::TClassificationType type);