mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-17 04:51:48 +00:00
Changed: #1433 Merge changes from patch 1.13
This commit is contained in:
parent
f5feca0430
commit
19fa9a35dc
6 changed files with 59 additions and 39 deletions
|
@ -251,8 +251,10 @@ CInterfaceGroup *CInterfaceHelp::activateNextWindow(CDBCtrlSheet *elt, sint forc
|
||||||
CDBCtrlSheet *ctrlSrc= elt;
|
CDBCtrlSheet *ctrlSrc= elt;
|
||||||
// get the ctrl sheet in this help window.
|
// get the ctrl sheet in this help window.
|
||||||
CDBCtrlSheet *ctrlDst= dynamic_cast<CDBCtrlSheet*>(group->getCtrl(":ctrl_slot"));
|
CDBCtrlSheet *ctrlDst= dynamic_cast<CDBCtrlSheet*>(group->getCtrl(":ctrl_slot"));
|
||||||
|
bool showSlotAndCreator = false;
|
||||||
if(ctrlDst && ctrlSrc)
|
if(ctrlDst && ctrlSrc)
|
||||||
{
|
{
|
||||||
|
showSlotAndCreator = true;
|
||||||
// if same Aspect
|
// if same Aspect
|
||||||
if( ctrlSrc->sameAspect(ctrlDst) )
|
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
|
// If some free window possible, search which to take
|
||||||
|
|
|
@ -370,8 +370,14 @@ void CGuildManager::update()
|
||||||
{
|
{
|
||||||
for (uint j = 0; j < CachedGuildMembers.size(); ++j)
|
for (uint j = 0; j < CachedGuildMembers.size(); ++j)
|
||||||
{
|
{
|
||||||
if ((CachedGuildMembers[j].Name == _GuildMembers[i].Name) &&
|
// Status change is from offline to online/abroad online or vice versa.
|
||||||
(CachedGuildMembers[j].Online != _GuildMembers[i].Online))
|
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;
|
ucstring msg = (_GuildMembers[i].Online != ccs_offline) ? onlineMessage : offlineMessage;
|
||||||
strFindReplace(msg, "%s", _GuildMembers[i].Name);
|
strFindReplace(msg, "%s", _GuildMembers[i].Name);
|
||||||
|
|
|
@ -1420,11 +1420,9 @@ void CPeopleInterraction::updateContactInList(uint32 contactId, TCharConnectionS
|
||||||
sint index = FriendList.getIndexFromContactId(contactId);
|
sint index = FriendList.getIndexFromContactId(contactId);
|
||||||
if (index != -1)
|
if (index != -1)
|
||||||
{
|
{
|
||||||
|
// Only do work if online status has changed
|
||||||
if (FriendList.getOnline(index) != online)
|
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);
|
CCDBNodeLeaf* node = CInterfaceManager::getInstance()->getDbProp("UI:SAVE:CHAT:SHOW_ONLINE_OFFLINE_NOTIFICATIONS_CB", false);
|
||||||
if (node && node->getValueBool())
|
if (node && node->getValueBool())
|
||||||
{
|
{
|
||||||
|
@ -1441,8 +1439,11 @@ void CPeopleInterraction::updateContactInList(uint32 contactId, TCharConnectionS
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Player is not in my guild
|
TCharConnectionState prevState = FriendList.getOnline(index);
|
||||||
if (bOnlyFriend)
|
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");
|
ucstring msg = (online != ccs_offline) ? CI18N::get("uiPlayerOnline") : CI18N::get("uiPlayerOffline");
|
||||||
strFindReplace(msg, "%s", FriendList.getName(index));
|
strFindReplace(msg, "%s", FriendList.getName(index));
|
||||||
|
@ -1458,6 +1459,8 @@ void CPeopleInterraction::updateContactInList(uint32 contactId, TCharConnectionS
|
||||||
PeopleInterraction.ChatInput.AroundMe.displayMessage(msg, col, 2, &dummy);
|
PeopleInterraction.ChatInput.AroundMe.displayMessage(msg, col, 2, &dummy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FriendList.setOnline(index, online);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1605,29 +1605,38 @@ const ucchar *CStringManagerClient::getSPhraseLocalizedDescription(NLMISC::CShee
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
const ucchar *CStringManagerClient::getTitleLocalizedName(const std::string &titleId, bool women)
|
const ucchar *CStringManagerClient::getTitleLocalizedName(const std::string &titleId, bool women)
|
||||||
{
|
{
|
||||||
const ucchar * infos = getSpecialWord(titleId, women);
|
vector<ucstring> listInfos = getTitleInfos(titleId, women);
|
||||||
ucstring infosUC(infos);
|
|
||||||
|
|
||||||
vector<ucstring> listInfos;
|
if (listInfos.size() > 0)
|
||||||
splitUCString(infosUC, ucstring("#"), listInfos);
|
{
|
||||||
if (listInfos.empty())
|
_TitleWords.push_back(listInfos[0]);
|
||||||
return infos;
|
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)
|
vector<ucstring> CStringManagerClient::getTitleInfos(const std::string &titleId, bool women)
|
||||||
{
|
{
|
||||||
const ucchar * infos = getSpecialWord(titleId, women);
|
ucstring infosUC;
|
||||||
ucstring infosUC(infos);
|
infosUC.fromUtf8(titleId);
|
||||||
|
|
||||||
vector<ucstring> listInfos;
|
vector<ucstring> listInfos;
|
||||||
splitUCString(infosUC, 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;
|
return listInfos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
const ucchar *CStringManagerClient::getClassificationTypeLocalizedName(EGSPD::CClassificationType::TClassificationType type)
|
const ucchar *CStringManagerClient::getClassificationTypeLocalizedName(EGSPD::CClassificationType::TClassificationType type)
|
||||||
{
|
{
|
||||||
|
|
|
@ -108,6 +108,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> 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);
|
||||||
|
|
||||||
|
|
|
@ -11423,7 +11423,7 @@ void CCharacter::setBerserkFlag(bool isBerserk)
|
||||||
}
|
}
|
||||||
else
|
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 )
|
if( percentTmp < 0 )
|
||||||
percent = 0;
|
percent = 0;
|
||||||
else
|
else
|
||||||
|
@ -14846,16 +14846,12 @@ void CCharacter::addRoomAccessToPlayer(const NLMISC::CEntityId &id)
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
void CCharacter::addPlayerToFriendList(const NLMISC::CEntityId &id)
|
void CCharacter::addPlayerToFriendList(const NLMISC::CEntityId &id)
|
||||||
{
|
{
|
||||||
/*// if player not found
|
// if player not found
|
||||||
if (id == CEntityId::Unknown || PlayerManager.getChar(id)==NULL)
|
if (id == CEntityId::Unknown)
|
||||||
{
|
{
|
||||||
if ( ! (IShardUnifierEvent::getInstance() && IShardUnifierEvent::getInstance()->isCharacterOnlineAbroad(id)))
|
PHRASE_UTILITIES::sendDynamicSystemMessage( _EntityRowId, "OPERATION_OFFLINE");
|
||||||
{
|
return;
|
||||||
// player not found => message
|
}
|
||||||
PHRASE_UTILITIES::sendDynamicSystemMessage( _EntityRowId, "OPERATION_OFFLINE");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
// check not already in list
|
// check not already in list
|
||||||
const uint size = (uint)_FriendsList.size();
|
const uint size = (uint)_FriendsList.size();
|
||||||
|
@ -14923,15 +14919,11 @@ void CCharacter::addPlayerToFriendList(const NLMISC::CEntityId &id)
|
||||||
void CCharacter::addPlayerToLeagueList(const NLMISC::CEntityId &id)
|
void CCharacter::addPlayerToLeagueList(const NLMISC::CEntityId &id)
|
||||||
{
|
{
|
||||||
// if player not found
|
// if player not found
|
||||||
/*if (id == CEntityId::Unknown || PlayerManager.getChar(id)==NULL)
|
if (id == CEntityId::Unknown)
|
||||||
{
|
{
|
||||||
if ( ! (IShardUnifierEvent::getInstance() && IShardUnifierEvent::getInstance()->isCharacterOnlineAbroad(id)))
|
PHRASE_UTILITIES::sendDynamicSystemMessage( _EntityRowId, "OPERATION_OFFLINE");
|
||||||
{
|
return;
|
||||||
// player not found => message
|
}
|
||||||
PHRASE_UTILITIES::sendDynamicSystemMessage( _EntityRowId, "OPERATION_OFFLINE");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
// check not already in list
|
// check not already in list
|
||||||
const uint size = _LeagueList.size();
|
const uint size = _LeagueList.size();
|
||||||
|
@ -14972,7 +14964,7 @@ void CCharacter::addPlayerToLeagueList(const NLMISC::CEntityId &id)
|
||||||
|
|
||||||
if ( ! GenericMsgManager.pushNameToStream( "TEAM:CONTACT_CREATE", bms) )
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue