Author Topic: Feature suggestion: filter rule inherit  (Read 4013 times)

keilmillerjr

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1167
    • View Profile
Feature suggestion: filter rule inherit
« on: November 25, 2014, 12:15:11 PM »
It would be nice to add some sort of rule inheritance for filters to keep our config file DRY (Don't Repeat Yourself). See example below of how this could work.

Code: [Select]
# Generated by Attract-Mode 1.4.0
#
list Arcade
layout               cools
romlist              mame
filter               All
rule                 Category not_contains *Mature*|BIOS|Casino|Fruit Machines|PinMAME|Quiz|Rhythm|Tabletop
rule                 CloneOf not_equals .+
rule                 Control contains 2-way|4-way|8-way|trackball
rule                 DisplayCount equals 1
rule                 Manufacturer not_contains <pirate>|<unknown>|<unlicensed>|bootleg|hack
rule                 Players equals 1P alt|1P sim|2P alt|2P sim|3P alt|4P alt|6P alt
rule                 Status equals good|imperfect
rule                 Year not_contains ?
filter               Favourites
rule                 Favourite equals 1
filter               Atari
rule                 Inherit from All
rule                 Manufacturer contains Atari

The Atari filter would contain all of the rules from the All filter, as well as it's own.

cools

  • Full Member
  • ***
  • Posts: 83
  • Arcade Otaku Sysadmin
    • View Profile
    • Arcade Otaku
Re: Feature suggestion: filter rule inherit
« Reply #1 on: November 28, 2014, 11:35:39 AM »
This would be a fantastic addition.

raygun

  • Administrator
  • Sr. Member
  • *****
  • Posts: 393
    • View Profile
Re: Feature suggestion: filter rule inherit
« Reply #2 on: November 30, 2014, 12:53:05 PM »
Ok, I'll add it to the list!

On a somewhat related noted, you can already specify default rules that get automatically added whenever a new filter gets created (just paste them from the attract.cfg file into the default-filter.cfg file in the config directory) which is useful in situations where you are always adding the same rules to every new filter created...