Changed: #1433 Merge changes from patch 1.13

This commit is contained in:
kervala 2012-03-05 18:56:30 +01:00
parent b1ad39a21b
commit b40f9b933d
6 changed files with 59 additions and 39 deletions

View file

@ -251,8 +251,10 @@ CInterfaceGroup *CInterfaceHelp::activateNextWindow(CDBCtrlSheet *elt, sint forc
CDBCtrlSheet *ctrlSrc= elt;
// get the ctrl sheet in this help window.
CDBCtrlSheet *ctrlDst= dynamic_cast<CDBCtrlSheet*>(group->getCtrl(":ctrl_slot"));
bool showSlotAndCreator = false;
if(ctrlDst && ctrlSrc)
{
showSlotAndCreator = true;
// if same Aspect
if( ctrlSrc->sameAspect(ctrlDst) )
{
@ -277,6 +279,13 @@ CInterfaceGroup *CInterfaceHelp::activateNextWindow(CDBCtrlSheet *elt, sint forc
}
}
}
CInterfaceElement *ctrl = group->getElement(group->getId()+":content:ctrl_slot");
if (ctrl) ctrl->setActive(showSlotAndCreator);
ctrl = group->getElement(group->getId()+":content:creator");
if (ctrl) ctrl->setActive(showSlotAndCreator);
ctrl = group->getElement(group->getId()+":content:creator_header");
if (ctrl) ctrl->setActive(showSlotAndCreator);
}
// If some free window possible, search which to take

View file

@ -370,8 +370,14 @@ void CGuildManager::update()
{
for (uint j = 0; j < CachedGuildMembers.size(); ++j)
{
if ((CachedGuildMembers[j].Name == _GuildMembers[i].Name) &&
(CachedGuildMembers[j].Online != _GuildMembers[i].Online))
// Status change is from offline to online/abroad online or vice versa.
TCharConnectionState prevState = CachedGuildMembers[j].Online;
TCharConnectionState curState = _GuildMembers[i].Online;
bool showMsg = (prevState != curState) &&
(CachedGuildMembers[j].Name == _GuildMembers[i].Name) &&
(prevState == ccs_offline || curState == ccs_offline);
if (showMsg)
{
ucstring msg = (_GuildMembers[i].Online != ccs_offline) ? onlineMessage : offlineMessage;
strFindReplace(msg, "%s", _GuildMembers[i].Name);

View file

@ -1420,11 +1420,9 @@ void CPeopleInterraction::updateContactInList(uint32 contactId, TCharConnectionS
sint index = FriendList.getIndexFromContactId(contactId);
if (index != -1)
{
// Only do work if online status has changed
if (FriendList.getOnline(index) != online)
{
// Only do work if online status has changed
FriendList.setOnline(index, online);
CCDBNodeLeaf* node = CInterfaceManager::getInstance()->getDbProp("UI:SAVE:CHAT:SHOW_ONLINE_OFFLINE_NOTIFICATIONS_CB", false);
if (node && node->getValueBool())
{
@ -1441,8 +1439,11 @@ void CPeopleInterraction::updateContactInList(uint32 contactId, TCharConnectionS
}
}
// Player is not in my guild
if (bOnlyFriend)
TCharConnectionState prevState = FriendList.getOnline(index);
bool showMsg = bOnlyFriend && (prevState == ccs_offline || online == ccs_offline);
// Player is not in my guild, and the status change is from offline to online/abroad online or vice versa.
if (showMsg)
{
ucstring msg = (online != ccs_offline) ? CI18N::get("uiPlayerOnline") : CI18N::get("uiPlayerOffline");
strFindReplace(msg, "%s", FriendList.getName(index));
@ -1458,6 +1459,8 @@ void CPeopleInterraction::updateContactInList(uint32 contactId, TCharConnectionS
PeopleInterraction.ChatInput.AroundMe.displayMessage(msg, col, 2, &dummy);
}
}
FriendList.setOnline(index, online);
}
}
}

View file

@ -1605,29 +1605,38 @@ const ucchar *CStringManagerClient::getSPhraseLocalizedDescription(NLMISC::CShee
// ***************************************************************************
const ucchar *CStringManagerClient::getTitleLocalizedName(const std::string &titleId, bool women)
{
const ucchar * infos = getSpecialWord(titleId, women);
ucstring infosUC(infos);
vector<ucstring> listInfos = getTitleInfos(titleId, women);
vector<ucstring> listInfos;
splitUCString(infosUC, ucstring("#"), listInfos);
if (listInfos.empty())
return infos;
if (listInfos.size() > 0)
{
_TitleWords.push_back(listInfos[0]);
return _TitleWords.back().c_str();
}
_TitleWords.push_back(listInfos[0]);
return _TitleWords.back().c_str();
ucstring ucId;
ucId.fromUtf8(titleId);
return ucId.c_str();
}
// ***************************************************************************
vector<ucstring> CStringManagerClient::getTitleInfos(const std::string &titleId, bool women)
{
const ucchar * infos = getSpecialWord(titleId, women);
ucstring infosUC(infos);
ucstring infosUC;
infosUC.fromUtf8(titleId);
vector<ucstring> listInfos;
splitUCString(infosUC, ucstring("#"), listInfos);
if (listInfos.size() > 0)
{
string title = listInfos[0].toUtf8();
if (titleId[0] == '#')
title = "#" + title;
listInfos[0] = getSpecialWord(title, women);
}
return listInfos;
}
// ***************************************************************************
const ucchar *CStringManagerClient::getClassificationTypeLocalizedName(EGSPD::CClassificationType::TClassificationType type)
{

View file

@ -108,6 +108,7 @@ public:
// Get the Localized Title name
static const ucchar *getTitleLocalizedName(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
static const ucchar *getClassificationTypeLocalizedName(EGSPD::CClassificationType::TClassificationType type);

View file

@ -11423,7 +11423,7 @@ void CCharacter::setBerserkFlag(bool isBerserk)
}
else
{
sint8 percentTmp = sint8( (100.0 * ( target->getPhysScores()._PhysicalScores[ SCORES::hit_points ].Current ) ) / ( target->getPhysScores()._PhysicalScores[ SCORES::hit_points ].Max ) );
sint8 percentTmp = sint8( (127.0 * ( target->getPhysScores()._PhysicalScores[ SCORES::hit_points ].Current ) ) / ( target->getPhysScores()._PhysicalScores[ SCORES::hit_points ].Max ) );
if( percentTmp < 0 )
percent = 0;
else
@ -14846,16 +14846,12 @@ void CCharacter::addRoomAccessToPlayer(const NLMISC::CEntityId &id)
//--------------------------------------------------------------
void CCharacter::addPlayerToFriendList(const NLMISC::CEntityId &id)
{
/*// if player not found
if (id == CEntityId::Unknown || PlayerManager.getChar(id)==NULL)
// if player not found
if (id == CEntityId::Unknown)
{
if ( ! (IShardUnifierEvent::getInstance() && IShardUnifierEvent::getInstance()->isCharacterOnlineAbroad(id)))
{
// player not found => message
PHRASE_UTILITIES::sendDynamicSystemMessage( _EntityRowId, "OPERATION_OFFLINE");
return;
}
}*/
PHRASE_UTILITIES::sendDynamicSystemMessage( _EntityRowId, "OPERATION_OFFLINE");
return;
}
// check not already in list
const uint size = (uint)_FriendsList.size();
@ -14923,15 +14919,11 @@ void CCharacter::addPlayerToFriendList(const NLMISC::CEntityId &id)
void CCharacter::addPlayerToLeagueList(const NLMISC::CEntityId &id)
{
// if player not found
/*if (id == CEntityId::Unknown || PlayerManager.getChar(id)==NULL)
if (id == CEntityId::Unknown)
{
if ( ! (IShardUnifierEvent::getInstance() && IShardUnifierEvent::getInstance()->isCharacterOnlineAbroad(id)))
{
// player not found => message
PHRASE_UTILITIES::sendDynamicSystemMessage( _EntityRowId, "OPERATION_OFFLINE");
return;
}
}*/
PHRASE_UTILITIES::sendDynamicSystemMessage( _EntityRowId, "OPERATION_OFFLINE");
return;
}
// check not already in list
const uint size = _LeagueList.size();
@ -14972,7 +14964,7 @@ void CCharacter::addPlayerToLeagueList(const NLMISC::CEntityId &id)
if ( ! GenericMsgManager.pushNameToStream( "TEAM:CONTACT_CREATE", bms) )
{
nlwarning("<CEntityBase::addPlayerToFriendList> Msg name TEAM:CONTACT_CREATE not found");
nlwarning("<CEntityBase::addPlayerToLeagueList> Msg name TEAM:CONTACT_CREATE not found");
return;
}