parent
70e752ac48
commit
d305028f70
|
|
@ -1117,7 +1117,7 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it
|
|||
}
|
||||
|
||||
|
||||
//// User has picked "wear on avatar" from a menu.
|
||||
// User has picked "wear on avatar" from a menu.
|
||||
//void LLAgentWearables::setWearableItem(LLInventoryItem* new_item, LLViewerWearable* new_wearable, bool do_append)
|
||||
//{
|
||||
// //LLAgentDumper dumper("setWearableItem");
|
||||
|
|
@ -1159,78 +1159,78 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it
|
|||
//}
|
||||
|
||||
// static
|
||||
bool LLAgentWearables::onSetWearableDialog(const LLSD& notification, const LLSD& response, LLViewerWearable* wearable)
|
||||
{
|
||||
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
|
||||
LLInventoryItem* new_item = gInventory.getItem(notification["payload"]["item_id"].asUUID());
|
||||
U32 index = gAgentWearables.getWearableIndex(wearable);
|
||||
if (!new_item)
|
||||
{
|
||||
delete wearable;
|
||||
return false;
|
||||
}
|
||||
|
||||
switch(option)
|
||||
{
|
||||
case 0: // "Save"
|
||||
gAgentWearables.saveWearable(wearable->getType(),index);
|
||||
gAgentWearables.setWearableFinal(new_item, wearable);
|
||||
break;
|
||||
|
||||
case 1: // "Don't Save"
|
||||
gAgentWearables.setWearableFinal(new_item, wearable);
|
||||
break;
|
||||
|
||||
case 2: // "Cancel"
|
||||
break;
|
||||
|
||||
default:
|
||||
llassert(0);
|
||||
break;
|
||||
}
|
||||
|
||||
delete wearable;
|
||||
return false;
|
||||
}
|
||||
//bool LLAgentWearables::onSetWearableDialog(const LLSD& notification, const LLSD& response, LLViewerWearable* wearable)
|
||||
//{
|
||||
// S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
|
||||
// LLInventoryItem* new_item = gInventory.getItem(notification["payload"]["item_id"].asUUID());
|
||||
// U32 index = gAgentWearables.getWearableIndex(wearable);
|
||||
// if (!new_item)
|
||||
// {
|
||||
// delete wearable;
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// switch(option)
|
||||
// {
|
||||
// case 0: // "Save"
|
||||
// gAgentWearables.saveWearable(wearable->getType(),index);
|
||||
// gAgentWearables.setWearableFinal(new_item, wearable);
|
||||
// break;
|
||||
//
|
||||
// case 1: // "Don't Save"
|
||||
// gAgentWearables.setWearableFinal(new_item, wearable);
|
||||
// break;
|
||||
//
|
||||
// case 2: // "Cancel"
|
||||
// break;
|
||||
//
|
||||
// default:
|
||||
// llassert(0);
|
||||
// break;
|
||||
// }
|
||||
//
|
||||
// delete wearable;
|
||||
// return false;
|
||||
//}
|
||||
|
||||
// Called from setWearableItem() and onSetWearableDialog() to actually set the wearable.
|
||||
// MULTI_WEARABLE: unify code after null objects are gone.
|
||||
void LLAgentWearables::setWearableFinal(LLInventoryItem* new_item, LLViewerWearable* new_wearable, bool do_append)
|
||||
{
|
||||
const LLWearableType::EType type = new_wearable->getType();
|
||||
|
||||
if (do_append && getWearableItemID(type,0).notNull())
|
||||
{
|
||||
new_wearable->setItemID(new_item->getUUID());
|
||||
const bool trigger_updated = false;
|
||||
pushWearable(type, new_wearable, trigger_updated);
|
||||
LL_INFOS() << "Added additional wearable for type " << type
|
||||
<< " size is now " << getWearableCount(type) << LL_ENDL;
|
||||
checkWearableAgainstInventory(new_wearable);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Replace the old wearable with a new one.
|
||||
llassert(new_item->getAssetUUID() == new_wearable->getAssetID());
|
||||
|
||||
LLViewerWearable *old_wearable = getViewerWearable(type,0);
|
||||
LLUUID old_item_id;
|
||||
if (old_wearable)
|
||||
{
|
||||
old_item_id = old_wearable->getItemID();
|
||||
}
|
||||
new_wearable->setItemID(new_item->getUUID());
|
||||
setWearable(type,0,new_wearable);
|
||||
|
||||
if (old_item_id.notNull())
|
||||
{
|
||||
gInventory.addChangedMask(LLInventoryObserver::LABEL, old_item_id);
|
||||
gInventory.notifyObservers();
|
||||
}
|
||||
LL_INFOS() << "Replaced current element 0 for type " << type
|
||||
<< " size is now " << getWearableCount(type) << LL_ENDL;
|
||||
}
|
||||
}
|
||||
//void LLAgentWearables::setWearableFinal(LLInventoryItem* new_item, LLViewerWearable* new_wearable, bool do_append)
|
||||
//{
|
||||
// const LLWearableType::EType type = new_wearable->getType();
|
||||
//
|
||||
// if (do_append && getWearableItemID(type,0).notNull())
|
||||
// {
|
||||
// new_wearable->setItemID(new_item->getUUID());
|
||||
// const bool trigger_updated = false;
|
||||
// pushWearable(type, new_wearable, trigger_updated);
|
||||
// LL_INFOS() << "Added additional wearable for type " << type
|
||||
// << " size is now " << getWearableCount(type) << LL_ENDL;
|
||||
// checkWearableAgainstInventory(new_wearable);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// // Replace the old wearable with a new one.
|
||||
// llassert(new_item->getAssetUUID() == new_wearable->getAssetID());
|
||||
//
|
||||
// LLViewerWearable *old_wearable = getViewerWearable(type,0);
|
||||
// LLUUID old_item_id;
|
||||
// if (old_wearable)
|
||||
// {
|
||||
// old_item_id = old_wearable->getItemID();
|
||||
// }
|
||||
// new_wearable->setItemID(new_item->getUUID());
|
||||
// setWearable(type,0,new_wearable);
|
||||
//
|
||||
// if (old_item_id.notNull())
|
||||
// {
|
||||
// gInventory.addChangedMask(LLInventoryObserver::LABEL, old_item_id);
|
||||
// gInventory.notifyObservers();
|
||||
// }
|
||||
// LL_INFOS() << "Replaced current element 0 for type " << type
|
||||
// << " size is now " << getWearableCount(type) << LL_ENDL;
|
||||
// }
|
||||
//}
|
||||
|
||||
// User has picked "remove from avatar" from a menu.
|
||||
// static
|
||||
|
|
|
|||
|
|
@ -116,8 +116,8 @@ public:
|
|||
void addLocalTextureObject(const LLWearableType::EType wearable_type, const LLAvatarAppearanceDefines::ETextureIndex texture_type, U32 wearable_index);
|
||||
|
||||
protected:
|
||||
void setWearableFinal(LLInventoryItem* new_item, LLViewerWearable* new_wearable, bool do_append = false);
|
||||
static bool onSetWearableDialog(const LLSD& notification, const LLSD& response, LLViewerWearable* wearable);
|
||||
// void setWearableFinal(LLInventoryItem* new_item, LLViewerWearable* new_wearable, bool do_append = false);
|
||||
// static bool onSetWearableDialog(const LLSD& notification, const LLSD& response, LLViewerWearable* wearable);
|
||||
|
||||
void addWearableToAgentInventory(LLPointer<LLInventoryCallback> cb,
|
||||
LLViewerWearable* wearable,
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ LLAttachmentsMgr::~LLAttachmentsMgr()
|
|||
void LLAttachmentsMgr::addAttachment(const LLUUID& item_id,
|
||||
const U8 attachment_pt,
|
||||
// const BOOL add)
|
||||
// [RLVa:KB] - Checked: 2010-09-13 (RLVa-1.2.1c) | Added: RLVa-1.2.1c
|
||||
// [RLVa:KB] - Checked: 2010-09-13 (RLVa-1.2.1)
|
||||
const BOOL add, const BOOL fRlvForce /*=FALSE*/)
|
||||
// [/RLVa:KB]
|
||||
{
|
||||
|
|
@ -58,7 +58,7 @@ void LLAttachmentsMgr::addAttachment(const LLUUID& item_id,
|
|||
attachment.mAttachmentPt = attachment_pt;
|
||||
attachment.mAdd = add;
|
||||
|
||||
// [RLVa:KB] - Checked: 2010-09-23 (RLVa-1.2.1d) | Modified: RLVa-1.2.1d
|
||||
// [RLVa:KB] - Checked: 2010-09-23 (RLVa-1.2.1)
|
||||
if ( (rlv_handler_t::isEnabled()) && (!fRlvForce) && (gRlvAttachmentLocks.hasLockedAttachmentPoint(RLV_LOCK_ANY)) )
|
||||
{
|
||||
const LLInventoryItem* pItem = gInventory.getItem(item_id);
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ public:
|
|||
void addAttachment(const LLUUID& item_id,
|
||||
const U8 attachment_pt,
|
||||
// const BOOL add);
|
||||
// [RLVa:KB] - Checked: 2010-09-13 (RLVa-1.2.1c) | Added: RLVa-1.2.1c
|
||||
// [RLVa:KB] - Checked: 2010-09-13 (RLVa-1.2.1)
|
||||
const BOOL add, const BOOL fRlvForce = FALSE);
|
||||
// [/RLVa:KB]
|
||||
static void onIdle(void *);
|
||||
|
|
|
|||
|
|
@ -374,6 +374,7 @@ public:
|
|||
virtual BOOL tick();
|
||||
};
|
||||
|
||||
// NOTE: Unused as of SL-3.7.2
|
||||
class RlvCallbackTimerOnce : public LLEventTimer
|
||||
{
|
||||
public:
|
||||
|
|
@ -389,6 +390,7 @@ protected:
|
|||
nullary_func_t m_Callback;
|
||||
};
|
||||
|
||||
// NOTE: Unused as of SL-3.7.2
|
||||
inline void rlvCallbackTimerOnce(F32 nPeriod, RlvCallbackTimerOnce::nullary_func_t cb)
|
||||
{
|
||||
// Timer will automatically delete itself after the callback
|
||||
|
|
|
|||
Loading…
Reference in New Issue