Attract-Mode Support Forum

Attract-Mode Support => Scripting => Topic started by: j.e.f.f on October 05, 2020, 02:21:22 AM

Title: Thoughts on a global search plugin
Post by: j.e.f.f on October 05, 2020, 02:21:22 AM
Hello.  I'm. thinking about how I might create a plugin/module for Attract Mode that allows me to search for any game across all of my active games lists.  Generally I'd want it to work as follows:

I'm not an expert in Squirrel, but pretty good with JavaScript and having created my own layout, I feel fairly comfortable attempting to code this myself. I'm more unsure about what is available and possible in AM's environment, in particular, indexing all games and preserving the search function's screen state as I navigate away from it and back.  Ideally I'd like it to be preserved for as long as AM is running, or until I take an action to explicitly clear it.

Before I jump in, does anyone have any thoughts on my points above and how I might approach this from a conceptual standpoint?

Of course, I'm more than willing to share this once it's working, as I believe this a feature many of us will want, and as always, any and all help is greatly appreciated.

Thanks!
 - Jeff
Title: Re: Thoughts on a global search plugin
Post by: rand0m on November 04, 2020, 10:50:10 AM
Creating a separate "All Games" list would be preferable else you be forced to run search on all the separate lists which would be more resource consuming. Secondly you will need to figure out how to display results from multiple lists in a single place.

Search can easily be launched by gamepad (custom key) and keyboard as it is. List results while typing would be problematic, for one thing keyboard keys need to un-mapped from all AM functions (or you need an overlay where keyboard keys behave differently)

Search results can show info like system, year, rating etc as it is (depending on info present in romlist).

preserving navigation position would require a specific display for search results it would also require some adjustment where nested platform list are used (parent list > sub list > sub-sub list etc, "B" or "back"in that case would take you one step upward).

All info (search results/ position preservation) can be stored in tables but that is beyond my coding skills. I can suggest you go for an overlay screen which pops up on button press and like AM settings confine all key presses till the time overlay is up and use a single all-system list for searching even if you don't use it in AM (hidden). I have adjusted Andrew's keyboard-search plugin to search for "series" (button press searches for series of currently selected item) but have not yet applied that to All-System List.

The ideal would be a search function which allows searching for all info present in romlists + play time & play count and allows for searching within current list and all lists.