Hi everyone. I saw someone else make a similar post about how to go about making a button to do a particular function in foobar, which seemed to help them, so I wanted to see if someone can help me with mine.
I've spent many hours trying to figure this out, but it always seems to come up with an error in the console windows and a crash of the panel with the created button when I try running it.
In one panel of the skin, I have a button that toggles a playlist side panel on/off. The code for it looks like this.
$imagebutton($sub(%ps_width%,113),5,14,10,,%do.images%Default.png,SETGLOBAL:do.view.switch:$ifequal(%do.view.switch%,1,2,1);REFRESH)
This button works fine and makes the playlist panel hide/display as intended. However, I do not like the tiny button hiding in the top corner of the window, and want to have it in the same area as the other large buttons in the bottom left of the skin.
Using the destination panel's pre-existing buttons (which are in a different format than the other panel) as a template, I copy the function in and get this:
Buttons.PLAYLIST = new Button(Math.max(0, ww / 2 - 226), 0, 58, 30, c, SETGLOBAL:do.view.switch:$ifequal(%do.view.switch%,1,2,1);REFRESH);
This results with a console error and a crashed panel.
Any idea as to why it functions correctly in one panel, and not in another? How can I to get this to work? Any help would be greatly appreciated.