/* Wild Card Helper Panel v.0.1 by Jorge Vásquez Pérez yorchWyorchnet.com https://yorchnet.com/ https://github.com/jorgevasquezp Changes 0.2: - None TODO: - Get artist initials in Windows too. */ (function wcHelperPanel (thisObj) { /* Build UI */ function buildUI(thisObj) { var windowTitle = "WC Artist Helper"; var firstButton = "+1"; var secondButton = "own"; var thirdButton = "render"; var fourthButton = "<< test >>"; var win = (thisObj instanceof Panel)? thisObj : new Window('palette', windowTitle); win.spacing = 0; win.margins = 4; var myArtistGroup = win.add ("group"); artistNameLabel= myArtistGroup.add("statictext"); artistName= myArtistGroup.add("statictext"); artistRoleLabel= myArtistGroup.add("statictext"); artistRole= myArtistGroup.add("dropdownlist",undefined,["Offline","Finishing"]) artistRole.selection = 0; artistNameLabel.text = "Artist:"; artistRoleLabel.text = "Role:"; artistName.text = system.callSystem("whoami"); var myButtonGroup = win.add ("group"); myButtonGroup.spacing = 4; myButtonGroup.margins = 0; myButtonGroup.orientation = "row"; win.button1 = myButtonGroup.add ("button", undefined, firstButton); win.button2 = myButtonGroup.add ("button", undefined, secondButton); win.button3 = myButtonGroup.add ("button", undefined, thirdButton); win.button4 = myButtonGroup.add ("button", undefined, fourthButton); myButtonGroup.alignment = "center"; myButtonGroup.alignChildren = "center"; win.button1.onClick = function(){ versionUpSelectedComps(1); } win.button2.onClick = function(){ versionUpSelectedComps(0); } win.button3.onClick = function(){ renderSelectedToProjectPath(); } win.button4.onClick = function(){ test(); } win.layout.layout(true); return win } // Show the Panel var w = buildUI(thisObj); if (w.toString() == "[object Panel]") { w; } else { w.show(); } /* General functions */ function pad(n,i){ //pad n with ceroes up to i places. if (String(n).length>=i){ return String(n) }else{ dif = i- (String(n)).length; padding = ""; for (p=0;p