alloowishus
November 21st, 2024, 18:51
I was able to change my inventory search drop down box, originally it only filtered by the item type and was prepopulated, I changed it to filter by name and removed the item type population of the drop down. This is in the template_char.xml file:
<template name="list_charinv">
<windowlist>
<datasource>.inventorylist</datasource>
<class>char_invitem</class>
<allowcreate />
<allowdelete />
<filter control="typefilter" />
<filteron control="name" />
<script file="campaign/scripts/char_invlist.lua" />
</windowlist>
</template>
However, what I would like is that I keep the type in the dropdown, so if they type a word in the box, it searches by name, but if the text value matches an item type (i.e. "Accessory","Armor","Weapon" etc) then it searches by type. Is this possible?
<template name="list_charinv">
<windowlist>
<datasource>.inventorylist</datasource>
<class>char_invitem</class>
<allowcreate />
<allowdelete />
<filter control="typefilter" />
<filteron control="name" />
<script file="campaign/scripts/char_invlist.lua" />
</windowlist>
</template>
However, what I would like is that I keep the type in the dropdown, so if they type a word in the box, it searches by name, but if the text value matches an item type (i.e. "Accessory","Armor","Weapon" etc) then it searches by type. Is this possible?