void LLNearbyChatBar::displaySpeakingIndicator() { LLSpeakerMgr::speaker_list_t speaker_list; LLUUID id; id.setNull(); mSpeakerMgr->update(TRUE); mSpeakerMgr->getSpeakerList(&speaker_list, FALSE); for (LLSpeakerMgr::speaker_list_t::iterator i = speaker_list.begin(); i != speaker_list.end(); ++i) { LLPointer<LLSpeaker> s = *i; if (s->mSpeechVolume > 0 || s->mStatus == LLSpeaker::STATUS_SPEAKING) { id = s->mID; break; } } if (!id.isNull()) { mOutputMonitor->setVisible(TRUE); mOutputMonitor->setSpeakerId(id); } else { mOutputMonitor->setVisible(FALSE); } }
////////////////////////////////////////////////////////////////////////////////////////// // static void LLViewerMediaImpl::updateMovieImage(const LLUUID& uuid, BOOL active) { // IF the media image hasn't changed, do nothing if (mMovieImageID == uuid) { return; } // If we have changed media uuid, restore the old one if (!mMovieImageID.isNull()) { LLViewerImage* oldImage = LLViewerImage::getImage( mMovieImageID ); if (oldImage) { oldImage->reinit(mMovieImageHasMips); oldImage->mIsMediaTexture = FALSE; } mMovieImageID.setNull(); } // If the movie is playing, set the new media image if (active && !uuid.isNull()) { LLViewerImage* viewerImage = LLViewerImage::getImage( uuid ); if( viewerImage ) { mMovieImageID = uuid; // Can't use mipmaps for movies because they don't update the full image mMovieImageHasMips = viewerImage->getUseMipMaps(); viewerImage->reinit(FALSE); viewerImage->mIsMediaTexture = TRUE; } } }
void NearbyVoiceMonitor::draw() { LLSpeakerMgr::speaker_list_t speaker_list; LLUUID id; BOOL draw=FALSE; id.setNull(); mSpeakerMgr->update(TRUE); mSpeakerMgr->getSpeakerList(&speaker_list, FALSE); for (LLSpeakerMgr::speaker_list_t::iterator i = speaker_list.begin(); i != speaker_list.end(); ++i) { LLPointer<LLSpeaker> s = *i; if (s->mSpeechVolume > 0 || s->mStatus == LLSpeaker::STATUS_SPEAKING) { draw=TRUE; id = s->mID; break; } } setSpeakerId(id); switchIndicator(true); // Ansa: Make sure the output monitor is visible at all times if(!mAutoHide || draw) { LLOutputMonitorCtrl::draw(); } }
void LLParcel::expireSale( U32& type, U8& flags, LLUUID& from_id, LLUUID& to_id) { mSaleTimerExpires.setTimerExpirySec(0.0); mSaleTimerExpires.stop(); setPreviousOwnerID(LLUUID::null); setPreviouslyGroupOwned(FALSE); setSellWithObjects(FALSE); type = TRANS_LAND_RELEASE; mStatus = OS_NONE; flags = pack_transaction_flags(mGroupOwned, FALSE); mAuthBuyerID.setNull(); from_id = mOwnerID; mOwnerID.setNull(); to_id.setNull(); }
void LLFloaterBuyLandUI::updateParcelInfo() { LLParcel* parcel = mParcel->getParcel(); mParcelValid = parcel && mRegion; mParcelIsForSale = false; mParcelIsGroupLand = false; mParcelGroupContribution = 0; mParcelPrice = 0; mParcelActualArea = 0; mParcelBillableArea = 0; mParcelSupportedObjects = 0; mParcelSoldWithObjects = false; mParcelLocation = ""; mParcelSnapshot.setNull(); mParcelSellerName = ""; mCanBuy = false; mCannotBuyIsError = false; if (!mParcelValid) { mCannotBuyReason = getString("no_land_selected"); return; } if (mParcel->getMultipleOwners()) { mCannotBuyReason = getString("multiple_parcels_selected"); return; } const LLUUID& parcelOwner = parcel->getOwnerID(); mIsClaim = parcel->isPublic(); if (!mIsClaim) { mParcelActualArea = parcel->getArea(); mParcelIsForSale = parcel->getForSale(); mParcelIsGroupLand = parcel->getIsGroupOwned(); mParcelPrice = mParcelIsForSale ? parcel->getSalePrice() : 0; if (mParcelIsGroupLand) { LLUUID group_id = parcel->getGroupID(); mParcelGroupContribution = gAgent.getGroupContribution(group_id); } } else { mParcelActualArea = mParcel->getClaimableArea(); mParcelIsForSale = true; mParcelPrice = mParcelActualArea * parcel->getClaimPricePerMeter(); } mParcelBillableArea = llround(mRegion->getBillableFactor() * mParcelActualArea); mParcelSupportedObjects = llround( parcel->getMaxPrimCapacity() * parcel->getParcelPrimBonus()); // Can't have more than region max tasks, regardless of parcel // object bonus factor. LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion(); if(region) { S32 max_tasks_per_region = (S32)region->getMaxTasks(); mParcelSupportedObjects = llmin( mParcelSupportedObjects, max_tasks_per_region); } mParcelSoldWithObjects = parcel->getSellWithObjects(); LLVector3 center = parcel->getCenterpoint(); mParcelLocation = llformat("%s %d,%d", mRegion->getName().c_str(), (int)center[VX], (int)center[VY] ); mParcelSnapshot = parcel->getSnapshotID(); updateNames(); bool haveEnoughCash = mParcelPrice <= mAgentCashBalance; S32 cashBuy = haveEnoughCash ? 0 : (mParcelPrice - mAgentCashBalance); mCurrency.setAmount(cashBuy, true); mCurrency.setZeroMessage(haveEnoughCash ? getString("none_needed") : LLStringUtil::null); // checks that we can buy the land if(mIsForGroup && !gAgent.hasPowerInActiveGroup(GP_LAND_DEED)) { mCannotBuyReason = getString("cant_buy_for_group"); return; } if (!mIsClaim) { const LLUUID& authorizedBuyer = parcel->getAuthorizedBuyerID(); const LLUUID buyer = gAgent.getID(); const LLUUID newOwner = mIsForGroup ? gAgent.getGroupID() : buyer; if (!mParcelIsForSale || (mParcelPrice == 0 && authorizedBuyer.isNull())) { mCannotBuyReason = getString("parcel_not_for_sale"); return; } if (parcelOwner == newOwner) { if (mIsForGroup) { mCannotBuyReason = getString("group_already_owns"); } else { mCannotBuyReason = getString("you_already_own"); } return; } if (!authorizedBuyer.isNull() && buyer != authorizedBuyer) { // Maybe the parcel is set for sale to a group we are in. bool authorized_group = gAgent.hasPowerInGroup(authorizedBuyer,GP_LAND_DEED) && gAgent.hasPowerInGroup(authorizedBuyer,GP_LAND_SET_SALE_INFO); if (!authorized_group) { mCannotBuyReason = getString("set_to_sell_to_other"); return; } } } else { if (mParcelActualArea == 0) { mCannotBuyReason = getString("no_public_land"); return; } if (mParcel->hasOthersSelected()) { // Policy: Must not have someone else's land selected mCannotBuyReason = getString("not_owned_by_you"); return; } } mCanBuy = true; }
void done() { mID.setNull(); }
//----------------------------------------------------------------------------- // Return the animation state for a given name //----------------------------------------------------------------------------- LLUUID LLAnimationLibrary::stringToAnimState( const std::string& name, BOOL allow_ids ) { std::string lower_case_name(name); LLStringUtil::toLower(lower_case_name); char *true_name = mAnimStringTable.checkString(lower_case_name.c_str()); LLUUID id; id.setNull(); if (true_name) { for (anim_map_t::iterator iter = mAnimMap.begin(); iter != mAnimMap.end(); iter++) { if (iter->second == true_name) { id = iter->first; break; } } } else if (allow_ids) { // try to convert string to LLUUID id.set(name, FALSE); } return id; }