Author Topic: Thoughts on a global search plugin  (Read 3486 times)

j.e.f.f

  • Jr. Member
  • **
  • Posts: 15
    • View Profile
Thoughts on a global search plugin
« 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:

  • Index all games lists that are currently active in AM (ideally without needing to create a separate "All Games" list for the purpose of searching)
  • Make search available anywhere (e.g., with a configurable custom hot key)
  • Search is operable by both an attached keyboard as well as with a game controller
  • Search automatically lists results as you type, no need to click on an explicit "search" button, and not by scrolling the current display.  I want to results list to be completely independent of any Display.
  • Results list is includes various information available, such as system, year rating, images, video, etc.
  • Game can be launched from results list OR associated display can be raised with the game preselected
  • Search is preserved as I navigate away from search and back.  What I mean by this is that if I search for, say, "MARIO," a number of results will be presented.  If selecting a result takes me to the game in its associated display, and it turns out not to be the one I was looking for, I'd like to return to the search with my previous search term, result list, and navigation position preserved.
  • Search is preserved, as above, even if I launch a game and return to AM.
  • Since all keyboard keys would be available to type in a search term, I'd want to make sure that other keyboard shortcuts are temporarily suppressed while search is active.[\li]
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

rand0m

  • Sr. Member
  • ****
  • Posts: 343
    • View Profile
Re: Thoughts on a global search plugin
« Reply #1 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.