1
Scripting / How to set a list filter from a plug-in script
« on: September 03, 2020, 05:53:24 PM »
I'm a scripting novice, but I'm trying to programmatically set a filter on the current layout game list from a plug-in, and I'm hoping someone can offer a bit of advice.
If the filter is named "foo", it seems like I should do this (based on the find function described here: https://developer.electricimp.com/squirrel/array/find):
However, this doesn't seem to work, reporting "AN ERROR HAS OCCURED [the index 'find' does not exist]" in the console when run.
What is the right way to do this? Thanks in advance for any help!
If the filter is named "foo", it seems like I should do this (based on the find function described here: https://developer.electricimp.com/squirrel/array/find):
Code: [Select]
filter_id = fe.filters.find("foo");
if ( filter_id != null ) fe.list.filter_index = filter_id;
However, this doesn't seem to work, reporting "AN ERROR HAS OCCURED [the index 'find' does not exist]" in the console when run.
What is the right way to do this? Thanks in advance for any help!