DICE PACKS BUNDLE
  1. #1

    Want to have the inventory search box multi purpose

    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?

  2. #2
    You’d have to completely override the list filtering (onFilter) and update of list when the filter box changes. You won’t be able to use the default filtering at all, since you need to write the logic to know which field to check based on the value in the filter box.

    Regards,
    JPG

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Cosmere RPG Beta Launch

Log in

Log in