[BOM] Add Universal wearables functionality

This commit is contained in:
Liru Færs
2019-10-14 21:53:01 -04:00
parent 27c259bf7c
commit 278b617290
14 changed files with 1289 additions and 123 deletions

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

View File

@@ -80,6 +80,24 @@ using namespace LLAvatarAppearanceDefines;
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
void set_default_permissions(LLViewerInventoryItem* item)
{
llassert(item);
LLPermissions perm = item->getPermissions();
if (perm.getMaskNextOwner() != LLFloaterPerms::getNextOwnerPerms("Wearables")
|| perm.getMaskEveryone() != LLFloaterPerms::getEveryonePerms("Wearables")
|| perm.getMaskGroup() != LLFloaterPerms::getGroupPerms("Wearables"))
{
perm.setMaskNext(LLFloaterPerms::getNextOwnerPerms("Wearables"));
perm.setMaskEveryone(LLFloaterPerms::getEveryonePerms("Wearables"));
perm.setMaskGroup(LLFloaterPerms::getGroupPerms("Wearables"));
item->setPermissions(perm);
item->updateServer(FALSE);
}
}
// Callback to wear and start editing an item that has just been created. // Callback to wear and start editing an item that has just been created.
void wear_and_edit_cb(const LLUUID& inv_item) void wear_and_edit_cb(const LLUUID& inv_item)
{ {
@@ -88,13 +106,9 @@ void wear_and_edit_cb(const LLUUID& inv_item)
LLViewerInventoryItem* item = gInventory.getItem(inv_item); LLViewerInventoryItem* item = gInventory.getItem(inv_item);
if (!item) return; if (!item) return;
LLPermissions perm = item->getPermissions(); set_default_permissions(item);
perm.setMaskNext(LLFloaterPerms::getNextOwnerPerms("Wearables"));
perm.setMaskEveryone(LLFloaterPerms::getEveryonePerms("Wearables"));
perm.setMaskGroup(LLFloaterPerms::getGroupPerms("Wearables"));
item->setPermissions(perm);
item->updateServer(FALSE); // item was just created, update even if permissions did not changed
gInventory.updateItem(item); gInventory.updateItem(item);
gInventory.notifyObservers(); gInventory.notifyObservers();
@@ -112,13 +126,8 @@ void wear_cb(const LLUUID& inv_item)
LLViewerInventoryItem* item = gInventory.getItem(inv_item); LLViewerInventoryItem* item = gInventory.getItem(inv_item);
if (item) if (item)
{ {
LLPermissions perm = item->getPermissions(); set_default_permissions(item);
perm.setMaskNext(LLFloaterPerms::getNextOwnerPerms("Wearables"));
perm.setMaskEveryone(LLFloaterPerms::getEveryonePerms("Wearables"));
perm.setMaskGroup(LLFloaterPerms::getGroupPerms("Wearables"));
item->setPermissions(perm);
item->updateServer(FALSE);
gInventory.updateItem(item); gInventory.updateItem(item);
gInventory.notifyObservers(); gInventory.notifyObservers();
} }
@@ -184,7 +193,7 @@ void LLAgentWearables::dump()
struct LLAgentDumper struct LLAgentDumper
{ {
LLAgentDumper(std::string name): LLAgentDumper(std::string name):
mName(name) mName(std::move(name))
{ {
LL_INFOS() << LL_ENDL; LL_INFOS() << LL_ENDL;
LL_INFOS() << "LLAgentDumper " << mName << LL_ENDL; LL_INFOS() << "LLAgentDumper " << mName << LL_ENDL;
@@ -259,7 +268,7 @@ LLAgentWearables::AddWearableToAgentInventoryCallback::AddWearableToAgentInvento
mIndex(index), mIndex(index),
mWearable(wearable), mWearable(wearable),
mTodo(todo), mTodo(todo),
mCB(cb), mCB(std::move(cb)),
mDescription(description) mDescription(description)
{ {
LL_INFOS() << "constructor" << LL_ENDL; LL_INFOS() << "constructor" << LL_ENDL;
@@ -1647,6 +1656,12 @@ void LLAgentWearables::createWearable(LLWearableType::EType type, bool wear, con
{ {
if (type == LLWearableType::WT_INVALID || type == LLWearableType::WT_NONE) return; if (type == LLWearableType::WT_INVALID || type == LLWearableType::WT_NONE) return;
if (type == LLWearableType::WT_UNIVERSAL && !gAgent.getRegion()->bakesOnMeshEnabled())
{
LL_WARNS("Inventory") << "Can't create WT_UNIVERSAL type " << LL_ENDL;
return;
}
LLViewerWearable* wearable = LLWearableList::instance().createNewWearable(type, gAgentAvatarp); LLViewerWearable* wearable = LLWearableList::instance().createNewWearable(type, gAgentAvatarp);
LLAssetType::EType asset_type = wearable->getAssetType(); LLAssetType::EType asset_type = wearable->getAssetType();
LLInventoryType::EType inv_type = LLInventoryType::IT_WEARABLE; LLInventoryType::EType inv_type = LLInventoryType::IT_WEARABLE;

View File

@@ -103,6 +103,7 @@ enum ESubpart
SUBPART_SKIRT, SUBPART_SKIRT,
SUBPART_ALPHA, SUBPART_ALPHA,
SUBPART_TATTOO, SUBPART_TATTOO,
SUBPART_UNIVERSAL,
SUBPART_PHYSICS_BREASTS_UPDOWN, SUBPART_PHYSICS_BREASTS_UPDOWN,
SUBPART_PHYSICS_BREASTS_INOUT, SUBPART_PHYSICS_BREASTS_INOUT,
SUBPART_PHYSICS_BREASTS_LEFTRIGHT, SUBPART_PHYSICS_BREASTS_LEFTRIGHT,
@@ -245,6 +246,7 @@ LLEditWearableDictionary::Wearables::Wearables()
addEntry(LLWearableType::WT_SKIRT, new WearableEntry(LLWearableType::WT_SKIRT,"edit_skirt_title",1,1,1, TEX_SKIRT, TEX_SKIRT, SUBPART_SKIRT)); addEntry(LLWearableType::WT_SKIRT, new WearableEntry(LLWearableType::WT_SKIRT,"edit_skirt_title",1,1,1, TEX_SKIRT, TEX_SKIRT, SUBPART_SKIRT));
addEntry(LLWearableType::WT_ALPHA, new WearableEntry(LLWearableType::WT_ALPHA,"edit_alpha_title",0,5,1, TEX_LOWER_ALPHA, TEX_UPPER_ALPHA, TEX_HEAD_ALPHA, TEX_EYES_ALPHA, TEX_HAIR_ALPHA, SUBPART_ALPHA)); addEntry(LLWearableType::WT_ALPHA, new WearableEntry(LLWearableType::WT_ALPHA,"edit_alpha_title",0,5,1, TEX_LOWER_ALPHA, TEX_UPPER_ALPHA, TEX_HEAD_ALPHA, TEX_EYES_ALPHA, TEX_HAIR_ALPHA, SUBPART_ALPHA));
addEntry(LLWearableType::WT_TATTOO, new WearableEntry(LLWearableType::WT_TATTOO,"edit_tattoo_title",1,3,1, TEX_HEAD_TATTOO, TEX_LOWER_TATTOO, TEX_UPPER_TATTOO, TEX_HEAD_TATTOO, SUBPART_TATTOO)); addEntry(LLWearableType::WT_TATTOO, new WearableEntry(LLWearableType::WT_TATTOO,"edit_tattoo_title",1,3,1, TEX_HEAD_TATTOO, TEX_LOWER_TATTOO, TEX_UPPER_TATTOO, TEX_HEAD_TATTOO, SUBPART_TATTOO));
addEntry(LLWearableType::WT_UNIVERSAL, new WearableEntry(LLWearableType::WT_UNIVERSAL, "edit_universal_title", 1, 11, 1, TEX_HEAD_UNIVERSAL_TATTOO, TEX_HEAD_UNIVERSAL_TATTOO, TEX_UPPER_UNIVERSAL_TATTOO, TEX_LOWER_UNIVERSAL_TATTOO, TEX_SKIRT_TATTOO, TEX_HAIR_TATTOO, TEX_EYES_TATTOO, TEX_LEFT_ARM_TATTOO, TEX_LEFT_LEG_TATTOO, TEX_AUX1_TATTOO, TEX_AUX2_TATTOO, TEX_AUX3_TATTOO, SUBPART_UNIVERSAL));
addEntry(LLWearableType::WT_PHYSICS, new WearableEntry(LLWearableType::WT_PHYSICS,"edit_physics_title",0,0,7, SUBPART_PHYSICS_BREASTS_UPDOWN, SUBPART_PHYSICS_BREASTS_INOUT, SUBPART_PHYSICS_BREASTS_LEFTRIGHT, SUBPART_PHYSICS_BELLY_UPDOWN, SUBPART_PHYSICS_BUTT_UPDOWN, SUBPART_PHYSICS_BUTT_LEFTRIGHT, SUBPART_PHYSICS_ADVANCED)); addEntry(LLWearableType::WT_PHYSICS, new WearableEntry(LLWearableType::WT_PHYSICS,"edit_physics_title",0,0,7, SUBPART_PHYSICS_BREASTS_UPDOWN, SUBPART_PHYSICS_BREASTS_INOUT, SUBPART_PHYSICS_BREASTS_LEFTRIGHT, SUBPART_PHYSICS_BELLY_UPDOWN, SUBPART_PHYSICS_BUTT_UPDOWN, SUBPART_PHYSICS_BUTT_LEFTRIGHT, SUBPART_PHYSICS_ADVANCED));
} }
@@ -315,6 +317,8 @@ LLEditWearableDictionary::Subparts::Subparts()
addEntry(SUBPART_UNDERPANTS, new SubpartEntry(SUBPART_UNDERPANTS, "mPelvis", "underpants",LLStringUtil::null, LLVector3d(0.f, 0.f, -0.5f), LLVector3d(-1.6f, 0.15f, -0.5f), SEX_BOTH)); addEntry(SUBPART_UNDERPANTS, new SubpartEntry(SUBPART_UNDERPANTS, "mPelvis", "underpants",LLStringUtil::null, LLVector3d(0.f, 0.f, -0.5f), LLVector3d(-1.6f, 0.15f, -0.5f), SEX_BOTH));
addEntry(SUBPART_ALPHA, new SubpartEntry(SUBPART_ALPHA, "mPelvis", "alpha",LLStringUtil::null, LLVector3d(0.f, 0.f, 0.1f), LLVector3d(-2.5f, 0.5f, 0.8f), SEX_BOTH)); addEntry(SUBPART_ALPHA, new SubpartEntry(SUBPART_ALPHA, "mPelvis", "alpha",LLStringUtil::null, LLVector3d(0.f, 0.f, 0.1f), LLVector3d(-2.5f, 0.5f, 0.8f), SEX_BOTH));
addEntry(SUBPART_TATTOO, new SubpartEntry(SUBPART_TATTOO, "mPelvis", "tattoo", LLStringUtil::null, LLVector3d(0.f, 0.f, 0.1f), LLVector3d(-2.5f, 0.5f, 0.8f),SEX_BOTH)); addEntry(SUBPART_TATTOO, new SubpartEntry(SUBPART_TATTOO, "mPelvis", "tattoo", LLStringUtil::null, LLVector3d(0.f, 0.f, 0.1f), LLVector3d(-2.5f, 0.5f, 0.8f),SEX_BOTH));
addEntry(SUBPART_UNIVERSAL, new SubpartEntry(SUBPART_UNIVERSAL, "mPelvis", "universal", LLStringUtil::null, LLVector3d(0.f, 0.f, 0.1f), LLVector3d(-2.5f, 0.5f, 0.8f), SEX_BOTH));
addEntry(SUBPART_PHYSICS_BREASTS_UPDOWN, new SubpartEntry(SUBPART_PHYSICS_BREASTS_UPDOWN, "mTorso", "physics_breasts_updown", "Breast Bounce", LLVector3d(0.f, 0.f, 0.1f), LLVector3d(-0.8f, 0.15f, 0.38),SEX_FEMALE)); addEntry(SUBPART_PHYSICS_BREASTS_UPDOWN, new SubpartEntry(SUBPART_PHYSICS_BREASTS_UPDOWN, "mTorso", "physics_breasts_updown", "Breast Bounce", LLVector3d(0.f, 0.f, 0.1f), LLVector3d(-0.8f, 0.15f, 0.38),SEX_FEMALE));
addEntry(SUBPART_PHYSICS_BREASTS_INOUT, new SubpartEntry(SUBPART_PHYSICS_BREASTS_INOUT, "mTorso", "physics_breasts_inout", "Breast Cleavage", LLVector3d(0.f, 0.f, 0.1f), LLVector3d(-0.8f, 0.15f, 0.38f),SEX_FEMALE)); addEntry(SUBPART_PHYSICS_BREASTS_INOUT, new SubpartEntry(SUBPART_PHYSICS_BREASTS_INOUT, "mTorso", "physics_breasts_inout", "Breast Cleavage", LLVector3d(0.f, 0.f, 0.1f), LLVector3d(-0.8f, 0.15f, 0.38f),SEX_FEMALE));
addEntry(SUBPART_PHYSICS_BREASTS_LEFTRIGHT, new SubpartEntry(SUBPART_PHYSICS_BREASTS_LEFTRIGHT, "mTorso", "physics_breasts_leftright", "Breast Sway", LLVector3d(0.f, 0.f, 0.1f), LLVector3d(-0.8f, 0.15f, 0.38f),SEX_FEMALE)); addEntry(SUBPART_PHYSICS_BREASTS_LEFTRIGHT, new SubpartEntry(SUBPART_PHYSICS_BREASTS_LEFTRIGHT, "mTorso", "physics_breasts_leftright", "Breast Sway", LLVector3d(0.f, 0.f, 0.1f), LLVector3d(-0.8f, 0.15f, 0.38f),SEX_FEMALE));
@@ -354,6 +358,7 @@ LLEditWearableDictionary::ColorSwatchCtrls::ColorSwatchCtrls()
addEntry ( TEX_UPPER_UNDERSHIRT, new PickerControlEntry (TEX_UPPER_UNDERSHIRT, "Color/Tint" )); addEntry ( TEX_UPPER_UNDERSHIRT, new PickerControlEntry (TEX_UPPER_UNDERSHIRT, "Color/Tint" ));
addEntry ( TEX_LOWER_UNDERPANTS, new PickerControlEntry (TEX_LOWER_UNDERPANTS, "Color/Tint" )); addEntry ( TEX_LOWER_UNDERPANTS, new PickerControlEntry (TEX_LOWER_UNDERPANTS, "Color/Tint" ));
addEntry ( TEX_HEAD_TATTOO, new PickerControlEntry(TEX_HEAD_TATTOO, "Color/Tint" )); addEntry ( TEX_HEAD_TATTOO, new PickerControlEntry(TEX_HEAD_TATTOO, "Color/Tint" ));
addEntry (TEX_HEAD_UNIVERSAL_TATTOO, new PickerControlEntry(TEX_HEAD_UNIVERSAL_TATTOO, "Color/Tint"));
} }
LLEditWearableDictionary::TextureCtrls::TextureCtrls() LLEditWearableDictionary::TextureCtrls::TextureCtrls()
@@ -381,6 +386,17 @@ LLEditWearableDictionary::TextureCtrls::TextureCtrls()
addEntry ( TEX_LOWER_TATTOO, new PickerControlEntry (TEX_LOWER_TATTOO, "Lower Tattoo", LLUUID::null, TRUE )); addEntry ( TEX_LOWER_TATTOO, new PickerControlEntry (TEX_LOWER_TATTOO, "Lower Tattoo", LLUUID::null, TRUE ));
addEntry ( TEX_UPPER_TATTOO, new PickerControlEntry (TEX_UPPER_TATTOO, "Upper Tattoo", LLUUID::null, TRUE )); addEntry ( TEX_UPPER_TATTOO, new PickerControlEntry (TEX_UPPER_TATTOO, "Upper Tattoo", LLUUID::null, TRUE ));
addEntry ( TEX_HEAD_TATTOO, new PickerControlEntry (TEX_HEAD_TATTOO, "Head Tattoo", LLUUID::null, TRUE )); addEntry ( TEX_HEAD_TATTOO, new PickerControlEntry (TEX_HEAD_TATTOO, "Head Tattoo", LLUUID::null, TRUE ));
addEntry ( TEX_LOWER_UNIVERSAL_TATTOO, new PickerControlEntry( TEX_LOWER_UNIVERSAL_TATTOO, "Lower Universal Tattoo", LLUUID::null, TRUE));
addEntry ( TEX_UPPER_UNIVERSAL_TATTOO, new PickerControlEntry( TEX_UPPER_UNIVERSAL_TATTOO, "Upper Universal Tattoo", LLUUID::null, TRUE));
addEntry ( TEX_HEAD_UNIVERSAL_TATTOO, new PickerControlEntry( TEX_HEAD_UNIVERSAL_TATTOO, "Head Universal Tattoo", LLUUID::null, TRUE));
addEntry ( TEX_SKIRT_TATTOO, new PickerControlEntry(TEX_SKIRT_TATTOO, "Skirt Tattoo", LLUUID::null, TRUE));
addEntry ( TEX_HAIR_TATTOO, new PickerControlEntry(TEX_HAIR_TATTOO, "Hair Tattoo", LLUUID::null, TRUE));
addEntry ( TEX_EYES_TATTOO, new PickerControlEntry(TEX_EYES_TATTOO, "Eyes Tattoo", LLUUID::null, TRUE));
addEntry (TEX_LEFT_ARM_TATTOO, new PickerControlEntry(TEX_LEFT_ARM_TATTOO, "Left Arm Tattoo", LLUUID::null, TRUE));
addEntry (TEX_LEFT_LEG_TATTOO, new PickerControlEntry(TEX_LEFT_LEG_TATTOO, "Left Leg Tattoo", LLUUID::null, TRUE));
addEntry (TEX_AUX1_TATTOO, new PickerControlEntry(TEX_AUX1_TATTOO, "Aux1 Tattoo", LLUUID::null, TRUE));
addEntry (TEX_AUX2_TATTOO, new PickerControlEntry(TEX_AUX2_TATTOO, "Aux2 Tattoo", LLUUID::null, TRUE));
addEntry (TEX_AUX3_TATTOO, new PickerControlEntry(TEX_AUX3_TATTOO, "Aux3 Tattoo", LLUUID::null, TRUE));
} }
LLEditWearableDictionary::PickerControlEntry::PickerControlEntry(ETextureIndex tex_index, LLEditWearableDictionary::PickerControlEntry::PickerControlEntry(ETextureIndex tex_index,
@@ -407,9 +423,9 @@ get_pickers_indexes(const LLEditWearableDictionary::WearableEntry *wearable_entr
// Specializations of this template function return picker control entry for particular control type. // Specializations of this template function return picker control entry for particular control type.
template <typename T> template <typename T>
const LLEditWearableDictionary::PickerControlEntry* const LLEditWearableDictionary::PickerControlEntry*
get_picker_entry (const ETextureIndex index) { return NULL; } get_picker_entry (const ETextureIndex index) { return nullptr; }
typedef boost::function<void(LLPanel* panel, const LLEditWearableDictionary::PickerControlEntry*)> function_t; typedef std::function<void(LLPanel* panel, const LLEditWearableDictionary::PickerControlEntry*)> function_t;
typedef struct PickerControlEntryNamePredicate typedef struct PickerControlEntryNamePredicate
{ {
@@ -473,16 +489,13 @@ find_picker_ctrl_entry_if(LLWearableType::EType type, const Predicate pred)
if (!wearable_entry) if (!wearable_entry)
{ {
LL_WARNS() << "could not get wearable dictionary entry for wearable of type: " << type << LL_ENDL; LL_WARNS() << "could not get wearable dictionary entry for wearable of type: " << type << LL_ENDL;
return NULL; return nullptr;
} }
const texture_vec_t& indexes = get_pickers_indexes<CtrlType>(wearable_entry); const texture_vec_t& indexes = get_pickers_indexes<CtrlType>(wearable_entry);
for (texture_vec_t::const_iterator for (auto te : indexes)
iter = indexes.begin(),
iter_end = indexes.end();
iter != iter_end; ++iter)
{ {
const ETextureIndex te = *iter; const LLEditWearableDictionary::PickerControlEntry* entry
const LLEditWearableDictionary::PickerControlEntry* entry = get_picker_entry<CtrlType>(te); = get_picker_entry<CtrlType>(te);
if (!entry) if (!entry)
{ {
LL_WARNS() << "could not get picker dictionary entry (" << te << ") for wearable of type: " << type << LL_ENDL; LL_WARNS() << "could not get picker dictionary entry (" << te << ") for wearable of type: " << type << LL_ENDL;
@@ -493,7 +506,7 @@ find_picker_ctrl_entry_if(LLWearableType::EType type, const Predicate pred)
return entry; return entry;
} }
} }
return NULL; return nullptr;
} }
template <typename CtrlType> template <typename CtrlType>

View File

@@ -115,6 +115,7 @@ public:
mInventoryItemsDict["New Skirt"] = LLTrans::getString("New Skirt"); mInventoryItemsDict["New Skirt"] = LLTrans::getString("New Skirt");
mInventoryItemsDict["New Alpha"] = LLTrans::getString("New Alpha"); mInventoryItemsDict["New Alpha"] = LLTrans::getString("New Alpha");
mInventoryItemsDict["New Tattoo"] = LLTrans::getString("New Tattoo"); mInventoryItemsDict["New Tattoo"] = LLTrans::getString("New Tattoo");
mInventoryItemsDict["New Universal"] = LLTrans::getString("New Universal");
mInventoryItemsDict["New Physics"] = LLTrans::getString("New Physics"); mInventoryItemsDict["New Physics"] = LLTrans::getString("New Physics");
mInventoryItemsDict["Invalid Wearable"] = LLTrans::getString("Invalid Wearable"); mInventoryItemsDict["Invalid Wearable"] = LLTrans::getString("Invalid Wearable");

View File

@@ -1543,7 +1543,7 @@ bool LLViewerRegion::simulatorFeaturesReceived() const
return mSimulatorFeaturesReceived; return mSimulatorFeaturesReceived;
} }
void LLViewerRegion::getSimulatorFeatures(LLSD& sim_features) void LLViewerRegion::getSimulatorFeatures(LLSD& sim_features) const
{ {
sim_features = mSimulatorFeatures; sim_features = mSimulatorFeatures;
} }
@@ -2367,6 +2367,12 @@ bool LLViewerRegion::meshUploadEnabled() const
} }
} }
bool LLViewerRegion::bakesOnMeshEnabled() const
{
return (mSimulatorFeatures.has("BakesOnMeshEnabled") &&
mSimulatorFeatures["BakesOnMeshEnabled"].asBoolean());
}
bool LLViewerRegion::meshRezEnabled() const bool LLViewerRegion::meshRezEnabled() const
{ {
if (!capabilitiesReceived()) if (!capabilitiesReceived())

View File

@@ -327,13 +327,15 @@ public:
bool meshRezEnabled() const; bool meshRezEnabled() const;
bool meshUploadEnabled() const; bool meshUploadEnabled() const;
bool bakesOnMeshEnabled() const;
// has region received its simulator features list? Requires an additional query after caps received. // has region received its simulator features list? Requires an additional query after caps received.
void requestSimulatorFeatures(); void requestSimulatorFeatures();
void setSimulatorFeaturesReceived(bool); void setSimulatorFeaturesReceived(bool);
bool simulatorFeaturesReceived() const; bool simulatorFeaturesReceived() const;
boost::signals2::connection setSimulatorFeaturesReceivedCallback(const caps_received_signal_t::slot_type& cb); boost::signals2::connection setSimulatorFeaturesReceivedCallback(const caps_received_signal_t::slot_type& cb);
void getSimulatorFeatures(LLSD& info); void getSimulatorFeatures(LLSD& info) const;
void setSimulatorFeatures(const LLSD& info); void setSimulatorFeatures(const LLSD& info);
@@ -372,7 +374,8 @@ public:
friend std::ostream& operator<<(std::ostream &s, const LLViewerRegion &region); friend std::ostream& operator<<(std::ostream &s, const LLViewerRegion &region);
/// implements LLCapabilityProvider /// implements LLCapabilityProvider
virtual std::string getDescription() const; virtual std::string getDescription() const override;
std::string getViewerAssetUrl() const { return mViewerAssetUrl; } std::string getViewerAssetUrl() const { return mViewerAssetUrl; }
LLSpatialPartition* getSpatialPartition(U32 type); LLSpatialPartition* getSpatialPartition(U32 type);

View File

@@ -130,7 +130,7 @@ LLWearable::EImportResult LLViewerWearable::importStream( std::istream& input_st
LLViewerFetchedTexture* image = LLViewerTextureManager::getFetchedTexture( textureid ); LLViewerFetchedTexture* image = LLViewerTextureManager::getFetchedTexture( textureid );
if(gSavedSettings.getBOOL("DebugAvatarLocalTexLoadedTime")) if(gSavedSettings.getBOOL("DebugAvatarLocalTexLoadedTime"))
{ {
image->setLoadedCallback(LLVOAvatarSelf::debugOnTimingLocalTexLoaded,0,TRUE,FALSE, new LLVOAvatarSelf::LLAvatarTexData(textureid, (LLAvatarAppearanceDefines::ETextureIndex)te), NULL); image->setLoadedCallback(LLVOAvatarSelf::debugOnTimingLocalTexLoaded,0,TRUE,FALSE, new LLVOAvatarSelf::LLAvatarTexData(textureid, (LLAvatarAppearanceDefines::ETextureIndex)te), nullptr);
} }
} }
@@ -235,7 +235,6 @@ BOOL LLViewerWearable::isDirty() const
U8 a = F32_to_U8( saved_weight, param->getMinWeight(), param->getMaxWeight() ); U8 a = F32_to_U8( saved_weight, param->getMinWeight(), param->getMaxWeight() );
U8 b = F32_to_U8( current_weight, param->getMinWeight(), param->getMaxWeight() ); U8 b = F32_to_U8( current_weight, param->getMinWeight(), param->getMaxWeight() );
if( a != b ) if( a != b )
{ {
//LL_WARNS() << "param ID " << param->getID() << " was changed." << LL_ENDL; //LL_WARNS() << "param ID " << param->getID() << " was changed." << LL_ENDL;
@@ -317,8 +316,8 @@ void LLViewerWearable::setTexturesToDefaults()
const LLUUID LLViewerWearable::getDefaultTextureImageID(ETextureIndex index) const const LLUUID LLViewerWearable::getDefaultTextureImageID(ETextureIndex index) const
{ {
const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = LLAvatarAppearanceDictionary::getInstance()->getTexture(index); const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = LLAvatarAppearanceDictionary::getInstance()->getTexture(index);
const std::string &default_image_name = texture_dict->mDefaultImageName; const std::string &default_image_name = texture_dict ? texture_dict->mDefaultImageName : "";
if (default_image_name == "") if (default_image_name.empty())
{ {
return IMG_DEFAULT_AVATAR; return IMG_DEFAULT_AVATAR;
} }
@@ -336,15 +335,9 @@ void LLViewerWearable::writeToAvatar(LLAvatarAppearance *avatarp)
if (!avatarp || !avatarp->isSelf() || !avatarp->isValid()) return; if (!avatarp || !avatarp->isSelf() || !avatarp->isValid()) return;
LLVOAvatarSelf* viewer_avatar = static_cast<LLVOAvatarSelf*>(avatarp); LLVOAvatarSelf* viewer_avatar = static_cast<LLVOAvatarSelf*>(avatarp);
#if 0 if (!avatarp || !viewer_avatar) return;
// FIXME DRANO - kludgy way to avoid overwriting avatar state from wearables.
// Ideally would avoid calling this func in the first place. if (!viewer_avatar->isValid()) return;
if (viewer_avatar->isUsingServerBakes() &&
!viewer_avatar->isUsingLocalAppearance())
{
return;
}
#endif
ESex old_sex = avatarp->getSex(); ESex old_sex = avatarp->getSex();
@@ -456,7 +449,7 @@ void LLViewerWearable::copyDataFrom(const LLViewerWearable* src)
{ {
te_map_t::const_iterator iter = src->mTEMap.find(te); te_map_t::const_iterator iter = src->mTEMap.find(te);
LLUUID image_id; LLUUID image_id;
LLViewerFetchedTexture *image = NULL; LLViewerFetchedTexture *image = nullptr;
if(iter != src->mTEMap.end()) if(iter != src->mTEMap.end())
{ {
image = dynamic_cast<LLViewerFetchedTexture*> (src->getLocalTextureObject(te)->getImage()); image = dynamic_cast<LLViewerFetchedTexture*> (src->getLocalTextureObject(te)->getImage());
@@ -489,13 +482,6 @@ void LLViewerWearable::setItemID(const LLUUID& item_id)
void LLViewerWearable::revertValues() void LLViewerWearable::revertValues()
{ {
#if 0
// DRANO avoid overwrite when not in local appearance
if (isAgentAvatarValid() && gAgentAvatarp->isUsingServerBakes() && !gAgentAvatarp->isUsingLocalAppearance())
{
return;
}
#endif
LLWearable::revertValues(); LLWearable::revertValues();
@@ -611,28 +597,29 @@ void LLViewerWearable::saveNewAsset() const
// save it out to database // save it out to database
if( gAssetStorage ) if( gAssetStorage )
{ {
/* #if 0
std::string url = gAgent.getRegion()->getCapability("NewAgentInventory"); const std::string url = gAgent.getRegion()->getCapability("NewFileAgentInventory");
if (!url.empty()) if (!url.empty())
{ {
LL_INFOS() << "Update Agent Inventory via capability" << LL_ENDL; LL_INFOS() << "Update Agent Inventory via capability" << LL_ENDL;
LLSD body; LLSD body;
body["folder_id"] = gInventory.findCategoryUUIDForType(LLFolderType::assetToFolderType(getAssetType())); body["folder_id"] = gInventory.findCategoryUUIDForType(LLFolderType::assetTypeToFolderType(getAssetType()));
body["asset_type"] = LLAssetType::lookup(getAssetType()); body["asset_type"] = LLAssetType::lookup(getAssetType());
body["inventory_type"] = LLInventoryType::lookup(LLInventoryType::IT_WEARABLE); body["inventory_type"] = LLInventoryType::lookup(LLInventoryType::IT_WEARABLE);
body["name"] = getName(); body["name"] = getName();
body["description"] = getDescription(); body["description"] = getDescription();
LLHTTPClient::post(url, body, new LLNewAgentInventoryResponder(body, filename)); LLHTTPClient::post(url, body, new LLNewAgentInventoryResponder(body, filename,
getAssetType()));
} }
else else
#endif // 0
{ {
} LLWearableSaveData* data = new LLWearableSaveData;
*/ data->mType = mType;
LLWearableSaveData* data = new LLWearableSaveData; gAssetStorage->storeAssetData(filename, mTransactionID, getAssetType(),
data->mType = mType;
gAssetStorage->storeAssetData(filename, mTransactionID, getAssetType(),
&LLViewerWearable::onSaveNewAssetComplete, &LLViewerWearable::onSaveNewAssetComplete,
(void*)data); (void*)data);
}
} }
} }
@@ -673,21 +660,19 @@ std::ostream& operator<<(std::ostream &s, const LLViewerWearable &w)
//w.mSaleInfo //w.mSaleInfo
s << " Params:" << "\n"; s << " Params:" << "\n";
for (LLViewerWearable::visual_param_index_map_t::const_iterator iter = w.mVisualParamIndexMap.begin(); for (const auto& iter : w.mVisualParamIndexMap)
iter != w.mVisualParamIndexMap.end(); ++iter)
{ {
S32 param_id = iter->first; S32 param_id = iter.first;
LLVisualParam *wearable_param = iter->second; LLVisualParam *wearable_param = iter.second;
F32 param_weight = wearable_param->getWeight(); F32 param_weight = wearable_param->getWeight();
s << " " << param_id << " " << param_weight << "\n"; s << " " << param_id << " " << param_weight << "\n";
} }
s << " Textures:" << "\n"; s << " Textures:" << "\n";
for (LLViewerWearable::te_map_t::const_iterator iter = w.mTEMap.begin(); for (const auto& iter : w.mTEMap)
iter != w.mTEMap.end(); ++iter)
{ {
S32 te = iter->first; S32 te = iter.first;
const LLUUID& image_id = iter->second->getID(); const LLUUID& image_id = iter.second->getID();
s << " " << te << " " << image_id << "\n"; s << " " << te << " " << image_id << "\n";
} }
return s; return s;

View File

@@ -1348,6 +1348,184 @@ one from scratch and wear it.
<button name="Revert" label="Revert" label_selected="Revert" <button name="Revert" label="Revert" label_selected="Revert"
follows="right|bottom" width="82" height="20" left="305" bottom="-478"/> follows="right|bottom" width="82" height="20" left="305" bottom="-478"/>
</panel> </panel>
<panel label="Universal" name="Universal" border="true" follows="all" height="481" left="102" bottom="-482" width="389">
<icon bottom="-21" color="1 1 1 1" follows="top|right" height="16"
image_name="icon_lock.tga" left="333" mouse_opaque="true" name="square"
width="16" />
<icon bottom="-24" color="1 1 1 1" follows="left|top" height="16" left="8"
mouse_opaque="true" name="icon" width="16" />
<text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom="-24" drop_shadow_visible="true" follows="left|top|right"
font="SansSerif" h_pad="0" halign="left" height="16" left="26"
mouse_opaque="true" name="title" v_pad="0" width="355">
[DESC]
</text>
<text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom="-24" drop_shadow_visible="true" follows="left|top|right"
font="SansSerif" h_pad="0" halign="left" height="16" left="26"
mouse_opaque="true" name="title_no_modify" v_pad="0" width="355">
[DESC]: cannot modify
</text>
<text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom="-24" drop_shadow_visible="true" follows="left|top|right"
font="SansSerif" h_pad="0" halign="left" height="16" left="26"
mouse_opaque="true" name="title_loading" v_pad="0" width="355">
[DESC]: loading...
</text>
<text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom="-24" drop_shadow_visible="true" follows="left|top|right"
font="SansSerif" h_pad="0" halign="left" height="16" left="26"
mouse_opaque="true" name="title_not_worn" v_pad="0" width="355">
[DESC]: not worn
</text>
<text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom="-38" drop_shadow_visible="true" follows="left|top|right"
font="SansSerifSmall" h_pad="0" halign="left" height="14" left="8"
mouse_opaque="true" name="path" v_pad="0" width="373">
Located in [PATH]
</text>
<tab_container name="layer_tabs" follows="all" left_delta="85" bottom_delta="-30" height="16" width="300" tab_min_width="55"/>
<text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom="-104" drop_shadow_visible="true" follows="left|top|right"
font="SansSerifSmall" h_pad="0" halign="left" height="28" left="102"
mouse_opaque="true" name="not worn instructions" v_pad="0" width="284">
Put on a new universal by dragging one from your
inventory to your avatar. Alternately, you can create a
new one from scratch and wear it.
</text>
<text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom="-50" drop_shadow_visible="true" follows="left|top|right"
font="SansSerifSmall" h_pad="0" halign="left" height="14" left="8"
mouse_opaque="true" name="no modify instructions" v_pad="0" width="373">
You do not have permission to modify this wearable.
</text>
<text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom="-486" drop_shadow_visible="true" follows="left|bottom|right"
font="SansSerif" h_pad="0" halign="right" height="28" right="117"
mouse_opaque="true" name="Item Action Label" v_pad="0" width="100">
Universal:
</text>
<texture_picker
can_apply_immediately="true"
allow_no_texture="true"
default_image_name="Default"
follows="left|top"
width="80" height="96" left="109" bottom="-174"
label="Head Tattoo"
name="Head Universal Tattoo"
tool_tip="Click to choose a picture"/>
<texture_picker
can_apply_immediately="true"
allow_no_texture="true"
default_image_name="Default"
follows="left|top"
label="Upper Tattoo"
width="80" height="96" left_delta="96" bottom_delta="0"
name="Upper Universal Tattoo"
tool_tip="Click to choose a picture"/>
<texture_picker
can_apply_immediately="true"
allow_no_texture="true"
default_image_name="Default"
follows="left|top"
label="Lower Tattoo"
width="80" height="96" left_delta="96" bottom_delta="0"
name="Lower Universal Tattoo"
tool_tip="Click to choose a picture"/>
<texture_picker
can_apply_immediately="true"
allow_no_texture="true"
default_image_name="Default"
follows="left|top"
width="80" height="96" left_delta="-192" bottom_delta="-106"
label="Skirt Tattoo"
name="Skirt Tattoo"
tool_tip="Click to choose a picture"/>
<texture_picker
can_apply_immediately="true"
allow_no_texture="true"
default_image_name="Default"
follows="left|top"
width="80" height="96" left_delta="96" bottom_delta="0"
label="Hair Tattoo"
name="Hair Tattoo"
tool_tip="Click to choose a picture"/>
<texture_picker
can_apply_immediately="true"
allow_no_texture="true"
default_image_name="Default"
follows="left|top"
width="80" height="96" left_delta="96" bottom_delta="0"
label="Eyes Tattoo"
name="Eyes Tattoo"
tool_tip="Click to choose a picture"/>
<texture_picker
can_apply_immediately="true"
allow_no_texture="true"
default_image_name="Default"
follows="left|top"
width="80" height="96" left_delta="-192" bottom_delta="-106"
label="Left Arm Tattoo"
name="Left Arm Tattoo"
tool_tip="Click to choose a picture"/>
<texture_picker
can_apply_immediately="true"
allow_no_texture="true"
default_image_name="Default"
follows="left|top"
width="80" height="96" left_delta="96" bottom_delta="0"
label="Left Leg Tattoo"
name="Left Leg Tattoo"
tool_tip="Click to choose a picture"/>
<texture_picker
can_apply_immediately="true"
allow_no_texture="true"
default_image_name="Default"
follows="left|top"
width="80" height="96" left_delta="96" bottom_delta="0"
label="Aux1 Tattoo"
name="Aux1 Tattoo"
tool_tip="Click to choose a picture"/>
<texture_picker
can_apply_immediately="true"
allow_no_texture="true"
default_image_name="Default"
follows="left|top"
width="80" height="96" left_delta="-192" bottom_delta="-106"
label="Aux2 Tattoo"
name="Aux2 Tattoo"
tool_tip="Click to choose a picture"/>
<texture_picker
can_apply_immediately="true"
allow_no_texture="true"
default_image_name="Default"
follows="left|top"
width="80" height="96" left_delta="96" bottom_delta="0"
label="Aux3 Tattoo"
name="Aux3 Tattoo"
tool_tip="Click to choose a picture"/>
<color_swatch
can_apply_immediately="true"
allow_no_texture="true"
follows="left|top"
width="80" height="96" left_delta="96" bottom_delta="0"
label="Color/Tint"
name="Color/Tint"
tool_tip="Click to open color picker"/>
<button name="Create New" label="Create New Universal" label_selected="Create New Universal"
follows="left|top" width="170" height="24" left="160" bottom="-148"/>
<button name="Take Off" label="Take Off"
follows="left|top" width="82" height="20" left="8" bottom="-330"/>
<button bottom_delta="-26" follows="left|top" height="20" width="82" name="New Layer" label="New Layer"/>
<button bottom_delta="-26" follows="left|top" height="20" width="41" name="Arrow Left" label="◀️◀️" tool_tip="Move to inner layer."/>
<button bottom_delta="0" left_delta="41" height="20" follows="left|top" width="41" name="Arrow Right" label="▶️▶️" tool_tip="Move to outer layer."/>
<button name="Save" label="Save"
follows="right|bottom" width="82" height="20" left="123" bottom="-478"/>
<button name="Save As" label="Save As..."
follows="right|bottom" width="92" height="20" left="209" bottom="-478"/>
<button name="Revert" label="Revert"
follows="right|bottom" width="82" height="20" left="305" bottom="-478"/>
</panel>
<panel border="true" bottom="-482" follows="left|top|right|bottom" height="481" <panel border="true" bottom="-482" follows="left|top|right|bottom" height="481"
label="Physics" left="102" mouse_opaque="true" name="Physics" width="389"> label="Physics" left="102" mouse_opaque="true" name="Physics" width="389">
<icon bottom="-21" color="1 1 1 1" follows="top|right" height="16" <icon bottom="-21" color="1 1 1 1" follows="top|right" height="16"

View File

@@ -171,6 +171,9 @@
mouse_opaque="true" name="New Alpha" width="125"> mouse_opaque="true" name="New Alpha" width="125">
<on_click filter="" function="Inventory.DoCreate" userdata="alpha" /> <on_click filter="" function="Inventory.DoCreate" userdata="alpha" />
</menu_item_call> </menu_item_call>
<menu_item_call label="New Universal" name="New Universal">
<on_click function="Inventory.DoCreate" userdata="universal"/>
</menu_item_call>
<menu_item_call bottom_delta="-18" height="18" label="New Physics" left="0" <menu_item_call bottom_delta="-18" height="18" label="New Physics" left="0"
mouse_opaque="true" name="New Physics" width="125"> mouse_opaque="true" name="New Physics" width="125">
<on_click filter="" function="Inventory.DoCreate" userdata="physics" /> <on_click filter="" function="Inventory.DoCreate" userdata="physics" />

View File

@@ -157,6 +157,9 @@
mouse_opaque="true" name="New Alpha" width="128"> mouse_opaque="true" name="New Alpha" width="128">
<on_click filter="" function="Inventory.DoCreate" userdata="alpha" /> <on_click filter="" function="Inventory.DoCreate" userdata="alpha" />
</menu_item_call> </menu_item_call>
<menu_item_call label="New Universal" name="New Universal">
<on_click function="Inventory.DoCreate" userdata="universal"/>
</menu_item_call>
<menu_item_call bottom_delta="-18" height="18" label="New Physics" left="0" <menu_item_call bottom_delta="-18" height="18" label="New Physics" left="0"
mouse_opaque="true" name="New Physics" width="128"> mouse_opaque="true" name="New Physics" width="128">
<on_click filter="" function="Inventory.DoCreate" userdata="physics" /> <on_click filter="" function="Inventory.DoCreate" userdata="physics" />

View File

@@ -3259,61 +3259,6 @@ Where tag = tag string to match. Removes bot's matching the tag.
<string name="AvatarSetNotBusy">Not Busy</string> <string name="AvatarSetNotBusy">Not Busy</string>
<string name="AvatarSetBusy">Busy</string> <string name="AvatarSetBusy">Busy</string>
<!-- Wearable Types -->
<string name="shape">Shape</string>
<string name="skin">Skin</string>
<string name="hair">Hair</string>
<string name="eyes">Eyes</string>
<string name="shirt">Shirt</string>
<string name="pants">Pants</string>
<string name="shoes">Shoes</string>
<string name="socks">Socks</string>
<string name="jacket">Jacket</string>
<string name="gloves">Gloves</string>
<string name="undershirt">Undershirt</string>
<string name="underpants">Underpants</string>
<string name="skirt">Skirt</string>
<string name="alpha">Alpha</string>
<string name="tattoo">Tattoo</string>
<string name="physics">Physics</string>
<string name="invalid">invalid</string>
<string name="none">none</string>
<string name="unknown">Unknown</string>
<!-- Not Worn Wearable Types -->
<string name="shirt_not_worn">Shirt not worn</string>
<string name="pants_not_worn">Pants not worn</string>
<string name="shoes_not_worn">Shoes not worn</string>
<string name="socks_not_worn">Socks not worn</string>
<string name="jacket_not_worn">Jacket not worn</string>
<string name="gloves_not_worn">Gloves not worn</string>
<string name="undershirt_not_worn">Undershirt not worn</string>
<string name="underpants_not_worn">Underpants not worn</string>
<string name="skirt_not_worn">Skirt not worn</string>
<string name="alpha_not_worn">Alpha not worn</string>
<string name="tattoo_not_worn">Tattoo not worn</string>
<string name="physics_not_worn">Physics not worn</string>
<string name="invalid_not_worn">invalid</string>
<!-- Create new wearable of the specified type -->
<string name="create_new_shape">Create new shape</string>
<string name="create_new_skin">Create new skin</string>
<string name="create_new_hair">Create new hair</string>
<string name="create_new_eyes">Create new eyes</string>
<string name="create_new_shirt">Create new shirt</string>
<string name="create_new_pants">Create new pants</string>
<string name="create_new_shoes">Create new shoes</string>
<string name="create_new_socks">Create new socks</string>
<string name="create_new_jacket">Create new jacket</string>
<string name="create_new_gloves">Create new gloves</string>
<string name="create_new_undershirt">Create new undershirt</string>
<string name="create_new_underpants">Create new underpants</string>
<string name="create_new_skirt">Create new skirt</string>
<string name="create_new_alpha">Create new alpha</string>
<string name="create_new_tattoo">Create new tattoo</string>
<string name="create_new_physics">Create new physics</string>
<string name="create_new_invalid">invalid</string>
<!-- Wearable List--> <!-- Wearable List-->
<string name="NewWearable">New [WEARABLE_ITEM]</string> <string name="NewWearable">New [WEARABLE_ITEM]</string>
@@ -3336,7 +3281,7 @@ Where tag = tag string to match. Removes bot's matching the tag.
<string name="universal">Universal</string> <string name="universal">Universal</string>
<string name="physics">Physics</string> <string name="physics">Physics</string>
<string name="invalid">invalid</string> <string name="invalid">invalid</string>
<string name="unknown">unknown</string> <string name="unknown">Unknown</string>
<string name="none">none</string> <string name="none">none</string>
<!-- Not Worn Wearable Types --> <!-- Not Worn Wearable Types -->
@@ -3351,6 +3296,7 @@ Where tag = tag string to match. Removes bot's matching the tag.
<string name="skirt_not_worn">Skirt not worn</string> <string name="skirt_not_worn">Skirt not worn</string>
<string name="alpha_not_worn">Alpha not worn</string> <string name="alpha_not_worn">Alpha not worn</string>
<string name="tattoo_not_worn">Tattoo not worn</string> <string name="tattoo_not_worn">Tattoo not worn</string>
<string name="universal_not_worn">Universal not worn</string>
<string name="physics_not_worn">Physics not worn</string> <string name="physics_not_worn">Physics not worn</string>
<string name="invalid_not_worn">invalid</string> <string name="invalid_not_worn">invalid</string>
@@ -3370,6 +3316,7 @@ Where tag = tag string to match. Removes bot's matching the tag.
<string name="create_new_skirt">Create new skirt</string> <string name="create_new_skirt">Create new skirt</string>
<string name="create_new_alpha">Create new alpha</string> <string name="create_new_alpha">Create new alpha</string>
<string name="create_new_tattoo">Create new tattoo</string> <string name="create_new_tattoo">Create new tattoo</string>
<string name="create_new_universal">Create new universal</string>
<string name="create_new_physics">Create new physics</string> <string name="create_new_physics">Create new physics</string>
<string name="create_new_invalid">invalid</string> <string name="create_new_invalid">invalid</string>
@@ -4694,6 +4641,7 @@ Abuse Report</string>
<string name="New Skirt">New Skirt</string> <string name="New Skirt">New Skirt</string>
<string name="New Alpha">New Alpha</string> <string name="New Alpha">New Alpha</string>
<string name="New Tattoo">New Tattoo</string> <string name="New Tattoo">New Tattoo</string>
<string name="New Universal">New Universal</string>
<string name="New Physics">New Physics</string> <string name="New Physics">New Physics</string>
<string name="Invalid Wearable">Invalid Wearable</string> <string name="Invalid Wearable">Invalid Wearable</string>
<string name="New Gesture">New Gesture</string> <string name="New Gesture">New Gesture</string>