@Spanky Monkey, my button scripts only support normal and hover states which is ok for your SAC button but you won't be able to add buttons with down states unless you hack it.
extract this zip into your foobar profile folder.
https://dl.dropboxusercontent.com/u/22801321/wsh2015.zip <<there are a few other basic scripts inside for album art, seekbar, volume, playback buttons and rating.
then place this script inside a panel. modify the folder path if you need to.
// ==PREPROCESSOR==
// @name "SAC Button"
// @author "marc2003"
// @import "%fb2k_profile_path%wsh_marc2003\js\lodash.min.js"
// @import "%fb2k_profile_path%wsh_marc2003\js\helpers.js"
// @import "%fb2k_profile_path%wsh_marc2003\js\panel.js"
// ==/PREPROCESSOR==
folders.images = fb.ProfilePath + "buttons_gfx\\";
var panel = new _.panel("SAC Button", ["custom_background"]);
var buttons = new _.buttons();
buttons.update = function () {
if (fb.StopAfterCurrent)
//if the hover image is the same as the normal, you can just leave it out
this.buttons.sac = new _.button(0, 0, 36, 36, {normal : "SACon_n_36.png"}, function () { fb.StopAfterCurrent = !fb.StopAfterCurrent; }, "Disable Stop After Current");
else
this.buttons.sac = new _.button(0, 0, 36, 36, {normal : "SACoff_n_36.png", hover : "SACoff_h_36.png"}, function () { fb.StopAfterCurrent = !fb.StopAfterCurrent; }, "Enable Stop After Current");
window.RepaintRect(this.buttons.sac.x, this.buttons.sac.y, this.buttons.sac.w, this.buttons.sac.h);
}
function on_playlist_stop_after_current_changed() {
buttons.update();
}
function on_size() {
panel.size();
buttons.update();
}
function on_paint(gr) {
panel.paint(gr);
buttons.paint(gr);
}
function on_mouse_move(x, y) {
buttons.move(x, y);
}
function on_mouse_leave() {
buttons.leave();
}
function on_mouse_lbtn_up(x, y) {
buttons.lbtn_up(x, y);
}
function on_mouse_rbtn_up(x, y) {
return panel.rbtn_up(x, y);
}
@incifinci, use [codebox ] tags instead of [code ]
as for your script error, just delete this as it's not even used.
var info = g_focus_metadb.GetFileInfo();
and you might as well use foo_textdisplay (DUI) for displaying file tags or item details (CUI - it's built in)
@samithaj,
looking at the code on line 1166 might be a start. you should know better by now....
does my unmodified script also crash? if so, tough... i can't do anything to troubleshoot as i don't have my own computer. if it's your mods, then you fix it...
you can always put the code inside try/catch like this
try {
//some dodgy code
} catch(e) {
//something went wrong but at least the script didn't crash
}