void LLPanelGroupInvite::addUsers(std::vector<LLUUID>& agent_ids) { std::vector<std::string> names; for (S32 i = 0; i < (S32)agent_ids.size(); i++) { LLUUID agent_id = agent_ids[i]; LLVOAvatar* avatarp = gObjectList.findAvatar(agent_id); if(avatarp) { std::string fullname; LLNameValue* nvfirst = avatarp->getNVPair("FirstName"); LLNameValue* nvlast = avatarp->getNVPair("LastName"); if(nvfirst && nvlast) { fullname = std::string(nvfirst->getString()) + " " + std::string(nvlast->getString()); } if (!fullname.empty()) { names.push_back(fullname); } else { llwarns << "llPanelGroupInvite: Selected avatar has no name: " << avatarp->getID() << llendl; names.push_back("(Unknown)"); } } } mImplementation->addUsers(names, agent_ids); }
void LLPanelGroupBulk::addUsers(uuid_vec_t& agent_ids) { std::vector<std::string> names; for (S32 i = 0; i < (S32)agent_ids.size(); i++) { std::string fullname; LLUUID agent_id = agent_ids[i]; LLViewerObject* dest = gObjectList.findObject(agent_id); if(dest && dest->isAvatar()) { LLNameValue* nvfirst = dest->getNVPair("FirstName"); LLNameValue* nvlast = dest->getNVPair("LastName"); if(nvfirst && nvlast) { fullname = LLCacheName::buildFullName( nvfirst->getString(), nvlast->getString()); } if (!fullname.empty()) { names.push_back(fullname); } else { llwarns << "llPanelGroupBulk: Selected avatar has no name: " << dest->getID() << llendl; names.push_back("(Unknown)"); } } else { //looks like user try to invite offline friend //for offline avatar_id gObjectList.findObject() will return null //so we need to do this additional search in avatar tracker, see EXT-4732 //if (LLAvatarTracker::instance().isBuddy(agent_id)) // Singu Note: We may be using this from another avatar list like group profile, disregard friendship status. { LLAvatarName av_name; if (!LLAvatarNameCache::get(agent_id, &av_name)) { // actually it should happen, just in case LLAvatarNameCache::get(LLUUID(agent_id), boost::bind(&LLPanelGroupBulk::addUserCallback, this, _1, _2)); // for this special case! //when there is no cached name we should remove resident from agent_ids list to avoid breaking of sequence // removed id will be added in callback agent_ids.erase(agent_ids.begin() + i); } else { std::string name; LLAvatarNameCache::getPNSName(av_name, name); names.push_back(name); } } } } mImplementation->mListFullNotificationSent = false; mImplementation->addUsers(names, agent_ids); }
void namevalue_object_t::test<1>() { // LLNameValue() LLNameValue nValue; ensure("mName should have been NULL", nValue.mName == NULL); ensure("getTypeEnum failed",nValue.getTypeEnum() == NVT_NULL); ensure("getClassEnum failed",nValue.getClassEnum() == NVC_NULL); ensure("getSendtoEnum failed",nValue.getSendtoEnum() == NVS_NULL); LLNameValue nValue1(" SecondLife ASSET RW SIM 232324343"); }
void LLPanelGroupInvite::addUsers(std::vector<LLUUID>& agent_ids) { std::vector<std::string> names; for (S32 i = 0; i < (S32)agent_ids.size(); i++) { LLUUID agent_id = agent_ids[i]; LLViewerObject* dest = gObjectList.findObject(agent_id); std::string fullname; if(dest && dest->isAvatar()) { LLNameValue* nvfirst = dest->getNVPair("FirstName"); LLNameValue* nvlast = dest->getNVPair("LastName"); if(nvfirst && nvlast) { fullname = std::string(nvfirst->getString()) + " " + std::string(nvlast->getString()); } if (!fullname.empty()) { names.push_back(fullname); } else { llwarns << "llPanelGroupInvite: Selected avatar has no name: " << dest->getID() << llendl; names.push_back("(Unknown)"); } } else { //looks like user try to invite offline friend //for offline avatar_id gObjectList.findObject() will return null //so we need to do this additional search in avatar tracker, see EXT-4732 if (LLAvatarTracker::instance().isBuddy(agent_id)) { if (!gCacheName->getFullName(agent_id, fullname)) { // actually it should happen, just in case gCacheName->get(LLUUID(agent_id), false, boost::bind( &LLPanelGroupInvite::addUserCallback, this, _1, _2, _3)); // for this special case! //when there is no cached name we should remove resident from agent_ids list to avoid breaking of sequence // removed id will be added in callback agent_ids.erase(agent_ids.begin() + i); } else { names.push_back(fullname); } } } } mImplementation->addUsers(names, agent_ids); }
void ScriptCounter::completechk() { if(invqueries == 0) { if(reqObjectID.isNull()) { if(sstr.str() == "") { if(foo->isAvatar()) { int valid=1; LLVOAvatar *av=find_avatar_from_object(foo); LLNameValue *firstname; LLNameValue *lastname; if(!av) valid=0; else { firstname = av->getNVPair("FirstName"); lastname = av->getNVPair("LastName"); if(!firstname || !lastname) valid=0; if(valid) sstr << "Counted scripts from " << objectCount << " attachments on " << firstname->getString() << " " << lastname->getString() << ": "; } if(!valid) sstr << "Counted scripts from " << objectCount << " attachments on avatar: "; } else { if(doDelete) sstr << "Deleted scripts in " << objectCount << " objects: "; else sstr << "Counted scripts in " << objectCount << " objects: "; } F32 throttle = gSavedSettings.getF32("OutBandwidth"); if(throttle != 0.f) { gMessageSystem->mPacketRing.setOutBandwidth(throttle); gMessageSystem->mPacketRing.setUseOutThrottle(TRUE); } else { gMessageSystem->mPacketRing.setOutBandwidth(0.0); gMessageSystem->mPacketRing.setUseOutThrottle(FALSE); } } showResult(); } else countingDone=true; } }
// Assets (aka potential inventory items) can be applied to an // object in the world. We'll store that as a string name value // pair where the name encodes part of asset info, and the value // the rest. LLAssetInfo objects will be responsible for parsing // the meaning out froman LLNameValue object. See the inventory // design docs for details. Briefly: // name=<inv_type>|<uuid> // value=<creatorid>|<name>|<description>| void LLAssetInfo::setFromNameValue( const LLNameValue& nv ) { std::string str; std::string buf; std::string::size_type pos1; std::string::size_type pos2; // convert the name to useful information str.assign( nv.mName ); pos1 = str.find('|'); buf.assign( str, 0, pos1++ ); mType = LLAssetType::lookup( buf ); buf.assign( str, pos1, std::string::npos ); mUuid.set( buf ); // convert the value to useful information str.assign( nv.getAsset() ); pos1 = str.find('|'); buf.assign( str, 0, pos1++ ); mCreatorID.set( buf ); pos2 = str.find( '|', pos1 ); buf.assign( str, pos1, (pos2++) - pos1 ); setName( buf ); buf.assign( str, pos2, std::string::npos ); setDescription( buf ); llinfos << "uuid: " << mUuid << llendl; llinfos << "creator: " << mCreatorID << llendl; }
void LLPanelGroupInvite::addUsers(std::vector<LLUUID>& agent_ids) { std::vector<std::string> names; for (S32 i = 0; i < (S32)agent_ids.size(); i++) { LLUUID agent_id = agent_ids[i]; LLViewerObject* dest = gObjectList.findObject(agent_id); if(dest && dest->isAvatar()) { std::string fullname; LLStringUtil::format_map_t args; LLNameValue* nvfirst = dest->getNVPair("FirstName"); LLNameValue* nvlast = dest->getNVPair("LastName"); if(nvfirst && nvlast) { args["[FIRST]"] = nvfirst->getString(); args["[LAST]"] = nvlast->getString(); fullname = nvfirst->getString(); fullname += " "; fullname += nvlast->getString(); } if (!fullname.empty()) { names.push_back(fullname); } else { llwarns << "llPanelGroupInvite: Selected avatar has no name: " << dest->getID() << llendl; names.push_back("(Unknown)"); } } } mImplementation->addUsers(names, agent_ids); }
LLMute::LLMute(const LLUUID& id, const std::string& name, EType type, U32 flags) : mID(id), mName(name), mType(type), mFlags(flags) { // muting is done by root objects only - try to find this objects root LLViewerObject* mute_object = get_object_to_mute_from_id(id); if(mute_object && mute_object->getID() != id) { mID = mute_object->getID(); LLNameValue* firstname = mute_object->getNVPair("FirstName"); LLNameValue* lastname = mute_object->getNVPair("LastName"); if (firstname && lastname) { mName = LLCacheName::buildFullName( firstname->getString(), lastname->getString()); } mType = mute_object->isAvatar() ? AGENT : OBJECT; } }
BOOL LLToolPie::handleTooltipObject( LLViewerObject* hover_object, std::string line, std::string tooltip_msg) { if ( hover_object->isHUDAttachment() ) { // no hover tips for HUD elements, since they can obscure // what the HUD is displaying return TRUE; } if ( hover_object->isAttachment() ) { // get root of attachment then parent, which is avatar LLViewerObject* root_edit = hover_object->getRootEdit(); if (!root_edit) { // Strange parenting issue, don't show any text return TRUE; } hover_object = (LLViewerObject*)root_edit->getParent(); if (!hover_object) { // another strange parenting issue, bail out return TRUE; } } line.clear(); if (hover_object->isAvatar()) { // only show tooltip if same inspector not already open LLFloater* existing_inspector = LLFloaterReg::findInstance("inspect_avatar"); if (!existing_inspector || !existing_inspector->getVisible() || existing_inspector->getKey()["avatar_id"].asUUID() != hover_object->getID()) { std::string avatar_name; LLNameValue* firstname = hover_object->getNVPair("FirstName"); LLNameValue* lastname = hover_object->getNVPair("LastName"); if (firstname && lastname) { avatar_name = llformat("%s %s", firstname->getString(), lastname->getString()); } else { avatar_name = LLTrans::getString("TooltipPerson"); } // *HACK: We may select this object, so pretend it was clicked mPick = mHoverPick; LLInspector::Params p; p.fillFrom(LLUICtrlFactory::instance().getDefaultParams<LLInspector>()); p.message(avatar_name); p.image.name("Inspector_I"); p.click_callback(boost::bind(showAvatarInspector, hover_object->getID())); p.visible_time_near(6.f); p.visible_time_far(3.f); p.delay_time(0.35f); p.wrap(false); LLToolTipMgr::instance().show(p); } } else { // // We have hit a regular object (not an avatar or attachment) // // // Default prefs will suppress display unless the object is interactive // bool show_all_object_tips = (bool)gSavedSettings.getBOOL("ShowAllObjectHoverTip"); LLSelectNode *nodep = LLSelectMgr::getInstance()->getHoverNode(); // only show tooltip if same inspector not already open LLFloater* existing_inspector = LLFloaterReg::findInstance("inspect_object"); if (nodep && (!existing_inspector || !existing_inspector->getVisible() || existing_inspector->getKey()["object_id"].asUUID() != hover_object->getID())) { // Add price to tooltip for items on sale bool for_sale = for_sale_selection(nodep); if(for_sale) { LLStringUtil::format_map_t args; S32 price = nodep->mSaleInfo.getSalePrice(); args["[AMOUNT]"] = LLResMgr::getInstance()->getMonetaryString(price); tooltip_msg.append(LLTrans::getString("TooltipPrice", args) ); } if (nodep->mName.empty()) { tooltip_msg.append(LLTrans::getString("TooltipNoName")); } else { tooltip_msg.append( nodep->mName ); } bool has_media = false; bool is_time_based_media = false; bool is_web_based_media = false; bool is_media_playing = false; bool is_media_displaying = false; // Does this face have media? const LLTextureEntry* tep = hover_object->getTE(mHoverPick.mObjectFace); if(tep) { has_media = tep->hasMedia(); const LLMediaEntry* mep = has_media ? tep->getMediaData() : NULL; if (mep) { viewer_media_t media_impl = LLViewerMedia::getMediaImplFromTextureID(mep->getMediaID()); LLPluginClassMedia* media_plugin = NULL; if (media_impl.notNull() && (media_impl->hasMedia())) { is_media_displaying = true; //LLStringUtil::format_map_t args; media_plugin = media_impl->getMediaPlugin(); if(media_plugin) { if(media_plugin->pluginSupportsMediaTime()) { is_time_based_media = true; is_web_based_media = false; //args["[CurrentURL]"] = media_impl->getMediaURL(); is_media_playing = media_impl->isMediaPlaying(); } else { is_time_based_media = false; is_web_based_media = true; //args["[CurrentURL]"] = media_plugin->getLocation(); } //tooltip_msg.append(LLTrans::getString("CurrentURL", args)); } } } } // Avoid showing tip over media that's displaying unless it's for sale // also check the primary node since sometimes it can have an action even though // the root node doesn't bool needs_tip = (!is_media_displaying || for_sale) && (has_media || needs_tooltip(nodep) || needs_tooltip(LLSelectMgr::getInstance()->getPrimaryHoverNode())); if (show_all_object_tips || needs_tip) { // We may select this object, so pretend it was clicked mPick = mHoverPick; LLInspector::Params p; p.fillFrom(LLUICtrlFactory::instance().getDefaultParams<LLInspector>()); p.message(tooltip_msg); p.image.name("Inspector_I"); p.click_callback(boost::bind(showObjectInspector, hover_object->getID(), mHoverPick.mObjectFace)); p.time_based_media(is_time_based_media); p.web_based_media(is_web_based_media); p.media_playing(is_media_playing); p.click_playmedia_callback(boost::bind(playCurrentMedia, mHoverPick)); p.click_homepage_callback(boost::bind(VisitHomePage, mHoverPick)); p.visible_time_near(6.f); p.visible_time_far(3.f); p.delay_time(0.35f); p.wrap(false); LLToolTipMgr::instance().show(p); } } } return TRUE; }
void LLFloaterReporter::getObjectInfo(const LLUUID& object_id) { // TODO -- // 1 need to send to correct simulator if object is not // in same simulator as agent // 2 display info in widget window that gives feedback that // we have recorded the object info // 3 can pick avatar ==> might want to indicate when a picked // object is an avatar, attachment, or other category mObjectID = object_id; if (LLUUID::null != mObjectID) { // get object info for the user's benefit LLViewerObject* objectp = NULL; objectp = gObjectList.findObject( mObjectID ); if (objectp) { if ( objectp->isAttachment() ) { objectp = (LLViewerObject*)objectp->getRoot(); mObjectID = objectp->getID(); } // correct the region and position information LLViewerRegion *regionp = objectp->getRegion(); if (regionp) { getChild<LLUICtrl>("sim_field")->setValue(regionp->getName()); LLVector3d global_pos; global_pos.setVec(objectp->getPositionRegion()); setPosBox(global_pos); } if (objectp->isAvatar()) { // we have the information we need std::string object_owner; LLNameValue* firstname = objectp->getNVPair("FirstName"); LLNameValue* lastname = objectp->getNVPair("LastName"); if (firstname && lastname) { object_owner.append(firstname->getString()); object_owner.append(1, ' '); object_owner.append(lastname->getString()); } else { object_owner.append("Unknown"); } setFromAvatar(mObjectID, object_owner); } else { // we have to query the simulator for information // about this object LLMessageSystem* msg = gMessageSystem; U32 request_flags = COMPLAINT_REPORT_REQUEST; msg->newMessageFast(_PREHASH_RequestObjectPropertiesFamily); msg->nextBlockFast(_PREHASH_AgentData); msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); msg->nextBlockFast(_PREHASH_ObjectData); msg->addU32Fast(_PREHASH_RequestFlags, request_flags ); msg->addUUIDFast(_PREHASH_ObjectID, mObjectID); LLViewerRegion* regionp = objectp->getRegion(); msg->sendReliable( regionp->getHost() ); } } } }
void LLFloaterReporter::getObjectInfo(const LLUUID& object_id) { // TODO -- // 1 need to send to correct simulator if object is not // in same simulator as agent // 2 display info in widget window that gives feedback that // we have recorded the object info // 3 can pick avatar ==> might want to indicate when a picked // object is an avatar, attachment, or other category mObjectID = object_id; if (LLUUID::null != mObjectID) { // get object info for the user's benefit LLViewerObject* objectp = NULL; objectp = gObjectList.findObject( mObjectID ); if (objectp) { if ( objectp->isAttachment() ) { objectp = (LLViewerObject*)objectp->getRoot(); } // correct the region and position information LLViewerRegion *regionp = objectp->getRegion(); if (regionp) { childSetText("sim_field", regionp->getName()); // [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ) { childSetText("sim_field", RlvStrings::getString(RLV_STRING_HIDDEN_REGION)); } // [/RLVa:KB] LLVector3d global_pos; global_pos.setVec(objectp->getPositionRegion()); setPosBox(global_pos); } if (objectp->isAvatar()) { // we have the information we need std::string object_owner; LLNameValue* firstname = objectp->getNVPair("FirstName"); LLNameValue* lastname = objectp->getNVPair("LastName"); if (firstname && lastname) { object_owner.append(firstname->getString()); object_owner.append(1, ' '); object_owner.append(lastname->getString()); } else { object_owner.append("Unknown"); } childSetText("object_name", object_owner); // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RVLa-1.0.0e if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) { childSetVisible("object_name", false); // Hide the object name if the picked object represents an avataz } // [/RLVa:KB] childSetText("owner_name", object_owner); childSetText("abuser_name_edit", object_owner); mAbuserID = object_id; } else { // we have to query the simulator for information // about this object LLSelectMgr::registerObjectPropertiesFamilyRequest(mObjectID); LLMessageSystem* msg = gMessageSystem; U32 request_flags = (mReportType == BUG_REPORT) ? BUG_REPORT_REQUEST : COMPLAINT_REPORT_REQUEST; msg->newMessageFast(_PREHASH_RequestObjectPropertiesFamily); msg->nextBlockFast(_PREHASH_AgentData); msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); msg->nextBlockFast(_PREHASH_ObjectData); msg->addU32Fast(_PREHASH_RequestFlags, request_flags ); msg->addUUIDFast(_PREHASH_ObjectID, mObjectID); LLViewerRegion* regionp = objectp->getRegion(); msg->sendReliable( regionp->getHost() ); } } } }
void LLHoverView::updateText() { LLViewerObject* hit_object = getLastHoverObject(); std::string line; mText.clear(); if ( hit_object ) { if ( hit_object->isHUDAttachment() ) { // no hover tips for HUD elements, since they can obscure // what the HUD is displaying return; } if ( hit_object->isAttachment() ) { // get root of attachment then parent, which is avatar LLViewerObject* root_edit = hit_object->getRootEdit(); if (!root_edit) { // Strange parenting issue, don't show any text return; } hit_object = (LLViewerObject*)root_edit->getParent(); if (!hit_object) { // another strange parenting issue, bail out return; } } line.clear(); if (hit_object->isAvatar()) { LLNameValue* title = hit_object->getNVPair("Title"); LLNameValue* firstname = hit_object->getNVPair("FirstName"); LLNameValue* lastname = hit_object->getNVPair("LastName"); if (firstname && lastname) { // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) { line = RlvStrings::getAnonym(line.append(firstname->getString()).append(1, ' ').append(lastname->getString())); } else { // [/RLVa:KB] if (title) { line.append(title->getString()); line.append(1, ' '); } line.append(firstname->getString()); line.append(1, ' '); line.append(lastname->getString()); // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) } // [/RLVa:KB] } else { line.append(LLTrans::getString("TooltipPerson")); } mText.push_back(line); } else { // // We have hit a regular object (not an avatar or attachment) // // // Default prefs will suppress display unless the object is interactive // BOOL suppressObjectHoverDisplay = !gSavedSettings.getBOOL("ShowAllObjectHoverTip"); LLSelectNode *nodep = LLSelectMgr::getInstance()->getHoverNode();; if (nodep) { line.clear(); if (nodep->mName.empty()) { line.append(LLTrans::getString("TooltipNoName")); } else { line.append( nodep->mName ); } mText.push_back(line); if (!nodep->mDescription.empty() && nodep->mDescription != DEFAULT_DESC) { mText.push_back( nodep->mDescription ); } // Line: "Owner: James Linden" line.clear(); line.append(LLTrans::getString("TooltipOwner") + " "); if (nodep->mValid) { LLUUID owner; std::string name; if (!nodep->mPermissions->isGroupOwned()) { owner = nodep->mPermissions->getOwner(); if (LLUUID::null == owner) { line.append(LLTrans::getString("TooltipPublic")); } else if(gCacheName->getFullName(owner, name)) { // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) { name = RlvStrings::getAnonym(name); } // [/RLVa:KB] line.append(name); } else { line.append(LLTrans::getString("RetrievingData")); } } else { std::string name; owner = nodep->mPermissions->getGroup(); if (gCacheName->getGroupName(owner, name)) { line.append(name); line.append(LLTrans::getString("TooltipIsGroup")); } else { line.append(LLTrans::getString("RetrievingData")); } } } else { line.append(LLTrans::getString("RetrievingData")); } mText.push_back(line); // Build a line describing any special properties of this object. LLViewerObject *object = hit_object; LLViewerObject *parent = (LLViewerObject *)object->getParent(); if (object && (object->usePhysics() || object->flagScripted() || object->flagHandleTouch() || (parent && parent->flagHandleTouch()) || object->flagTakesMoney() || (parent && parent->flagTakesMoney()) || object->flagAllowInventoryAdd() || object->flagTemporary() || object->flagPhantom()) ) { line.clear(); if (object->flagScripted()) { line.append(LLTrans::getString("TooltipFlagScript") + " "); } if (object->usePhysics()) { line.append(LLTrans::getString("TooltipFlagPhysics") + " "); } if (object->flagHandleTouch() || (parent && parent->flagHandleTouch()) ) { line.append(LLTrans::getString("TooltipFlagTouch") + " "); suppressObjectHoverDisplay = FALSE; // Show tip } if (object->flagTakesMoney() || (parent && parent->flagTakesMoney()) ) { line.append(LLTrans::getString("TooltipFlagL$") + " "); suppressObjectHoverDisplay = FALSE; // Show tip } if (object->flagAllowInventoryAdd()) { line.append(LLTrans::getString("TooltipFlagDropInventory") + " "); suppressObjectHoverDisplay = FALSE; // Show tip } if (object->flagPhantom()) { line.append(LLTrans::getString("TooltipFlagPhantom") + " "); } if (object->flagTemporary()) { line.append(LLTrans::getString("TooltipFlagTemporary") + " "); } if (object->usePhysics() || object->flagHandleTouch() || (parent && parent->flagHandleTouch()) ) { line.append(LLTrans::getString("TooltipFlagRightClickMenu") + " "); } mText.push_back(line); } // Free to copy / For Sale: L$ line.clear(); if (nodep->mValid) { BOOL for_copy = nodep->mPermissions->getMaskEveryone() & PERM_COPY && object->permCopy(); BOOL for_sale = nodep->mSaleInfo.isForSale() && nodep->mPermissions->getMaskOwner() & PERM_TRANSFER && (nodep->mPermissions->getMaskOwner() & PERM_COPY || nodep->mSaleInfo.getSaleType() != LLSaleInfo::FS_COPY); if (for_copy) { line.append(LLTrans::getString("TooltipFreeToCopy")); suppressObjectHoverDisplay = FALSE; // Show tip } else if (for_sale) { LLStringUtil::format_map_t args; args["[AMOUNT]"] = llformat("%d", nodep->mSaleInfo.getSalePrice()); line.append(LLTrans::getString("TooltipForSaleL$", args)); suppressObjectHoverDisplay = FALSE; // Show tip } else { // Nothing if not for sale // line.append("Not for sale"); } } else { LLStringUtil::format_map_t args; args["[MESSAGE]"] = LLTrans::getString("RetrievingData"); line.append(LLTrans::getString("TooltipForSaleMsg", args)); } mText.push_back(line); } line.clear(); S32 prim_count = LLSelectMgr::getInstance()->getHoverObjects()->getObjectCount(); line.append(llformat("Prims: %d", prim_count)); mText.push_back(line); line.clear(); line.append("Position: "); LLViewerRegion *region = gAgent.getRegion(); LLVector3 position = region->getPosRegionFromGlobal(hit_object->getPositionGlobal());//regionp->getOriginAgent(); LLVector3 mypos = region->getPosRegionFromGlobal(gAgent.getPositionGlobal()); LLVector3 delta = position - mypos; F32 distance = (F32)delta.magVec(); line.append(llformat("<%.02f,%.02f,%.02f>",position.mV[0],position.mV[1],position.mV[2])); mText.push_back(line); line.clear(); line.append(llformat("Distance: %.02fm",distance)); mText.push_back(line); // If the hover tip shouldn't be shown, delete all the object text if (suppressObjectHoverDisplay) { mText.clear(); } } } else if ( mHoverLandGlobal != LLVector3d::zero ) { // // Do not show hover for land unless prefs are set to allow it. // if (!gSavedSettings.getBOOL("ShowLandHoverTip")) return; // Didn't hit an object, but since we have a land point we // must be hovering over land. LLParcel* hover_parcel = LLViewerParcelMgr::getInstance()->getHoverParcel(); LLUUID owner; S32 width = 0; S32 height = 0; if ( hover_parcel ) { owner = hover_parcel->getOwnerID(); width = S32(LLViewerParcelMgr::getInstance()->getHoverParcelWidth()); height = S32(LLViewerParcelMgr::getInstance()->getHoverParcelHeight()); } // Line: "Land" line.clear(); line.append(LLTrans::getString("TooltipLand")); if (hover_parcel) { // [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) | Added: RLVa-0.2.0b line.append( (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ? hover_parcel->getName() : RlvStrings::getString(RLV_STRING_HIDDEN_PARCEL) ); // [/RLVa:KB] //line.append(hover_parcel->getName()); } mText.push_back(line); // Line: "Owner: James Linden" line.clear(); line.append(LLTrans::getString("TooltipOwner") + " "); if ( hover_parcel ) { std::string name; if (LLUUID::null == owner) { line.append(LLTrans::getString("TooltipPublic")); } else if (hover_parcel->getIsGroupOwned()) { if (gCacheName->getGroupName(owner, name)) { line.append(name); line.append(LLTrans::getString("TooltipIsGroup")); } else { line.append(LLTrans::getString("RetrievingData")); } } else if(gCacheName->getFullName(owner, name)) { // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-0.2.0b line.append( (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ? name : RlvStrings::getAnonym(name)); // [/RLVa:KB] //line.append(name); } else { line.append(LLTrans::getString("RetrievingData")); } } else { line.append(LLTrans::getString("RetrievingData")); } mText.push_back(line); // Line: "no fly, not safe, no build" // Don't display properties for your land. This is just // confusing, because you can do anything on your own land. if ( hover_parcel && owner != gAgent.getID() ) { S32 words = 0; line.clear(); // JC - Keep this in the same order as the checkboxes // on the land info panel if ( !hover_parcel->getAllowModify() ) { if ( hover_parcel->getAllowGroupModify() ) { line.append(LLTrans::getString("TooltipFlagGroupBuild")); } else { line.append(LLTrans::getString("TooltipFlagNoBuild")); } words++; } if ( !hover_parcel->getAllowTerraform() ) { if (words) line.append(", "); line.append(LLTrans::getString("TooltipFlagNoEdit")); words++; } if ( hover_parcel->getAllowDamage() ) { if (words) line.append(", "); line.append(LLTrans::getString("TooltipFlagNotSafe")); words++; } // Maybe we should reflect the estate's block fly bit here as well? DK 12/1/04 if ( !hover_parcel->getAllowFly() ) { if (words) line.append(", "); line.append(LLTrans::getString("TooltipFlagNoFly")); words++; } if ( !hover_parcel->getAllowOtherScripts() ) { if (words) line.append(", "); if ( hover_parcel->getAllowGroupScripts() ) { line.append(LLTrans::getString("TooltipFlagGroupScripts")); } else { line.append(LLTrans::getString("TooltipFlagNoScripts")); } words++; } if (words) { mText.push_back(line); } } // Line: "Size: 1x4" // Only show for non-public land /* if ( hover_parcel && LLUUID::null != owner) { line = llformat("Size: %dx%d", width, height ); mText.push_back(line); } */ if (hover_parcel && hover_parcel->getParcelFlag(PF_FOR_SALE)) { LLStringUtil::format_map_t args; args["[AMOUNT]"] = llformat("%d", hover_parcel->getSalePrice()); line = LLTrans::getString("TooltipForSaleL$", args); mText.push_back(line); } } }
void LLHoverView::updateText() { LLViewerObject* hit_object = getLastHoverObject(); std::string line; //<singu> if (hit_object == mLastTextHoverObject && !(mLastTextHoverObjectTimer.getStarted() && mLastTextHoverObjectTimer.hasExpired())) { // mText is already up to date. return; } mLastTextHoverObject = hit_object; mLastTextHoverObjectTimer.stop(); bool retrieving_data = false; //</singu> mText.clear(); if ( hit_object ) { if ( hit_object->isHUDAttachment() ) { // no hover tips for HUD elements, since they can obscure // what the HUD is displaying return; } if ( hit_object->isAttachment() ) { // get root of attachment then parent, which is avatar LLViewerObject* root_edit = hit_object->getRootEdit(); if (!root_edit) { // Strange parenting issue, don't show any text return; } hit_object = (LLViewerObject*)root_edit->getParent(); if (!hit_object) { // another strange parenting issue, bail out return; } } line.clear(); if (hit_object->isAvatar()) { LLNameValue* title = hit_object->getNVPair("Title"); LLNameValue* firstname = hit_object->getNVPair("FirstName"); LLNameValue* lastname = hit_object->getNVPair("LastName"); if (firstname && lastname) { // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) { line = RlvStrings::getAnonym(line.append(firstname->getString()).append(1, ' ').append(lastname->getString())); } else { // [/RLVa:KB] std::string complete_name; if (!LLAvatarNameCache::getNSName(hit_object->getID(), complete_name)) complete_name = firstname->getString() + std::string(" ") + lastname->getString(); if (title) { line.append(title->getString()); line.append(1, ' '); } line += complete_name; // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) } // [/RLVa:KB] } else { line.append(LLTrans::getString("TooltipPerson")); } mText.push_back(line); } else { // // We have hit a regular object (not an avatar or attachment) // // // Default prefs will suppress display unless the object is interactive // BOOL suppressObjectHoverDisplay = !gSavedSettings.getBOOL("ShowAllObjectHoverTip"); LLSelectNode *nodep = LLSelectMgr::getInstance()->getHoverNode(); if (nodep) { line.clear(); bool for_copy = nodep->mValid && nodep->mPermissions->getMaskEveryone() & PERM_COPY && hit_object && hit_object->permCopy(); bool for_sale = nodep->mValid && for_sale_selection(nodep); bool has_media = false; bool is_time_based_media = false; bool is_web_based_media = false; bool is_media_playing = false; bool is_media_displaying = false; // Does this face have media? const LLTextureEntry* tep = hit_object ? hit_object->getTE(mLastPickInfo.mObjectFace) : NULL; if(tep) { has_media = tep->hasMedia(); const LLMediaEntry* mep = has_media ? tep->getMediaData() : NULL; if (mep) { viewer_media_t media_impl = LLViewerMedia::getMediaImplFromTextureID(mep->getMediaID()); LLPluginClassMedia* media_plugin = NULL; if (media_impl.notNull() && (media_impl->hasMedia())) { is_media_displaying = true; //LLStringUtil::format_map_t args; media_plugin = media_impl->getMediaPlugin(); if(media_plugin) { if(media_plugin->pluginSupportsMediaTime()) { is_time_based_media = true; is_web_based_media = false; //args["[CurrentURL]"] = media_impl->getMediaURL(); is_media_playing = media_impl->isMediaPlaying(); } else { is_time_based_media = false; is_web_based_media = true; //args["[CurrentURL]"] = media_plugin->getLocation(); } //tooltip_msg.append(LLTrans::getString("CurrentURL", args)); } } } } // Avoid showing tip over media that's displaying unless it's for sale // also check the primary node since sometimes it can have an action even though // the root node doesn't if(!suppressObjectHoverDisplay || !is_media_displaying || for_sale) { if (nodep->mName.empty()) { line.append(LLTrans::getString("TooltipNoName")); } else { line.append( nodep->mName ); } mText.push_back(line); if (!nodep->mDescription.empty() && nodep->mDescription != DEFAULT_DESC) { mText.push_back( nodep->mDescription ); } // Line: "Owner: James Linden" line.clear(); line.append(LLTrans::getString("TooltipOwner") + " "); if (nodep->mValid) { LLUUID owner; std::string name; if (!nodep->mPermissions->isGroupOwned()) { owner = nodep->mPermissions->getOwner(); if (LLUUID::null == owner) { line.append(LLTrans::getString("TooltipPublic")); } else if (LLAvatarNameCache::getNSName(owner, name)) { // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) { name = RlvStrings::getAnonym(name); } // [/RLVa:KB] line.append(name); } else { line.append(LLTrans::getString("RetrievingData")); retrieving_data = true; } } else { std::string name; owner = nodep->mPermissions->getGroup(); if (gCacheName->getGroupName(owner, name)) { line.append(name); line.append(LLTrans::getString("TooltipIsGroup")); } else { line.append(LLTrans::getString("RetrievingData")); retrieving_data = true; } } } else { line.append(LLTrans::getString("RetrievingData")); retrieving_data = true; } mText.push_back(line); // Build a line describing any special properties of this object. LLViewerObject *object = hit_object; LLViewerObject *parent = (LLViewerObject *)object->getParent(); if (object && (object->flagUsePhysics() || object->flagScripted() || object->flagHandleTouch() || (parent && parent->flagHandleTouch()) || object->flagTakesMoney() || (parent && parent->flagTakesMoney()) || object->flagAllowInventoryAdd() || object->flagTemporary() || object->flagPhantom()) ) { line.clear(); if (object->flagScripted()) { line.append(LLTrans::getString("TooltipFlagScript") + " "); } if (object->flagUsePhysics()) { line.append(LLTrans::getString("TooltipFlagPhysics") + " "); } if (object->flagHandleTouch() || (parent && parent->flagHandleTouch()) ) { line.append(LLTrans::getString("TooltipFlagTouch") + " "); suppressObjectHoverDisplay = FALSE; // Show tip } if (object->flagTakesMoney() || (parent && parent->flagTakesMoney()) ) { line.append(gHippoGridManager->getConnectedGrid()->getCurrencySymbol() + " "); suppressObjectHoverDisplay = FALSE; // Show tip } if (object->flagAllowInventoryAdd()) { line.append(LLTrans::getString("TooltipFlagDropInventory") + " "); suppressObjectHoverDisplay = FALSE; // Show tip } if (object->flagPhantom()) { line.append(LLTrans::getString("TooltipFlagPhantom") + " "); } if (object->flagTemporary()) { line.append(LLTrans::getString("TooltipFlagTemporary") + " "); } if (object->flagUsePhysics() || object->flagHandleTouch() || (parent && parent->flagHandleTouch()) ) { line.append(LLTrans::getString("TooltipFlagRightClickMenu") + " "); } mText.push_back(line); } // Free to copy / For Sale: L$ line.clear(); if (nodep->mValid) { if (for_copy) { line.append(LLTrans::getString("TooltipFreeToCopy")); suppressObjectHoverDisplay = FALSE; // Show tip } else if (for_sale) { LLStringUtil::format_map_t args; args["[AMOUNT]"] = llformat("%d", nodep->mSaleInfo.getSalePrice()); line.append(LLTrans::getString("TooltipForSaleL$", args)); suppressObjectHoverDisplay = FALSE; // Show tip } else { // Nothing if not for sale // line.append("Not for sale"); } } else { LLStringUtil::format_map_t args; args["[MESSAGE]"] = LLTrans::getString("RetrievingData"); retrieving_data = true; line.append(LLTrans::getString("TooltipForSaleMsg", args)); } mText.push_back(line); line.clear(); S32 prim_count = LLSelectMgr::getInstance()->getHoverObjects()->getObjectCount(); line.append(llformat("Prims: %d", prim_count)); mText.push_back(line); line.clear(); line.append("Position: "); LLViewerRegion *region = gAgent.getRegion(); LLVector3 position = region->getPosRegionFromGlobal(hit_object->getPositionGlobal());//regionp->getOriginAgent(); LLVector3 mypos = region->getPosRegionFromGlobal(gAgent.getPositionGlobal()); LLVector3 delta = position - mypos; F32 distance = (F32)delta.magVec(); line.append(llformat("<%.02f,%.02f,%.02f>",position.mV[0],position.mV[1],position.mV[2])); mText.push_back(line); line.clear(); line.append(llformat("Distance: %.02fm",distance)); mText.push_back(line); } else { suppressObjectHoverDisplay = TRUE; } // If the hover tip shouldn't be shown, delete all the object text if (suppressObjectHoverDisplay) { mText.clear(); } } } } else if ( mHoverLandGlobal != LLVector3d::zero ) { // // Do not show hover for land unless prefs are set to allow it. // if (!gSavedSettings.getBOOL("ShowLandHoverTip")) return; // Didn't hit an object, but since we have a land point we // must be hovering over land. LLParcel* hover_parcel = LLViewerParcelMgr::getInstance()->getHoverParcel(); LLUUID owner; if ( hover_parcel ) { owner = hover_parcel->getOwnerID(); } // Line: "Land" line.clear(); line.append(LLTrans::getString("TooltipLand")); if (hover_parcel) { // [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) | Added: RLVa-0.2.0b line.append( (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ? hover_parcel->getName() : RlvStrings::getString(RLV_STRING_HIDDEN_PARCEL) ); // [/RLVa:KB] //line.append(hover_parcel->getName()); } mText.push_back(line); // Line: "Owner: James Linden" line.clear(); line.append(LLTrans::getString("TooltipOwner") + " "); if ( hover_parcel ) { std::string name; if (LLUUID::null == owner) { line.append(LLTrans::getString("TooltipPublic")); } else if (hover_parcel->getIsGroupOwned()) { if (gCacheName->getGroupName(owner, name)) { line.append(name); line.append(LLTrans::getString("TooltipIsGroup")); } else { line.append(LLTrans::getString("RetrievingData")); retrieving_data = true; } } else if(gCacheName->getFullName(owner, name)) { // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-0.2.0b line.append( (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ? name : RlvStrings::getAnonym(name)); // [/RLVa:KB] //line.append(name); } else { line.append(LLTrans::getString("RetrievingData")); retrieving_data = true; } } else { line.append(LLTrans::getString("RetrievingData")); retrieving_data = true; } mText.push_back(line); // Line: "no fly, not safe, no build" // Don't display properties for your land. This is just // confusing, because you can do anything on your own land. if ( hover_parcel && owner != gAgent.getID() ) { S32 words = 0; line.clear(); // JC - Keep this in the same order as the checkboxes // on the land info panel if ( !hover_parcel->getAllowModify() ) { if ( hover_parcel->getAllowGroupModify() ) { line.append(LLTrans::getString("TooltipFlagGroupBuild")); } else { line.append(LLTrans::getString("TooltipFlagNoBuild")); } words++; } if ( !hover_parcel->getAllowTerraform() ) { if (words) line.append(", "); line.append(LLTrans::getString("TooltipFlagNoEdit")); words++; } if ( hover_parcel->getAllowDamage() ) { if (words) line.append(", "); line.append(LLTrans::getString("TooltipFlagNotSafe")); words++; } // Maybe we should reflect the estate's block fly bit here as well? DK 12/1/04 if ( !hover_parcel->getAllowFly() ) { if (words) line.append(", "); line.append(LLTrans::getString("TooltipFlagNoFly")); words++; } if ( !hover_parcel->getAllowOtherScripts() ) { if (words) line.append(", "); if ( hover_parcel->getAllowGroupScripts() ) { line.append(LLTrans::getString("TooltipFlagGroupScripts")); } else { line.append(LLTrans::getString("TooltipFlagNoScripts")); } words++; } if (words) { mText.push_back(line); } } if (hover_parcel && hover_parcel->getParcelFlag(PF_FOR_SALE)) { LLStringUtil::format_map_t args; args["[AMOUNT]"] = llformat("%d", hover_parcel->getSalePrice()); line = LLTrans::getString("TooltipForSaleL$", args); mText.push_back(line); } } //<singu> if (retrieving_data) { // Keep doing this twice per second, until all data was retrieved. mLastTextHoverObjectTimer.start(DELAY_BEFORE_REFRESH_TIP); } //</singu> }
void ScriptCounter::completechk() { std::string user_msg; llinfos << "Completechk called." << llendl; if(invqueries == 0) { llinfos << "InvQueries = 0..." << llendl; if(reqObjectID.isNull()) { llinfos << "reqObjectId is null..." << llendl; if(foo->isAvatar()) { int valid=1; LLVOAvatar *av=find_avatar_from_object(foo); LLNameValue *firstname; LLNameValue *lastname; if(!av) valid=0; else { firstname = av->getNVPair("FirstName"); lastname = av->getNVPair("LastName"); if(!firstname || !lastname) valid=0; if(valid) { user_msg = llformat("Counted %u scripts in %u attachments on %s %s.", scriptcount, objectCount, firstname->getString() , lastname->getString()); //sstr << "Counted scripts from " << << " attachments on " << firstname->getString() << " " << lastname->getString() << ": "; } } if(!valid) { user_msg = llformat("Counted %u scripts in %u attachments on selected avatar.", scriptcount, objectCount); //sstr << "Counted scripts from " << objectCount << " attachments on avatar: "; } } else { if(doDelete) { user_msg = llformat("Deleted %u scripts in %u objects.", scriptcount, objectCount); //sstr << "Deleted scripts in " << objectCount << " objects: "; } else { user_msg = llformat("Counted %u scripts in %u objects.", scriptcount, objectCount); //sstr << "Counted scripts in " << objectCount << " objects: "; } } F32 throttle = gSavedSettings.getF32("OutBandwidth"); if(throttle != 0.f) { gMessageSystem->mPacketRing.setOutBandwidth(throttle); gMessageSystem->mPacketRing.setUseOutThrottle(TRUE); } else { gMessageSystem->mPacketRing.setOutBandwidth(0.0); gMessageSystem->mPacketRing.setUseOutThrottle(FALSE); } llinfos << "Sending readout to chat..." << llendl; showResult(user_msg); } else countingDone=true; } }