Author Topic: How to get attract-mode config values from within plugin?  (Read 2425 times)

arzoo

  • Newbie
  • *
  • Posts: 9
    • View Profile
How to get attract-mode config values from within plugin?
« on: May 14, 2020, 02:57:20 PM »
Hi, Is it possible to get the values from the attrract.cfg file from within a plugin? Any suggestions would be appreciated. Thanks.

keilmillerjr

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1167
    • View Profile
Re: How to get attract-mode config values from within plugin?
« Reply #1 on: May 14, 2020, 03:12:16 PM »
Read the file using squirrel standard library. May I ask what you are trying to do?

arzoo

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: How to get attract-mode config values from within plugin?
« Reply #2 on: May 14, 2020, 08:14:20 PM »
Read the file using squirrel standard library. May I ask what you are trying to do?

I'm updating the LEDBlinky plugin so it correctly passes events to LEDBlinky. If I can get this working I'll add AM as a front-end that's natively supported by LEDBlinky (I'm the dev). The last issue I'm having with the plugin is that when AM is configured to show the Displays menu on startup (startup_mode = displays_menu), the plugin receives two back-to-back Transition.ToNewList callbacks on startup, the first is for the selected item (display) in the list and the second is for the Displays menu itself. I don't want the plugin to pass the first (bogus) ToNewList transition to LEDBlinky. The only way I can see making this work is if the plugin knows how the startup_mode is set, which is why I need to read the value from the attract.cfg file. I was hoping the config values were stored in a table that was included in the fe object, but I guess I'll have to manually parse the file.

Can you point me to any docs or examples for using the squirrel standard library to read a file? Thanks!
« Last Edit: May 14, 2020, 08:21:18 PM by arzoo »

cools

  • Full Member
  • ***
  • Posts: 83
  • Arcade Otaku Sysadmin
    • View Profile
    • Arcade Otaku
Re: How to get attract-mode config values from within plugin?
« Reply #3 on: May 15, 2020, 04:43:33 AM »
That sounds more like an AM bug to me, have you reported it?

arzoo

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: How to get attract-mode config values from within plugin?
« Reply #4 on: May 15, 2020, 05:30:42 AM »
That sounds more like an AM bug to me, have you reported it?

Good idea, I'll report the bug. In the mean time, I realize there's no need for the plugin to read the AM config file since LEDBlinky itself does that to get the control codes.