diff options
| author | Neal Orman <nyx@lindenlab.com> | 2009-10-19 21:02:33 +0000 | 
|---|---|---|
| committer | Neal Orman <nyx@lindenlab.com> | 2009-10-19 21:02:33 +0000 | 
| commit | 404ed736ec99acb81b0368f4402bba2504518bfd (patch) | |
| tree | f78928b8170fdd904f2a9b6883f6af052ba44ab0 /indra | |
| parent | 42767687efc32f8c035ed62480e300ca62239c9c (diff) | |
Remove "add" inventory operation and rename MAX_WEARABLES_PER_TYPE
This patch removes the invalid "add" operation shown on wearables in inventory
It also renames MAX_WEARABLES_PER_TYPE, resets the value to 1 (non-multi-wearables), and adds a weak check to enforce one wearable per type.
Code reviewed by Vir
Diffstat (limited to 'indra')
| -rw-r--r-- | indra/newview/llagentwearables.cpp | 12 | ||||
| -rw-r--r-- | indra/newview/llagentwearables.h | 2 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/menu_inventory.xml | 8 | 
3 files changed, 7 insertions, 15 deletions
diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 223f8779ec..34d2c00007 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -655,20 +655,20 @@ U32 LLAgentWearables::pushWearable(const EWearableType type, LLWearable *wearabl  	{  		// no null wearables please!  		//TODO: insert llwarns -		return MAX_ATTACHMENTS_PER_TYPE; +		return MAX_WEARABLES_PER_TYPE;  	} -	if (type < WT_COUNT) +	if (type < WT_COUNT || mWearableDatas[type].size() < MAX_WEARABLES_PER_TYPE)  	{  		mWearableDatas[type].push_back(wearable);  		return mWearableDatas[type].size()-1;  	} -	return MAX_ATTACHMENTS_PER_TYPE; +	return MAX_WEARABLES_PER_TYPE;  }  void LLAgentWearables::popWearable(const EWearableType type, LLWearable *wearable)  {  	U32 index = getWearableIndex(type, wearable); -	if (index < MAX_ATTACHMENTS_PER_TYPE && index < getWearableCount(type)) +	if (index < MAX_WEARABLES_PER_TYPE && index < getWearableCount(type))  	{  		popWearable(type, index);  	} @@ -688,7 +688,7 @@ U32	LLAgentWearables::getWearableIndex(const EWearableType type, LLWearable *wea  	if (wearable_iter == mWearableDatas.end())  	{  		llwarns << "tried to get wearable index with an invalid type!" << llendl; -		return MAX_ATTACHMENTS_PER_TYPE; +		return MAX_WEARABLES_PER_TYPE;  	}  	const wearableentry_vec_t& wearable_vec = wearable_iter->second;  	for(U32 index = 0; index < wearable_vec.size(); index++) @@ -699,7 +699,7 @@ U32	LLAgentWearables::getWearableIndex(const EWearableType type, LLWearable *wea  		}  	} -	return MAX_ATTACHMENTS_PER_TYPE; +	return MAX_WEARABLES_PER_TYPE;  }  const LLWearable* LLAgentWearables::getWearable(const EWearableType type, U32 index) const diff --git a/indra/newview/llagentwearables.h b/indra/newview/llagentwearables.h index d147b0447b..6b456abfa7 100644 --- a/indra/newview/llagentwearables.h +++ b/indra/newview/llagentwearables.h @@ -258,7 +258,7 @@ private:  		LLPointer<LLRefCount> mCB;  	}; -	static const U32 MAX_ATTACHMENTS_PER_TYPE = 4;  +	static const U32 MAX_WEARABLES_PER_TYPE = 1;   }; // LLAgentWearables diff --git a/indra/newview/skins/default/xui/en/menu_inventory.xml b/indra/newview/skins/default/xui/en/menu_inventory.xml index 7785492651..62940b87dc 100644 --- a/indra/newview/skins/default/xui/en/menu_inventory.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory.xml @@ -603,14 +603,6 @@           function="Inventory.DoToSelected"           parameter="wear" />      </menu_item_call> -	<menu_item_call -    label="Add" -    layout="topleft" -    name="Wearable Add"> -       <menu_item_call.on_click -        function="Inventory.DoToSelected" -        parameter="wear_add" /> -   </menu_item_call>       <menu_item_call       label="Take Off"       layout="topleft"  | 
