// ==PREPROCESSOR== // @name "DarkOne Control Panel" // @version "3.0" // @author "T.P Wang and tedGo" // @import "%fb2k_path%themes\DarkOne\Others\WSH Scripts\DO Global Script.js" // @import "%fb2k_path%themes\DarkOne\Others\WSH Scripts\DO Global Button Script.js" // ==/PREPROCESSOR== window.MinWidth = 280; // ----- CREATE BUTTONS -------------------------------------------- var imgPath = configPath + "Buttons\\Control\\"; var a = {normal: imgPath + "AddOnAlone.png", hover: imgPath + "AddOnAloneMH.png"}; var b = {normal: imgPath + "AddOnLeft.png", hover: imgPath + "AddOnLeftMH.png"}; var c = {normal: imgPath + "AddOnMiddle.png", hover: imgPath + "AddOnMiddleMH.png"}; var d = {normal: imgPath + "AddOnRight.png", hover: imgPath + "AddOnRightMH.png"}; var e = {normal: imgPath + "Stop2.png", hover: imgPath + "Stop2MH.png"}; var f = {normal: imgPath + "Stop.png", hover: imgPath + "StopMH.png"}; var g = {normal: imgPath + "Previous2.png", hover: imgPath + "Previous2MH.png"}; var h = {normal: imgPath + "Previous.png", hover: imgPath + "PreviousMH.png"}; var i = {normal: imgPath + "Play.png", hover: imgPath + "PlayMH.png"}; var j = {normal: imgPath + "Pause.png", hover: imgPath + "PauseMH.png"}; var k = {normal: imgPath + "PlayPause.png", hover: imgPath + "PlayPauseMH.png"}; var l = {normal: imgPath + "Next2.png", hover: imgPath + "Next2MH.png"}; var m = {normal: imgPath + "Next.png", hover: imgPath + "NextMH.png"}; var n = {normal: imgPath + "Random2.png", hover: imgPath + "Random2MH.png"}; var o = {normal: imgPath + "Random.png", hover: imgPath + "RandomMH.png"}; var last_fm = utils.CheckComponent("foo_lastfm_radio",true); Buttons.opencd = new Button(1, 22, 60, 14, a, function(){fb.RunMainMenuCommand("Open Audio CD...");}); Buttons.open = new Button(ww / 2 - 112, 22, 58, 14, b, function(){fb.RunMainMenuCommand("Open...");}); Buttons.addfiles = new Button(ww / 2 - 54, 22, 55, 14, c, function(){fb.AddFiles();}); Buttons.adddirectory = new Button(ww / 2 + 1, 22, 55, 14, c, function(){fb.AddDirectory();}); Buttons.addloc = new Button(ww / 2 + 56, 22, 57, 14, d, function() {fb.RunMainMenuCommand( last_fm ? "A custom Last.fm station." : "Add Location...");}); Buttons.clear = new Button(ww - 60, 22, 60, 14, a, function(){fb.RunMainMenuCommand("Clear");}); Buttons.stop = new Button(1, 50, 60, 30, e, function(){fb.Stop(); fb.RunMainMenuCommand("ELPlaylist/Redraw")}); Buttons.prev = new Button(ww / 2 - 112, 50, 58, 30, g, function(){fb.Prev();}); Buttons.play = new Button(ww / 2 - 54, 50, 55, 30, i, function(){fb.Play();}); Buttons.pause = new Button(ww / 2 + 1, 50, 55, 30, j, function(){fb.Pause();}); Buttons.next = new Button(ww / 2 + 56, 50, 57, 30, l, function(){fb.Next();}); Buttons.random = new Button(ww - 60, 50, 60, 30, n, function(){fb.Random();}); Buttons.playorpause = new Button(ww / 2 - 27, 50, 55, 30, k, function(){fb.PlayOrPause();}); // ----- DRAW ------------------------------------------------------ var x1 = x2 = x3 = x4 = x5 = 0; function on_paint(gr) { var tfive = last_fm ? "LAST.FM" : "ADD LOC."; if (!window.IsTransparent) { gr.FillSolidRect(0, 0, ww, wh, ui_backcol); gr.FillGradRect(0, 0, ww, wh, 90, RGBA(151, 180, 202, 128), 0); } buttonsDraw(gr); gr.GdiDrawText("OPEN CD", btn_font, ui_btntxtcol, x1, 10, 54, 10, 33); gr.GdiDrawText("OPEN FILES", btn_font, ui_btntxtcol, x2, 10, 54, 10, 33); gr.GdiDrawText("ADD FILES", btn_font, ui_btntxtcol, x3, 10, 54, 10, 33); gr.GdiDrawText("ADD FOLDER", btn_font, ui_btntxtcol, x4, 10, 54, 10, 33); gr.GdiDrawText(tfive, btn_font, ui_btntxtcol, x5, 10, 54, 10, 33); if (ww > 346) gr.GdiDrawText("CLEAR LIST", btn_font, ui_btntxtcol, ww - 57, 10, 54, 10, 33); } // ----- EVENTS ---------------------------------------------------- function on_size() { ww = window.Width; wh = window.Height; if (ww > 346) { x1 = 4; x2 = ww / 2 - 108; x3 = ww / 2 - 54; x4 = ww / 2 + 1; x5 = ww / 2 + 56; } else { x1 = (ww > 290) ? 3 : ww / 2 - 137; x2 = ww / 2 - 82; x3 = ww / 2 - 27; x4 = ww / 2 + 28; x5 = (ww > 290) ? ww - 57 : ww / 2 + 83; } if(ww > 346) { Buttons.opencd.changePos(1, 22, 60, 14); Buttons.opencd.alterImage(a); Buttons.open.changePos(ww / 2 - 112, 22, 58, 14); Buttons.open.alterImage(b); Buttons.addfiles.changePos(x3, 22, 55, 14); Buttons.addloc.changePos(x5, 22, 57, 14); Buttons.addloc.alterImage(d); Buttons.adddirectory.changePos(ww / 2 + 1, 22, 55, 14); Buttons.adddirectory.alterImage(c); Buttons.stop.changePos(1, 50, 60, 30); Buttons.stop.alterImage(e); Buttons.prev.changePos(ww / 2 - 112, 50, 58, 30); Buttons.prev.alterImage(g); Buttons.next.changePos(x5, 50, 57, 30); Buttons.next.alterImage(l); Buttons.random.changePos(ww - 60, 50, 60, 30); Buttons.random.alterImage(n); Buttons.play.changePos(x3, 50, 55, 30); Buttons.pause.changePos(x4, 50, 55, 30); Buttons.clear.changePos(ww - 60, 22, 60, 14); Buttons.play.changeState(ButtonStates.normal); Buttons.pause.changeState(ButtonStates.normal); Buttons.clear.changeState(ButtonStates.normal); Buttons.playorpause.changeState(ButtonStates.hide); } else { if (ww > 290) { Buttons.opencd.changePos(0, 22, 60, 14); Buttons.opencd.alterImage(a); Buttons.open.changePos(ww / 2 - 85, 22, 58, 14); Buttons.open.alterImage(b); Buttons.addfiles.changePos(x3, 22, 55, 14); Buttons.addloc.changePos(ww - 60, 22, 60, 14); Buttons.addloc.alterImage(a); Buttons.adddirectory.changePos(x4, 22, 57, 14); Buttons.adddirectory.alterImage(d); Buttons.stop.changePos(0, 50, 60, 30); Buttons.stop.alterImage(e); Buttons.prev.changePos(ww / 2 - 85, 50, 58, 30); Buttons.prev.alterImage(g); Buttons.next.changePos(x4, 50, 57, 30); Buttons.next.alterImage(l); Buttons.random.changePos(ww - 60, 50, 60, 30); Buttons.random.alterImage(n); } else { Buttons.opencd.changePos(ww / 2 - 140, 22, 58, 14); Buttons.opencd.alterImage(b); Buttons.open.changePos(x2, 22, 55, 14); Buttons.open.alterImage(c); Buttons.addfiles.changePos(x3, 22, 55, 14); Buttons.addloc.changePos(ww / 2 + 83, 22, 57, 14); Buttons.addloc.alterImage(d); Buttons.adddirectory.changePos(x4, 22, 55, 14); Buttons.adddirectory.alterImage(c); Buttons.stop.changePos(ww / 2 - 140, 50, 58, 30); Buttons.stop.alterImage(f); Buttons.prev.changePos(x2, 50, 55, 30); Buttons.prev.alterImage(h); Buttons.next.changePos(x4, 50, 55, 30); Buttons.next.alterImage(m); Buttons.random.changePos(ww / 2 + 83, 50, 57, 30); Buttons.random.alterImage(o); } Buttons.playorpause.changePos(x3, 50, 55, 30); Buttons.play.changeState(ButtonStates.hide); Buttons.pause.changeState(ButtonStates.hide); Buttons.clear.changeState(ButtonStates.hide); Buttons.playorpause.changeState(ButtonStates.normal); } }