当前位置: 首页>>代码示例>>C++>>正文


C++ LLFloaterIMPanel::getVisible方法代码示例

本文整理汇总了C++中LLFloaterIMPanel::getVisible方法的典型用法代码示例。如果您正苦于以下问题:C++ LLFloaterIMPanel::getVisible方法的具体用法?C++ LLFloaterIMPanel::getVisible怎么用?C++ LLFloaterIMPanel::getVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LLFloaterIMPanel的用法示例。


在下文中一共展示了LLFloaterIMPanel::getVisible方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: addMessage


//.........这里部分代码省略.........
			{
				if (i->mID == session_id)
				{
					group_data = &*i;
					break;
				}
			}

			// If the group is in our list then return
			if (group_data && gIMMgr->getIgnoreGroup(group_data->mID))
			{
				return;
			}
		}

		std::string name = from;
		if(!session_name.empty() && session_name.size()>1)
		{
			name = session_name;
		}

		
		floater = createFloater(
			new_session_id,
			other_participant_id,
			name,
			dialog,
			FALSE);

		// When we get a new IM, and if you are a god, display a bit
		// of information about the source. This is to help liaisons
		// when answering questions.
		if(gAgent.isGodlike())
		{
			// *TODO:translate (low priority, god ability)
			std::ostringstream bonus_info;
			bonus_info << "*** parent estate: "
				<< parent_estate_id
				<< ((parent_estate_id == 1) ? ", mainland" : "")
				<< ((parent_estate_id == 5) ? ", teen" : "");

			// once we have web-services (or something) which returns
			// information about a region id, we can print this out
			// and even have it link to map-teleport or something.
			//<< "*** region_id: " << region_id << std::endl
			//<< "*** position: " << position << std::endl;

			floater->addHistoryLine(bonus_info.str(), gSavedSettings.getColor4("SystemChatColor"));
		}

		make_ui_sound("UISndNewIncomingIMSession");
	}

	// now add message to floater
	bool is_from_system = target_id.isNull() || (from == SYSTEM_FROM);
	const LLColor4& color = ( is_from_system ? 
							  gSavedSettings.getColor4("SystemChatColor") : 
							  gSavedSettings.getColor("IMChatColor"));
	if ( !link_name )
	{
		floater->addHistoryLine(msg,color); // No name to prepend, so just add the message normally
	}
	else
	{
		
		if( other_participant_id == session_id )
		{
			// The name can be bogus on InWorldz
			floater->addHistoryLine(msg, color, true, LLUUID::null, from);
		}
		else 
		{
			// Insert linked name to front of message
			floater->addHistoryLine(msg, color, true, other_participant_id, from);
		}
	}

	LLFloaterChatterBox* chat_floater = LLFloaterChatterBox::getInstance(LLSD());

	if( !chat_floater->getVisible() && !floater->getVisible())
	{
		//if the IM window is not open and the floater is not visible (i.e. not torn off)
		LLFloater* previouslyActiveFloater = chat_floater->getActiveFloater();

		// select the newly added floater (or the floater with the new line added to it).
		// it should be there.
		chat_floater->selectFloater(floater);

		//there was a previously unseen IM, make that old tab flashing
		//it is assumed that the most recently unseen IM tab is the one current selected/active
		if ( previouslyActiveFloater && getIMReceived() )
		{
			chat_floater->setFloaterFlashing(previouslyActiveFloater, TRUE);
		}

		//notify of a new IM
		notifyNewIM();
		mIMUnreadCount++;
	}
}
开发者ID:IamusNavarathna,项目名称:SingularityViewer,代码行数:101,代码来源:llimview.cpp

示例2: addMessage


//.........这里部分代码省略.........

		
		floater = createFloater(
			new_session_id,
			other_participant_id,
			name,
			dialog,
			FALSE);

		// When we get a new IM, and if you are a god, display a bit
		// of information about the source. This is to help liaisons
		// when answering questions.
		if(gAgent.isGodlike())
		{
			// *TODO:translate (low priority, god ability)
			std::ostringstream bonus_info;
			bonus_info << "*** parent estate: "
				<< parent_estate_id
				<< ((parent_estate_id == 1) ? ", mainland" : "")
				<< ((parent_estate_id == 5) ? ", teen" : "");

			// once we have web-services (or something) which returns
			// information about a region id, we can print this out
			// and even have it link to map-teleport or something.
			//<< "*** region_id: " << region_id << std::endl
			//<< "*** position: " << position << std::endl;

			floater->addHistoryLine(bonus_info.str(), gSavedSettings.getColor4("SystemChatColor"));
		}

		make_ui_sound("UISndNewIncomingIMSession");
	}

	// now add message to floater
	bool is_from_system = target_id.isNull() || (from == SYSTEM_FROM);
	bool is_encrypted = (msg.substr(0, 3) == "\xe2\x80\xa7");
	LLColor4 color;
	//Phoenix:KC - color chat from friends. taking care not to color when RLV hide names is in effect, lol
	static BOOL* sPhoenixColorFriendsChat = rebind_llcontrol<BOOL>("PhoenixColorFriendsChat", &gSavedSettings, true);
	static BOOL* sPhoenixColorLindensChat = rebind_llcontrol<BOOL>("PhoenixColorLindensChat", &gSavedSettings, true);
	if (is_from_system)
	{
		color = gSavedSettings.getColor4("SystemChatColor");
	}
	else if (is_encrypted)
	{
		color = gSavedSettings.getColor4("PhoenixIMEncryptedChatColor");
	}
	else if (target_id == gAgent.getID())
	{
		color = gSavedSettings.getColor("UserChatColor");
	}
	else if (*sPhoenixColorFriendsChat
	&& LLAvatarTracker::instance().isBuddy(other_participant_id)
	&& (!rlv_handler_t::isEnabled()
	|| !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)))
	{
		color = gSavedSettings.getColor4("PhoenixFriendChatColor");
	}
	else if (*sPhoenixColorLindensChat && is_linden)
	{
		color = gSavedSettings.getColor4("PhoenixLindensChatColor");
	}
	else
	{
		color = gSavedSettings.getColor4("IMChatColor");
	}
	
	if ( !link_name )
	{
		floater->addHistoryLine(msg,color); // No name to prepend, so just add the message normally
	}
	else
	{
		floater->addHistoryLine(msg, color, true, other_participant_id, from); // Insert linked name to front of message
	}

	LLFloaterChatterBox* chat_floater = LLFloaterChatterBox::getInstance(LLSD());

	if( !chat_floater->getVisible() && !floater->getVisible())
	{
		//if the IM window is not open and the floater is not visible (i.e. not torn off)
		LLFloater* previouslyActiveFloater = chat_floater->getActiveFloater();

		// select the newly added floater (or the floater with the new line added to it).
		// it should be there.
		chat_floater->selectFloater(floater);

		//there was a previously unseen IM, make that old tab flashing
		//it is assumed that the most recently unseen IM tab is the one current selected/active
		if ( previouslyActiveFloater && getIMReceived() )
		{
			chat_floater->setFloaterFlashing(previouslyActiveFloater, TRUE);
		}

		//notify of a new IM
		notifyNewIM();
		mIMUnreadCount++;
	}
}
开发者ID:Xara,项目名称:Immortality,代码行数:101,代码来源:llimview.cpp


注:本文中的LLFloaterIMPanel::getVisible方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。