summaryrefslogtreecommitdiff
path: root/indra/newview/llpaneleditwearable.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpaneleditwearable.cpp')
-rwxr-xr-xindra/newview/llpaneleditwearable.cpp95
1 files changed, 49 insertions, 46 deletions
diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp
index 0621cc8fad..ac00c5d986 100755
--- a/indra/newview/llpaneleditwearable.cpp
+++ b/indra/newview/llpaneleditwearable.cpp
@@ -30,6 +30,7 @@
#include "llpanel.h"
#include "llviewerwearable.h"
#include "lluictrl.h"
+#include "lllocaltextureobject.h"
#include "llscrollingpanellist.h"
#include "llvisualparam.h"
#include "lltoolmorph.h"
@@ -453,7 +454,7 @@ get_pickers_indexes<LLColorSwatchCtrl> (const LLEditWearableDictionary::Wearable
{
if (!wearable_entry)
{
- llwarns << "could not get LLColorSwatchCtrl indexes for null wearable entry." << llendl;
+ LL_WARNS() << "could not get LLColorSwatchCtrl indexes for null wearable entry." << LL_ENDL;
return null_texture_vec;
}
return wearable_entry->mColorSwatchCtrls;
@@ -466,7 +467,7 @@ get_pickers_indexes<LLTextureCtrl> (const LLEditWearableDictionary::WearableEntr
{
if (!wearable_entry)
{
- llwarns << "could not get LLTextureCtrl indexes for null wearable entry." << llendl;
+ LL_WARNS() << "could not get LLTextureCtrl indexes for null wearable entry." << LL_ENDL;
return null_texture_vec;
}
return wearable_entry->mTextureCtrls;
@@ -496,7 +497,7 @@ find_picker_ctrl_entry_if(LLWearableType::EType type, const Predicate pred)
= LLEditWearableDictionary::getInstance()->getWearable(type);
if (!wearable_entry)
{
- llwarns << "could not get wearable dictionary entry for wearable of type: " << type << llendl;
+ LL_WARNS() << "could not get wearable dictionary entry for wearable of type: " << type << LL_ENDL;
return NULL;
}
const texture_vec_t& indexes = get_pickers_indexes<CtrlType>(wearable_entry);
@@ -510,7 +511,7 @@ find_picker_ctrl_entry_if(LLWearableType::EType type, const Predicate pred)
= get_picker_entry<CtrlType>(te);
if (!entry)
{
- llwarns << "could not get picker dictionary entry (" << te << ") for wearable of type: " << type << llendl;
+ LL_WARNS() << "could not get picker dictionary entry (" << te << ") for wearable of type: " << type << LL_ENDL;
continue;
}
if (pred(entry))
@@ -527,14 +528,14 @@ for_each_picker_ctrl_entry(LLPanel* panel, LLWearableType::EType type, function_
{
if (!panel)
{
- llwarns << "the panel wasn't passed for wearable of type: " << type << llendl;
+ LL_WARNS() << "the panel wasn't passed for wearable of type: " << type << LL_ENDL;
return;
}
const LLEditWearableDictionary::WearableEntry *wearable_entry
= LLEditWearableDictionary::getInstance()->getWearable(type);
if (!wearable_entry)
{
- llwarns << "could not get wearable dictionary entry for wearable of type: " << type << llendl;
+ LL_WARNS() << "could not get wearable dictionary entry for wearable of type: " << type << LL_ENDL;
return;
}
const texture_vec_t& indexes = get_pickers_indexes<CtrlType>(wearable_entry);
@@ -548,7 +549,7 @@ for_each_picker_ctrl_entry(LLPanel* panel, LLWearableType::EType type, function_
= get_picker_entry<CtrlType>(te);
if (!entry)
{
- llwarns << "could not get picker dictionary entry (" << te << ") for wearable of type: " << type << llendl;
+ LL_WARNS() << "could not get picker dictionary entry (" << te << ") for wearable of type: " << type << LL_ENDL;
continue;
}
fun (panel, entry);
@@ -700,12 +701,12 @@ void LLPanelEditWearable::setWearablePanelVisibilityChangeCallback(LLPanel* body
}
else
{
- llwarns << "accordion_ctrl is NULL" << llendl;
+ LL_WARNS() << "accordion_ctrl is NULL" << LL_ENDL;
}
}
else
{
- llwarns << "bodypart_panel is NULL" << llendl;
+ LL_WARNS() << "bodypart_panel is NULL" << LL_ENDL;
}
}
@@ -776,7 +777,7 @@ BOOL LLPanelEditWearable::postBuild()
const LLEditWearableDictionary::WearableEntry *wearable_entry = LLEditWearableDictionary::getInstance()->getWearable(type);
if (!wearable_entry)
{
- llwarns << "could not get wearable dictionary entry for wearable of type: " << type << llendl;
+ LL_WARNS() << "could not get wearable dictionary entry for wearable of type: " << type << LL_ENDL;
continue;
}
U8 num_subparts = wearable_entry->mSubparts.size();
@@ -789,7 +790,7 @@ BOOL LLPanelEditWearable::postBuild()
if (!subpart_entry)
{
- llwarns << "could not get wearable subpart dictionary entry for subpart: " << subpart_e << llendl;
+ LL_WARNS() << "could not get wearable subpart dictionary entry for subpart: " << subpart_e << LL_ENDL;
continue;
}
@@ -799,7 +800,7 @@ BOOL LLPanelEditWearable::postBuild()
if (!tab)
{
- llwarns << "could not get llaccordionctrltab from UI with name: " << accordion_tab << llendl;
+ LL_WARNS() << "could not get llaccordionctrltab from UI with name: " << accordion_tab << LL_ENDL;
continue;
}
@@ -943,11 +944,11 @@ void LLPanelEditWearable::onCommitSexChange()
LLViewerWearable* wearable = gAgentWearables.getViewerWearable(type, index);
if (wearable)
{
- wearable->setVisualParamWeight(param->getID(), is_new_sex_male, FALSE);
+ wearable->setVisualParamWeight(param->getID(), is_new_sex_male);
}
- param->setWeight( is_new_sex_male, FALSE );
+ param->setWeight( is_new_sex_male);
- gAgentAvatarp->updateSexDependentLayerSets( FALSE );
+ gAgentAvatarp->updateSexDependentLayerSets();
gAgentAvatarp->updateVisualParams();
@@ -959,7 +960,7 @@ void LLPanelEditWearable::onTexturePickerCommit(const LLUICtrl* ctrl)
const LLTextureCtrl* texture_ctrl = dynamic_cast<const LLTextureCtrl*>(ctrl);
if (!texture_ctrl)
{
- llwarns << "got commit signal from not LLTextureCtrl." << llendl;
+ LL_WARNS() << "got commit signal from not LLTextureCtrl." << LL_ENDL;
return;
}
@@ -982,12 +983,12 @@ void LLPanelEditWearable::onTexturePickerCommit(const LLUICtrl* ctrl)
U32 index = gAgentWearables.getWearableIndex(getWearable());
gAgentAvatarp->setLocalTexture(entry->mTextureIndex, image, FALSE, index);
LLVisualParamHint::requestHintUpdates();
- gAgentAvatarp->wearableUpdated(type, FALSE);
+ gAgentAvatarp->wearableUpdated(type);
}
}
else
{
- llwarns << "could not get texture picker dictionary entry for wearable of type: " << type << llendl;
+ LL_WARNS() << "could not get texture picker dictionary entry for wearable of type: " << type << LL_ENDL;
}
}
}
@@ -1006,14 +1007,14 @@ void LLPanelEditWearable::onColorSwatchCommit(const LLUICtrl* ctrl)
const LLColor4& new_color = LLColor4(ctrl->getValue());
if( old_color != new_color )
{
- getWearable()->setClothesColor(entry->mTextureIndex, new_color, TRUE);
+ getWearable()->setClothesColor(entry->mTextureIndex, new_color);
LLVisualParamHint::requestHintUpdates();
- gAgentAvatarp->wearableUpdated(getWearable()->getType(), FALSE);
+ gAgentAvatarp->wearableUpdated(getWearable()->getType());
}
}
else
{
- llwarns << "could not get color swatch dictionary entry for wearable of type: " << type << llendl;
+ LL_WARNS() << "could not get color swatch dictionary entry for wearable of type: " << type << LL_ENDL;
}
}
}
@@ -1070,7 +1071,7 @@ void LLPanelEditWearable::saveChanges(bool force_save_as)
LLAppearanceMgr::instance().findCOFItemLinks(mWearablePtr->getItemID());
if (links.size()>0)
{
- link_item = links.get(0).get();
+ link_item = links.at(0).get();
if (link_item && link_item->getIsLinkType())
{
description = link_item->getActualDescription();
@@ -1079,10 +1080,10 @@ void LLPanelEditWearable::saveChanges(bool force_save_as)
if (force_save_as)
{
- // the name of the wearable has changed, re-save wearable with new name
- LLAppearanceMgr::instance().removeCOFItemLinks(mWearablePtr->getItemID());
+ // the name of the wearable has changed, re-save wearable with new name
+ LLAppearanceMgr::instance().removeCOFItemLinks(mWearablePtr->getItemID(),gAgentAvatarp->mEndCustomizeCallback);
gAgentWearables.saveWearableAs(mWearablePtr->getType(), index, new_name, description, FALSE);
- mNameEditor->setText(mWearableItem->getName());
+ mNameEditor->setText(mWearableItem->getName());
}
else
{
@@ -1092,17 +1093,19 @@ void LLPanelEditWearable::saveChanges(bool force_save_as)
if (link_item)
{
// Create new link
- link_inventory_item( gAgent.getID(),
- link_item->getLinkedUUID(),
- LLAppearanceMgr::instance().getCOF(),
- link_item->getName(),
- description,
- LLAssetType::AT_LINK,
- NULL);
+ LL_DEBUGS("Avatar") << "link refresh, creating new link to " << link_item->getLinkedUUID()
+ << " removing old link at " << link_item->getUUID()
+ << " wearable item id " << mWearablePtr->getItemID() << LL_ENDL;
+
+ LLInventoryObject::const_object_list_t obj_array;
+ obj_array.push_back(LLConstPointer<LLInventoryObject>(link_item));
+ link_inventory_array(LLAppearanceMgr::instance().getCOF(),
+ obj_array,
+ gAgentAvatarp->mEndCustomizeCallback);
// Remove old link
- gInventory.purgeObject(link_item->getUUID());
+ remove_inventory_item(link_item->getUUID(), gAgentAvatarp->mEndCustomizeCallback);
}
- gAgentWearables.saveWearable(mWearablePtr->getType(), index, TRUE, new_name);
+ gAgentWearables.saveWearable(mWearablePtr->getType(), index, new_name);
}
@@ -1120,7 +1123,7 @@ void LLPanelEditWearable::revertChanges()
mNameEditor->setText(mWearableItem->getName());
updatePanelPickerControls(mWearablePtr->getType());
updateTypeSpecificControls(mWearablePtr->getType());
- gAgentAvatarp->wearableUpdated(mWearablePtr->getType(), FALSE);
+ gAgentAvatarp->wearableUpdated(mWearablePtr->getType());
}
void LLPanelEditWearable::showWearable(LLViewerWearable* wearable, BOOL show, BOOL disable_camera_switch)
@@ -1141,7 +1144,7 @@ void LLPanelEditWearable::showWearable(LLViewerWearable* wearable, BOOL show, BO
const LLEditWearableDictionary::WearableEntry *wearable_entry = LLEditWearableDictionary::getInstance()->getWearable(type);
if (!wearable_entry)
{
- llwarns << "called LLPanelEditWearable::showWearable with an invalid wearable type! (" << type << ")" << llendl;
+ LL_WARNS() << "called LLPanelEditWearable::showWearable with an invalid wearable type! (" << type << ")" << LL_ENDL;
return;
}
@@ -1179,7 +1182,7 @@ void LLPanelEditWearable::showWearable(LLViewerWearable* wearable, BOOL show, BO
if (!subpart_entry)
{
- llwarns << "could not get wearable subpart dictionary entry for subpart: " << subpart_e << llendl;
+ LL_WARNS() << "could not get wearable subpart dictionary entry for subpart: " << subpart_e << LL_ENDL;
continue;
}
@@ -1191,13 +1194,13 @@ void LLPanelEditWearable::showWearable(LLViewerWearable* wearable, BOOL show, BO
if (!panel_list)
{
- llwarns << "could not get scrolling panel list: " << scrolling_panel << llendl;
+ LL_WARNS() << "could not get scrolling panel list: " << scrolling_panel << LL_ENDL;
continue;
}
if (!tab)
{
- llwarns << "could not get llaccordionctrltab from UI with name: " << accordion_tab << llendl;
+ LL_WARNS() << "could not get llaccordionctrltab from UI with name: " << accordion_tab << LL_ENDL;
continue;
}
@@ -1271,13 +1274,13 @@ void LLPanelEditWearable::changeCamera(U8 subpart)
const LLEditWearableDictionary::WearableEntry *wearable_entry = LLEditWearableDictionary::getInstance()->getWearable(mWearablePtr->getType());
if (!wearable_entry)
{
- llinfos << "could not get wearable dictionary entry for wearable type: " << mWearablePtr->getType() << llendl;
+ LL_INFOS() << "could not get wearable dictionary entry for wearable type: " << mWearablePtr->getType() << LL_ENDL;
return;
}
if (subpart >= wearable_entry->mSubparts.size())
{
- llinfos << "accordion tab expanded for invalid subpart. Wearable type: " << mWearablePtr->getType() << " subpart num: " << subpart << llendl;
+ LL_INFOS() << "accordion tab expanded for invalid subpart. Wearable type: " << mWearablePtr->getType() << " subpart num: " << subpart << LL_ENDL;
return;
}
@@ -1286,7 +1289,7 @@ void LLPanelEditWearable::changeCamera(U8 subpart)
if (!subpart_entry)
{
- llwarns << "could not get wearable subpart dictionary entry for subpart: " << subpart_e << llendl;
+ LL_WARNS() << "could not get wearable subpart dictionary entry for subpart: " << subpart_e << LL_ENDL;
return;
}
@@ -1375,7 +1378,7 @@ void LLPanelEditWearable::updateScrollingPanelUI()
if (!panel_list)
{
- llwarns << "could not get scrolling panel list: " << scrolling_panel << llendl;
+ LL_WARNS() << "could not get scrolling panel list: " << scrolling_panel << LL_ENDL;
continue;
}
@@ -1571,7 +1574,7 @@ void LLPanelEditWearable::onInvisibilityCommit(LLCheckBoxCtrl* checkbox_ctrl, LL
if (!checkbox_ctrl) return;
if (!getWearable()) return;
- llinfos << "onInvisibilityCommit, self " << this << " checkbox_ctrl " << checkbox_ctrl << llendl;
+ LL_INFOS() << "onInvisibilityCommit, self " << this << " checkbox_ctrl " << checkbox_ctrl << LL_ENDL;
bool new_invis_state = checkbox_ctrl->get();
if (new_invis_state)
@@ -1582,7 +1585,7 @@ void LLPanelEditWearable::onInvisibilityCommit(LLCheckBoxCtrl* checkbox_ctrl, LL
LLViewerFetchedTexture* image = LLViewerTextureManager::getFetchedTexture( IMG_INVISIBLE );
U32 index = gAgentWearables.getWearableIndex(getWearable());
gAgentAvatarp->setLocalTexture(te, image, FALSE, index);
- gAgentAvatarp->wearableUpdated(getWearable()->getType(), FALSE);
+ gAgentAvatarp->wearableUpdated(getWearable()->getType());
}
else
{
@@ -1599,7 +1602,7 @@ void LLPanelEditWearable::onInvisibilityCommit(LLCheckBoxCtrl* checkbox_ctrl, LL
U32 index = gAgentWearables.getWearableIndex(getWearable());
gAgentAvatarp->setLocalTexture(te, image, FALSE, index);
- gAgentAvatarp->wearableUpdated(getWearable()->getType(), FALSE);
+ gAgentAvatarp->wearableUpdated(getWearable()->getType());
}
updatePanelPickerControls(getWearable()->getType());