From 18c9f97895804d65fa0e18ff488a0abc27603341 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Thu, 24 Sep 2020 23:25:27 +0200 Subject: [PATCH] FIRE-30096: Display attachment points in appearance window lists; Special bonus: Highlight items in red if there is a mismatch between what is being attached and what is linked in CoF --- indra/newview/llinventorylistitem.cpp | 19 +++++++++- indra/newview/llinventorylistitem.h | 4 +++ indra/newview/llwearableitemslist.cpp | 36 +++++++++++++++++-- indra/newview/llwearableitemslist.h | 1 + .../xui/en/panel_outfits_wearing.xml | 2 +- .../newview/skins/default/xui/de/strings.xml | 4 +-- .../default/xui/en/panel_outfits_wearing.xml | 2 +- .../xui/en/widgets/cof_wearable_list_item.xml | 18 +++++++++- .../xui/en/widgets/inventory_list_item.xml | 6 ++++ .../xui/en/panel_outfits_wearing.xml | 2 +- .../xui/en/widgets/inventory_list_item.xml | 6 ++++ .../xui/en/widgets/inventory_list_item.xml | 6 ++++ .../vintage/xui/en/panel_outfits_wearing.xml | 2 +- 13 files changed, 97 insertions(+), 11 deletions(-) diff --git a/indra/newview/llinventorylistitem.cpp b/indra/newview/llinventorylistitem.cpp index 9e5916b5f5..69aebec5b1 100644 --- a/indra/newview/llinventorylistitem.cpp +++ b/indra/newview/llinventorylistitem.cpp @@ -47,6 +47,7 @@ static const S32 WIDGET_SPACING = 3; LLPanelInventoryListItemBase::Params::Params() : default_style("default_style"), + mismatch_style("mismatch_style"), // Better attachment list worn_style("worn_style"), hover_image("hover_image"), selected_image("selected_image"), @@ -361,6 +362,14 @@ void LLPanelInventoryListItemBase::setIconImage(const LLUIImagePtr& image) } } +// Better attachment list +//virtual +const LLPanelInventoryListItemBase::Params& LLPanelInventoryListItemBase::getDefaultParams() const +{ + return LLUICtrlFactory::getDefaultParams(); +} +// + void LLPanelInventoryListItemBase::setTitle(const std::string& title, const std::string& highlit_text, EItemState item_state) @@ -370,7 +379,10 @@ void LLPanelInventoryListItemBase::setTitle(const std::string& title, LLStyle::Params style_params; - const LLPanelInventoryListItemBase::Params& params = LLUICtrlFactory::getDefaultParams(); + // Better attachment list + //const LLPanelInventoryListItemBase::Params& params = LLUICtrlFactory::getDefaultParams(); + const LLPanelInventoryListItemBase::Params& params = getDefaultParams(); + // switch(item_state) { @@ -380,6 +392,11 @@ void LLPanelInventoryListItemBase::setTitle(const std::string& title, case IS_WORN: style_params = params.worn_style(); break; + // Better attachment list + case IS_MISMATCH: + style_params = params.mismatch_style(); + break; + // default:; } diff --git a/indra/newview/llinventorylistitem.h b/indra/newview/llinventorylistitem.h index d4dd212cc3..3d07116651 100644 --- a/indra/newview/llinventorylistitem.h +++ b/indra/newview/llinventorylistitem.h @@ -64,6 +64,7 @@ public: struct Params : public LLInitParam::Block { Optional default_style, + mismatch_style, // Better attachment list worn_style; Optional hover_image, selected_image, @@ -76,6 +77,7 @@ public: typedef enum e_item_state { IS_DEFAULT, IS_WORN, + IS_MISMATCH // Better attachment list } EItemState; static LLPanelInventoryListItemBase* create(LLViewerInventoryItem* item); @@ -196,6 +198,8 @@ protected: */ virtual BOOL handleToolTip( S32 x, S32 y, MASK mask); + virtual const LLPanelInventoryListItemBase::Params& getDefaultParams() const; // Better attachment list + const LLUUID mInventoryItemUUID; private: diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp index 21363c11e4..6b7efeded6 100644 --- a/indra/newview/llwearableitemslist.cpp +++ b/indra/newview/llwearableitemslist.cpp @@ -135,11 +135,35 @@ void LLPanelWearableOutfitItem::updateItem(const std::string& name, // We don't use get_is_item_worn() here because this update is triggered by // an inventory observer upon link in COF beind added or removed so actual // worn status of a linked item may still remain unchanged. - if (mWornIndicationEnabled && LLAppearanceMgr::instance().isLinkedInCOF(mInventoryItemUUID)) + // Better attachment list + //if (mWornIndicationEnabled && LLAppearanceMgr::instance().isLinkedInCOF(mInventoryItemUUID)) + //{ + // search_label += LLTrans::getString("worn"); + // item_state = IS_WORN; + //} + if (mWornIndicationEnabled && get_is_item_worn(mInventoryItemUUID)) { - search_label += LLTrans::getString("worn"); - item_state = IS_WORN; + std::string attachment_point_name; + if (getType() != LLAssetType::AT_OBJECT || !isAgentAvatarValid()) // System layer or error condition, can't figure out attach point + { + search_label += LLTrans::getString("worn"); + } + else if (gAgentAvatarp->getAttachedPointName(mInventoryItemUUID, attachment_point_name)) + { + LLStringUtil::format_map_t args; + args["[ATTACHMENT_POINT]"] = LLTrans::getString(attachment_point_name); + search_label += LLTrans::getString("WornOnAttachmentPoint", args); + } + else + { + LLStringUtil::format_map_t args; + args["[ATTACHMENT_ERROR]"] = LLTrans::getString(attachment_point_name); + search_label += LLTrans::getString("AttachmentErrorMessage", args); + } + + item_state = LLAppearanceMgr::instance().isLinkedInCOF(mInventoryItemUUID) ? IS_WORN : IS_MISMATCH; } + // LLPanelInventoryListItemBase::updateItem(search_label, item_state); } @@ -452,6 +476,12 @@ void FSPanelCOFWearableOutfitListItem::updateItemWeight(U32 item_weight) } mWeightCtrl->setText(complexity_string); } + +//virtual +const LLPanelInventoryListItemBase::Params& FSPanelCOFWearableOutfitListItem::getDefaultParams() const +{ + return LLUICtrlFactory::getDefaultParams(); +} // ////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llwearableitemslist.h b/indra/newview/llwearableitemslist.h index c8693e33f9..cdd5cac605 100644 --- a/indra/newview/llwearableitemslist.h +++ b/indra/newview/llwearableitemslist.h @@ -240,6 +240,7 @@ protected: FSPanelCOFWearableOutfitListItem(LLViewerInventoryItem* item, bool worn_indication_enabled, const Params& params); + virtual const LLPanelInventoryListItemBase::Params& getDefaultParams() const; private: LLTextBox* mWeightCtrl; }; diff --git a/indra/newview/skins/ansastorm/xui/en/panel_outfits_wearing.xml b/indra/newview/skins/ansastorm/xui/en/panel_outfits_wearing.xml index 2e9ab53681..f87e6f4d30 100644 --- a/indra/newview/skins/ansastorm/xui/en/panel_outfits_wearing.xml +++ b/indra/newview/skins/ansastorm/xui/en/panel_outfits_wearing.xml @@ -36,7 +36,7 @@ top="0" width="309" show_complexity="true" - worn_indication_enabled="false" /> + worn_indication_enabled="true" /> Keine Inhalte - - + + Ja diff --git a/indra/newview/skins/default/xui/en/panel_outfits_wearing.xml b/indra/newview/skins/default/xui/en/panel_outfits_wearing.xml index 3c77d7dd28..92f78f9ce0 100644 --- a/indra/newview/skins/default/xui/en/panel_outfits_wearing.xml +++ b/indra/newview/skins/default/xui/en/panel_outfits_wearing.xml @@ -40,7 +40,7 @@ top="0" width="309" show_complexity="true" - worn_indication_enabled="false" /> + worn_indication_enabled="true" /> + + + + + + + + diff --git a/indra/newview/skins/default/xui/en/widgets/inventory_list_item.xml b/indra/newview/skins/default/xui/en/widgets/inventory_list_item.xml index 1e7701cd07..6c7ea8ee50 100644 --- a/indra/newview/skins/default/xui/en/widgets/inventory_list_item.xml +++ b/indra/newview/skins/default/xui/en/widgets/inventory_list_item.xml @@ -18,6 +18,12 @@ font="SansSerifSmall" font.style="BOLD" color="EmphasisColor" /> + + + + worn_indication_enabled="true" /> + + + + + + + worn_indication_enabled="true" />