コード例 #1
0
ファイル: llfloaterbump.cpp プロジェクト: N3X15/Luna-Viewer
void LLFloaterBump::add(LLScrollListCtrl* list, LLMeanCollisionData* mcd)
{
	if (!sInstance)
	{
		new LLFloaterBump();
	}
	
	if (mcd->mFirstName.empty() || list->getItemCount() >= 20)
	{
		return;
	}

	// There's only one internal tm buffer.
	struct tm* timep;
	
	// Convert to Pacific, based on server's opinion of whether
	// it's daylight savings time there.
	timep = utc_to_pacific_time(mcd->mTime, gPacificDaylightTime);
	
	std::string time = llformat("[%d:%02d]", timep->tm_hour, timep->tm_min);

	std::string action;
	switch(mcd->mType)
	{
	case MEAN_BUMP:
		action = "bump";
		break;
	case MEAN_LLPUSHOBJECT:
		action = "llpushobject";
		break;
	case MEAN_SELECTED_OBJECT_COLLIDE:
		action = "selected_object_collide";
		break;
	case MEAN_SCRIPTED_OBJECT_COLLIDE:
		action = "scripted_object_collide";
		break;
	case MEAN_PHYSICAL_OBJECT_COLLIDE:
		action = "physical_object_collide";
		break;
	default:
		llinfos << "LLFloaterBump::add unknown mean collision type "
			<< mcd->mType << llendl;
		return;
	}

	// All above action strings are in XML file
	LLUIString text = sInstance->getString(action);
	text.setArg("[TIME]", time);
	text.setArg("[FIRST]", mcd->mFirstName);
	text.setArg("[LAST]", mcd->mLastName);

	LLSD row;
	row["id"] = mcd->mPerp;
	row["columns"][0]["value"] = text;
	row["columns"][0]["font"] = "SansSerifBold";
	list->addElement(row);

	//@hook OnBump(action,time,firstname,lastname) You were bumped by something
	LUA_CALL("OnBump") << action << time << mcd->mFirstName << mcd->mLastName << LUA_END;
}
コード例 #2
0
ファイル: llfloaternewim.cpp プロジェクト: Nora28/imprudence
void LLFloaterNewIM::addAgent(const LLUUID& uuid, void* data, BOOL online)
{
	std::string first, last;
	gCacheName->getName(uuid, first, last);
	LLUIString fullname = sNameFormat;
	fullname.setArg("[FIRST]", first);
	fullname.setArg("[LAST]", last);

	LLSD row;
	row["id"] = uuid;
	row["columns"][0]["value"] = fullname;
	row["columns"][0]["width"] = COL_1_WIDTH;
	row["columns"][0]["font"] = "SANSSERIF";
	row["columns"][0]["font-style"] = online ? "BOLD" : "NORMAL";
	row["columns"][1]["value"] = online ? sOnlineDescriptor : "";
	row["columns"][1]["font"] = "SANSSERIF";
	row["columns"][1]["font-style"] = "BOLD";
	LLScrollListItem* itemp = mSelectionList->addElement(row);
	itemp->setUserdata(data);

	if (mSelectionList->getFirstSelectedIndex() == -1)
	{
		mSelectionList->selectFirstItem();
	}
}
コード例 #3
0
ファイル: llimview.cpp プロジェクト: Xara/Luna-Viewer
void LLIMMgr::noteOfflineUsers(
	LLFloaterIMPanel* floater,
	const LLDynamicArray<LLUUID>& ids)
{
	S32 count = ids.count();
	if(count == 0)
	{
		floater->addHistoryLine(sOnlyUserMessage, gSavedSettings.getColor4("SystemChatColor"));
	}
	else
	{
		const LLRelationship* info = NULL;
		LLAvatarTracker& at = LLAvatarTracker::instance();
		for(S32 i = 0; i < count; ++i)
		{
			info = at.getBuddyInfo(ids.get(i));
			std::string first, last;
			if(info && !info->isOnline()
			   && gCacheName->getName(ids.get(i), first, last))
			{
				LLUIString offline = sOfflineMessage;
				offline.setArg("[FIRST]", first);
				offline.setArg("[LAST]", last);
				floater->addHistoryLine(offline, gSavedSettings.getColor4("SystemChatColor"));
				floater->setOffline();
			}
		}
	}
}
コード例 #4
0
void LLFloaterBump::add(LLScrollListCtrl* list, LLMeanCollisionData* mcd)
{
	if (mcd->mFullName.empty() || list->getItemCount() >= 20)
	{
		return;
	}

	// There's only one internal tm buffer.
	// Convert to Pacific, based on server's opinion of whether
	// it's daylight savings time there.
	tm* timep = utc_to_pacific_time(mcd->mTime, gPacificDaylightTime);
	
	std::string timeStr = llformat("[%d:%02d]", timep->tm_hour, timep->tm_min);

	std::string action;
	switch(mcd->mType)
	{
	case MEAN_BUMP:
		action = "bump";
		break;
	case MEAN_LLPUSHOBJECT:
		action = "llpushobject";
		break;
	case MEAN_SELECTED_OBJECT_COLLIDE:
		action = "selected_object_collide";
		break;
	case MEAN_SCRIPTED_OBJECT_COLLIDE:
		action = "scripted_object_collide";
		break;
	case MEAN_PHYSICAL_OBJECT_COLLIDE:
		action = "physical_object_collide";
		break;
	default:
		LL_INFOS() << "LLFloaterBump::add unknown mean collision type "
			<< mcd->mType << LL_ENDL;
		return;
	}

	// All above action strings are in XML file
	LLUIString text = getString(action);
	text.setArg("[TIME]", timeStr);
	text.setArg("[NAME]", mcd->mFullName);

	LLSD row;
	row["id"] = mcd->mPerp;
	row["columns"][0]["value"] = text;
	row["columns"][0]["font"] = "SansSerifBold";
	list->addElement(row);
}
コード例 #5
0
void LLFloaterBump::add(LLScrollListCtrl* list, LLMeanCollisionData* mcd)
{
	if (mcd->mFirstName.empty() || list->getItemCount() >= 20)
	{
		return;
	}

	std::string timeStr = getString ("timeStr");
	LLSD substitution;

	substitution["datetime"] = (S32) mcd->mTime;
	LLStringUtil::format (timeStr, substitution);

	std::string action;
	switch(mcd->mType)
	{
	case MEAN_BUMP:
		action = "bump";
		break;
	case MEAN_LLPUSHOBJECT:
		action = "llpushobject";
		break;
	case MEAN_SELECTED_OBJECT_COLLIDE:
		action = "selected_object_collide";
		break;
	case MEAN_SCRIPTED_OBJECT_COLLIDE:
		action = "scripted_object_collide";
		break;
	case MEAN_PHYSICAL_OBJECT_COLLIDE:
		action = "physical_object_collide";
		break;
	default:
		llinfos << "LLFloaterBump::add unknown mean collision type "
			<< mcd->mType << llendl;
		return;
	}

	// All above action strings are in XML file
	LLUIString text = getString(action);
	text.setArg("[TIME]", timeStr);
	text.setArg("[FIRST]", mcd->mFirstName);
	text.setArg("[LAST]", mcd->mLastName);

	LLSD row;
	row["id"] = mcd->mPerp;
	row["columns"][0]["value"] = text;
	row["columns"][0]["font"] = "SansSerifBold";
	list->addElement(row);
}
コード例 #6
0
void LLCurrencyUIManager::buy(const std::string& buy_msg)
{
	if (!canBuy())
	{
		return;
	}

	LLUIString msg = buy_msg;
	msg.setArg("[LINDENS]", llformat("%d", impl.mUserCurrencyBuy));
	msg.setArg("[LOCALAMOUNT]", getLocalEstimate());
	LLConfirmationManager::confirm(impl.mSiteConfirm,
								   msg,
								   impl,
								   &LLCurrencyUIManager::Impl::startCurrencyBuy);
}
コード例 #7
0
void LLCurrencyUIManager::buy(const std::string& buy_msg)
{
	if (!canBuy())
	{
		return;
	}

	LLUIString msg = buy_msg;
	msg.setArg("[LINDENS]", llformat("%d", impl.mUserCurrencyBuy));
	msg.setArg("[USD]", llformat("%#.2f", impl.mSiteCurrencyEstimatedCost / 100.0));
	LLConfirmationManager::confirm(impl.mSiteConfirm,
								   msg,
								   impl,
								   &LLCurrencyUIManager::Impl::startCurrencyBuy);
}
コード例 #8
0
BOOL LLFloaterLandHoldings::postBuild()
{
	childSetAction("Teleport", onClickTeleport, this);
	childSetAction("Show on Map", onClickMap, this);

	// Grant list
	childSetDoubleClickCallback("grant list", onGrantList);
	childSetUserData("grant list", this);

	LLCtrlListInterface *list = childGetListInterface("grant list");
	if (!list) return TRUE;

	S32 count = gAgent.mGroups.count();
	for(S32 i = 0; i < count; ++i)
	{
		LLUUID id(gAgent.mGroups.get(i).mID);

		LLSD element;
		element["id"] = id;
		element["columns"][0]["column"] = "group";
		element["columns"][0]["value"] = gAgent.mGroups.get(i).mName;
		element["columns"][0]["font"] = "SANSSERIF";

		LLUIString areastr = getString("area_string");
		areastr.setArg("[AREA]", llformat("%d", gAgent.mGroups.get(i).mContribution));
		element["columns"][1]["column"] = "area";
		element["columns"][1]["value"] = areastr;
		element["columns"][1]["font"] = "SANSSERIF";

		list->addElement(element, ADD_SORTED);
	}

	return TRUE;
}
コード例 #9
0
BOOL LLFloaterLandHoldings::postBuild()
{
	childSetAction("Teleport", onClickTeleport, this);
	childSetAction("Show on Map", onClickMap, this);

	// Grant list
	LLScrollListCtrl* grant_list = getChild<LLScrollListCtrl>("grant list");
	grant_list->sortByColumnIndex(0, TRUE);
	grant_list->setDoubleClickCallback(onGrantList, this);

	S32 count = gAgent.mGroups.count();
	for(S32 i = 0; i < count; ++i)
	{
		LLUUID id(gAgent.mGroups.get(i).mID);

		LLSD element;
		element["id"] = id;
		element["columns"][0]["column"] = "group";
		element["columns"][0]["value"] = gAgent.mGroups.get(i).mName;
		element["columns"][0]["font"] = "SANSSERIF";

		LLUIString areastr = getString("area_string");
		areastr.setArg("[AREA]", llformat("%d", gAgent.mGroups.get(i).mContribution));
		element["columns"][1]["column"] = "area";
		element["columns"][1]["value"] = areastr;
		element["columns"][1]["font"] = "SANSSERIF";

		grant_list->addElement(element);
	}
	
	center();
	
	return TRUE;
}
コード例 #10
0
void LLIMMgr::noteOfflineUsers(
	LLFloaterIMPanel* floater,
	const std::vector<LLUUID>& ids)
{
	S32 count = ids.size();
	if(count == 0)
	{
		const std::string& only_user = LLTrans::getString("only_user_message");
		floater->addHistoryLine(only_user, gSavedSettings.getColor4("SystemChatColor"));
	}
	else
	{
		const LLRelationship* info = NULL;
		LLAvatarTracker& at = LLAvatarTracker::instance();
		for(S32 i = 0; i < count; ++i)
		{
			info = at.getBuddyInfo(ids.at(i));
			std::string full_name;
			if (info
				&& !info->isOnline()
				&& LLAvatarNameCache::getNSName(ids.at(i), full_name))
			{
				LLUIString offline = LLTrans::getString("offline_message");
				offline.setArg("[NAME]", full_name);
				floater->addHistoryLine(offline, gSavedSettings.getColor4("SystemChatColor"));
			}
		}
	}
}
コード例 #11
0
void LLCurrencyUIManager::buy(const std::string& buy_msg)
{
	if (!canBuy())
	{
		return;
	}

	LLUIString msg = buy_msg;
	msg.setArg("[LINDENS]", llformat("%d", impl.mUserCurrencyBuy));
	msg.setArg("[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol());
	msg.setArg("[USD]", llformat("%#.2f", impl.mSiteCurrencyEstimatedCost / 100.0));
	msg.setArg("[REALCURRENCY]", gHippoGridManager->getConnectedGrid()->getRealCurrencySymbol());
	LLConfirmationManager::confirm(impl.mSiteConfirm,
								   msg,
								   impl,
								   &LLCurrencyUIManager::Impl::startCurrencyBuy);
}
コード例 #12
0
std::string LLIMMgr::getOfflineMessage(const LLUUID& id)
{
	std::string full_name;
	if (LLAvatarNameCache::getNSName(id, full_name))
	{
		LLUIString offline = LLTrans::getString("offline_message");
		offline.setArg("[NAME]", full_name);
		return offline;
	}
	return LLStringUtil::null;
}
コード例 #13
0
BOOL LLFloaterJoystick::postBuild()
{		
	F32 range = gSavedSettings.getBOOL("Cursor3D") ? 1024.f : 2.f;
	LLUIString axis = getString("Axis");
	LLUIString joystick = getString("JoystickMonitor");

	// use this child to get relative positioning info; we'll place the
	// joystick monitor on its right, vertically aligned to it.
	LLView* child = getChild<LLView>("FlycamAxisScale1");
	LLRect rect;

	if (child)
	{
		LLRect r = child->getRect();
		rect = LLRect(350, r.mTop, r.mRight + 200, 0);
	}


	LLStatView::Params params;
	params.name("axis values");
	params.rect(rect);
	params.show_label(true);
	params.label(joystick);
	mAxisStatsView = LLUICtrlFactory::create<LLStatView>(params);

	for (U32 i = 0; i < 6; i++)
	{
		axis.setArg("[NUM]", llformat("%d", i));
		std::string stat_name(llformat("Joystick axis %d", i));
		mAxisStats[i] = new LLStat(stat_name,4);
		mAxisStatsBar[i] = mAxisStatsView->addStat(axis, mAxisStats[i]);
		mAxisStatsBar[i]->mMinBar = -range;
		mAxisStatsBar[i]->mMaxBar = range;
		mAxisStatsBar[i]->mLabelSpacing = range * 0.5f;
		mAxisStatsBar[i]->mTickSpacing = range * 0.25f;			
	}

	addChild(mAxisStatsView);
	
	mCheckJoystickEnabled = getChild<LLCheckBoxCtrl>("enable_joystick");
	childSetCommitCallback("enable_joystick",onCommitJoystickEnabled,this);
	mCheckFlycamEnabled = getChild<LLCheckBoxCtrl>("JoystickFlycamEnabled");
	childSetCommitCallback("JoystickFlycamEnabled",onCommitJoystickEnabled,this);

	getChild<LLUICtrl>("Default")->setCommitCallback(boost::bind(&LLFloaterJoystick::onClickDefault, this, _2));
	childSetAction("cancel_btn", onClickCancel, this);
	childSetAction("ok_btn", onClickOK, this);

	refresh();
	return TRUE;
}
コード例 #14
0
ファイル: llcameraview.cpp プロジェクト: Boy/netbook
// static
void LLFloaterJoystick::show(void*)
{
	if (sInstance)
	{
		sInstance->open();	/*Flawfinder: ignore*/
	}
	else
	{
		LLFloaterJoystick* floater = new LLFloaterJoystick();

		gUICtrlFactory->buildFloater(floater, "floater_joystick.xml");
		F32 range = gSavedSettings.getBOOL("FlycamAbsolute") ? 1024.f : 2.f;
		LLUIString axis = floater->childGetText("Axis");
		LLUIString joystick = floater->childGetText("JoystickMonitor");

		LLView* child = floater->getChildByName("ZoomLabel");
		LLRect rect;

		if (child)
		{
			LLRect r = child->getRect();
			LLRect f = floater->getRect();
			rect = LLRect(150, r.mTop, r.mRight, 0);
		}

		floater->mAxisStats = new LLStatView("axis values", joystick, "", rect);
		floater->mAxisStats->setDisplayChildren(TRUE);

		for (U32 i = 0; i < 6; i++)
		{
			axis.setArg("[NUM]", llformat("%d", i));
			floater->mAxis[i] = new LLStat(4);
			floater->mAxisBar[i] = floater->mAxisStats->addStat(axis, floater->mAxis[i]);
			floater->mAxisBar[i]->mMinBar = -range;
			floater->mAxisBar[i]->mMaxBar = range;
			floater->mAxisBar[i]->mLabelSpacing = range * 0.5f;
			floater->mAxisBar[i]->mTickSpacing = range * 0.25f;			
		}

		

		floater->addChild(floater->mAxisStats);
		floater->open();	/*Flawfinder: ignore*/
	}
}
コード例 #15
0
void LLPanelClassifiedInfo::processProperties(void* data, EAvatarProcessorType type)
{
	if(APT_CLASSIFIED_INFO == type)
	{
		LLAvatarClassifiedInfo* c_info = static_cast<LLAvatarClassifiedInfo*>(data);
		if(c_info && getClassifiedId() == c_info->classified_id)
		{
			setClassifiedName(c_info->name);
			setDescription(c_info->description);
			setSnapshotId(c_info->snapshot_id);
			setParcelId(c_info->parcel_id);
			setPosGlobal(c_info->pos_global);
			setSimName(c_info->sim_name);

			setClassifiedLocation(createLocationText(c_info->parcel_name, c_info->sim_name, c_info->pos_global));
			getChild<LLUICtrl>("category")->setValue(LLClassifiedInfo::sCategories[c_info->category]);

			static std::string mature_str = getString("type_mature");
			static std::string pg_str = getString("type_pg");
			static LLUIString  price_str = getString("l$_price");
			static std::string date_fmt = getString("date_fmt");

			bool mature = is_cf_mature(c_info->flags);
			getChild<LLUICtrl>("content_type")->setValue(mature ? mature_str : pg_str);
			getChild<LLIconCtrl>("content_type_moderate")->setVisible(mature);
			getChild<LLIconCtrl>("content_type_general")->setVisible(!mature);

			std::string auto_renew_str = is_cf_auto_renew(c_info->flags) ? 
				getString("auto_renew_on") : getString("auto_renew_off");
			getChild<LLUICtrl>("auto_renew")->setValue(auto_renew_str);

			price_str.setArg("[PRICE]", llformat("%d", c_info->price_for_listing));
			getChild<LLUICtrl>("price_for_listing")->setValue(LLSD(price_str));

			std::string date_str = date_fmt;
			LLStringUtil::format(date_str, LLSD().with("datetime", (S32) c_info->creation_date));
			getChild<LLUICtrl>("creation_date")->setValue(date_str);

			setInfoLoaded(true);
		}
	}
}
コード例 #16
0
BOOL LLFloaterLandHoldings::postBuild()
{
	childSetAction("Teleport", onClickTeleport, this);
	childSetAction("Show on Map", onClickMap, this);

	// Grant list
	LLScrollListCtrl *grant_list = getChild<LLScrollListCtrl>("grant list");
	grant_list->setDoubleClickCallback(boost::bind(LLGroupActions::show, boost::bind(&LLScrollListCtrl::getCurrentID, grant_list)));

	LLCtrlListInterface *list = grant_list->getListInterface();
	if (!list) return TRUE;

	S32 count = gAgent.mGroups.size();
	for(S32 i = 0; i < count; ++i)
	{
		LLUUID id(gAgent.mGroups.at(i).mID);

		LLSD element;
		element["id"] = id;
		element["columns"][0]["column"] = "group";
		element["columns"][0]["value"] = gAgent.mGroups.at(i).mName;
		element["columns"][0]["font"] = "SANSSERIF";

		LLUIString areastr = getString("area_string");
		areastr.setArg("[AREA]", llformat("%d", gAgent.mGroups.at(i).mContribution));
		element["columns"][1]["column"] = "area";
		element["columns"][1]["value"] = areastr;
		element["columns"][1]["font"] = "SANSSERIF";

		list->addElement(element, ADD_SORTED);
	}

	center();

	return TRUE;
}
コード例 #17
0
ファイル: llpanelplace.cpp プロジェクト: HyangZhao/NaCl-main
//virtual
void LLPanelPlace::processParcelInfo(const LLParcelData& parcel_data)
{
	mAuctionID = parcel_data.auction_id;

	if(parcel_data.snapshot_id.notNull())
	{
		mSnapshotCtrl->setImageAssetID(parcel_data.snapshot_id);
	}

	if( !parcel_data.name.empty()
	   && mNameEditor && mNameEditor->getText().empty())
	{
		mNameEditor->setText(parcel_data.name);
	}

	if( !parcel_data.desc.empty()
		&& mDescEditor && mDescEditor->getText().empty())
	{
		mDescEditor->setText(parcel_data.desc);
	}

	std::string info_text;
	LLUIString traffic = getString("traffic_text");
	traffic.setArg("[TRAFFIC]", llformat("%d ", (int)parcel_data.dwell));
	info_text = traffic;
	LLUIString area = getString("area_text");
	area.setArg("[AREA]", llformat("%d", parcel_data.actual_area));
	info_text += area;
	if (parcel_data.flags & DFQ_FOR_SALE)
	{
		LLUIString forsale = getString("forsale_text");
		forsale.setArg("[PRICE]", llformat("%d", parcel_data.sale_price));
		info_text += forsale;
	}
	if (parcel_data.auction_id != 0)
	{
		LLUIString auction = getString("auction_text");
		auction.setArg("[ID]", llformat("%010d ", parcel_data.auction_id));
		info_text += auction;
	}
	if (mInfoEditor)
	{
		mInfoEditor->setText(info_text);
	}

	// HACK: Flag 0x2 == adult region,
	// Flag 0x1 == mature region, otherwise assume PG
	std::string rating = LLViewerRegion::accessToString(SIM_ACCESS_PG);
	if (parcel_data.flags & 0x2)
	{
		rating = LLViewerRegion::accessToString(SIM_ACCESS_ADULT);
	}
	else if (parcel_data.flags & 0x1)
	{
		rating = LLViewerRegion::accessToString(SIM_ACCESS_MATURE);
	}

	// Just use given region position for display
	S32 region_x = llround(mPosRegion.mV[0]);
	S32 region_y = llround(mPosRegion.mV[1]);
	S32 region_z = llround(mPosRegion.mV[2]);

	// If the region position is zero, grab position from the global
	if(mPosRegion.isExactlyZero())
	{
		region_x = llround(parcel_data.global_x) % REGION_WIDTH_UNITS;
		region_y = llround(parcel_data.global_y) % REGION_WIDTH_UNITS;
		region_z = llround(parcel_data.global_z);
	}

	if(mPosGlobal.isExactlyZero())
	{
		mPosGlobal.setVec(parcel_data.global_x, parcel_data.global_y, parcel_data.global_z);
	}

	std::string location = llformat("%s %d, %d, %d (%s)",
									parcel_data.sim_name.c_str(), region_x, region_y, region_z, rating.c_str());
	if (mLocationDisplay)
	{
		mLocationDisplay->setText(location);
	}

	BOOL show_auction = (parcel_data.auction_id > 0);
	mAuctionBtn->setVisible(show_auction);
}
コード例 #18
0
void LLFloaterTopObjects::handleReply(LLMessageSystem *msg, void** data)
{
	U32 request_flags;
	U32 total_count;

	msg->getU32Fast(_PREHASH_RequestData, _PREHASH_RequestFlags, request_flags);
	msg->getU32Fast(_PREHASH_RequestData, _PREHASH_TotalObjectCount, total_count);
	msg->getU32Fast(_PREHASH_RequestData, _PREHASH_ReportType, mCurrentMode);

	LLScrollListCtrl *list = getChild<LLScrollListCtrl>("objects_list");

	S32 block_count = msg->getNumberOfBlocks("ReportData");
	for (S32 block = 0; block < block_count; ++block)
	{
		U32 task_local_id;
		U32 time_stamp = 0;
		LLUUID task_id;
		F32 location_x, location_y, location_z;
		F32 score;
		std::string name_buf;
		std::string owner_buf;
		F32 mono_score = 0.f;
		bool have_extended_data = false;
		S32 public_urls = 0;

		msg->getU32Fast(_PREHASH_ReportData, _PREHASH_TaskLocalID, task_local_id, block);
		msg->getUUIDFast(_PREHASH_ReportData, _PREHASH_TaskID, task_id, block);
		msg->getF32Fast(_PREHASH_ReportData, _PREHASH_LocationX, location_x, block);
		msg->getF32Fast(_PREHASH_ReportData, _PREHASH_LocationY, location_y, block);
		msg->getF32Fast(_PREHASH_ReportData, _PREHASH_LocationZ, location_z, block);
		msg->getF32Fast(_PREHASH_ReportData, _PREHASH_Score, score, block);
		msg->getStringFast(_PREHASH_ReportData, _PREHASH_TaskName, name_buf, block);
		msg->getStringFast(_PREHASH_ReportData, _PREHASH_OwnerName, owner_buf, block);
		if(msg->has("DataExtended"))
		{
			have_extended_data = true;
			msg->getU32("DataExtended", "TimeStamp", time_stamp, block);
			msg->getF32("DataExtended", "MonoScore", mono_score, block);
			msg->getS32(_PREHASH_ReportData,"PublicURLs",public_urls,block);
		}

		LLSD element;

		element["id"] = task_id;

		LLSD columns;
		columns[0]["column"] = "score";
		columns[0]["value"] = llformat("%0.3f", score);
		columns[0]["font"] = "SANSSERIF";
		
		columns[1]["column"] = "name";
		columns[1]["value"] = name_buf;
		columns[1]["font"] = "SANSSERIF";
		
		// Owner names can have trailing spaces sent from server
		LLStringUtil::trim(owner_buf);
		
		if (LLAvatarNameCache::useDisplayNames())
		{
			// ...convert hard-coded name from server to a username
			// *TODO: Send owner_id from server and look up display name
			owner_buf = LLCacheName::buildUsername(owner_buf);
		}
		else
		{
			// ...just strip out legacy "Resident" name
			owner_buf = LLCacheName::cleanFullName(owner_buf);
		}
		columns[2]["column"] = "owner";
		columns[2]["value"] = owner_buf;
		columns[2]["font"] = "SANSSERIF";

		columns[3]["column"] = "location";
		columns[3]["value"] = llformat("<%0.1f,%0.1f,%0.1f>", location_x, location_y, location_z);
		columns[3]["font"] = "SANSSERIF";
		columns[4]["column"] = "time";
		columns[4]["value"] = formatted_time((time_t)time_stamp);
		columns[4]["font"] = "SANSSERIF";

		if (mCurrentMode == STAT_REPORT_TOP_SCRIPTS
			&& have_extended_data)
		{
			columns[5]["column"] = "mono_time";
			columns[5]["value"] = llformat("%0.3f", mono_score);
			columns[5]["font"] = "SANSSERIF";

			columns[6]["column"] = "URLs";
			columns[6]["value"] = llformat("%d", public_urls);
			columns[6]["font"] = "SANSSERIF";
		}
		element["columns"] = columns;
		list->addElement(element);
		
		mObjectListData.append(element);
		mObjectListIDs.push_back(task_id);

		mtotalScore += score;
	}

	if (total_count == 0 && list->getItemCount() == 0)
	{
		list->setCommentText(getString("none_descriptor"));
	}
	else
	{
		list->selectFirstItem();
	}

	if (mCurrentMode == STAT_REPORT_TOP_SCRIPTS)
	{
		setTitle(getString("top_scripts_title"));
		list->setColumnLabel("score", getString("scripts_score_label"));
		list->setColumnLabel("mono_time", getString("scripts_mono_time_label"));
		
		LLUIString format = getString("top_scripts_text");
		format.setArg("[COUNT]", llformat("%d", total_count));
		format.setArg("[TIME]", llformat("%0.1f", mtotalScore));
		getChild<LLUICtrl>("title_text")->setValue(LLSD(format));
	}
	else
	{
		setTitle(getString("top_colliders_title"));
		list->setColumnLabel("score", getString("colliders_score_label"));
		list->setColumnLabel("mono_time", "");
		LLUIString format = getString("top_colliders_text");
		format.setArg("[COUNT]", llformat("%d", total_count));
		getChild<LLUICtrl>("title_text")->setValue(LLSD(format));
	}
}
コード例 #19
0
//static 
void LLPanelPlace::processParcelInfoReply(LLMessageSystem *msg, void **)
{
	LLUUID	agent_id;
	LLUUID	parcel_id;
	LLUUID	owner_id;
	std::string	name;
	std::string	desc;
	S32		actual_area;
	S32		billable_area;
	U8		flags;
	F32		global_x;
	F32		global_y;
	F32		global_z;
	std::string	sim_name;
	LLUUID	snapshot_id;
	F32		dwell;
	S32		sale_price;
	S32		auction_id;

	msg->getUUID("AgentData", "AgentID", agent_id );
	msg->getUUID("Data", "ParcelID", parcel_id);

	// look up all panels which have this avatar
	for (panel_list_t::iterator iter = sAllPanels.begin(); iter != sAllPanels.end(); ++iter)
	{
		LLPanelPlace* self = *iter;
		if (self->mParcelID != parcel_id)
		{
			continue;
		}

		msg->getUUID	("Data", "OwnerID", owner_id);
		msg->getString	("Data", "Name", name);
		msg->getString	("Data", "Desc", desc);
		msg->getS32		("Data", "ActualArea", actual_area);
		msg->getS32		("Data", "BillableArea", billable_area);
		msg->getU8		("Data", "Flags", flags);
		msg->getF32		("Data", "GlobalX", global_x);
		msg->getF32		("Data", "GlobalY", global_y);
		msg->getF32		("Data", "GlobalZ", global_z);
		msg->getString	("Data", "SimName", sim_name);
		msg->getUUID	("Data", "SnapshotID", snapshot_id);
		msg->getF32		("Data", "Dwell", dwell);
		msg->getS32		("Data", "SalePrice", sale_price);
		msg->getS32		("Data", "AuctionID", auction_id);


		self->mAuctionID = auction_id;

		if(snapshot_id.notNull())
		{
			self->mSnapshotCtrl->setImageAssetID(snapshot_id);
		}

		// Only assign the name and description if they are not empty and there is not a 
		// value present (passed in from a landmark, e.g.)

		if( !name.empty()
		   && self->mNameEditor && self->mNameEditor->getText().empty())
		{
			self->mNameEditor->setText(name);
		}

		if( !desc.empty()
			&& self->mDescEditor && self->mDescEditor->getText().empty())
		{
			self->mDescEditor->setText(desc);
		}

		std::string info_text;
		LLUIString traffic = self->getString("traffic_text");
		traffic.setArg("[TRAFFIC]", llformat("%d ", (int)dwell));
		info_text = traffic;
		LLUIString area = self->getString("area_text");
		area.setArg("[AREA]", llformat("%d", actual_area));
		info_text += area;
		if (flags & DFQ_FOR_SALE)
		{
			LLUIString forsale = self->getString("forsale_text");
			forsale.setArg("[PRICE]", llformat("%d", sale_price));
			info_text += forsale;
		}
		if (auction_id != 0)
		{
			LLUIString auction = self->getString("auction_text");
			auction.setArg("[ID]", llformat("%010d ", auction_id));
			info_text += auction;
		}
		if (self->mInfoEditor)
		{
			self->mInfoEditor->setText(info_text);
		}

		// HACK: Flag 0x1 == mature region, otherwise assume PG
		std::string rating = LLViewerRegion::accessToString(SIM_ACCESS_PG);
		if (flags & 0x1)
		{
			rating = LLViewerRegion::accessToString(SIM_ACCESS_MATURE);
		}

		// Just use given region position for display
		S32 region_x = llround(self->mPosRegion.mV[0]);
		S32 region_y = llround(self->mPosRegion.mV[1]);
		S32 region_z = llround(self->mPosRegion.mV[2]);

		// If the region position is zero, grab position from the global
		if(self->mPosRegion.isExactlyZero())
		{
			region_x = llround(global_x) % REGION_WIDTH_UNITS;
			region_y = llround(global_y) % REGION_WIDTH_UNITS;
			region_z = llround(global_z);
		}

		if(self->mPosGlobal.isExactlyZero())
		{
			self->mPosGlobal.setVec(global_x, global_y, global_z);
		}

		std::string location = llformat("%s %d, %d, %d (%s)",
										sim_name.c_str(), region_x, region_y, region_z, rating.c_str());
		if (self->mLocationEditor)
		{
			self->mLocationEditor->setText(location);
		}

		BOOL show_auction = (auction_id > 0);
		self->mAuctionBtn->setVisible(show_auction);
	}
}
コード例 #20
0
// static
void LLPanelClassifiedInfo::setClickThrough(
	const LLUUID& classified_id,
	S32 teleport,
	S32 map,
	S32 profile,
	bool from_new_table)
{
	LL_INFOS() << "Click-through data for classified " << classified_id << " arrived: ["
			<< teleport << ", " << map << ", " << profile << "] ("
			<< (from_new_table ? "new" : "old") << ")" << LL_ENDL;

	for (panel_list_t::iterator iter = sAllPanels.begin(); iter != sAllPanels.end(); ++iter)
	{
		LLPanelClassifiedInfo* self = *iter;
		if (self->getClassifiedId() != classified_id)
		{
			continue;
		}

		// *HACK: Skip LLPanelClassifiedEdit instances: they don't display clicks data.
		// Those instances should not be in the list at all.
		if (typeid(*self) != typeid(LLPanelClassifiedInfo))
		{
			continue;
		}

		LL_INFOS() << "Updating classified info panel" << LL_ENDL;

		// We need to check to see if the data came from the new stat_table 
		// or the old classified table. We also need to cache the data from 
		// the two separate sources so as to display the aggregate totals.

		if (from_new_table)
		{
			self->mTeleportClicksNew = teleport;
			self->mMapClicksNew = map;
			self->mProfileClicksNew = profile;
		}
		else
		{
			self->mTeleportClicksOld = teleport;
			self->mMapClicksOld = map;
			self->mProfileClicksOld = profile;
		}

		static LLUIString ct_str = self->getString("click_through_text_fmt");

		ct_str.setArg("[TELEPORT]",	llformat("%d", self->mTeleportClicksNew + self->mTeleportClicksOld));
		ct_str.setArg("[MAP]",		llformat("%d", self->mMapClicksNew + self->mMapClicksOld));
		ct_str.setArg("[PROFILE]",	llformat("%d", self->mProfileClicksNew + self->mProfileClicksOld));

		self->getChild<LLUICtrl>("click_through_text")->setValue(ct_str.getString());
		// *HACK: remove this when there is enough room for click stats in the info panel
		self->getChildView("click_through_text")->setToolTip(ct_str.getString());  

		LL_INFOS() << "teleport: " << llformat("%d", self->mTeleportClicksNew + self->mTeleportClicksOld)
				<< ", map: "    << llformat("%d", self->mMapClicksNew + self->mMapClicksOld)
				<< ", profile: " << llformat("%d", self->mProfileClicksNew + self->mProfileClicksOld)
				<< LL_ENDL;
	}
}
コード例 #21
0
// static
void LLFloaterBuy::show(const LLSaleInfo& sale_info)
{
	LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection();

	if (selection->getRootObjectCount() != 1)
	{
		LLNotificationsUtil::add("BuyOneObjectOnly");
		return;
	}
	
	LLFloaterBuy* floater = LLFloaterReg::showTypedInstance<LLFloaterBuy>("buy_object");
	if (!floater)
		return;
	
	// Clean up the lists...
	floater->reset();
	floater->mSaleInfo = sale_info;
	floater->mObjectSelection = LLSelectMgr::getInstance()->getEditSelection();
	
	LLSelectNode* node = selection->getFirstRootNode();
	if (!node)
		return;
	
	// Set title based on sale type
	LLUIString title;
	switch (sale_info.getSaleType())
	{
	  case LLSaleInfo::FS_ORIGINAL:
		title = floater->getString("title_buy_text");
		break;
	  case LLSaleInfo::FS_COPY:
	  default:
		title = floater->getString("title_buy_copy_text");
		break;
	}
	title.setArg("[NAME]", node->mName);
	floater->setTitle(title);

	LLUUID owner_id;
	std::string owner_name;
	BOOL owners_identical = LLSelectMgr::getInstance()->selectGetOwner(owner_id, owner_name);
	if (!owners_identical)
	{
		LLNotificationsUtil::add("BuyObjectOneOwner");
		return;
	}

	LLCtrlListInterface *object_list = floater->childGetListInterface("object_list");
	if (!object_list)
	{
		return;
	}

	// Update the display
	// Display next owner permissions
	LLSD row;

	// Compute icon for this item
	std::string icon_name = LLInventoryIcon::getIconName(LLAssetType::AT_OBJECT, 
									 LLInventoryType::IT_OBJECT);

	row["columns"][0]["column"] = "icon";
	row["columns"][0]["type"] = "icon";
	row["columns"][0]["value"] = icon_name;
	
	// Append the permissions that you will acquire (not the current
	// permissions).
	U32 next_owner_mask = node->mPermissions->getMaskNextOwner();
	std::string text = node->mName;
	if (!(next_owner_mask & PERM_COPY))
	{
		text.append(floater->getString("no_copy_text"));
	}
	if (!(next_owner_mask & PERM_MODIFY))
	{
		text.append(floater->getString("no_modify_text"));
	}
	if (!(next_owner_mask & PERM_TRANSFER))
	{
		text.append(floater->getString("no_transfer_text"));
	}

	row["columns"][1]["column"] = "text";
	row["columns"][1]["value"] = text;
	row["columns"][1]["font"] = "SANSSERIF";

	// Add after columns added so appropriate heights are correct.
	object_list->addElement(row);

	floater->getChild<LLUICtrl>("buy_text")->setTextArg("[AMOUNT]", llformat("%d", sale_info.getSalePrice()));
	floater->getChild<LLUICtrl>("buy_name_text")->setTextArg("[NAME]", owner_name);

	// Must do this after the floater is created, because
	// sometimes the inventory is already there and 
	// the callback is called immediately.
	LLViewerObject* obj = selection->getFirstRootObject();
	floater->registerVOInventoryListener(obj,NULL);
	floater->requestVOInventory();
}
コード例 #22
0
ファイル: llpanelgroupvoting.cpp プロジェクト: Boy/rainbow
void LLPanelGroupVoting::impl::setEnableVoteProposal()
{
	if (!gAgent.hasPowerInGroup(mGroupID, GP_PROPOSAL_VOTE))
		return;

	LLScrollListItem *item = mProposals->getFirstSelected();
	if (item)
	{
		std::string already_voted;
		std::string vote_cast;

		mProposalID = item->getUUID();
		
		// col 0: index id
		LLScrollListCell * proposal_cell = item->getColumn(1);
		if ( proposal_cell )
		{
			 //proposal text
			mProposalText->setText(proposal_cell->getValue().asString());
		}
		else
		{	// Something's wrong... should have some text
			mProposalText->setText(LLStringUtil::null);
		}

		proposal_cell = item->getColumn(2);
		if (proposal_cell)
		{
			//end date
			mEndDate->setText(proposal_cell->getValue().asString());
		}
		else
		{	// Something's wrong... should have some text
			mEndDate->setText(LLStringUtil::null);
		}

		// col 3: Vote Type
		proposal_cell = item->getColumn(3);
		if (proposal_cell)
		{
			//already voted
			already_voted = proposal_cell->getValue().asString();
		}
		else
		{	// Something's wrong... should have some text
			already_voted = "";
		}

		proposal_cell = item->getColumn(5);
		if (proposal_cell)
		{
			//start date
			mStartDate->setText(proposal_cell->getValue().asString());
		}
		else
		{	// Something's wrong... should have some text
			mStartDate->setText(LLStringUtil::null);
		}

		proposal_cell = item->getColumn(6);
		if (proposal_cell)
		{
			// Vote Cast
			vote_cast = proposal_cell->getValue().asString();
		}

		// col 8: Vote Initiator
		proposal_cell = item->getColumn(8);
		if (proposal_cell)
		{
			//quorum
			mQuorum->set(
				(F32)atoi(proposal_cell->getValue().asString().c_str()));
		}
		else
		{
			mQuorum->set(0);
		}

		F32 majority = 0.0f;
		proposal_cell = item->getColumn(9);
		if (proposal_cell)
		{
			//majority
			majority =
				(F32)atof(proposal_cell->getValue().asString().c_str());
		}

		if(majority == 0.0f)
		{	// Select the Simple Majority
			mMajority->setSelectedIndex(0);
		}
		else if (majority == 1.0f)
		{
			//Select Unanimous
			mMajority->setSelectedIndex(2);
		}
		else
		{
			//Select 2/3 Majority
			mMajority->setSelectedIndex(1);
		}

		if (already_voted == "Yes")
		{
			LLUIString votestr = mPanel.getString("proposals_header_voted_inst");
			votestr.setArg("[VOTE]", vote_cast);
			mPanel.childSetText("proposal_instructions", votestr.getString());

			mBtnYes->setEnabled(FALSE);
			mBtnNo->setEnabled(FALSE);
			mBtnAbstain->setEnabled(FALSE);
		}
		else
		{
			mPanel.childSetText("proposal_instructions", mPanel.getString("proposals_header_vote_inst"));

			mBtnYes->setEnabled(TRUE);
			mBtnNo->setEnabled(TRUE);
			mBtnAbstain->setEnabled(TRUE);
		}

		mPanel.childSetText("proposal_header", mPanel.getString("proposals_header_vote_txt"));
		mPanel.childSetVisible("proposal_lbl", TRUE);
		mPanel.childSetVisible("proposal_voting_lbl", FALSE);
		mProposals->setVisible(FALSE);
		mProposalText->setEnabled(FALSE);
		mProposalText->setVisible(TRUE);
		mBtnYes->setVisible(TRUE);
		mBtnNo->setVisible(TRUE);
		mBtnAbstain->setVisible(TRUE);
		mBtnSubmitProposal->setEnabled(FALSE);
		mBtnSubmitProposal->setVisible(FALSE);
		mBtnCreateProposal->setEnabled(FALSE);
		mBtnCreateProposal->setVisible(FALSE);
		mBtnCancelProposal->setEnabled(FALSE);
		mBtnCancelProposal->setVisible(FALSE);

		mBtnViewProposalItem->setEnabled(FALSE);
		mBtnViewProposalItem->setVisible(FALSE);

		mBtnViewProposalList->setEnabled(TRUE);
		mBtnViewProposalList->setVisible(TRUE);

		mQuorumLbl->setVisible(TRUE);
		mQuorum->setEnabled(FALSE);
		mQuorum->setVisible(TRUE);
		mPanel.childSetVisible("quorum_text", TRUE);

		mDurationLbl->setVisible(FALSE);
		mDuration->setEnabled(FALSE);
		mDuration->setVisible(FALSE);
		mDurationText->setVisible(FALSE);

		mMajorityLbl->setVisible(TRUE);
		mMajority->setEnabled(FALSE);
		mMajority->setVisible(TRUE);
		mStartLbl->setVisible(TRUE);
		mStartDate->setVisible(TRUE);
		mEndLbl->setVisible(TRUE);
		mEndDate->setVisible(TRUE);
	}
}
コード例 #23
0
void LLFloaterTopObjects::handleReply(LLMessageSystem *msg, void** data)
{
	U32 request_flags;
	U32 total_count;

	msg->getU32Fast(_PREHASH_RequestData, _PREHASH_RequestFlags, request_flags);
	msg->getU32Fast(_PREHASH_RequestData, _PREHASH_TotalObjectCount, total_count);
	msg->getU32Fast(_PREHASH_RequestData, _PREHASH_ReportType, mCurrentMode);

	LLScrollListCtrl *list = getChild<LLScrollListCtrl>("objects_list");
	
	S32 block_count = msg->getNumberOfBlocks("ReportData");
	for (S32 block = 0; block < block_count; ++block)
	{
		U32 task_local_id;
		U32 time_stamp = 0;
		LLUUID task_id;
		F32 location_x, location_y, location_z;
		F32 score;
		std::string name_buf;
		std::string owner_buf;
		F32 mono_score = 0.f;
		bool have_extended_data = false;
		S32 public_urls = 0;

		msg->getU32Fast(_PREHASH_ReportData, _PREHASH_TaskLocalID, task_local_id, block);
		msg->getUUIDFast(_PREHASH_ReportData, _PREHASH_TaskID, task_id, block);
		msg->getF32Fast(_PREHASH_ReportData, _PREHASH_LocationX, location_x, block);
		msg->getF32Fast(_PREHASH_ReportData, _PREHASH_LocationY, location_y, block);
		msg->getF32Fast(_PREHASH_ReportData, _PREHASH_LocationZ, location_z, block);
		msg->getF32Fast(_PREHASH_ReportData, _PREHASH_Score, score, block);
		msg->getStringFast(_PREHASH_ReportData, _PREHASH_TaskName, name_buf, block);
		msg->getStringFast(_PREHASH_ReportData, _PREHASH_OwnerName, owner_buf, block);
		if(msg->has("DataExtended"))
		{
			have_extended_data = true;
			msg->getU32("DataExtended", "TimeStamp", time_stamp, block);
			msg->getF32("DataExtended", "MonoScore", mono_score, block);
			msg->getS32(_PREHASH_ReportData,"PublicURLs",public_urls,block);
		}

		LLSD element;

		element["id"] = task_id;
		element["object_name"] = name_buf;
		element["owner_name"] = owner_buf;
		element["columns"][0]["column"] = "score";
		element["columns"][0]["value"] = llformat("%0.3f", score);
		element["columns"][0]["font"] = "SANSSERIF";
		
		element["columns"][1]["column"] = "name";
		element["columns"][1]["value"] = name_buf;
		element["columns"][1]["font"] = "SANSSERIF";
		element["columns"][2]["column"] = "owner";
		element["columns"][2]["value"] = owner_buf;
		element["columns"][2]["font"] = "SANSSERIF";
		element["columns"][3]["column"] = "location";
		element["columns"][3]["value"] = llformat("<%0.1f,%0.1f,%0.1f>", location_x, location_y, location_z);
		element["columns"][3]["font"] = "SANSSERIF";
		element["columns"][4]["column"] = "time";
		element["columns"][4]["value"] = formatted_time((time_t)time_stamp);
		element["columns"][4]["font"] = "SANSSERIF";

		if (mCurrentMode == STAT_REPORT_TOP_SCRIPTS
			&& have_extended_data)
		{
			element["columns"][5]["column"] = "mono_time";
			element["columns"][5]["value"] = llformat("%0.3f", mono_score);
			element["columns"][5]["font"] = "SANSSERIF";

			element["columns"][6]["column"] = "URLs";
			element["columns"][6]["value"] = llformat("%d", public_urls);
			element["columns"][6]["font"] = "SANSSERIF";
		}
		
		list->addElement(element);
		
		mObjectListData.append(element);
		mObjectListIDs.push_back(task_id);

		mtotalScore += score;
	}

	if (total_count == 0 && list->getItemCount() == 0)
	{
		list->addCommentText(getString("none_descriptor"));
	}
	else
	{
		list->selectFirstItem();
	}

	if (mCurrentMode == STAT_REPORT_TOP_SCRIPTS)
	{
		setTitle(getString("top_scripts_title"));
		list->setColumnLabel("score", getString("scripts_score_label"));
		list->setColumnLabel("mono_time", getString("scripts_mono_time_label"));
		
		LLUIString format = getString("top_scripts_text");
		format.setArg("[COUNT]", llformat("%d", total_count));
		format.setArg("[TIME]", llformat("%0.1f", mtotalScore));
		childSetValue("title_text", LLSD(format));
	}
	else
	{
		setTitle(getString("top_colliders_title"));
		list->setColumnLabel("score", getString("colliders_score_label"));
		list->setColumnLabel("mono_time", "");
		LLUIString format = getString("top_colliders_text");
		format.setArg("[COUNT]", llformat("%d", total_count));
		childSetValue("title_text", LLSD(format));
	}
}
コード例 #24
0
ファイル: panelradar.cpp プロジェクト: ArminW/imprudence
void PanelRadar::updateRadarDisplay()
{
	if (visibleItemsSelected())
	{
		mSelectedAvatar = mRadarList->getFirstSelected()->getUUID();
		//TODO: as we expand columns, make these numbers enums
		mSelectedDistance = mRadarList->getFirstSelected()->getColumn(1)->getValue().asReal(); 
	}
	else
	{
		mSelectedAvatar.setNull();
		mSelectedDistance = -1.0f;
	}

	S32 scroll_pos = mRadarList->getScrollPos();

	LLSD element;

	// Zap all the avie names. Zap zap zap!
	mRadarList->deleteAllItems();

	U32 chat_distance = gSavedSettings.getU32("ChatDistance");
	F32 range = gSavedSettings.getF32("NearMeRange");
	bool notify_chat = gSavedSettings.getBOOL("MiniMapNotifyChatRange");
	bool notify_sim = gSavedSettings.getBOOL("MiniMapNotifySimRange");
// [RLVa:KB] - Alternate: Imprudence-1.2.0
	if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
	{
		notify_chat = false;
		notify_sim = false;
	}
// [/RLVa:KB]

	std::map<LLUUID, PanelRadarEntry>::iterator mIt;
	for (mIt = mAvatars.begin(); mIt != mAvatars.end(); ++mIt)
	{
		PanelRadarEntry* entry = &mIt->second;

		LL_DEBUGS("Radar") << "Avatar :" << entry->getName()
						   << " Position: " << entry->getPosition()
						   << " Your Position: " << gAgent.getPositionGlobal()
						   << " Distance: " << entry->getDistance()
						   << " Status: " << entry->getStatus()
						   << " Notified: " << entry->getNotified()
						   << " Timer Seconds: " << entry->getStatusTimer().getElapsedTimeF32()
						   << LL_ENDL;

		// Check if they're in certain ranges and notify user if we've enabled that, starting with chat range
		// We round for accuracy when avs tp in
		std::string dist_string = llformat("%.1f", llround(entry->getDistance(), 0.1f));

		// Don't notify if we don't know their name. It takes a few seconds for names to load on OpenSim, anyway
		if (entry->getName() != getString("unknown_avatar"))
		{
			if (notify_sim && 
				(entry->getNotified() < RADAR_NOTIFIED_SIM))
			{
				LLViewerObject *av_obj = gObjectList.findObject(entry->getID());
				if (av_obj != NULL && av_obj->isAvatar())
				{
					LLVOAvatar* avatarp = (LLVOAvatar*)av_obj;
					if (avatarp != NULL)
					{
						if (avatarp->getRegion() == gAgent.getRegion())
						{
							LLChat chat;
							LLUIString notify = getString("entering_sim_range");
							notify.setArg("[NAME]", entry->getName());
							notify.setArg("[DISTANCE]", dist_string);
							chat.mText = notify;
							chat.mSourceType = CHAT_SOURCE_SYSTEM;
							LLFloaterChat::addChat(chat, FALSE, FALSE);
							entry->setNotified(RADAR_NOTIFIED_SIM);
						}
					}
				}
			}
			else if (notify_chat && 
					(entry->getDistance() < chat_distance) && 
					(entry->getNotified() < RADAR_NOTIFIED_CHAT))
			{
				LLChat chat;
				LLUIString notify = getString("entering_chat_range");
				notify.setArg("[NAME]", entry->getName());
				notify.setArg("[DISTANCE]", dist_string);
				chat.mText = notify;
				chat.mSourceType = CHAT_SOURCE_SYSTEM;
				LLFloaterChat::addChat(chat, FALSE, FALSE);
				entry->setNotified(RADAR_NOTIFIED_CHAT);
			}
		}

		// Only display avatars in range
		if (entry->getDistance() <= range)
		{
			// Append typing string
			std::string typing = "";
			if (entry->getStatus() == RADAR_STATUS_TYPING)
			{
				typing = getString("is_typing")+ " ";
			}

			std::string mute_text = LLMuteList::getInstance()->isMuted(entry->getID()) ? getString("is_muted") : "";
			element["id"] = entry->getID();
			element["columns"][0]["column"] = "avatar_name";
			element["columns"][0]["type"] = "text";
//			element["columns"][0]["value"] = typing + entry->getName() + " " + mute_text;
// [RLVa:KB] - Alternate: Imprudence-1.2.0
			element["columns"][0]["value"] =
				(gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
					? gRlvHandler.getAnonym(entry->getName())
					: typing + entry->getName() + " " + mute_text;
// [/RLVa:KB]
			element["columns"][1]["column"] = "avatar_distance";
			element["columns"][1]["type"] = "text";
			element["columns"][1]["value"] = dist_string+"m";

			mRadarList->addElement(element, ADD_BOTTOM);
		}
	}

	mRadarList->sortItems();
	mRadarList->setScrollPos(scroll_pos);
	if (mSelectedAvatar.notNull())
	{
		mRadarList->selectByID(mSelectedAvatar);
	}

	LLUIString av_count_string = (mRadarList->getItemCount() == 1) ? getString("avatars_in_singular") : getString("avatars_in_plural");
	av_count_string.setArg("[COUNT]", llformat("%d", mRadarList->getItemCount()));
	childSetText("avatar_count", av_count_string.getString());

	updateButtonStates();

	LL_DEBUGS("Radar") << "mSelectedAvatar: " << mSelectedAvatar.asString() << LL_ENDL;
}
コード例 #25
0
// static public
// Insert an item in the relevant region map
// returns true if item inserted, false otherwise
bool LLWorldMap::insertItem(U32 x_world, U32 y_world, std::string& name, LLUUID& uuid, U32 type, S32 extra, S32 extra2)
{
	// Create an item record for the received object
	LLItemInfo new_item((F32)x_world, (F32)y_world, name, uuid);

	// Compute a region handle based on the objects coordinates
	LLVector3d	pos((F32)x_world, (F32)y_world, 40.0);
	U64 handle = to_region_handle(pos);

	// Get the region record for that handle or NULL if we haven't browsed it yet
	LLSimInfo* siminfo = LLWorldMap::getInstance()->simInfoFromHandle(handle);
	if (siminfo == NULL)
	{
		siminfo = LLWorldMap::getInstance()->createSimInfoFromHandle(handle);
	}

	//LL_INFOS("World Map") << "Process item : type = " << type << LL_ENDL;
	switch (type)
	{
		case MAP_ITEM_TELEHUB: // telehubs
		{
			/* Merov: we are not using the hub color anymore for display so commenting that out
			// Telehub color
			U32 X = x_world / REGION_WIDTH_UNITS;
			U32 Y = y_world / REGION_WIDTH_UNITS;
			F32 red = fmod((F32)X * 0.11f, 1.f) * 0.8f;
			F32 green = fmod((F32)Y * 0.11f, 1.f) * 0.8f;
			F32 blue = fmod(1.5f * (F32)(X + Y) * 0.11f, 1.f) * 0.8f;
			F32 add_amt = (X % 2) ? 0.15f : -0.15f;
			add_amt += (Y % 2) ? -0.15f : 0.15f;
			LLColor4 color(red + add_amt, green + add_amt, blue + add_amt);
			new_item.setColor(color);
			*/
			
			// extra2 specifies whether this is an infohub or a telehub.
			if (extra2)
			{
				siminfo->insertInfoHub(new_item);
			}
			else
			{
				siminfo->insertTeleHub(new_item);
			}
			break;
		}
		case MAP_ITEM_PG_EVENT: // events
		case MAP_ITEM_MATURE_EVENT:
		case MAP_ITEM_ADULT_EVENT:
		{
			std::string timeStr = "["+ LLTrans::getString ("TimeHour")+"]:["
					                   +LLTrans::getString ("TimeMin")+"] ["
									   +LLTrans::getString ("TimeAMPM")+"]";
			LLSD substitution;
			substitution["datetime"] = (S32) extra;
			LLStringUtil::format (timeStr, substitution);				
			new_item.setTooltip(timeStr);

			// HACK: store Z in extra2
			new_item.setElevation((F64)extra2);
			if (type == MAP_ITEM_PG_EVENT)
			{
				siminfo->insertPGEvent(new_item);
			}
			else if (type == MAP_ITEM_MATURE_EVENT)
			{
				siminfo->insertMatureEvent(new_item);
			}
			else if (type == MAP_ITEM_ADULT_EVENT)
			{
				siminfo->insertAdultEvent(new_item);
			}
			break;
		}
		case MAP_ITEM_LAND_FOR_SALE:		// land for sale
		case MAP_ITEM_LAND_FOR_SALE_ADULT:	// adult land for sale 
		{
			static LLUIString tooltip_fmt = LLTrans::getString("worldmap_item_tooltip_format");
			std::string type_currency = LLGridManager::getInstance()->getCurrency();

			tooltip_fmt.setArg("[AREA]",  llformat("%d", extra));
			tooltip_fmt.setArg("[PRICE]", llformat("%d", extra2));
			tooltip_fmt.setArg("[CUR]", type_currency);
			new_item.setTooltip(tooltip_fmt.getString());

			if (type == MAP_ITEM_LAND_FOR_SALE)
			{
				siminfo->insertLandForSale(new_item);
			}
			else if (type == MAP_ITEM_LAND_FOR_SALE_ADULT)
			{
				siminfo->insertLandForSaleAdult(new_item);
			}
			break;
		}
		case MAP_ITEM_CLASSIFIED: // classifieds
		{
			//DEPRECATED: no longer used
			break;
		}
		case MAP_ITEM_AGENT_LOCATIONS: // agent locations
		{
// 				LL_INFOS("World Map") << "New Location " << new_item.mName << LL_ENDL;
			if (extra > 0)
			{
				new_item.setCount(extra);
				siminfo->insertAgentLocation(new_item);
			}
			break;
		}
		default:
			break;
	}
	return true;
}
コード例 #26
0
ファイル: llfloaterbuy.cpp プロジェクト: Xara/Meta7-Viewer
// static
void LLFloaterBuy::show(const LLSaleInfo& sale_info)
{
	LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection();

	if (selection->getRootObjectCount() != 1)
	{
		LLNotifications::instance().add("BuyOneObjectOnly");
		return;
	}

	// Create a new instance only if one doesn't exist
	if (sInstance)
	{
		// Clean up the lists...
		sInstance->reset();
	}
	else
	{
		sInstance = new LLFloaterBuy();
	}
	
	sInstance->open(); /*Flawfinder: ignore*/
	sInstance->setFocus(TRUE);
	sInstance->mSaleInfo = sale_info;
	sInstance->mObjectSelection = LLSelectMgr::getInstance()->getEditSelection();

	// Always center the dialog.  User can change the size,
	// but purchases are important and should be center screen.
	// This also avoids problems where the user resizes the application window
	// mid-session and the saved rect is off-center.
	sInstance->center();

	LLSelectNode* node = selection->getFirstRootNode();
	if (!node)
		return;

	// Set title based on sale type
	LLUIString title;
	switch (sale_info.getSaleType())
	{
	  case LLSaleInfo::FS_ORIGINAL:
		title = sInstance->getString("title_buy_text");
		break;
	  case LLSaleInfo::FS_COPY:
	  default:
		title = sInstance->getString("title_buy_copy_text");
		break;
	}
	title.setArg("[NAME]", node->mName);
	sInstance->setTitle(title);

	LLUUID owner_id;
	std::string owner_name;
	BOOL owners_identical = LLSelectMgr::getInstance()->selectGetOwner(owner_id, owner_name);
	if (!owners_identical)
	{
		LLNotifications::instance().add("BuyObjectOneOwner");
		return;
	}

	LLCtrlListInterface *object_list = sInstance->childGetListInterface("object_list");
	if (!object_list)
	{
		return;
	}

	// Update the display
	// Display next owner permissions
	LLSD row;

	// Compute icon for this item
	std::string icon_name = get_item_icon_name(LLAssetType::AT_OBJECT, 
									 LLInventoryType::IT_OBJECT,
									 0x0, FALSE);

	row["columns"][0]["column"] = "icon";
	row["columns"][0]["type"] = "icon";
	row["columns"][0]["color"] = gColors.getColor("DefaultListIcon").getValue();
	row["columns"][0]["value"] = icon_name;
	
	// Append the permissions that you will acquire (not the current
	// permissions).
	U32 next_owner_mask = node->mPermissions->getMaskNextOwner();
	std::string text = node->mName;
	if (!(next_owner_mask & PERM_COPY))
	{
		text.append(sInstance->getString("no_copy_text"));
	}
	if (!(next_owner_mask & PERM_MODIFY))
	{
		text.append(sInstance->getString("no_modify_text"));
	}
	if (!(next_owner_mask & PERM_TRANSFER))
	{
		text.append(sInstance->getString("no_transfer_text"));
	}

	row["columns"][1]["column"] = "text";
	row["columns"][1]["color"] = gColors.getColor("DefaultListText").getValue();
	row["columns"][1]["value"] = text;
	row["columns"][1]["font"] = "SANSSERIF";

	// Add after columns added so appropriate heights are correct.
	object_list->addElement(row);

	sInstance->childSetTextArg("buy_text", "[AMOUNT]", llformat("%d", sale_info.getSalePrice()));
	sInstance->childSetTextArg("buy_text", "[NAME]", owner_name);

	// Must do this after the floater is created, because
	// sometimes the inventory is already there and 
	// the callback is called immediately.
	LLViewerObject* obj = selection->getFirstRootObject();
	sInstance->registerVOInventoryListener(obj,NULL);
	sInstance->requestVOInventory();
}