menuMode = 1 allmaps = "" inCol = 3 inRow = 17 levelScroll = 0 cmaps = "" getmaps = [ //loop files looks at a directory and finds all givin type of files that lie there in. allmaps = "" loopfiles f packages/base ogz [ allmaps = (concat $f $allmaps ) ] maxscroll = (- (+ (div (listlen $allmaps) $inCol ) 1 ) (* $inCol $inRow ) ) ] getcurmaps = [ if (< (listlen $allmaps) (* $inRow $inCol ) ) [ curent = $allmaps ][ srl = (* $inCol $levelScroll ) cmaps = "" loop i (* $inRow $inCol ) [ cmaps = (concatword $cmaps " " (at $allmaps (+ $srl $i) ) ) ] ] ] newgui AllMaps [ guistayopen [ guilist [ guibutton "Update" getmaps //loads the new files on click guibar guititle "Menu Mode:" guibar guiradio "Tabs" menuMode 1 guibar guiradio "Scroll" menuMode 2 guititle " " ] if (= $menuMode 2 ) [ guislider levelScroll 1 $maxscroll getcurmaps ] [ cmaps = $allmaps ] ] createmenu $cmaps 3 17 "void" "map" "cube" "void" // runs create menu def below if (= autoupdate 1) [ getmaps ] ] //\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\\ //\\//\\ $arg1 array \\\\\\\\\///////// \ /////\\\\\ $arg2 column in tab \\\\\\//\\////// / ////\\//\\\\ $arg3 items in collum \\\\\\\/////// \ ///////\\\\\\\ $arg4 menu name:0= void \\\\//\\//// / //////\\//\\\\\\ $arg5 command on click \\\\\///// \ /////////\\\\\\\\\ $arg6 icon to load \\//\\// / ///////\\//\\\\\\\\\ $arg7 the max items \\\/// \ ///\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\/// createmenu = [ p = ( listlen $arg1 ) capitems = $arg7 // variable the set the max items that can be in a list if (> (listlen $arg1) capitems) && (> capitems 0 ) [ // checks the array against the maximum and to see if it is not 0 (0 = infinite ) p = capitems // if true sets p to the maximum ] // inx = 0 // index for array ts = (* $arg3 $arg2 ) // Tab Size column items * columns in tabs ic = $arg3 // Items in Colum cit = $arg2 // Columns In Tab t = (div (- $p 1) $ts ) // Tabs divs p (total items) by Tab Size (total items in one tab) w = (mod (- $p 1) $ts ) // remainder from tabs mods (get reminder) of the div of p and ts c = (div $w $ic ) // Columns is done same as above to get the total number of columns z = (mod $w $ic ) // z reminder of items that will not fit in a tab or a column if (= $arg4 "0" ) [ // checks to see if it is to create a first tab or not. If there is 0 instead of a name then it will void ][ guitab ( $arg4 ) ] // creates a tab with the name given loop r $t [ // loops r the amount of tabs times guilist [ // loop o $cit [ // loops i the amount of Columns In Tab maketab $arg1 $arg5 $arg6 $ic // sends array command icon Items_In_Collums Index ] // showmapshot // ] // guitab (+ $r 2) // makes guitab r (starts at 0 and adds every time through) + 2 (so that it starts with 2 and increases) ] // guilist [ // loop e $c [ // maketab $arg1 $arg5 $arg6 $ic // runs again for the extra columns ] // runs again to make the remainder z maketab $arg1 $arg5 $arg6 (+ $z 1) // inx = 0 // reset inx just in case showmapshot // ] // ] maketab = [ guilist [ // i = 0 // loop g $arg4 [ // loops i items being created times v = ( at $arg1 $inx ) // guibutton $v (concat $arg2 $v ) $arg3 // inx = (+ $inx 1 ) // adds one so that it can pick the correct item from the array ] // ] // ] cleararray = [ $arg1 = "" ]