Author Topic: Function to add a tag or Extra info  (Read 116 times)

l3m35

  • Jr. Member
  • **
  • Posts: 15
    • View Profile
Function to add a tag or Extra info
« on: March 26, 2020, 07:09:55 PM »
Quick doubt: how to add a tag or fill the Extra field with a function?

I see there is the fe.game_info(Info.Tags), but it just get the tags, but don't let we add a new one like this:

Code: [Select]
fe.game_info(Info.Tags).push("newtag") // example
Same thing to add a string to the Extra field would be useful, too.

progets

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 980
    • View Profile
Re: Function to add a tag or Extra info
« Reply #1 on: March 26, 2020, 08:59:53 PM »
You don't need to add code to a layout for tags, it's builtin to AttractModes controls.

Configure-->Controls-->Add/Remove Tags=<whatever_you_want>

zpaolo11x

  • Hero Member
  • *****
  • Posts: 730
    • View Profile
    • My deviantart page
Re: Function to add a tag or Extra info
« Reply #2 on: March 27, 2020, 12:11:30 AM »
It would be great if one could add tags to the tag list using code, right now you can do it only via overlay menu

l3m35

  • Jr. Member
  • **
  • Posts: 15
    • View Profile
Re: Function to add a tag or Extra info
« Reply #3 on: March 27, 2020, 12:23:18 AM »
You don't need to add code to a layout for tags, it's builtin to AttractModes controls.

Configure-->Controls-->Add/Remove Tags=<whatever_you_want>

Thank you. I know of it, my idea is to add a shortcut to quickly add a tag like "finished", same way we can configure one to add a game to Favorites. So I can show a proper badge on each game.

Or instead of a tag, I was thinking in use the Extra field.

zpaolo11x

  • Hero Member
  • *****
  • Posts: 730
    • View Profile
    • My deviantart page
Re: Function to add a tag or Extra info
« Reply #4 on: March 27, 2020, 01:03:29 AM »
Thank you. I know of it, my idea is to add a shortcut to quickly add a tag like "finished", same way we can configure one to add a game to Favorites. So I can show a proper badge on each game.

That is exactly what I'd love to do, but right now it can't be done, since you can't add tags "from code". In my theme if a user adds a tag "Completed" then the badge appears, but you have to explain the user that he has to do it that way.

The other issue of this is that tag names must be entered using a "real" keyboard, I was planning to go "keyboard free" for people using cabinets and provide an on-screen keyboard to enter text (I already use a spinoff of the keyboard search plugin for search strings), but it won't work for tags sadly. Or let the user connect the keyboard, define a list of useful tags, and then the layout could show the list to select from. This can't be done either for the same reason.

l3m35

  • Jr. Member
  • **
  • Posts: 15
    • View Profile
Re: Function to add a tag or Extra info
« Reply #5 on: March 27, 2020, 02:22:20 PM »
In my theme if a user adds a tag "Completed" then the badge appears, but you have to explain the user that he has to do it that way.

Exactly what I was trying to do. So bad it can't be done now...

Thank you, folks.

qqplayer

  • Sr. Member
  • ****
  • Posts: 289
    • View Profile
Re: Function to add a tag or Extra info
« Reply #6 on: March 28, 2020, 01:26:29 PM »
I was thinking on a dirty solution.
Maybe you can just edit your romlist with some sort of command line by creating a plugin.

https://stackoverflow.com/questions/21418748/insert-a-string-number-into-a-specific-cell-of-a-csv-file

You always now the column number, just need a function to get the row of the selected game on the  romlist.

Code: [Select]
fe.game_info( index_offset+1 )