---------------------------------------------------------------------------------- --Viewport Background Manager Script --(C) Sam O'Hare, Uniform Communications Ltd, Jan 2005 --Email sam.ohare@pixelpollen.com --Version 0.2 --Current Functionality --Allow selection and quick changing of multiple viewport backgrounds --Proposed Functionality: -- ---------------------------------------------------------------------------------- macroScript BG_Switcher category:"Dusk" tooltip:"BG Switcher" icon:#("Uniform",4) ( --VARIABLES-- persistent global map_array --Array of bitmaps for use as backgrounds if map_array == undefined then map_array = #() map_names --Array of names of bitmaps to use in Listbox --FUNCTIONS-- fn get_names array = -- Collects all names for the name array ( if array[1] != undefined then ( map_names = for i in array collect i.filename as string ) ) get_names map_array if map_names == undefined then map_names = #() rollout VBS "Available Background Images" ( listbox bitmap_list height:10 items:map_names --width:352 button load_bm "Load" across:5 button remove_bm "Remove" button apply_bm "Apply" button view_bm "View" -- button active_bg "Active" button dialog "Dialog" on load_bm pressed do ( new_bm = selectBitmap caption:"Select BG image file" if new_bm != undefined then ( append map_array new_bm bitmap_list.items = get_names map_array ) ) on remove_bm pressed do ( if bitmap_list.selection != 0 then ( deleteItem map_array bitmap_list.selection bitmap_list.items = get_names map_array ) ) on apply_bm pressed do ( if bitmap_list.selection != 0 then ( setAsBackground map_array[bitmap_list.selection] ) ) on view_bm pressed do ( if bitmap_list.selection != 0 then ( display map_array[bitmap_list.selection] ) ) on dialog pressed do (max background) ) RF = newRolloutFloater "Viewport Background Switcher" 700 206 50 50 addrollout VBS RF )