diff --git a/code/ryzom/client/data/gamedev/interfaces_v3/inventory.xml b/code/ryzom/client/data/gamedev/interfaces_v3/inventory.xml
index e9ff0719b..2864894ab 100644
--- a/code/ryzom/client/data/gamedev/interfaces_v3/inventory.xml
+++ b/code/ryzom/client/data/gamedev/interfaces_v3/inventory.xml
@@ -549,7 +549,7 @@
pop_min_h="240"
pop_max_w="920"
pop_max_h="1600"
- w="300"
+ w="400"
h="400"
movable="true"
active="false"
diff --git a/code/ryzom/client/data/gamedev/interfaces_v3/widgets.xml b/code/ryzom/client/data/gamedev/interfaces_v3/widgets.xml
index bf3c8d44b..e5ece5680 100644
--- a/code/ryzom/client/data/gamedev/interfaces_v3/widgets.xml
+++ b/code/ryzom/client/data/gamedev/interfaces_v3/widgets.xml
@@ -6589,6 +6589,18 @@
dblink="UI:SAVE:#inv_type:FILTER_ARMOR"
texture="filter_armor.tga"
tooltip="uittFilterArmor" />
+
getValue8() != 0);
}
+ if (SearchFilterChanged)
+ {
+ bRet = true;
+ SearchFilterChanged = false;
+ }
+
return bRet;
}
@@ -2075,6 +2094,26 @@ bool SBagOptions::canDisplay(CDBCtrlSheet *pCS) const
const CItemSheet *pIS = pCS->asItemSheet();
if (pIS != NULL)
{
+ if (SearchFilter.size() > 0)
+ {
+ bool match = true;
+ ucstring lcName = toLower(pCS->getItemActualName());
+
+ // add item quality as a keyword to match
+ if (pCS->getQuality() > 1)
+ {
+ lcName += ucstring(" " + toString(pCS->getQuality()));
+ }
+
+ for (uint i = 0; i< SearchFilter.size(); ++i)
+ {
+ if (lcName.find(SearchFilter[i]) == ucstring::npos)
+ {
+ return false;
+ }
+ }
+ }
+
// Armor
if ((pIS->Family == ITEMFAMILY::ARMOR) ||
(pIS->Family == ITEMFAMILY::JEWELRY))
@@ -2455,6 +2494,30 @@ class CHandlerInvDrag : public IActionHandler
};
REGISTER_ACTION_HANDLER( CHandlerInvDrag, "inv_drag" );
+// **********************************************************************************************************
+class CHandlerInvSetSearch : public IActionHandler
+{
+ void execute (CCtrlBase *pCaller, const std::string &sParams)
+ {
+ if (!pCaller) return;
+
+ CGroupEditBox *eb = dynamic_cast(pCaller);
+ if (!eb) return;
+
+ CInterfaceManager *pIM = CInterfaceManager::getInstance();
+
+ // ui:interface:inventory:content:bag:iil:inv_query_eb:eb
+ string invId = pCaller->getParent()->getParent()->getId();
+
+ CDBGroupListSheetBag *pList = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(invId + ":bag_list"));
+ if (pList != NULL) pList->setSearchFilter(eb->getInputString());
+
+ CDBGroupIconListBag *pIcons = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(invId + ":bag_icons"));
+ if (pIcons != NULL) pIcons->setSearchFilter(eb->getInputString());
+ }
+};
+REGISTER_ACTION_HANDLER( CHandlerInvSetSearch, "inv_set_search" );
+
// ***************************************************************************
// COMMON INVENTORIES Test if we can drop an item to a slot or a list
class CHandlerInvCanDropTo : public IActionHandler
diff --git a/code/ryzom/client/src/interface_v3/inventory_manager.h b/code/ryzom/client/src/interface_v3/inventory_manager.h
index 0f6d0ea69..64114963c 100644
--- a/code/ryzom/client/src/interface_v3/inventory_manager.h
+++ b/code/ryzom/client/src/interface_v3/inventory_manager.h
@@ -519,18 +519,26 @@ struct SBagOptions
bool LastDbFilterMP;
bool LastDbFilterMissMP;
bool LastDbFilterTP;
+
+ bool SearchFilterChanged;
+ std::vector SearchFilter;
+
// -----------------------
SBagOptions()
{
InvType = CInventoryManager::InvUnknown;
DbFilterArmor = DbFilterWeapon = DbFilterTool = DbFilterMP = DbFilterMissMP = DbFilterTP = NULL;
LastDbFilterArmor = LastDbFilterWeapon = LastDbFilterTool = LastDbFilterMP = LastDbFilterMissMP = LastDbFilterTP = false;
+ SearchFilterChanged = false;
}
bool parse (xmlNodePtr cur, CInterfaceGroup *parentGroup);
bool isSomethingChanged(); // From last call ?
+ bool isSearchFilterChanged() const { return SearchFilterChanged; }
+ void setSearchFilter(const ucstring &s);
+
bool getFilterArmor() const
{
if (DbFilterArmor == NULL) return true;
@@ -621,6 +629,8 @@ public:
// Return true if the sheet can be displayed due to filters
bool canDisplay(CDBCtrlSheet *pCS) { return _BO.canDisplay(pCS); }
+ void setSearchFilter(const ucstring &s) { _BO.setSearchFilter(s); }
+
private:
SBagOptions _BO;
@@ -652,6 +662,8 @@ public:
// Return true if the sheet can be displayed due to filters
bool canDisplay(CDBCtrlSheet *pCS) const { return _BO.canDisplay(pCS); }
+ void setSearchFilter(const ucstring &s) { _BO.setSearchFilter(s); }
+
//////////////////////////////////////////////////////////////////////////
// A child node