From e8e75d05c026c67c078aa919aee8dd6b9ae6caab Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 22 Sep 2012 23:53:46 +0200 Subject: [PATCH] Changed: Synchronization with SVN --- .../data/gamedev/interfaces_v3/help.xml | 2 +- .../gamedev/interfaces_v3/out_v2_select.xml | 4 +- .../interface_v3/group_in_scene_user_info.cpp | 16 ++++-- .../client/src/interface_v3/guild_manager.cpp | 51 ++++++++++--------- 4 files changed, 43 insertions(+), 30 deletions(-) diff --git a/code/ryzom/client/data/gamedev/interfaces_v3/help.xml b/code/ryzom/client/data/gamedev/interfaces_v3/help.xml index 4d74b184c..39cfb1af4 100644 --- a/code/ryzom/client/data/gamedev/interfaces_v3/help.xml +++ b/code/ryzom/client/data/gamedev/interfaces_v3/help.xml @@ -864,7 +864,7 @@ + value="http://app.ryzom.com/ticket_system/index.php?mode=load" /> - - + + getDisplayName(); ucstring entityTitle = entity->getTitle(); + // For some NPC's the name is empty and only a title is given, + // in that case, treat the title as the name. + if (entityName.empty()) + { + entityName = entityTitle; + entityTitle.clear(); + } + ucstring entityTag1 = entity->getTag(1); ucstring entityTag2 = entity->getTag(2); ucstring entityTag3 = entity->getTag(3); @@ -174,7 +182,7 @@ CGroupInSceneUserInfo *CGroupInSceneUserInfo::build (CEntityCL *entity) bars[i]= false; name= !entityName.empty() && pIM->getDbProp(dbEntry+"NPCNAME")->getValueBool(); symbol= false; - title= (entityName.empty() && pIM->getDbProp(dbEntry+"NPCNAME")->getValueBool()) || pIM->getDbProp(dbEntry+"NPCTITLE")->getValueBool(); + title= !entityTitle.empty() && pIM->getDbProp(dbEntry+"NPCTITLE")->getValueBool(); guildName= false; templateName = "in_scene_user_info"; rpTags = (!entityTag1.empty() || !entityTag2.empty() || !entityTag3.empty() || !entityTag4.empty() ) && pIM->getDbProp(dbEntry+"RPTAGS")->getValueBool(); @@ -511,13 +519,13 @@ CGroupInSceneUserInfo *CGroupInSceneUserInfo::build (CEntityCL *entity) { info->delView(logoOver); } - //leftGroup->setW( leftGroup->getW() + 42 ); + leftGroup->setW( leftGroup->getW() + 42 ); } else { info->delView(logo); info->delView(logoOver); - //leftGroup->setX(0); + leftGroup->setX(0); } leftGroup->invalidateCoords(); } @@ -887,6 +895,8 @@ void CGroupInSceneUserInfo::updateDynamicData () _Name->setColor(entityColor); _Name->setModulateGlobalColor(false); ucstring entityName = _Entity->getDisplayName(); + if (entityName.empty()) + entityName = _Entity->getTitle(); if (pPlayer != NULL) if (pPlayer->isAFK()) entityName += CI18N::get("uiAFK"); diff --git a/code/ryzom/client/src/interface_v3/guild_manager.cpp b/code/ryzom/client/src/interface_v3/guild_manager.cpp index d1f8a2c9f..dce9558f9 100644 --- a/code/ryzom/client/src/interface_v3/guild_manager.cpp +++ b/code/ryzom/client/src/interface_v3/guild_manager.cpp @@ -362,44 +362,47 @@ void CGuildManager::update() if (node && node->getValueBool()) { // See if we need to show any online/offline messages - static vector CachedGuildMembers; + static map CachedGuildMembers; ucstring onlineMessage = CI18N::get("uiPlayerOnline"); ucstring offlineMessage = CI18N::get("uiPlayerOffline"); for (uint i = 0; i < _GuildMembers.size(); ++i) { - for (uint j = 0; j < CachedGuildMembers.size(); ++j) + map::const_iterator it = CachedGuildMembers.find(_GuildMembers[i].Name); + if ( it != CachedGuildMembers.end() ) { - // 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) + if ( (*it).second.Online == _GuildMembers[i].Online) { - ucstring msg = (_GuildMembers[i].Online != ccs_offline) ? onlineMessage : offlineMessage; - strFindReplace(msg, "%s", _GuildMembers[i].Name); - string cat = getStringCategory(msg, msg); - map::const_iterator it; - NLMISC::CRGBA col = CRGBA::Yellow; - it = ClientCfg.SystemInfoParams.find(toLower(cat)); - if (it != ClientCfg.SystemInfoParams.end()) - { - col = it->second.Color; - } - bool dummy; - PeopleInterraction.ChatInput.Guild.displayMessage(msg, col, 2, &dummy); - break; + // Online status not changed for this member + continue; } + + if ( (*it).second.Online != ccs_offline && _GuildMembers[i].Online != ccs_offline) + { + // Not from offline, or to offline, so don't show anything + continue; + } + + ucstring msg = (_GuildMembers[i].Online != ccs_offline) ? onlineMessage : offlineMessage; + strFindReplace(msg, "%s", _GuildMembers[i].Name); + string cat = getStringCategory(msg, msg); + map::const_iterator it; + NLMISC::CRGBA col = CRGBA::Yellow; + it = ClientCfg.SystemInfoParams.find(toLower(cat)); + if (it != ClientCfg.SystemInfoParams.end()) + { + col = it->second.Color; + } + bool dummy; + PeopleInterraction.ChatInput.Guild.displayMessage(msg, col, 2, &dummy); + break; } } CachedGuildMembers.clear(); for (uint i = 0; i < _GuildMembers.size(); ++i) { - CachedGuildMembers.push_back(_GuildMembers[i]); + CachedGuildMembers.insert(make_pair(_GuildMembers[i].Name, _GuildMembers[i])); } }