LLAgentWearables Transition (1/1)

This commit is contained in:
Shyotl
2011-06-09 01:35:49 -05:00
parent 858f4d1487
commit c57b97c8df
25 changed files with 2866 additions and 1960 deletions

View File

@@ -819,7 +819,7 @@ private:
/********************************************************************************
** **
** Deperciated stuff. Move when ready.
** Depreciated stuff. Move when ready.
**/
public:
const LLUUID& getInventoryRootID() const { return mInventoryRootID; }
@@ -833,164 +833,8 @@ private:
LLUUID mInventoryRootID;
static BOOL mForceTPose;
//--------------------------------------------------------------------
// Wearables
//--------------------------------------------------------------------
public:
void setWearable( LLInventoryItem* new_item, LLWearable* wearable );
static bool onSetWearableDialog( const LLSD& notification, const LLSD& response, LLWearable* wearable );
void setWearableFinal( LLInventoryItem* new_item, LLWearable* new_wearable );
void setWearableOutfit( const LLInventoryItem::item_array_t& items, const LLDynamicArray< LLWearable* >& wearables, BOOL remove );
void queryWearableCache();
BOOL isWearableModifiable(EWearableType type);
BOOL isWearableCopyable(EWearableType type);
BOOL needsReplacement(EWearableType wearableType, S32 remove);
U32 getWearablePermMask(EWearableType type);
LLInventoryItem* getWearableInventoryItem(EWearableType type);
LLWearable* getWearable( EWearableType type ) { return (type < WT_COUNT) ? mWearableEntry[ type ].mWearable : NULL; }
BOOL isWearingItem( const LLUUID& item_id );
LLWearable* getWearableFromWearableItem( const LLUUID& item_id );
const LLUUID& getWearableItem( EWearableType type ) { return (type < WT_COUNT) ? mWearableEntry[ type ].mItemID : LLUUID::null; }
static EWearableType getTEWearableType( S32 te );
static LLUUID getDefaultTEImageID( S32 te );
void copyWearableToInventory( EWearableType type );
void makeNewOutfit(
const std::string& new_folder_name,
const LLDynamicArray<S32>& wearables_to_include,
const LLDynamicArray<S32>& attachments_to_include,
BOOL rename_clothing);
void makeNewOutfitDone(S32 index);
void removeWearable( EWearableType type );
static bool onRemoveWearableDialog(const LLSD& notification, const LLSD& response );
void removeWearableFinal( EWearableType type );
void sendAgentWearablesUpdate();
/**
* @brief Only public because of addWearableToAgentInventoryCallback.
*
* NOTE: Do not call this method unless you are the inventory callback.
* NOTE: This can suffer from race conditions when working on the
* same values for index.
* @param index The index in mWearableEntry.
* @param item_id The inventory item id of the new wearable to wear.
* @param wearable The actual wearable data.
*/
void addWearabletoAgentInventoryDone(
S32 index,
const LLUUID& item_id,
LLWearable* wearable);
void saveWearableAs( EWearableType type, const std::string& new_name, BOOL save_in_lost_and_found );
void saveWearable( EWearableType type, BOOL send_update = TRUE );
void saveAllWearables();
void revertWearable( EWearableType type );
void revertAllWearables();
void setWearableName( const LLUUID& item_id, const std::string& new_name );
void createStandardWearables(BOOL female);
void createStandardWearablesDone(S32 index);
void createStandardWearablesAllDone();
BOOL areWearablesLoaded() { return mWearablesLoaded; }
// statics
static void processAgentInitialWearablesUpdate(LLMessageSystem* mesgsys, void** user_data);
static void userRemoveWearable( void* userdata ); // userdata is EWearableType
static void userRemoveAllClothes( void* userdata ); // userdata is NULL
static void userRemoveAllClothesStep2(BOOL proceed, void* userdata ); // userdata is NULL
static void userRemoveAllAttachments( void* userdata); // userdata is NULL
static BOOL selfHasWearable( void* userdata ); // userdata is EWearableType
// static void userUpdateAttachments(LLInventoryModel::item_array_t& obj_item_array);
// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-09-22 (Catznip-2.2.0a) | Added: Catznip-2.2.0a
// Not the best way to go about this but other attempts changed far too much LL code to be a viable solution
static void userUpdateAttachments(LLInventoryModel::item_array_t& obj_item_array, bool fAttachOnly = false);
// [/SL:KB]
static void userRemoveMultipleAttachments(llvo_vec_t& llvo_array);
static void userAttachMultipleAttachments(LLInventoryModel::item_array_t& obj_item_array);
protected:
// internal wearable functions
void sendAgentWearablesRequest();
static void onInitialWearableAssetArrived(LLWearable* wearable, void* userdata);
void recoverMissingWearable(EWearableType type);
void recoverMissingWearableDone();
void addWearableToAgentInventory(LLPointer<LLInventoryCallback> cb,
LLWearable* wearable, const LLUUID& category_id = LLUUID::null,
BOOL notify = TRUE);
private:
//--------------------------------------------------------------------
// Wearables
//--------------------------------------------------------------------
struct LLWearableEntry
{
LLWearableEntry() : mItemID( LLUUID::null ), mWearable( NULL ) {}
LLUUID mItemID; // ID of the inventory item in the agent's inventory.
LLWearable* mWearable;
};
LLWearableEntry mWearableEntry[ WT_COUNT ];
BOOL mWearablesLoaded;
class createStandardWearablesAllDoneCallback : public LLRefCount
{
protected:
~createStandardWearablesAllDoneCallback();
};
class sendAgentWearablesUpdateCallback : public LLRefCount
{
protected:
~sendAgentWearablesUpdateCallback();
};
class addWearableToAgentInventoryCallback : public LLInventoryCallback
{
public:
enum {
CALL_NONE = 0,
CALL_UPDATE = 1,
CALL_RECOVERDONE = 2,
CALL_CREATESTANDARDDONE = 4,
CALL_MAKENEWOUTFITDONE = 8
} EType;
/**
* @brief Construct a callback for dealing with the wearables.
*
* Would like to pass the agent in here, but we can't safely
* count on it being around later. Just use gAgent directly.
* @param cb callback to execute on completion (??? unused ???)
* @param index Index for the wearable in the agent
* @param wearable The wearable data.
* @param todo Bitmask of actions to take on completion.
*/
addWearableToAgentInventoryCallback(
LLPointer<LLRefCount> cb,
S32 index,
LLWearable* wearable,
U32 todo = CALL_NONE);
virtual void fire(const LLUUID& inv_item);
private:
S32 mIndex;
LLWearable* mWearable;
U32 mTodo;
LLPointer<LLRefCount> mCB;
};
/** DEPERCIATED
/** DEPRECIATED
** **
*******************************************************************************/