Update/Sync in llviewermessage, makes more things auto-previewable, like in v3.
This commit is contained in:
@@ -162,6 +162,7 @@ extern bool gShiftFrame;
|
|||||||
|
|
||||||
// function prototypes
|
// function prototypes
|
||||||
bool check_offer_throttle(const std::string& from_name, bool check_only);
|
bool check_offer_throttle(const std::string& from_name, bool check_only);
|
||||||
|
bool check_asset_previewable(const LLAssetType::EType asset_type);
|
||||||
void callbackCacheEstateOwnerName(const LLUUID& id, const LLAvatarName& av_name);
|
void callbackCacheEstateOwnerName(const LLUUID& id, const LLAvatarName& av_name);
|
||||||
static void process_money_balance_reply_extended(LLMessageSystem* msg);
|
static void process_money_balance_reply_extended(LLMessageSystem* msg);
|
||||||
|
|
||||||
@@ -1145,46 +1146,78 @@ bool check_offer_throttle(const std::string& from_name, bool check_only)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void open_inventory_offer(const uuid_vec_t& items, const std::string& from_name)
|
// Return "true" if we have a preview method for that asset type, "false" otherwise
|
||||||
|
bool check_asset_previewable(const LLAssetType::EType asset_type)
|
||||||
{
|
{
|
||||||
uuid_vec_t::const_iterator it = items.begin();
|
return (asset_type == LLAssetType::AT_NOTECARD) ||
|
||||||
uuid_vec_t::const_iterator end = items.end();
|
(asset_type == LLAssetType::AT_LANDMARK) ||
|
||||||
LLInventoryItem* item;
|
(asset_type == LLAssetType::AT_TEXTURE) ||
|
||||||
for(; it != end; ++it)
|
(asset_type == LLAssetType::AT_ANIMATION) ||
|
||||||
{
|
(asset_type == LLAssetType::AT_SCRIPT) ||
|
||||||
item = gInventory.getItem(*it);
|
(asset_type == LLAssetType::AT_SOUND);
|
||||||
if(!item)
|
}
|
||||||
{
|
|
||||||
LL_WARNS("Messaging") << "Unable to show inventory item: " << *it << LL_ENDL;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if(!highlight_offered_object(item->getUUID()))
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
LLAssetType::EType asset_type = item->getType();
|
|
||||||
|
|
||||||
//if we are throttled, don't display them
|
void open_inventory_offer(const uuid_vec_t& objects, const std::string& from_name)
|
||||||
if (check_offer_throttle(from_name, false))
|
{
|
||||||
|
for (uuid_vec_t::const_iterator obj_iter = objects.begin();
|
||||||
|
obj_iter != objects.end();
|
||||||
|
++obj_iter)
|
||||||
|
{
|
||||||
|
const LLUUID& obj_id = (*obj_iter);
|
||||||
|
if(!highlight_offered_object(obj_id))
|
||||||
{
|
{
|
||||||
// I'm not sure this is a good idea - Definitely a bad idea. HB
|
continue;
|
||||||
//bool show_keep_discard = item->getPermissions().getCreator() != gAgent.getID();
|
}
|
||||||
bool show_keep_discard = true;
|
|
||||||
switch(asset_type)
|
const LLInventoryObject *obj = gInventory.getObject(obj_id);
|
||||||
|
if (!obj)
|
||||||
|
{
|
||||||
|
llwarns << "Cannot find object [ itemID:" << obj_id << " ] to open." << llendl;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const LLAssetType::EType asset_type = obj->getActualType();
|
||||||
|
|
||||||
|
// Either an inventory item or a category.
|
||||||
|
const LLInventoryItem* item = dynamic_cast<const LLInventoryItem*>(obj);
|
||||||
|
if (item && check_asset_previewable(asset_type))
|
||||||
|
{
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Special handling for various types.
|
||||||
|
if (check_offer_throttle(from_name, false)) // If we are throttled, don't display
|
||||||
{
|
{
|
||||||
case LLAssetType::AT_NOTECARD:
|
// I'm not sure this is a good idea - Definitely a bad idea. HB
|
||||||
open_notecard((LLViewerInventoryItem*)item, std::string("Note: ") + item->getName(), LLUUID::null, show_keep_discard, LLUUID::null, FALSE);
|
//bool show_keep_discard = item->getPermissions().getCreator() != gAgent.getID();
|
||||||
break;
|
bool show_keep_discard = true;
|
||||||
case LLAssetType::AT_LANDMARK:
|
switch(asset_type)
|
||||||
open_landmark((LLViewerInventoryItem*)item, std::string("Landmark: ") + item->getName(), show_keep_discard, LLUUID::null, FALSE);
|
{
|
||||||
break;
|
case LLAssetType::AT_NOTECARD:
|
||||||
case LLAssetType::AT_TEXTURE:
|
{
|
||||||
open_texture(*it, std::string("Texture: ") + item->getName(), show_keep_discard, LLUUID::null, FALSE);
|
open_notecard((LLViewerInventoryItem*)item, std::string("Note: ") + item->getName(), LLUUID::null, show_keep_discard, LLUUID::null, FALSE);
|
||||||
break;
|
break;
|
||||||
default:
|
}
|
||||||
break;
|
case LLAssetType::AT_LANDMARK:
|
||||||
|
{
|
||||||
|
open_landmark((LLViewerInventoryItem*)item, std::string("Landmark: ") + item->getName(), show_keep_discard, LLUUID::null, FALSE);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case LLAssetType::AT_TEXTURE:
|
||||||
|
{
|
||||||
|
open_texture(obj_id, std::string("Texture: ") + item->getName(), show_keep_discard, LLUUID::null, FALSE);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case LLAssetType::AT_ANIMATION:
|
||||||
|
case LLAssetType::AT_SCRIPT:
|
||||||
|
case LLAssetType::AT_SOUND:
|
||||||
|
LLInvFVBridgeAction::doAction(asset_type, obj_id, &gInventory);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
LL_DEBUGS("Messaging") << "No preview method for previewable asset type : " << LLAssetType::lookupHumanReadable(asset_type) << LL_ENDL;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//highlight item, if it's not in the trash or lost+found
|
//highlight item, if it's not in the trash or lost+found
|
||||||
|
|
||||||
// Don't auto-open the inventory floater
|
// Don't auto-open the inventory floater
|
||||||
@@ -1194,42 +1227,28 @@ void open_inventory_offer(const uuid_vec_t& items, const std::string& from_name)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(gSavedSettings.getBOOL("ShowInInventory") &&
|
//Trash Check
|
||||||
|
if ((gInventory.isObjectDescendentOf(obj_id, gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH)))
|
||||||
|
// don't select lost and found items if the user is active
|
||||||
|
|| (gAwayTimer.getStarted() && gInventory.isObjectDescendentOf(obj_id, gInventory.findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND))))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gSavedSettings.getBOOL("ShowInInventory") &&
|
||||||
asset_type != LLAssetType::AT_CALLINGCARD &&
|
asset_type != LLAssetType::AT_CALLINGCARD &&
|
||||||
item->getInventoryType() != LLInventoryType::IT_ATTACHMENT &&
|
item->getInventoryType() != LLInventoryType::IT_ATTACHMENT &&
|
||||||
!from_name.empty())
|
!from_name.empty())
|
||||||
{
|
{
|
||||||
LLInventoryView::showAgentInventory(TRUE);
|
LLInventoryView::showAgentInventory(TRUE);
|
||||||
}
|
}
|
||||||
//Trash Check
|
|
||||||
LLUUID trash_id;
|
|
||||||
trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
|
|
||||||
if(gInventory.isObjectDescendentOf(item->getUUID(), trash_id))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
LLUUID lost_and_found_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND);
|
|
||||||
//BOOL inventory_has_focus = gFocusMgr.childHasKeyboardFocus(view);
|
|
||||||
BOOL user_is_away = gAwayTimer.getStarted();
|
|
||||||
|
|
||||||
// don't select lost and found items if the user is active
|
|
||||||
if (gInventory.isObjectDescendentOf(item->getUUID(), lost_and_found_id)
|
|
||||||
&& !user_is_away)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// Highlight item
|
// Highlight item
|
||||||
//Not sure about this check. Could make it easy to miss incoming items.
|
LL_DEBUGS("Messaging") << "Highlighting" << obj_id << LL_ENDL;
|
||||||
//don't dick with highlight while the user is working
|
|
||||||
//if(inventory_has_focus && !user_is_away)
|
|
||||||
// break;
|
|
||||||
LL_DEBUGS("Messaging") << "Highlighting" << item->getUUID() << LL_ENDL;
|
|
||||||
|
|
||||||
LLFocusableElement* focus_ctrl = gFocusMgr.getKeyboardFocus();
|
LLFocusableElement* focus_ctrl = gFocusMgr.getKeyboardFocus();
|
||||||
view->getPanel()->setSelection(item->getUUID(), TAKE_FOCUS_NO);
|
view->getPanel()->setSelection(obj_id, TAKE_FOCUS_NO);
|
||||||
gFocusMgr.setKeyboardFocus(focus_ctrl);
|
gFocusMgr.setKeyboardFocus(focus_ctrl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user