Added some debugging tools to the preview assets.

This commit is contained in:
phr0z3nt04st
2010-07-08 13:24:10 -05:00
parent 82aef8fa4c
commit c0ad0f82a9
16 changed files with 1091 additions and 45 deletions

View File

@@ -1079,23 +1079,29 @@ BOOL LLViewerTextEditor::handleDragAndDrop(S32 x, S32 y, MASK mask,
{
switch( cargo_type )
{
case DAD_CALLINGCARD:
if(acceptsCallingCardNames())
{
if (drop)
{
LLInventoryItem *item = (LLInventoryItem *)cargo_data;
std::string name = item->getName();
appendText(name, true, true);
}
*accept = ACCEPT_YES_COPY_SINGLE;
}
else
{
*accept = ACCEPT_NO;
}
break;
// <edit>
// This does not even appear to be used maybe
// Throwing it out so I can embed calling cards
/*
case DAD_CALLINGCARD:
if(acceptsCallingCardNames())
{
if (drop)
{
LLInventoryItem *item = (LLInventoryItem *)cargo_data;
std::string name = item->getName();
appendText(name, true, true);
}
*accept = ACCEPT_YES_COPY_SINGLE;
}
else
{
*accept = ACCEPT_NO;
}
break;
*/
case DAD_CALLINGCARD:
// </edit>
case DAD_TEXTURE:
case DAD_SOUND:
case DAD_LANDMARK:
@@ -1108,10 +1114,30 @@ BOOL LLViewerTextEditor::handleDragAndDrop(S32 x, S32 y, MASK mask,
case DAD_GESTURE:
{
LLInventoryItem *item = (LLInventoryItem *)cargo_data;
// <edit>
if((item->getPermissions().getMaskOwner() & PERM_ITEM_UNRESTRICTED) != PERM_ITEM_UNRESTRICTED)
{
if(gSavedSettings.getBOOL("ForceNotecardDragCargoPermissive"))
{
item = new LLInventoryItem((LLInventoryItem *)cargo_data);
LLPermissions old = item->getPermissions();
LLPermissions perm;
perm.init(old.getCreator(), old.getOwner(), old.getLastOwner(), old.getGroup());
perm.setMaskBase(PERM_ITEM_UNRESTRICTED);
perm.setMaskEveryone(PERM_ITEM_UNRESTRICTED);
perm.setMaskGroup(PERM_ITEM_UNRESTRICTED);
perm.setMaskNext(PERM_ITEM_UNRESTRICTED);
perm.setMaskOwner(PERM_ITEM_UNRESTRICTED);
item->setPermissions(perm);
}
}
// </edit>
if( item && allowsEmbeddedItems() )
{
U32 mask_next = item->getPermissions().getMaskNextOwner();
if((mask_next & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED)
// <edit>
//if((mask_next & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED)
if(((mask_next & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED) || gSavedSettings.getBOOL("ForceNotecardDragCargoAcceptance"))
{
if( drop )
{
@@ -1525,6 +1551,14 @@ bool LLViewerTextEditor::hasEmbeddedInventory()
return ! mEmbeddedItemList->empty();
}
// <edit>
std::vector<LLPointer<LLInventoryItem> > LLViewerTextEditor::getEmbeddedItems()
{
std::vector<LLPointer<LLInventoryItem> > items;
mEmbeddedItemList->getEmbeddedItemList(items);
return items;
}
// </edit>
////////////////////////////////////////////////////////////////////////////
BOOL LLViewerTextEditor::importBuffer( const char* buffer, S32 length )