本文整理汇总了C++中LLScriptFloater类的典型用法代码示例。如果您正苦于以下问题:C++ LLScriptFloater类的具体用法?C++ LLScriptFloater怎么用?C++ LLScriptFloater使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LLScriptFloater类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onRemoveNotification
void LLScriptFloaterManager::onRemoveNotification(const LLUUID& notification_id)
{
if(notification_id.isNull())
{
llwarns << "Invalid notification ID" << llendl;
return;
}
// remove related chiclet
if (LLChicletBar::instanceExists())
{
LLChicletBar::getInstance()->getChicletPanel()->removeChiclet(notification_id);
}
LLIMWellWindow* im_well_window = LLIMWellWindow::findInstance();
if (im_well_window)
{
im_well_window->removeObjectRow(notification_id);
}
mNotifications.erase(notification_id);
// close floater
LLScriptFloater* floater = LLFloaterReg::findTypedInstance<LLScriptFloater>("script_floater", notification_id);
if(floater)
{
floater->savePosition();
floater->setNotificationId(LLUUID::null);
floater->closeFloater();
}
}
示例2: toggle
bool LLScriptFloater::toggle(const LLUUID& notification_id)
{
LLScriptFloater* floater = LLFloaterReg::findTypedInstance<LLScriptFloater>("script_floater", notification_id);
// show existing floater
if(floater)
{
if(floater->getVisible())
{
floater->setVisible(false);
return false;
}
else
{
floater->setVisible(TRUE);
floater->setFocus(FALSE);
}
}
// create and show new floater
else
{
show(notification_id);
}
LLChicletBar::getInstance()->getChicletPanel()->setChicletToggleState(notification_id, true);
return true;
}
示例3: setFloaterVisible
void LLScriptFloaterManager::setFloaterVisible(const LLUUID& notification_id, bool visible)
{
LLScriptFloater* floater = LLFloaterReg::findTypedInstance<LLScriptFloater>(
"script_floater", notification_id);
if(floater)
{
floater->setVisible(visible);
}
}
示例4: show
LLScriptFloater* LLScriptFloater::show(const LLUUID& notification_id)
{
LLScriptFloater* floater = LLFloaterReg::getTypedInstance<LLScriptFloater>("script_floater", notification_id);
floater->setNotificationId(notification_id);
floater->createForm(notification_id);
//LLDialog(LLGiveInventory and LLLoadURL) should no longer steal focus (see EXT-5445)
floater->setAutoFocus(FALSE);
if(LLScriptFloaterManager::OBJ_SCRIPT == LLScriptFloaterManager::getObjectType(notification_id))
{
floater->setSavePosition(true);
floater->restorePosition();
}
else
{
floater->dockToChiclet(true);
}
//LLDialog(LLGiveInventory and LLLoadURL) should no longer steal focus (see EXT-5445)
LLFloaterReg::showTypedInstance<LLScriptFloater>("script_floater", notification_id, FALSE);
return floater;
}
示例5: notification_id_to_object_id
void LLScriptFloaterManager::onAddNotification(const LLUUID& notification_id)
{
if(notification_id.isNull())
{
llwarns << "Invalid notification ID" << llendl;
return;
}
// get scripted Object's ID
LLUUID object_id = notification_id_to_object_id(notification_id);
// Need to indicate of "new message" for object chiclets according to requirements
// specified in the Message Bar design specification. See EXT-3142.
bool set_new_message = false;
EObjectType obj_type = getObjectType(notification_id);
// LLDialog can spawn only one instance, LLLoadURL and LLGiveInventory can spawn unlimited number of instances
if(OBJ_SCRIPT == obj_type)
{
// // If an Object spawns more-than-one floater, only the newest one is shown.
// // The previous is automatically closed.
// script_notification_map_t::const_iterator it = findUsingObjectId(object_id);
// [SL:KB] - Patch: UI-ScriptDialog | Checked: 2011-01-17 (Catznip-2.4.0h) | Added: Catznip-2.4.0h
script_notification_map_t::const_iterator it = mNotifications.end();
switch (gSavedSettings.getS32("ScriptDialogPerObject"))
{
case 0: // One script dialog per object (viewer 2 default)
{
// If an Object spawns more-than-one floater, only the newest one is shown.
// The previous is automatically closed.
it = findUsingObjectId(object_id);
}
break;
case 1: // One script dialog per reply channel per object
{
// We'll allow an object to have more than one script dialog floater open, but we'll limit it to one per chat channel
// (in practice a lot of objects open a new listen channel for each new dialog but it still reduces chiclets somewhat)
LLNotificationPtr newNotif = LLNotifications::instance().find(notification_id);
if (newNotif)
{
S32 nNewChannel = newNotif->getPayload()["chat_channel"].asInteger();
for (it = mNotifications.begin(); it != mNotifications.end(); ++it)
{
if (it->second == object_id)
{
LLNotificationPtr curNotif = LLNotifications::instance().find(it->first);
if (curNotif)
{
S32 nCurChannel = curNotif->getPayload()["chat_channel"].asInteger();
if (nNewChannel == nCurChannel)
break;
}
}
}
}
}
break;
case 2: // Unconstrained
default:
break;
}
// [/SL:KB]
if(it != mNotifications.end())
{
LLIMChiclet* chiclet = LLChicletBar::getInstance()->getChicletPanel()->findChiclet<LLIMChiclet>(it->first);
if(chiclet)
{
// Pass the new_message icon state further.
set_new_message = chiclet->getShowNewMessagesIcon();
}
LLScriptFloater* floater = LLFloaterReg::findTypedInstance<LLScriptFloater>("script_floater", it->first);
if(floater)
{
// Generate chiclet with a "new message" indicator if a docked window was opened but not in focus. See EXT-3142.
set_new_message |= !floater->hasFocus();
}
removeNotification(it->first);
}
}
mNotifications.insert(std::make_pair(notification_id, object_id));
// Create inventory offer chiclet for offer type notifications
if( OBJ_GIVE_INVENTORY == obj_type )
{
LLChicletBar::instance().getChicletPanel()->createChiclet<LLInvOfferChiclet>(notification_id);
}
else
{
LLChicletBar::getInstance()->getChicletPanel()->createChiclet<LLScriptChiclet>(notification_id);
}
LLIMWellWindow::getInstance()->addObjectRow(notification_id, set_new_message);
LLSD data;
data["notification_id"] = notification_id;
data["new_message"] = set_new_message;
//.........这里部分代码省略.........
示例6: if
LLScriptFloater* LLScriptFloater::show(const LLUUID& notification_id)
{
LLScriptFloater* floater = LLFloaterReg::getTypedInstance<LLScriptFloater>("script_floater", notification_id);
floater->setNotificationId(notification_id);
floater->createForm(notification_id);
//LLDialog(LLGiveInventory and LLLoadURL) should no longer steal focus (see EXT-5445)
floater->setAutoFocus(FALSE);
LLScriptFloaterManager::e_object_type floaterType=LLScriptFloaterManager::getObjectType(notification_id);
// for some reason an inventory offer comes back as OBJ_UNKNOWN -Zi
if(floaterType==LLScriptFloaterManager::OBJ_UNKNOWN ||
floaterType==LLScriptFloaterManager::OBJ_SCRIPT)
{
floater->setSavePosition(true);
if(gSavedSettings.getBOOL("ShowScriptDialogsTopRight"))
{
// undock the dialog
floater->setDocked(false,true);
LLRect pos=floater->getRect();
S32 width=pos.getWidth();
S32 height=pos.getHeight();
pos.setOriginAndSize(gViewerWindow->getWorldViewWidthScaled()-width,
gViewerWindow->getWorldViewHeightScaled()-height,
width,height);
floater->setRect(pos);
floater->savePosition();
}
// do this only for inventory offers -Zi
else if(floaterType==LLScriptFloaterManager::OBJ_UNKNOWN)
{
// undock the dialog
floater->setDocked(false,true);
LLRect pos=floater->getRect();
S32 width=pos.getWidth();
S32 height=pos.getHeight();
pos.setOriginAndSize(gViewerWindow->getWorldViewWidthScaled()-width,
gViewerWindow->getWorldViewHeightScaled()-height,
width,height);
floater->setRect(pos);
floater->savePosition();
}
floater->restorePosition();
}
else
{
floater->dockToChiclet(true);
}
//LLDialog(LLGiveInventory and LLLoadURL) should no longer steal focus (see EXT-5445)
LLFloaterReg::showTypedInstance<LLScriptFloater>("script_floater", notification_id, FALSE);
return floater;
}
示例7: notification_id_to_object_id
void LLScriptFloaterManager::onAddNotification(const LLUUID& notification_id)
{
if(notification_id.isNull())
{
llwarns << "Invalid notification ID" << llendl;
return;
}
// get scripted Object's ID
LLUUID object_id = notification_id_to_object_id(notification_id);
// Need to indicate of "new message" for object chiclets according to requirements
// specified in the Message Bar design specification. See EXT-3142.
bool set_new_message = false;
EObjectType obj_type = getObjectType(notification_id);
// LLDialog can spawn only one instance, LLLoadURL and LLGiveInventory can spawn unlimited number of instances
if(OBJ_SCRIPT == obj_type)
{
// If an Object spawns more-than-one floater, only the newest one is shown.
// The previous is automatically closed.
script_notification_map_t::const_iterator it = findUsingObjectId(object_id);
if(it != mNotifications.end())
{
LLIMChiclet* chiclet = LLBottomTray::getInstance()->getChicletPanel()->findChiclet<LLIMChiclet>(it->first);
if(chiclet)
{
// Pass the new_message icon state further.
set_new_message = chiclet->getShowNewMessagesIcon();
}
LLScriptFloater* floater = LLFloaterReg::findTypedInstance<LLScriptFloater>("script_floater", it->first);
if(floater)
{
// Generate chiclet with a "new message" indicator if a docked window was opened but not in focus. See EXT-3142.
set_new_message |= !floater->hasFocus();
}
removeNotification(it->first);
}
}
mNotifications.insert(std::make_pair(notification_id, object_id));
// Create inventory offer chiclet for offer type notifications
if( OBJ_GIVE_INVENTORY == obj_type )
{
LLBottomTray::instance().getChicletPanel()->createChiclet<LLInvOfferChiclet>(notification_id);
}
else
{
LLBottomTray::getInstance()->getChicletPanel()->createChiclet<LLScriptChiclet>(notification_id);
}
LLIMWellWindow::getInstance()->addObjectRow(notification_id, set_new_message);
LLSD data;
data["notification_id"] = notification_id;
data["new_message"] = set_new_message;
data["unread"] = 1; // each object has got only one floater
mNewObjectSignal(data);
toggleScriptFloater(notification_id, set_new_message);
}