home *** CD-ROM | disk | FTP | other *** search
/ GameStar Special 2002 April / GSSH42002.iso / EDITOREN / DS / gmax / gmaxinst_1-1.exe / gmaxsetup11.cab / Macro_CustomAttributes.mcr < prev    next >
Text File  |  2002-02-13  |  116KB  |  2,654 lines

  1. -- Custom Attributes MacroScript File
  2. --
  3. -- Created:          May 15 2000
  4. -- Last Updated:     Jan 4 2001
  5. --
  6. -- Author :   Frank DeLise
  7. -- Version:  3ds max 4
  8. --
  9. -- 
  10. -- Custom Attributes Macroscript file.
  11. --***********************************************************************************************
  12. -- MODIFY THIS AT YOUR OWN RISK
  13. --
  14. --  This Script Adds Custom Attributes to Objects, Modifier and Materials
  15.  
  16. MacroScript Custom_Attributes
  17. ButtonText:"Add Custom Attribute"
  18. Category:"Customize User Interface" 
  19. internalCategory:"Customize User Interface" 
  20. Tooltip:"Add a Custom Attribute" 
  21. SilentErrors:(CAT_Debug != True)
  22.  
  23. -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  24. -- Localization Notes
  25. --
  26. -- /* Localize On */ states an area where localization should begin
  27. -- /* Localize Off */ states an area where localization should end
  28. --
  29. -- *** Localization Note *** states that the next line has special localization instructions for the next line.
  30. -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  31.  
  32. (
  33.     Global CAT_Defs, CAT_NewAttrib, CAT_ValidCharacters = #()
  34.     Global CAT_PropRoll_Boolean, CAT_PropRoll_Float, CAT_PropRoll_Integer, CAT_PropRoll_Material, CAT_PropRoll_Array, CAT_PropRoll_Color, CAT_PropRoll_Node, CAT_TestRoll, CAT_DoneRoll, CAT_ParamRoll, CAT_Float, CAT_AddRollName, CAT_CreateRoll, CAT_NewRollName, CAT_SelChange, CAT_EnableUI, CAT_DisableUI
  35.     Global Cat_CheckedText, Cat_UIText, CAT_ChangeRoll, CAT_DeleteUIRoll, CAT_DefData, CAT_IsDeleting, CAT_UI_Array, CAT_UIList, CAT_Debug, CAT_AttribName, CAT_GetDef, CAT_DefExist, CAT_SetDef, CAT_CurrentDef, CAT_MActive, CAT_NewMActive, Cat_Reset 
  36.     Global CAT_Rollouts, CAT_Source = #(), CAT_Rollouts_List, CAT_UIItems, CAT_ParamBlock, CAT_UIItem, CAT_CUSTAttrib, CAT_ParamBlock_Array, CAT_UIItems_Array, CUSTString
  37.     Global CAT_Set_Roll_Float, CAT_Set_Roll_Integer, CAT_Set_Roll_Boolean, CAT_Set_Roll_Color, CAT_Set_Roll_Node, CAT_Set_Roll_Array, CAT_Set_Roll_TextureMap, CAT_ModIndex
  38.     Global CAT_EvalUI, CAT_AddUI, CAT_EditUI, CAT_EditUIRoll, CAT_TextChecker, CAT_Edit_Set, CAT_AnyErrors, CAT_AnyErrors_Num = 1
  39.  
  40.     Persistent Global CAT_UINum, CAT_dummy_place_holder  
  41.     if CAT_UINum == undefined do 
  42.     ( 
  43.         CAT_UINum  = 1
  44.     )
  45.  
  46.     -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  47.     -- Rollout States
  48.     -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  49.     
  50.     Global CAT_UI_POS, CAT_UI_Size, CAT_UI_Prop_State
  51.     Global CAT_Boolean_State, CAT_Array_State, CAT_Integer_State, CAT_Float_State, CAT_Node_State, CAT_Material_State, CAT_Color_State
  52.     
  53.     Global CAT_Updating_UI = false -- keep CAT_EvalUI from looping.  Specifies that you are already updating.
  54.     
  55.     -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  56.     -- Rollout for Deleting UI Items
  57.     -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  58.  
  59.     /* Localize On */
  60.     
  61.     Rollout CAT_DeleteUIRoll "Delete Attribute" SilentErrors:(CAT_Debug != True)
  62.     (
  63.         Button CAT_DeleteUI_All     "Delete All"         Align:#Center     Offset:[0,0]     Height:20     Width:100
  64.         ListBox CAT_UIList             "Attributes:"
  65.         Button CAT_DeleteUI_OK         "Delete Selected"     Across:2    Align:#Left
  66.         Button CAT_DeleteUI_Cancel  "Close"                Align:#Right
  67.     
  68.     /* Localize Off */
  69.  
  70.         On CAT_DeleteUI_OK pressed do 
  71.         (
  72.             -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  73.             -- This is where the delete selected button action takes place.
  74.             -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  75.  
  76.             
  77.             -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  78.             -- Here the def data Arrays are cleared to start a fresh one
  79.             -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  80.                                     
  81.             CAT_ParamBlock_Array = #()
  82.             CAT_UIItems_Array = #()
  83.             CAT_UI_Array = #()
  84.             
  85.             If Debug == True then Format "%\n" ("Current Def Data Information Defore Deletion = " + CAT_Source as string)
  86.         
  87.             -- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  88.             --  Count the number of UI items found in the definition from the Cat_GetDef() funtion, Then build a UI Items list , Cat_UIItems_Array and CAT_Paramblock array
  89.             --  When building the new array, it excludes the ui item that corrispondes to the listbox item that was selected for delection.
  90.             --  CAT_UI_Array is a string array for the delete listbox.
  91.             -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  92.         
  93.             For i in 1 to CAT_DefData[2].count do
  94.             (
  95.                 If CAT_UIList.selection != i then
  96.                 (
  97.                     If CAT_DefData[2][i] != undefined then
  98.                     (
  99.                         Append CAT_UIItems_Array CAT_DefData[2][i]
  100.                          Append CAT_ParamBlock_Array CAT_DefData[1][i]
  101.                     )
  102.                 )
  103.             )
  104.             
  105.         -- Debug
  106.         If Debug == True then Format "%\n" ("New UI List " + CAT_UIItems_Array as string + "\n")
  107.              
  108.         -- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  109.         -- CAT_NewAttrib is the source for defdata, CAT_NewAttrib[1] is the paramblock array, CAT_NewAttrib[2] is the UI items associated with the paramblock. This is what is associated
  110.         -- in the the defdata of the object.
  111.         --
  112.         -- Once the item is deleted, A new CAT_NewAttrib is made and the array are stuffed into CAT_NewAttrib[1] and CAT_NewAttrib[2]
  113.         -- The Current definition is then set back to the current definition, "CAT_CurrentDef.Defdata = CAT_NewAttrib"
  114.         -- CAT_CurrentDef is the current custom attribute and is retrieved whenever CAT_GetDef() is called on the selected object.
  115.         -- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  116.                 
  117.                 CAT_Source[1] = CAT_ParamBlock_Array as array
  118.                 CAT_Source[2] = CAT_UIItems_Array as array
  119.                                 
  120.  
  121.             undo "Delete CA" on 
  122.             (                
  123.                 
  124.         -- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  125.         -- This flag is set to tell tha Cat_AddUI funtion that we are currently deleting
  126.         -- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////        
  127.         
  128.                 CAT_IsDeleting = True
  129.         
  130.         -- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////        
  131.         -- CAT_AddUI is the function that adds the actually custom attribute    
  132.         -- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////    
  133.                 
  134.                 If Debug == True then Format "%\n" ("Current Def Data Information after Deletion = " + CAT_Source as string)
  135.                 
  136.                 CAT_AddUI ()
  137.                 Cat_SetDef()
  138.                                                 
  139.         -- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////        
  140.         -- Update Delete List Box
  141.         -- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////            
  142.             
  143.                 CAT_UIList.items = CAT_UI_Array
  144.             )
  145.  
  146.         )
  147.         On CAT_DeleteUI_Cancel pressed Do 
  148.         (
  149.             DestroyDialog CAT_DeleteUIRoll
  150.         )
  151.         
  152.         On CAT_DeleteUI_All pressed do
  153.         (
  154.         
  155.         -- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////        
  156.         -- Delete the Custom Attribute Definition
  157.         -- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  158.     
  159.             /* Localize On */
  160.             
  161.             if Querybox "This Will Delete ALL Custom Attributes \n On The Selected Object \n Continue?" Title:"Custom Attributes" then
  162.             (
  163.             
  164.             /* Localize Off */
  165.     
  166.                 Case CAT_DoneRoll.CAT_AddTo.selection of
  167.                 (
  168.                     1:(if getCommandPanelTaskMode() != #Create Then Max Create Mode; Undo "Delete All CAs" On (CustAttributes.Delete Selection[1].BaseObject CAT_CurrentDef))
  169.                     2:(Undo "Delete All CAs" On (CustAttributes.Delete Selection[1].modifiers[CAT_ModIndex] CAT_CurrentDef))
  170.                     3:(if getCommandPanelTaskMode() != #Create Then Max Create Mode; Undo "Delete All CAs" On (CustAttributes.Delete Selection[1].material CAT_CurrentDef))
  171.                 )
  172.             
  173.                 if getCommandPanelTaskMode() != #Modify Then Max Modify Mode
  174.                                                 
  175.                 DestroyDialog CAT_DeleteUIRoll
  176.             ) 
  177.         )
  178.  
  179.     )
  180.     
  181.             
  182.     --/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  183.     -- Rollout for Boolen Options
  184.     --/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  185.     
  186.     /* Localize On */
  187.     
  188.     Rollout CAT_PropRoll_Boolean "Boolean UI Options" Rolledup:True SilentErrors:(CAT_Debug != True)
  189.     (
  190.             Group "Size"
  191.             (
  192.                 Spinner CAT_Width     "Width:"     Width:70     Align:#Right     Type:#Integer     Range:[1,160,70]     Across:2
  193.                 Spinner CAT_Height     "Height:"    Width:70     Align:#Right     Type:#Integer     Range:[1,160,25]
  194.             )
  195.             Group "Alignment"
  196.             (
  197.                 RadioButtons CAT_Align Labels:#("Left", "Right", "Center") columns:3 Across:1 Default:3
  198.             )    
  199.  
  200.             Group "Check Button Options"
  201.             (
  202.                 ColorPicker CAT_HighLight "Highlight Color:" Color:[253,221,8] Enabled:False
  203.             )
  204.             
  205.     /* Localize Off */
  206.         
  207.             On CAT_Width                 Changed        Value do     Cat_EvalUI()
  208.             On CAT_Height                 Changed     Value do    Cat_EvalUI()
  209.             On CAT_Align                 Changed        State do    Cat_EvalUI()
  210.             On CAT_Highlight             Changed        Color do    Cat_EvalUI()
  211.     )
  212.     
  213.     --/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  214.     -- Rollout for Array Options
  215.     --/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  216.  
  217.     /* Localize On */
  218.     
  219.         Rollout CAT_PropRoll_Array "Array UI Options" Rolledup:True SilentErrors:(CAT_Debug != True)
  220.         (
  221.             Local CAT_MyArray = #()
  222.             
  223.             Group "Size"
  224.             (
  225.                 Spinner CAT_Width     "Width:"    Width:70    Align:#Right     Type:#Integer     Range:[1,160,150]     Across:2
  226.                 Spinner CAT_Height     "Height:"     Width:70     Align:#Right     Type:#Integer     Range:[1,160,5]
  227.             )
  228.             Group "Alignment"
  229.             (
  230.                 RadioButtons CAT_Align Labels:#("Left", "Right", "Center") columns:3 Across:1 Default:3
  231.             )
  232.             Group "Array"
  233.             (
  234.                 EditText CAT_ArrayName "Item name:"
  235.                 Button CAT_AddItem "Add Item:" Across:2 Width:70
  236.                 Button CAT_ClearArray "Clear Array:" Width:70
  237.                 ListBox CAT_AItems ""    
  238.             )
  239.             
  240.     /* Localize Off */
  241.  
  242.             On CAT_AddItem pressed do
  243.             (
  244.                 checked_item_text = CAT_ArrayName.Text
  245.                 str = "\""
  246.                 location = findString checked_item_text str
  247.                 master_location = 0
  248.                 while location != undefined do
  249.                 ( 
  250.                     master_location += location
  251.                     checked_item_text = replace checked_item_text master_location 1 "\\\""
  252.                     location = findString (subString checked_item_text (master_location + 2) -1) str
  253.                     master_location += 1
  254.                 )
  255.                 Append CAT_MyArray checked_item_text
  256.                 
  257.                 formatted_name_array = #()
  258.                 for i in 1 to CAT_MyArray.count do
  259.                 (
  260.                     temp_text_string = CAT_MyArray[i]
  261.                     -- strip the backslashes from the "'s before displaying in the list
  262.                     location = findString temp_text_string "\\\""
  263.                     while location != undefined do
  264.                     (
  265.                         temp_text_string = replace temp_text_string location 2 "\""
  266.                         format temp_text_string
  267.                         location = findString temp_text_string "\\\""
  268.                     )
  269.                     Append formatted_name_array temp_text_string
  270.                 )
  271.                 CAT_AItems.items = formatted_name_array
  272.                 
  273.                 Try(Cat_EvalUI())Catch()
  274.             )    
  275.             
  276.             On CAT_ClearArray Pressed do
  277.             (    
  278.                 CAT_MyArray = #()
  279.                 CAT_AItems.items = CAT_MyArray
  280.                 (Try(Cat_EvalUI())Catch())
  281.             )
  282.     
  283.             On CAT_Width                 Changed        value do     Cat_EvalUI()
  284.             On CAT_Height                 Changed     value do    Cat_EvalUI()
  285.             On CAT_Align                 Changed        State do    Cat_EvalUI()
  286.             
  287.     
  288.         )
  289.     
  290.     --/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  291.     -- Rollout for Color Options
  292.     --/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  293.     
  294.     /* Localize On */
  295.  
  296.         Rollout CAT_PropRoll_Color "Color UI Options" Rolledup:True SilentErrors:(CAT_Debug != True)
  297.         (
  298.             Group "Size"
  299.             (
  300.                 Spinner CAT_Width     "Width:"     Width:70     Align:#Right     Type:#Integer     Range:[1,160,100]     Across:2
  301.                 Spinner CAT_Height     "Height:"     Width:70     Align:#Right     Type:#Integer     Range:[1,160,25]
  302.             )
  303.             Group "Alignment"
  304.             (
  305.                 RadioButtons CAT_Align Labels:#("Left", "Right", "Center") columns:3 Across:1 Default:3
  306.             )
  307.             Group "ColorPicker Default Color"
  308.             (
  309.                 ColorPicker CAT_DColor "Default Color:" Color:[253,221,8] Enabled:True
  310.             )
  311.             
  312.     /* Localize Off */
  313.             
  314.             On CAT_Width                 Changed        Value do     Cat_EvalUI()
  315.             On CAT_Height                 Changed     Value do    Cat_EvalUI()
  316.             On CAT_Align                 Changed        State do    Cat_EvalUI()
  317.             On CAT_DColor                 Changed        Color do    Cat_EvalUI()
  318.             
  319.     
  320.         )
  321.         
  322.     ---/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  323.     -- Rollout for Node Options
  324.     ---/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  325.     -- This is the rollup for editing Node picking options
  326.  
  327.     /* Localize On */
  328.     
  329.         Rollout CAT_PropRoll_Node "Node UI Options" Rolledup:True SilentErrors:(CAT_Debug != True)
  330.         (
  331.             Group "Size"
  332.             (
  333.                 Spinner CAT_Width     "Width:"     Width:70     Align:#Right     Type:#Integer     Range:[1,160,150]     Across:2
  334.                 Spinner CAT_Height     "Height:"    Width:70    Align:#Right     Type:#Integer     Range:[1,160,25]
  335.             )
  336.             Group "Alignment"
  337.             (
  338.                 RadioButtons CAT_Align Labels:#("Left", "Right", "Center") columns:3 Across:1 Default:3
  339.             )
  340.             
  341.     /* Localize Off */
  342.         
  343.             On CAT_Width                 Changed        Value do     Cat_EvalUI()
  344.             On CAT_Height                 Changed     Value do    Cat_EvalUI()
  345.             On CAT_Align                 Changed        State do    Cat_EvalUI()
  346.             
  347.     
  348.         )
  349.  
  350.     ---/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  351.     -- Rollout for Material Options
  352.     ---/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  353.     -- This is the rollup for editing Map Button options
  354.     
  355.     /* Localize On */
  356.     
  357.         Rollout CAT_PropRoll_Material "TextureMap UI Options" Rolledup:True SilentErrors:(CAT_Debug != True)
  358.         (
  359.             Group "Size"
  360.             (
  361.                 Spinner CAT_Width     "Width:"     Width:70     Align:#Right     Type:#Integer    Range:[1,160,150]     Across:2
  362.                 Spinner CAT_Height     "Height:"     Width:70     Align:#Right     Type:#Integer     Range:[1,160,25]
  363.             )
  364.             Group "Alignment"
  365.             (
  366.                 RadioButtons CAT_Align Labels:#("Left", "Right", "Center") columns:3 Across:1 Default:3
  367.             )
  368.  
  369.     /* Localize Off */    
  370.             
  371.             On CAT_Width                 Changed        Value do     Cat_EvalUI()
  372.             On CAT_Height                 Changed     Value do    Cat_EvalUI()
  373.             On CAT_Align                 Changed        State do    Cat_EvalUI()
  374.             
  375.     
  376.         )
  377.         
  378.     --/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  379.     -- Rollout for Array Options
  380.     --/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  381.     -- This is the rollup for editing Array options
  382.     
  383.     /* Localize On */
  384.  
  385.         Rollout ArrayRoll "Attribute UI Options" Rolledup:True SilentErrors:(CAT_Debug != True)
  386.         (
  387.             Group "Array"
  388.             (
  389.                 EditText CAT_ArrayName "Item name:"
  390.                 Button CAT_AI "Add Item:" Across:2 
  391.                 Button CAT_DI "Delete Item:" 
  392.                 ListBox CAT_AItems ""    
  393.             )
  394.             Group "Alignment"
  395.             (
  396.                 RadioButtons CAT_Align Labels:#("Left", "Right", "Center") columns:3 Across:1 Default:3
  397.             )    
  398.             
  399.    /* Localize Off */
  400.         
  401.             On CAT_Width                 Changed        value do     (Try(Cat_EvalUI())Catch())
  402.             On CAT_Height                 Changed     value do    (Try(Cat_EvalUI())Catch())
  403.             On CAT_Align                 Changed        State do    (Try(Cat_EvalUI())Catch())
  404.         
  405.         )
  406.     --/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  407.     -- Rollout for Testing
  408.     --/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  409.     -- This rollup tests the attribute
  410.     
  411.     /* Localize On */
  412.  
  413.         Rollout CAT_TestRoll "Testing Attribute" SilentErrors:(CAT_Debug != True)
  414.         (
  415.         )
  416.         
  417.     /* Localize Off */
  418.     
  419.     ---/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  420.     -- Rollout for Creating the final Attribute
  421.     --/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  422.     
  423.     /* Localize On */
  424.                 
  425.         Rollout CAT_DoneRoll "Finish" SilentErrors:(CAT_Debug != True)
  426.         (
  427.                         
  428.             Group "Add Attribute to Type:"
  429.             (
  430.                 -- DropDownList CAT_AddTo Items:#("Object's Base Level ", "Object's Current Modifier", "Object's Material") Enabled:(Selection.count == 1)
  431.                 DropDownList CAT_AddTo Items:#("Object's Base Level ", "Object's Current Modifier") Enabled:(Selection.count == 1)
  432.             )
  433.             Group "Add\Delete Custom Attribute"
  434.             (
  435.                 Button CAT_Add       "Add"         Width:50     Across:2    Height:20     Offset:[-5,0]  Enabled:(Selection.count == 1)
  436.                 Button CAT_Delete     "Delete"     Width:50                Height:20     Enabled:(Selection.count == 1)
  437.             --    Button CAT_Update     "Update"     Width:50                Height:20     Enabled:(Selection.count == 1)
  438.                 Label CAT_L2 "" Offset:[0,-10]
  439.             )
  440.     
  441.     /* Localize Off */
  442.     
  443.     ---/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  444.     -- This is where the whole thing begins. :) When "Add" in the UI is pressed the code starts here....
  445.     --/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  446.                     
  447.             On CAT_Add Pressed do
  448.             (
  449.                 Try(if CAT_EditUIRoll != undefined do DestroyDialog CAT_EditUIRoll)Catch()
  450.                 ---/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  451.                 -- set delete mode false
  452.                 --/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  453.             
  454.                 CAT_IsDeleting = False
  455.                 
  456.                 ---/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  457.                 -- Clear UI and ParamBlock Arrays
  458.                 ---/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  459.                 
  460.                 CAT_ParamBlock_Array = #()
  461.                 CAT_UIItems_Array = #()
  462.                 CAT_Source = #()
  463.                 CAT_NewAttrib = #()                
  464.                 
  465.                 ---/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  466.                 -- If Attribute exisits, extract definition
  467.                 ---/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  468.                 
  469.                 CAT_GetDef()
  470.                 
  471.                 ---/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  472.                 -- Check for duplicate UI items
  473.                 ---/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  474.                 
  475.                 Cat_ParamExists = False
  476.                 
  477.                 For i in 1 to Cat_Paramblock_Array.count do
  478.                 (
  479.                     If Cat_Paramblock_Array[i].name == Cat_CheckedText then (Cat_ParamExists = True) 
  480.                     
  481.                 )
  482.                 
  483.                 /* Localize On */
  484.                 
  485.                 If Cat_ParamExists == True then MessageBox "Parameter Name Exists!\nPlease Enter a New Name" Title:"Custom Attributes" 
  486.                 
  487.                 /* Localize Off */
  488.                 
  489.                     Else
  490.                     (
  491.                         ---/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  492.                         --- Call the CAT_AddUI function, This funtion sets up the parameter and creates the custom attribute definition
  493.                         ---/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////    
  494.                         
  495.                         undo "Add CA" on 
  496.                         (
  497.                             ui_added = CAT_AddUI ()
  498.                             ---/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  499.                             -- Once the UI item is added, it append the new UI item and Paramblock item into the following 2 arrays 
  500.                             ---/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  501.                              if ui_added == true do
  502.                              (
  503.                                 Append CAT_ParamBlock_Array CAT_NewAttrib[1]
  504.                                 Append CAT_UIItems_Array CAT_NewAttrib[2]
  505.                                 
  506.                                 If Debug == True then Format "%\n" ("Added ParamBlock Item:" + CAT_ParamBlock_Array[CAT_ParamBlock_Array.count].name as string)
  507.                                 If Debug == True then Format "%\n" ("Added UI Item:" + CAT_ParamBlock_Array[CAT_ParamBlock_Array.count].name as string)
  508.                                 
  509.                                 -- Debug Print
  510.                                 
  511.                                 If CAT_Debug == True then Format "%\n" ("New ParamBlock Array: " + CAT_ParamBlock_Array as string + "\n")
  512.                                 If CAT_Debug == True then Format "%\n" ("New UIItems Array: " + CAT_UIItems_Array as string + "\n")
  513.                                 CAT_Source[1] = CAT_ParamBlock_Array
  514.                                 CAT_Source[2] = CAT_UIItems_Array
  515.                              
  516.                                 ---/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  517.                                 -- This takes the new paramblock and UI Items and sets it into the object as the new defdata using CAT_SetDef() function 
  518.                                 ---/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  519.                                 CAT_SetDef ()
  520.                             
  521.                                 ---/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  522.                                 -- Increment the param name number and reset the UI name feilds
  523.                                 --/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  524.                             
  525.                                 CAT_UINum += 1
  526.                                 CAT_ParamRoll.CAT_UIName.text = ("Param" + CAT_UINum as string)
  527.                                 Cat_CheckedText = ("Param" + CAT_UINum as string)
  528.                                 Cat_UIText = Cat_CheckedText
  529.                               ) 
  530.                             
  531.                             /* Localize On */
  532.                             
  533.                             
  534.                             /* Localize Off */
  535.                         ) -- undo off
  536.                         
  537.                         Try(Cat_EvalUI())Catch()
  538.                         
  539.                         -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  540.                         -- Update Delete UI List
  541.                         -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  542.  
  543.                         
  544.                         Try
  545.                         (
  546.                             CAT_GetDef()
  547.                             CAT_DeleteUIRoll.CAT_UIList.items = CAT_UI_Array
  548.                             
  549.                         )Catch()
  550.                                     
  551.                 
  552.                 )
  553.             )
  554.         
  555.                                 
  556.             On CAT_Delete Pressed do
  557.             (
  558.                 
  559.                 CAT_GetDef()                
  560.                 
  561.                 (CreateDialog CAT_DeleteUIRoll Pos:([CAT_Float.Pos.x + 225, CAT_Float.Pos.y + 250]) Width:200 Height:220)
  562.                 
  563.                 CAT_DeleteUIRoll.CAT_UIList.Items = CAT_UI_Array
  564.                 
  565.             )
  566.             
  567.             On CAT_Update Pressed do
  568.             (
  569.                 
  570.                 CAT_GetDef()
  571.                 CAT_EditUI()                
  572.                             
  573.             )
  574.             
  575.             On CAT_DoneRoll open do 
  576.             (
  577.                 Cat_EvalUI()
  578.                 if Cat_UIText != undefined do CAT_ParamRoll.CAT_UIName.text = Cat_UIText
  579.             )
  580.             
  581.         ) 
  582.     
  583.     -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  584.     -- Rollout for Float Options
  585.     -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  586.  
  587.     -- UI options for floats
  588.         
  589.         /* Localize On */
  590.         
  591.         Rollout CAT_PropRoll_Float "Float UI Options" Rolledup:True SilentErrors:(CAT_Debug != True)
  592.         (
  593.             Group "Size"
  594.             (
  595.                 Spinner CAT_Width     "Width:"     Width:100     Align:#Center     Type:#Float     Range:[1,160,160]     
  596.             )
  597.             Group "Range"
  598.             (
  599.                 Spinner CAT_UIRangeStart         "From:"             Range:[-99999,99999,0]         Align:#Center     Across:2         Type:#Float Width:90
  600.                 Spinner CAT_UIRangeEnd             "To:"             Range:[-99999,99999,100]    Align:#Right                     Type:#Float    Width:90
  601.                 Spinner CAT_UIRangeDefault         "Default:"         Range:[-99999,99999,0]         Align:#Center    Across:1         Type:#Float Width:95 Offset:[-5,0]
  602.             )
  603.             Group "Alignment"
  604.             (
  605.                 RadioButtons CAT_Align Labels:#("Left", "Right", "Center") columns:3 Across:1 Default:3
  606.             )    
  607.             Group "Orientation and Ticks"
  608.             (
  609.                 CheckBox CAT_Orient "Vertical:" Align:#Left Across:2 Enabled:False
  610.                 Spinner CAT_Ticks "Ticks:" Type:#Integer Range:[0,999,0] Enabled:False
  611.             )
  612.             
  613.             /* Localize Off */
  614.                                 
  615.             On CAT_Ticks                 Changed     value do    (Try(Cat_EvalUI())Catch())
  616.             On CAT_UIRangeStart         Changed     value do    (Try(Cat_EvalUI())Catch())
  617.             On CAT_UIRangeEnd             Changed        value do    (Try(Cat_EvalUI())Catch())
  618.             On CAT_UIRangeDefault         Changed     value do    (Try(Cat_EvalUI())Catch())
  619.             On CAT_Width                 Changed        value do     (Try(Cat_EvalUI())Catch())
  620.             On CAT_Height                 Changed     value do    (Try(Cat_EvalUI())Catch())
  621.             On CAT_Align                 Changed        State do    (Try(Cat_EvalUI())Catch())    
  622.             On CAT_Orient                 Changed     State do     (Try(Cat_EvalUI())Catch())
  623.             
  624.         )
  625.         
  626.     -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  627.     -- Rollout for Integer Options
  628.     -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  629.     -- UI options for Integers and floats
  630.     
  631.     /* Localize On */
  632.         
  633.         Rollout CAT_PropRoll_Integer "Integer UI Options" Rolledup:True SilentErrors:(CAT_Debug != True)
  634.         (
  635.             Group "Size"
  636.             (
  637.                 Spinner CAT_Width     "Width:"     Width:100     Align:#Center     Type:#Integer     Range:[1,160,160]     
  638.             )
  639.             Group "Range"
  640.             (
  641.                 Spinner CAT_UIRangeStart     "From:"             Range:[-99999,99999,0]         Align:#Center     Across:2     Type:#Integer Width:90
  642.                 Spinner CAT_UIRangeEnd         "To:"             Range:[-99999,99999,100]    Align:#Right                 Type:#Integer    Width:90
  643.                 Spinner CAT_UIRangeDefault "Default:"         Range:[-99999,99999,0]         Align:#Center    Across:1         Type:#Integer Width:90 Offset:[-5,0]
  644.             )
  645.             Group "Alignment"
  646.             (
  647.                 RadioButtons CAT_Align Labels:#("Left", "Right", "Center") columns:3 Across:1 Default:3
  648.                 
  649.                 
  650.             )    
  651.             Group "Orientation and Ticks"
  652.             (
  653.                 CheckBox CAT_Orient "Vertical:" Align:#Left Across:2 Enabled:False
  654.                 Spinner CAT_Ticks "Ticks:" Type:#Integer Range:[0,999,0] Enabled:False
  655.             )
  656.             
  657.     /* Localize Off */    
  658.             
  659.             On CAT_Ticks                 Changed     value do    (Try(Cat_EvalUI())Catch())
  660.             On CAT_UIRangeStart         Changed     value do    (Try(Cat_EvalUI())Catch())
  661.             On CAT_UIRangeEnd             Changed        value do    (Try(Cat_EvalUI())Catch())
  662.             On CAT_UIRangeDefault         Changed     value do    (Try(Cat_EvalUI())Catch())
  663.             On CAT_Width                 Changed        value do     (Try(Cat_EvalUI())Catch())
  664.             On CAT_Height                 Changed     value do    (Try(Cat_EvalUI())Catch())
  665.             On CAT_Align                 Changed        State do    (Try(Cat_EvalUI())Catch())    
  666.             On CAT_Orient                 Changed     State do     (Try(Cat_EvalUI())Catch())
  667.             
  668.         )
  669.         
  670.     -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  671.     -- Rollout for UI Type Options
  672.     -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  673.     
  674.     /* Localize On */
  675.     
  676.         Rollout CAT_ParamRoll "Attribute Style" SilentErrors:(CAT_Debug != True)
  677.         (
  678.             Local CAT_Items = #("Float", "Integer", "Boolean", "Array", "Node", "Color", "TextureMap") --, CAT_AddUI
  679.             
  680.             Group "Parameter Type:"
  681.             (
  682.                 DropDownList CAT_Type Items:CAT_Items
  683.             )
  684.             
  685.             Group "UI Type"
  686.             (
  687.                 DropDownList CAT_UIType Items:#("Spinner", "Slider")
  688.                 EditText CAT_UIName "Name:" text:"Param" -- + CAT_UINum as string)
  689.             )
  690.             
  691.     /* Localize Off */    
  692.     
  693.             On CAT_UIType selected i do
  694.             (
  695.                 Cat_EvalUI()
  696.             )
  697.             
  698.         
  699.             
  700.             On CAT_UIName Changed text do 
  701.             (
  702.                 -- AF (4/23/01) make this a valid sting by putting single quotes around it 
  703.                 CAT_TextChecker text
  704.             )
  705.             
  706.             
  707.             On CAT_UIName entered text do 
  708.             (
  709.                 -- AF (4/23/01) make this a valid sting by putting single quotes around it 
  710.                 CAT_TextChecker text
  711.                  Cat_EvalUI()
  712.             )
  713.         
  714.             On CAT_ParamRoll Close do 
  715.             (
  716.                 Try(
  717.                     CallBacks.RemoveScripts #SelectionSetChanged ID:#CAT_Callback
  718.                     if CAT_DeleteUIRoll != undefined do DestroyDialog CAT_DeleteUIRoll
  719.                     if CAT_EditUIRoll != undefined do DestroyDialog CAT_EditUIRoll
  720.                     if CAT_CreateRoll != undefined do DestroyDialog CAT_CreateRoll
  721.                     )Catch()
  722.             )
  723.                         
  724.             On CAT_ParamRoll moved pos do
  725.             (
  726.                 CAT_UI_POS = POS
  727.             )
  728.             On CAT_ParamRoll Resized Size do
  729.             (
  730.                 CAT_UI_Size = Size
  731.             )
  732.             
  733.             On CAT_Type selected i do
  734.             (
  735.                 Case of 
  736.                 (
  737.                     -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  738.                     -- Float
  739.                     -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  740.                     
  741.                     (i == 1):(CAT_Set_Roll_Float())
  742.                 
  743.                     -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  744.                     -- Integer
  745.                     -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  746.  
  747.                                                                                                             
  748.                     (i == 2):(CAT_Set_Roll_Integer())            
  749.                             
  750.                     -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  751.                     -- Boolean
  752.                     --- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  753.              
  754.                     (i == 3):(CAT_Set_Roll_Boolean())
  755.                                      
  756.                     -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  757.                     -- Array
  758.                     -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  759.                         
  760.                     (i == 4):(CAT_Set_Roll_Array ())                
  761.                                                         
  762.                     -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  763.                     -- Node
  764.                     -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  765.                 
  766.                     (i == 5):(CAT_Set_Roll_Node())
  767.                                             
  768.                     -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  769.                     -- Color
  770.                     -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  771.         
  772.                     (i == 6):(CAT_Set_Roll_Color())
  773.                                     
  774.                     -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  775.                     -- TextureMap
  776.                     -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  777.  
  778.                                     
  779.                     (i == 7):(CAT_Set_Roll_TextureMap())
  780.                 )
  781.             )
  782.                         
  783.     
  784.     )
  785.     -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  786.     -- Function for testing the UI
  787.     -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  788.  
  789.     FN Cat_EvalUI = 
  790.             (
  791.             --    Try(
  792.                 
  793.                 if CAT_Updating_UI == false do
  794.                 (
  795.                     CAT_Updating_UI = true
  796.                     RemoveRollout CAT_TestRoll CAT_Float
  797.  
  798.     
  799.                     -- *** Localization Note ***
  800.                     -- The "Testing Attribute" name needs to be localized in ("Rollout CAT_TestRoll \"Testing Attribute\" \n" + )
  801.                                     
  802.                     Cat_EvalString = "Rollout CAT_TestRoll \"Testing Attribute\" \n" + "( \n" 
  803.     
  804.                     Case CAT_ParamRoll.CAT_UIType.selected of
  805.                     (
  806.                             
  807.                         -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  808.                         -- Spinner
  809.                         -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////                
  810.                         "Spinner":(
  811.                                         CAT_DoneRoll.CAT_Add.enabled = (Selection.count ==1)
  812.                                         CAT_DoneRoll.CAT_Delete.enabled = (Selection.count ==1)
  813.                                         CAT_DoneRoll.CAT_AddTo.enabled = (Selection.count ==1)
  814.                                         
  815.                                         Cat_EvalString += CAT_ParamRoll.CAT_UIType.selected + " Cat_Testui " + "\"" + Cat_UIText + "\"" + " Type:#" 
  816.                                         Case CAT_ParamRoll.CAT_Type.Selection of 
  817.                                         (
  818.                                             1:(
  819.                                             
  820.                                                 Cat_EvalString += "Float"
  821.                                                 Cat_EvalString += " Width:" + CAT_PropRoll_Float.CAT_Width.value as string
  822.                                             --    Cat_EvalString += " Height:" + CAT_PropRoll_Float.CAT_Height.value as string
  823.                                                 Cat_EvalString += " Range:[" + CAT_PropRoll_Float.CAT_UIRangeStart.value as string + "," + CAT_PropRoll_Float.CAT_UIRangeEnd.value as string + "," + CAT_PropRoll_Float.CAT_UIRangeDefault.value as string + "]"
  824.                                                 Cat_EvalString += " Align:#" 
  825.                                         
  826.                                                 Case CAT_PropRoll_Float.CAT_Align.state of 
  827.                                                 (
  828.                                             
  829.                                                     1:(Cat_EvalString += "Left") 
  830.                                                     2:(Cat_EvalString += "Right") 
  831.                                                     3:(Cat_EvalString += "Center")
  832.                                                 )
  833.                                                                     
  834.                                                 CAT_PropRoll_Float.CAT_Orient.Enabled = False
  835.                                                 CAT_PropRoll_Float.CAT_Ticks.Enabled = False
  836.                                                 
  837.                                                 CAT_DoneRoll.CAT_Add.enabled = (Selection.count ==1)
  838.                                                 CAT_DoneRoll.CAT_Delete.enabled = (Selection.count ==1)
  839.                                             
  840.                                             )
  841.                                             2:(
  842.                                                     Cat_EvalString +="Integer"
  843.                                                     Cat_EvalString += " Width:" + CAT_PropRoll_Integer.CAT_Width.value as string
  844.                                                 --    Cat_EvalString += " Height:" + CAT_PropRoll_Integer.CAT_Height.value as string
  845.                                                     Cat_EvalString += " Range:[" + CAT_PropRoll_Integer.CAT_UIRangeStart.value as string + "," + CAT_PropRoll_Integer.CAT_UIRangeEnd.value as string + "," + CAT_PropRoll_Integer.CAT_UIRangeDefault.value as string + "]"
  846.                                                     Cat_EvalString += " Align:#" 
  847.                                         
  848.                                                     Case CAT_PropRoll_Integer.CAT_Align.state of 
  849.                                                     (
  850.                                             
  851.                                                         1:(Cat_EvalString += "Left") 
  852.                                                         2:(Cat_EvalString += "Right") 
  853.                                                         3:(Cat_EvalString += "Center")
  854.                                                     )
  855.                                                                     
  856.                                                     CAT_PropRoll_Integer.CAT_Orient.Enabled = False
  857.                                                     CAT_PropRoll_Integer.CAT_Ticks.Enabled = False
  858.                                                     
  859.                                                     CAT_DoneRoll.CAT_Add.enabled = (Selection.count ==1)
  860.                                         
  861.                                             
  862.                                             )
  863.                                         )
  864.                                         
  865.                                         
  866.                                     )
  867.                         
  868.                         -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  869.                         -- Slider
  870.                         -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  871.                          
  872.                         "Slider":(
  873.                                     
  874.                                     CAT_DoneRoll.CAT_Add.enabled = (Selection.count ==1)
  875.                                     CAT_DoneRoll.CAT_Delete.enabled = (Selection.count ==1)
  876.                                     CAT_DoneRoll.CAT_AddTo.enabled = (Selection.count ==1)
  877.                                 
  878.                                     Cat_EvalString += (CAT_ParamRoll.CAT_UIType.selected + " CAT_Testui " + "\"" + Cat_UIText + "\"" + " Type:#")
  879.                                     
  880.                                     Case CAT_ParamRoll.CAT_Type.selection of 
  881.                                     (
  882.                                         1:(
  883.                                             Cat_EvalString += "Float"
  884.                                             Cat_EvalString += " Width:" + CAT_PropRoll_Float.CAT_Width.value as string 
  885.                                         --    Cat_EvalString += " Height:" + CAT_PropRoll_Float.CAT_Height.value as string
  886.                                             Cat_EvalString += " Align:#" 
  887.                                     
  888.                                             Case CAT_PropRoll_Float.CAT_Align.state of 
  889.                                             (
  890.                                                 1:(Cat_EvalString += "Left") 
  891.                                                 2:(Cat_EvalString += "Right") 
  892.                                                 3:(Cat_EvalString += "Center")
  893.                                             )
  894.                                     
  895.                                             Cat_EvalString += " Orient:#" + (if CAT_PropRoll_Float.CAT_Orient.state == True then "Vertical" Else "Horizontal")
  896.                                             Cat_EvalString += " Ticks:" + CAT_PropRoll_Float.CAT_Ticks.value as string
  897.                                             Cat_EvalString += " Range:[" + CAT_PropRoll_Float.CAT_UIRangeStart.value as string + "," + CAT_PropRoll_Float.CAT_UIRangeEnd.value as string + "," + CAT_PropRoll_Float.CAT_UIRangeDefault.value as string + "]"
  898.                                 
  899.                                     
  900.                                         CAT_PropRoll_Float.CAT_Orient.Enabled = True
  901.                                         CAT_PropRoll_Float.CAT_Ticks.Enabled = True
  902.     
  903.                                         )
  904.                                         
  905.                                          2:(
  906.                                             Cat_EvalString += "Integer"
  907.                                             Cat_EvalString += " Width:" + CAT_PropRoll_Integer.CAT_Width.value as string 
  908.                                         --    Cat_EvalString += " Height:" + CAT_PropRoll_Integer.CAT_Height.value as string
  909.                                             Cat_EvalString += " Align:#" 
  910.                                     
  911.                                             Case CAT_PropRoll_Integer.CAT_Align.state of 
  912.                                             (
  913.                                                 1:(Cat_EvalString += "Left") 
  914.                                                 2:(Cat_EvalString += "Right") 
  915.                                                 3:(Cat_EvalString += "Center")
  916.                                             )
  917.                                         
  918.                                             Cat_EvalString += " Orient:#" + (if CAT_PropRoll_Integer.CAT_Orient.state == True then "Vertical" Else "Horizontal")
  919.                                             Cat_EvalString += " Ticks:" + CAT_PropRoll_Integer.CAT_Ticks.value as string
  920.                                             Cat_EvalString += " Range:[" + CAT_PropRoll_Integer.CAT_UIRangeStart.value as string + "," + CAT_PropRoll_Integer.CAT_UIRangeEnd.value as string + "," + CAT_PropRoll_Integer.CAT_UIRangeDefault.value as string + "]"
  921.                                 
  922.                                     
  923.                                             CAT_PropRoll_Integer.CAT_Orient.Enabled = True
  924.                                             CAT_PropRoll_Integer.CAT_Ticks.Enabled = True
  925.                                         )
  926.                                     ) 
  927.                                     
  928.                                     
  929.                                 ) 
  930.                                                 
  931.                         
  932.                         -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  933.                         -- DropDownList
  934.                         -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  935.                         "DropDownList":(
  936.                                             CAT_DoneRoll.CAT_Add.enabled = (Selection.count ==1)
  937.                                             CAT_DoneRoll.CAT_Delete.enabled = (Selection.count ==1)
  938.                                             CAT_DoneRoll.CAT_AddTo.enabled = (Selection.count ==1)
  939.     
  940.                                             Cat_EvalString += ("DropDownList" + " CAT_Testui " + "\"" + Cat_UIText + "\" ") 
  941.                                             
  942.                                             Cat_EvalString += (" Width:" + CAT_PropRoll_Array.CAT_Width.value as string) 
  943.                                             Cat_EvalString += (" Height:" + CAT_PropRoll_Array.CAT_Height.value as string)
  944.                                             Cat_EvalString += (" Align:#") 
  945.                                     
  946.                                             Case CAT_PropRoll_Array.CAT_Align.state of 
  947.                                             (
  948.                                                 1:(Cat_EvalString += "Left") 
  949.                                                 2:(Cat_EvalString += "Right") 
  950.                                                 3:(Cat_EvalString += "Center")
  951.                                             )
  952.                                             
  953.                                             Cat_EvalString += (" Items:" + CAT_PropRoll_Array.CAT_MyArray as string)
  954.                                             
  955.                                         CAT_PropRoll_Float.CAT_Orient.Enabled = False
  956.                                         CAT_PropRoll_Float.CAT_Ticks.Enabled = False
  957.                                         
  958.                                         
  959.                                         )
  960.                                 
  961.                         -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  962.                         -- Checkbox
  963.                         -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  964.                         "CheckBox":    (
  965.                                         CAT_DoneRoll.CAT_Add.enabled = (Selection.count ==1)
  966.                                         CAT_DoneRoll.CAT_Delete.enabled = (Selection.count ==1)
  967.                                         CAT_DoneRoll.CAT_AddTo.enabled = (Selection.count ==1)
  968.                                         
  969.                                         Cat_EvalString += (CAT_ParamRoll.CAT_UIType.selected + " CAT_Testui " + "\"" + Cat_UIText + "\"" + " Type:#Boolean")
  970.                                         Cat_EvalString += (" Width:" + CAT_PropRoll_Boolean.CAT_Width.value as string)
  971.                                         Cat_EvalString += (" Height:" + CAT_PropRoll_Boolean.CAT_Height.value as string)
  972.                                         Cat_EvalString += (" Align:#") 
  973.                                     
  974.                                         Case CAT_PropRoll_Boolean.CAT_Align.state of 
  975.                                         (
  976.                                             1:(Cat_EvalString += "Left") 
  977.                                             2:(Cat_EvalString += "Right") 
  978.                                             3:(Cat_EvalString += "Center")
  979.                                         )
  980.                         
  981.                         
  982.                                         CAT_PropRoll_Boolean.CAT_Highlight.Enabled = False
  983.                         
  984.                                     )
  985.                         -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  986.                         -- CheckButton
  987.                         -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  988.                         "CheckButton":(
  989.                                         CAT_DoneRoll.CAT_Add.enabled = (Selection.count ==1)
  990.                                         CAT_DoneRoll.CAT_Delete.enabled = (Selection.count ==1)
  991.                                         CAT_DoneRoll.CAT_AddTo.enabled = (Selection.count ==1)
  992.                                         
  993.                                         Cat_EvalString += (CAT_ParamRoll.CAT_UIType.selected + " CAT_Testui " + "\"" + Cat_UIText + "\"" + " Type:#Boolean")
  994.                                         Cat_EvalString += (" Width:" + CAT_PropRoll_Boolean.CAT_Width.value as string)
  995.                                         Cat_EvalString += (" Height:" + CAT_PropRoll_Boolean.CAT_Height.value as string)
  996.                                         Cat_EvalString += (" HighlightColor:" + CAT_PropRoll_Boolean.CAT_Highlight.color as string)
  997.                                         Cat_EvalString += " Align:#" 
  998.                                     
  999.                                         Case CAT_PropRoll_Boolean.CAT_Align.state of 
  1000.                                         (
  1001.                                             1:(Cat_EvalString += "Left") 
  1002.                                             2:(Cat_EvalString += "Right") 
  1003.                                             3:(Cat_EvalString += "Center")
  1004.                                         )
  1005.                                         
  1006.                                         CAT_PropRoll_Boolean.CAT_Highlight.Enabled = True
  1007.                         
  1008.                                         )
  1009.                         -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1010.                         -- MapButton
  1011.                         -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1012.                         "MapButton":(
  1013.                                         CAT_DoneRoll.CAT_Add.enabled = (Selection.count ==1)
  1014.                                         CAT_DoneRoll.CAT_Delete.enabled = (Selection.count ==1)
  1015.                                         CAT_DoneRoll.CAT_AddTo.enabled = (Selection.count ==1)
  1016.                                         
  1017.                                         Cat_EvalString += (CAT_ParamRoll.CAT_UIType.selected + " CAT_Testui " + "\"" + Cat_UIText + "\"" + " Type:#Material")
  1018.                                         Cat_EvalString += (" Width:" + CAT_PropRoll_Material.CAT_Width.value as string)
  1019.                                         Cat_EvalString += (" Height:" + CAT_PropRoll_Material.CAT_Height.value as string)
  1020.                                         Cat_EvalString += " Align:#" 
  1021.                                     
  1022.                                         Case CAT_PropRoll_Material.CAT_Align.state of 
  1023.                                         (
  1024.                                             1:(Cat_EvalString += "Left") 
  1025.                                             2:(Cat_EvalString += "Right") 
  1026.                                             3:(Cat_EvalString += "Center")
  1027.                                         )
  1028.                                     )
  1029.                         
  1030.                         -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1031.                         -- ColorPicker
  1032.                         -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1033.                         "ColorPicker":(
  1034.                                         CAT_DoneRoll.CAT_Add.enabled = (Selection.count ==1)
  1035.                                         CAT_DoneRoll.CAT_Delete.enabled = (Selection.count ==1)
  1036.                                         CAT_DoneRoll.CAT_AddTo.enabled = (Selection.count ==1)
  1037.                                         
  1038.                                             Cat_EvalString += (CAT_ParamRoll.CAT_UIType.selected + " CAT_Testui " + "\"" + Cat_UIText + "\"" + " Type:#Color")
  1039.                                             Cat_EvalString += (" Width:" + CAT_PropRoll_Color.CAT_Width.value as string)
  1040.                                             Cat_EvalString += (" Height:" + CAT_PropRoll_Color.CAT_Height.value as string)
  1041.                                             Cat_EvalString += (" Color:" + CAT_PropRoll_Color.CAT_DColor.Color as string)
  1042.                                             Cat_EvalString += " Align:#" 
  1043.                                     
  1044.                                             Case CAT_PropRoll_Color.CAT_Align.state of 
  1045.                                             (
  1046.                                                 1:(Cat_EvalString += "Left") 
  1047.                                                 2:(Cat_EvalString += "Right") 
  1048.                                                 3:(Cat_EvalString += "Center")
  1049.                                             )
  1050.                                         
  1051.                                         
  1052.                     
  1053.                                         )
  1054.                         -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1055.                         -- PickButton
  1056.                         -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1057.                         "PickButton":(
  1058.                                         CAT_DoneRoll.CAT_Add.enabled = (Selection.count ==1)
  1059.                                         CAT_DoneRoll.CAT_Delete.enabled = (Selection.count ==1)
  1060.                                         CAT_DoneRoll.CAT_AddTo.enabled = (Selection.count ==1)
  1061.         
  1062.                                         Cat_EvalString += (CAT_ParamRoll.CAT_UIType.selected + " CAT_Testui " + "\"" + Cat_UIText + "\"" + " Type:#Node")
  1063.                                         Cat_EvalString += (" Width:" + CAT_PropRoll_Node.CAT_Width.value as string)
  1064.                                         Cat_EvalString += (" Height:" + CAT_PropRoll_Node.CAT_Height.value as string)
  1065.                                         Cat_EvalString += " Align:#" 
  1066.                                     
  1067.                                         Case CAT_PropRoll_Node.CAT_Align.state of 
  1068.                                         (
  1069.                                             1:(Cat_EvalString += "Left") 
  1070.                                             2:(Cat_EvalString += "Right") 
  1071.                                             3:(Cat_EvalString += "Center")
  1072.                                         )
  1073.                                     
  1074.                                     )
  1075.                                     
  1076.         
  1077.                     )
  1078.                               
  1079.                     Cat_EvalString += "\n) \n" + "AddRollout CAT_TestRoll CAT_Float \n"
  1080.             
  1081.                     Try(Execute Cat_EvalString)Catch( CAT_Updating_UI = false )
  1082.                     CAT_Updating_UI = false            
  1083.                     --)Catch()
  1084.                 )
  1085.             )
  1086.  
  1087.     FN CAT_AddUI = 
  1088.     (
  1089.         
  1090.         
  1091.                 If Debug == True then Format "%\n" ("------------------------------------------------------------- \n -- Add UI Performed.. \n-------------------------------------------------------------")
  1092.     
  1093.                 -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1094.                 -- Setup String Streams
  1095.                 -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1096.             
  1097.                 Local CUSTString = StringStream, CAT_UIParamString = StringStream, CAT_MainParamString = StringStream, CAT_RolloutString = StringStream, CAT_UIString = StringStream, CAT_UIEndString = StringStream, CAT_ArrayString = Stringstream
  1098.                 
  1099.                 -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1100.                 -- Define Attribute Definition Start
  1101.                 -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1102.                 
  1103.                 -- *** Localization Note ***
  1104.                 -- The "Custom_Attributes" name needs to be localized in CAT_MainParamString = ("CAT_DEF = attributes Custom_Attributes \n") 
  1105.                                     
  1106.                 CAT_MainParamString = ("CAT_DEF = attributes Custom_Attributes \n") 
  1107.                 
  1108.                 If CAT_DefExist () == True then CAT_MainParamString += "Redefine:CAT_CurrentDef\n"
  1109.                              
  1110.                 CAT_MainParamString += ("(\n") 
  1111.                 CAT_MainParamString += ("Parameters main rollout:params\n") 
  1112.                  CAT_MainParamString += "(\n"
  1113.                 
  1114.                 -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1115.                 -- Build First ParamBlock Def
  1116.                 -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1117.                 -- AF (4/23/01) All we need to do is put "'"'s around the string
  1118.                 Cat_TextChecker CAT_ParamRoll.CAT_UIName.text
  1119.                 
  1120.                 -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1121.                 -- If in Delete Mode then skip the following
  1122.                 -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1123.                                 
  1124.                 If CAT_IsDeleting == false then
  1125.                 (    
  1126.                     CAT_NewAttrib[1] = CAT_ParamBlock Name:(Cat_CheckedText as string)
  1127.                     -- CAT_NewAttrib[1].ui = (Cat_UIText as string)
  1128.                     CAT_NewAttrib[1].ui = (Cat_CheckedText as string)
  1129.                                 
  1130.                 -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1131.                 -- Is the ParamBlock an Array?
  1132.                 -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1133.                             
  1134.                     if CAT_ParamRoll.CAT_Type.Selected != "Array" then
  1135.                     (
  1136.                         CAT_NewAttrib[1].Type = CAT_ParamRoll.CAT_Type.Selected
  1137.                     )
  1138.                     Else 
  1139.                     (
  1140.                         CAT_NewAttrib[1].Type = "Integer"
  1141.                         CAT_NewAttrib[1].Default = "1"
  1142.                     )
  1143.                     
  1144.                 -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1145.                 -- Is the ParamBlock an Integer Float, Boolean or Color?
  1146.                 -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1147.  
  1148.                     if CAT_ParamRoll.CAT_Type.Selected == "Integer" then
  1149.                     (
  1150.                         CAT_NewAttrib[1].Default = CAT_PropRoll_Float.CAT_UIRangeDefault.value as string
  1151.                     )
  1152.                     Else if CAT_ParamRoll.CAT_Type.Selected == "Boolean" then
  1153.                     (
  1154.                         CAT_NewAttrib[1].Default = "False"
  1155.                     )
  1156.         
  1157.                     Else if CAT_ParamRoll.CAT_Type.Selected == "Float" then
  1158.                     (
  1159.                         CAT_NewAttrib[1].Default = CAT_PropRoll_Float.CAT_UIRangeDefault.value as string
  1160.                     )
  1161.                     Else if CAT_ParamRoll.CAT_Type.Selected == "Color" then
  1162.                     (
  1163.                         CAT_NewAttrib[1].Default = CAT_PropRoll_Color.CAT_DColor.color as string
  1164.                     )
  1165.                     Else(CAT_NewAttrib[1].Default = "1")
  1166.                 
  1167.                 )
  1168.                 -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1169.                 -- Begin CUSTString, This will be the String that is Executed
  1170.                 -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1171.                                 
  1172.                 CUSTString = CAT_MainParamString
  1173.                 
  1174.                 -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1175.                 -- Build Exisiting Param Block String
  1176.                 -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1177.                                 
  1178.                 If CAT_ParamBlock_Array.count >= 1 then
  1179.                 (
  1180.                     For i in 1 to CAT_ParamBlock_Array.count do
  1181.                     (
  1182.                         If Debug == True then Format "%\n" ("ReBuilding ParamBlock Item:" + CAT_ParamBlock_Array[i].name as string)
  1183.                         
  1184.                         CurrentParam = CAT_ParamBlock_Array[i]
  1185.                         
  1186.                         CAT_UIParamString = CurrentParam.Name + " Type:#" + CurrentParam.Type + " UI:" + CurrentParam.UI 
  1187.                         
  1188.                         If CurrentParam.Type == "Node" then (CAT_UIParamString += "\n")
  1189.                         Else If CurrentParam.Type == "TextureMap" then (CAT_UIParamString += "\n")
  1190.                         Else (CAT_UIParamString += " Default:" + CurrentParam.Default + "\n")
  1191.                         
  1192.                         CUSTString += CAT_UIParamString
  1193.                     
  1194.                     )
  1195.                 )
  1196.                 
  1197.                                 
  1198.                 -- Debug
  1199.                 If Debug == True then Format "%\n" ("Delete Mode:" + CAT_IsDeleting as string + "\n")
  1200.                 
  1201.                 -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1202.                 -- Add new Parameter
  1203.                 -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1204.                 
  1205.                 If CAT_IsDeleting == False then
  1206.                 (
  1207.                     CAT_UIParamString = CAT_NewAttrib[1].Name + " Type:#" + CAT_NewAttrib[1].Type + " UI:" + CAT_NewAttrib[1].UI 
  1208.                     
  1209.                     If CAT_ParamRoll.CAT_Type.Selected == "Node" then (CAT_UIParamString += "\n")
  1210.                     Else if CAT_ParamRoll.CAT_Type.Selected == "TextureMap" then (CAT_UIParamString += "\n")
  1211.                     Else (CAT_UIParamString += " Default:" + CAT_NewAttrib[1].Default + "\n") 
  1212.  
  1213.                     CUSTString += CAT_UIParamString
  1214.                 )
  1215.                 
  1216.                 
  1217.                 
  1218.                 --     Debug
  1219.                     If Cat_Debug == True then Format "%\n" CUSTString
  1220.     
  1221.                 -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1222.                 -- Build Rollout String
  1223.                 -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1224.                 
  1225.                 CAT_RolloutString = ")\n" 
  1226.                 
  1227.                 -- *** Localization Note ***
  1228.                 -- The "Custom Attributes" name needs to be localized in ("Rollout Params \"" + "Custom Attributes" + "\"\n") 
  1229.                 
  1230.                 CAT_RolloutString += ("Rollout Params \"" + "Custom Attributes" + "\"\n") 
  1231.  
  1232.                 CAT_RolloutString += "(\n" 
  1233.                 
  1234.                 CUSTString += CAT_RolloutString
  1235.                 
  1236.                 -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1237.                 -- Build Array String
  1238.                 -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1239.                 
  1240.                 CAT_ArrayString = "\n"
  1241.                 
  1242.                 -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1243.                 -- Build Existing Array
  1244.                 -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1245.                 
  1246.                 If CAT_UIItems_Array.count >= 1 then
  1247.                 (
  1248.                     For i in 1 to CAT_UIItems_Array.count do
  1249.                     (
  1250.                         If CAT_UIItems_Array[i].ui == "DropdownList" then
  1251.                         (
  1252.                             CAT_ArrayString += ("Local '" + (substring CAT_UIItems_Array[i].name 2 (CAT_UIItems_Array[i].name.count-2)) + "Array' = " + CAT_UIItems_Array[i].array as string + "\n")
  1253.                         )
  1254.                     )
  1255.                     CAT_ArrayString += "\n"
  1256.                     CUSTString += CAT_ArrayString
  1257.                 )
  1258.                 
  1259.                 If CAT_Debug == True then Format "%\n" ("Array Output:" + CAT_ArrayString)
  1260.                 
  1261.                 -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1262.                 -- If an Array is used, build an Array definition
  1263.                 -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1264.                             
  1265.                 If CAT_IsDeleting == False then
  1266.                 (
  1267.                     if CAT_ParamRoll.CAT_Type.Selected == "Array" then
  1268.                     (
  1269.                         CAT_ArrayString = ("Local '" + (substring Cat_CheckedText 2 (Cat_CheckedText.count-2)) + "Array' = #(")
  1270.                         
  1271.                         For i in 1 to CAT_PropRoll_Array.CAT_MyArray.count do
  1272.                         (
  1273.                             CAT_ArrayString += "\""
  1274.                             CAT_ArrayString += (CAT_PropRoll_Array.CAT_MyArray[i] as string)
  1275.                             CAT_ArrayString += "\""
  1276.                             If i != CAT_PropRoll_Array.CAT_MyArray.count then CAT_ArrayString += ", "
  1277.                         )
  1278.                         CAT_ArrayString += ")\n"
  1279.                         CUSTString += CAT_ArrayString
  1280.                                     
  1281.                     )
  1282.                 )
  1283.             
  1284.                 -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1285.                 -- Start UI String
  1286.                 -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1287.                 
  1288.                 CAT_UIString = "\n"
  1289.                 -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1290.                 -- Build Exisiting UI array
  1291.                 -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1292.                 
  1293.                 If CAT_UIItems_Array.count >= 1 then
  1294.                 (
  1295.                     CAT_ArrayUIString = StringStream
  1296.                     
  1297.                     For i in 1 to CAT_UIItems_Array.count do
  1298.                     (
  1299.                         If Debug == True then Format "%\n" ("ReBuilding UI item:" + CAT_UIItems_Array[i].name as string)
  1300.                         
  1301.                         CurrentUI = CAT_UIItems_Array[i]
  1302.                         CAT_ArrayUIString = (CurrentUI.UI + " " + CurrentUI.Name + " \"" + CurrentUI.String + "\" Width:" + CurrentUI.Width + " Height:" + CurrentUI.Height + " Align:#" + CurrentUI.Align + " Type:#" + CurrentUI.Type)
  1303.                         CAT_ArrayUIString += (" Range:" + CurrentUI.Range + " Orient:#" + CurrentUI.Orient + " Ticks:" + CurrentUI.Ticks + " Items:" + CurrentUI.Items + " HighLightcolor:" + CurrentUI.HighLightColor)
  1304.                         CAT_ArrayUIString += (" Color:" + CurrentUI.Color + "\n")
  1305.                         CUSTString += CAT_ArrayUIString
  1306.                     )
  1307.                     
  1308.                 )
  1309.                                                 
  1310.                 -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1311.                 -- Build new UI parametar
  1312.                 -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1313.                 
  1314.                 If CAT_IsDeleting == False then
  1315.                 (
  1316.                     Case CAT_ParamRoll.CAT_UIType.selected of
  1317.                     (
  1318.                         
  1319.                         "Spinner":(
  1320.                         
  1321.                                                                 
  1322.                                          CAT_NewAttrib[2] = CAT_UIItem UI:"Spinner" Name:(Cat_CheckedText as string) String:Cat_UIText
  1323.                                         
  1324.                                         Case CAT_ParamRoll.CAT_Type.Selection of
  1325.                                         (
  1326.                                             1:(
  1327.                                                 CAT_NewAttrib[2].Type = "Float"
  1328.                                                 CAT_NewAttrib[2].Width =  CAT_PropRoll_Float.CAT_Width.value as string;CAT_NewAttrib[2].Width = CAT_PropRoll_Float.CAT_Width.value as string
  1329.                                             --    CAT_NewAttrib[2].Height =  CAT_PropRoll_Float.CAT_Height.value as string;CAT_NewAttrib[2].Height = CAT_PropRoll_Float.CAT_Height.value as string
  1330.                                                                         
  1331.                                                 CAT_NewAttrib[2].Range = ("[" + CAT_PropRoll_Float.CAT_UIRangeStart.value as string + ", " + CAT_PropRoll_Float.CAT_UIRangeEnd.value as string + ", " + CAT_PropRoll_Float.CAT_UIRangeDefault.value as string + "]")
  1332.                                         
  1333.                                                 Case CAT_PropRoll_Float.CAT_Align.state of 
  1334.                                                 (
  1335.                                                     1:(CAT_NewAttrib[2].Align = "Left") 
  1336.                                                     2:(CAT_NewAttrib[2].Align = "Right") 
  1337.                                                     3:(CAT_NewAttrib[2].Align = "Center")
  1338.                                                 )
  1339.     
  1340.                                                                         
  1341.                                             
  1342.                                             )
  1343.                                             2:(
  1344.                                                 CAT_NewAttrib[2].Type = "Integer"
  1345.                                                 CAT_NewAttrib[2].Width =  CAT_PropRoll_Integer.CAT_Width.value as string;CAT_NewAttrib[2].Width = CAT_PropRoll_Integer.CAT_Width.value as string
  1346.                                             --    CAT_NewAttrib[2].Height =  CAT_PropRoll_Integer.CAT_Height.value as string;CAT_NewAttrib[2].Height = CAT_PropRoll_Integer.CAT_Height.value as string
  1347.                                                                             
  1348.                                                 CAT_NewAttrib[2].Range = ("[" + CAT_PropRoll_Integer.CAT_UIRangeStart.value as string + ", " + CAT_PropRoll_Integer.CAT_UIRangeEnd.value as string + ", " + CAT_PropRoll_Integer.CAT_UIRangeDefault.value as string + "]")
  1349.                                         
  1350.                                                 Case CAT_PropRoll_Integer.CAT_Align.state of 
  1351.                                                 (
  1352.                                                     1:(CAT_NewAttrib[2].Align = "Left") 
  1353.                                                     2:(CAT_NewAttrib[2].Align = "Right") 
  1354.                                                     3:(CAT_NewAttrib[2].Align = "Center")
  1355.                                                 )
  1356.     
  1357.                                             )
  1358.                                         )
  1359.                                                                             
  1360.                                         
  1361.                                   )
  1362.                         
  1363.                         "Slider":(
  1364.                         
  1365.                                                                     
  1366.                                         CAT_NewAttrib[2] = CAT_UIItem UI:"Slider" Name:(Cat_CheckedText as string) String:Cat_UIText      
  1367.                                         
  1368.                                         Case CAT_ParamRoll.CAT_Type.Selection of 
  1369.                                         (
  1370.                                             1:(
  1371.                                                 CAT_NewAttrib[2].Type = "Float"
  1372.                                                 CAT_NewAttrib[2].Width = CAT_PropRoll_Float.CAT_Width.value as string
  1373.                                             --  CAT_NewAttrib[2].Height = CAT_PropRoll_Float.CAT_Height.value as string
  1374.                                                                                                         
  1375.                                                 Case CAT_PropRoll_Float.CAT_Align.state of 
  1376.                                                 (
  1377.                                                     1:(CAT_NewAttrib[2].Align = "Left") 
  1378.                                                     2:(CAT_NewAttrib[2].Align = "Right") 
  1379.                                                     3:(CAT_NewAttrib[2].Align = "Center")
  1380.                                                 )
  1381.                                         
  1382.                                                 CAT_NewAttrib[2].Orient = (if CAT_PropRoll_Float.CAT_Orient.state == True then "Vertical" Else "Horizontal")
  1383.                                                 CAT_NewAttrib[2].Ticks = CAT_PropRoll_Float.CAT_Ticks.value as string
  1384.                                                 CAT_NewAttrib[2].Range = ("[" + CAT_PropRoll_Float.CAT_UIRangeStart.value as string + "," + CAT_PropRoll_Float.CAT_UIRangeEnd.value as string + "," + CAT_PropRoll_Float.CAT_UIRangeDefault.value as string + "]")
  1385.                                             
  1386.                                             
  1387.                                             )
  1388.                                             2:(
  1389.                                                 CAT_NewAttrib[2].Type = "Integer"
  1390.                                                 CAT_NewAttrib[2].Width = CAT_PropRoll_Integer.CAT_Width.value as string
  1391.                                             --    CAT_NewAttrib[2].Height = CAT_PropRoll_Integer.CAT_Height.value as string
  1392.                                                                                                         
  1393.                                                 Case CAT_PropRoll_Integer.CAT_Align.state of 
  1394.                                                 (
  1395.                                                     1:(CAT_NewAttrib[2].Align = "Left") 
  1396.                                                     2:(CAT_NewAttrib[2].Align = "Right") 
  1397.                                                     3:(CAT_NewAttrib[2].Align = "Center")
  1398.                                                 )
  1399.                                         
  1400.                                                 CAT_NewAttrib[2].Orient = (if CAT_PropRoll_Integer.CAT_Orient.state == True then "Vertical" Else "Horizontal")
  1401.                                                 CAT_NewAttrib[2].Ticks = CAT_PropRoll_Integer.CAT_Ticks.value as string
  1402.                                                 CAT_NewAttrib[2].Range = ("[" + CAT_PropRoll_Integer.CAT_UIRangeStart.value as string + "," + CAT_PropRoll_Integer.CAT_UIRangeEnd.value as string + "," + CAT_PropRoll_Integer.CAT_UIRangeDefault.value as string + "]")
  1403.                                             
  1404.                                             
  1405.                                             )
  1406.                                         )
  1407.                                         
  1408.                                         
  1409.                                                                         
  1410.                                 )
  1411.                         
  1412.                         
  1413.                         "DropDownList":    (
  1414.                                             CAT_NewAttrib[2] = CAT_UIItem UI:"DropdownList" Name:(Cat_CheckedText as string) String:Cat_UIText Type:"Array"
  1415.                                          
  1416.                                             CAT_NewAttrib[2].Width = CAT_PropRoll_Array.CAT_Width.value as string
  1417.                                             CAT_NewAttrib[2].Height = CAT_PropRoll_Array.CAT_Height.value as string
  1418.                                                                                                         
  1419.                                             Case CAT_PropRoll_Array.CAT_Align.state of 
  1420.                                             (
  1421.                                                 1:(CAT_NewAttrib[2].Align = "Left") 
  1422.                                                 2:(CAT_NewAttrib[2].Align = "Right") 
  1423.                                                 3:(CAT_NewAttrib[2].Align = "Center")
  1424.                                             )
  1425.     
  1426.                                             
  1427.                                             CAT_NewAttrib[2].Items = "'" + (substring Cat_CheckedText 2 (Cat_CheckedText.count-2)) + "Array'"
  1428.                                             
  1429.                                             CAT_NewAttrib[2].array = #()
  1430.                                             
  1431.                                             CAT_NewAttrib[2].array = CAT_PropRoll_Array.CAT_MyArray    as array
  1432.                                             CAT_PropRoll_Array.CAT_MyArray = #()
  1433.                                             CAT_PropRoll_Array.CAT_AItems.items = #()
  1434.                                         )
  1435.                         
  1436.                         
  1437.                         "CheckBox":(
  1438.                                         CAT_NewAttrib[2] = CAT_UIItem UI:"CheckBox " Name:(Cat_CheckedText as string) String:Cat_UIText Type:"Boolean"
  1439.                                         
  1440.                                         CAT_NewAttrib[2].Width = CAT_PropRoll_Boolean.CAT_Width.value as string
  1441.                                         CAT_NewAttrib[2].Height = CAT_PropRoll_Boolean.CAT_Height.value as string
  1442.                                                                                                         
  1443.                                         Case CAT_PropRoll_Boolean.CAT_Align.state of 
  1444.                                         (
  1445.                                             1:(CAT_NewAttrib[2].Align = "Left") 
  1446.                                             2:(CAT_NewAttrib[2].Align = "Right") 
  1447.                                             3:(CAT_NewAttrib[2].Align = "Center")
  1448.                                         )
  1449.     
  1450.                                             
  1451.                                     )
  1452.                                     
  1453.                         "CheckButton":
  1454.                                     (
  1455.                                     
  1456.                                         CAT_NewAttrib[2] = CAT_UIItem UI:"CheckButton " Name:(Cat_CheckedText as string) String:Cat_UIText Type:"Boolean"
  1457.                                         
  1458.                                         CAT_NewAttrib[2].Width = CAT_PropRoll_Boolean.CAT_Width.value as string
  1459.                                         CAT_NewAttrib[2].Height = CAT_PropRoll_Boolean.CAT_Height.value as string
  1460.                                                                                                         
  1461.                                         Case CAT_PropRoll_Boolean.CAT_Align.state of 
  1462.                                         (
  1463.                                             1:(CAT_NewAttrib[2].Align = "Left") 
  1464.                                             2:(CAT_NewAttrib[2].Align = "Right") 
  1465.                                             3:(CAT_NewAttrib[2].Align = "Center")
  1466.                                         )
  1467.                                         
  1468.                                         CAT_NewAttrib[2].HighLightColor = CAT_PropRoll_Boolean.CAT_Highlight.color as string 
  1469.                         
  1470.                                     )
  1471.                                     
  1472.                                     
  1473.                         "MapButton":(
  1474.     
  1475.                                         CAT_NewAttrib[2] = CAT_UIItem UI:"MapButton " Name:(Cat_CheckedText as string) String:Cat_UIText Type:"TextureMap"  
  1476.                                         CAT_NewAttrib[2].Width = CAT_PropRoll_Material.CAT_Width.value as string
  1477.                                         CAT_NewAttrib[2].Height = CAT_PropRoll_Material.CAT_Height.value as string
  1478.                                                                                                         
  1479.                                         Case CAT_PropRoll_Material.CAT_Align.state of 
  1480.                                         (
  1481.                                             1:(CAT_NewAttrib[2].Align = "Left") 
  1482.                                             2:(CAT_NewAttrib[2].Align = "Right") 
  1483.                                             3:(CAT_NewAttrib[2].Align = "Center")
  1484.                                         )
  1485.     
  1486.         
  1487.                                     )
  1488.                                     
  1489.                                     
  1490.                         "ColorPicker":(
  1491.     
  1492.                                         CAT_NewAttrib[2] = CAT_UIItem UI:"ColorPicker " Name:(Cat_CheckedText as string) String:Cat_UIText Type:"Color"
  1493.                                         CAT_NewAttrib[2].Width = CAT_PropRoll_Color.CAT_Width.value as string
  1494.                                         CAT_NewAttrib[2].Height = CAT_PropRoll_Color.CAT_Height.value as string
  1495.                                                                                                         
  1496.                                         Case CAT_PropRoll_Color.CAT_Align.state of 
  1497.                                         (
  1498.                                             1:(CAT_NewAttrib[2].Align = "Left") 
  1499.                                             2:(CAT_NewAttrib[2].Align = "Right") 
  1500.                                             3:(CAT_NewAttrib[2].Align = "Center")
  1501.                                         )
  1502.                                         
  1503.                                         CAT_NewAttrib[2].Color = CAT_PropRoll_Color.CAT_DColor.Color as string
  1504.                                         
  1505.                                         
  1506.                         
  1507.                                     )
  1508.                         "PickButton":(
  1509.     
  1510.                                         CAT_NewAttrib[2] = CAT_UIItem UI:"PickButton " Name:(Cat_CheckedText as string) String:Cat_UIText Type:"Node"
  1511.                                         CAT_NewAttrib[2].Width = CAT_PropRoll_Node.CAT_Width.value as string
  1512.                                         CAT_NewAttrib[2].Height = CAT_PropRoll_Node.CAT_Height.value as string
  1513.                                                                                                         
  1514.                                         Case CAT_PropRoll_Node.CAT_Align.state of 
  1515.                                         (
  1516.                                             1:(CAT_NewAttrib[2].Align = "Left") 
  1517.                                             2:(CAT_NewAttrib[2].Align = "Right") 
  1518.                                             3:(CAT_NewAttrib[2].Align = "Center")
  1519.                                         )
  1520.                                         
  1521.                                         
  1522.                                     )
  1523.                     )
  1524.                 )
  1525.         
  1526.                 -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1527.                 -- Add new UI parametar
  1528.                 -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1529.  
  1530.                 If CAT_IsDeleting == False then
  1531.                 (
  1532.                     CAT_UIString += (CAT_NewAttrib[2].UI + " " + CAT_NewAttrib[2].Name + " \"" + CAT_NewAttrib[2].String + "\" Width:" + CAT_NewAttrib[2].Width + " Height:" + CAT_NewAttrib[2].Height + " Align:#" + CAT_NewAttrib[2].Align + " Type:#" + CAT_NewAttrib[2].Type)
  1533.                     CAT_UIString += (" Range:" + CAT_NewAttrib[2].Range + " Orient:#" + CAT_NewAttrib[2].Orient + " Ticks:" + CAT_NewAttrib[2].Ticks + " Items:" + CAT_NewAttrib[2].Items + " HighLightcolor:" + CAT_NewAttrib[2].HighLightColor)
  1534.                     CAT_UIString += (" Color:" + CAT_NewAttrib[2].Color + "\n")
  1535.                 )
  1536.             
  1537.                 CAT_UIEndString = ")\n" 
  1538.                 CAT_UIEndString += ")\n" 
  1539.                 
  1540.             -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1541.             -- Build Final Layout
  1542.             -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1543.                                                 
  1544.                 CUSTString += CAT_UIString
  1545.                 CUSTString += CAT_UIEndString
  1546.             
  1547.             -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1548.             -- Add Custom Attribute to Object
  1549.             -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1550.             
  1551.             /* Localize on */
  1552.         
  1553.             CAT_AttribName = "Custom_Attributes"
  1554.             
  1555.             /* Localize off */
  1556.             
  1557.             CAT_AnyTrue = False
  1558.             CAT_HoldStack = modpanel.GetCurrentobject ()
  1559.                             
  1560.         --    CUSTString += "For i in 1 to selection.count do"
  1561.         --    CUSTString += "(Try(\n"
  1562.     
  1563.                 Case  CAT_DoneRoll.CAT_AddTo.selection of
  1564.                 (
  1565.                     1:(CUSTString += "CustAttributes.add Selection[1].BaseObject CAT_DEF #Unique")
  1566.                     2:(CUSTString += "CustAttributes.add Selection[1].modifiers[CAT_ModIndex] CAT_DEF #Unique \n")
  1567.                     -- 3:(CUSTString += "CustAttributes.add Selection[1].material CAT_DEF #Unique \n")
  1568.                 )    
  1569.             
  1570.         --    CUSTString +=")Catch())\n"
  1571.     
  1572.          
  1573.             If CAT_Debug == True then Format "%\n" (CUSTString + "\n")
  1574.             
  1575.             -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1576.             -- Clear Update and Delete handlers
  1577.             -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1578.             
  1579.             CAT_IsDeleting = False
  1580.             
  1581.             -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1582.             -- Execute Command
  1583.             -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1584.             -- If a material is being added too, The material swatch must be deselected. The Following method will do this automaticly
  1585.             
  1586.             
  1587. --            if CAT_DoneRoll.CAT_AddTo.selection == 3 then
  1588. --            (
  1589. --                Cat_MActive = Medit.GetActiveMtlSlot ()
  1590. --                If Cat_MActive == 24 then (Cat_NewMActive = (Cat_MActive - 1)) Else (Cat_NewMActive = (Cat_MActive + 1)) 
  1591. --                 Medit.SetActiveMtlSlot Cat_NewMActive false 
  1592. --            )
  1593.                         
  1594.             
  1595.             -- Hold the selection
  1596.             
  1597.             Cat_TempHold = Selection as Array
  1598.             function_return_value = true
  1599.             
  1600.             /* Localize on */
  1601.             If CAT_Debug != True then 
  1602.             (
  1603.                 Try(Execute CUSTString)
  1604.                 Catch
  1605.                 (
  1606.                     MessageBox "Attribute Addition Error!"
  1607.                     function_return_value = false
  1608.                 ) 
  1609.             )
  1610.             Else Execute CUSTString
  1611.             /* Localize off */
  1612.             
  1613.             Select Cat_TempHold
  1614.             
  1615.             if getCommandPanelTaskMode() != #Modify Then Max Modify Mode
  1616.         
  1617. --            if CAT_DoneRoll.CAT_AddTo.selection == 3 then
  1618. --            (
  1619. --                Medit.SetActiveMtlSlot Cat_MActive false 
  1620. --            )
  1621.             
  1622.             ModPanel.SetCurrentObject CAT_HoldStack
  1623.             function_return_value
  1624.         )
  1625.         
  1626.         -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1627.         -- Define Variables and Structs
  1628.         -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1629.                 
  1630.         If CAT_ParamBlock_Array == undefined then CAT_ParamBlock_Array = #()
  1631.         If CAT_UIItems_Array == undefined then CAT_UIItems_Array = #()
  1632.         
  1633.         /* Localize on */
  1634.         
  1635.         If Cat_CheckedText == undefined or Cat_CheckedText == "" do
  1636.         (
  1637.             Cat_CheckedText = ("Param" + CAT_UINum as string)
  1638.             Cat_UIText = Cat_CheckedText
  1639.         )
  1640.         /* Localize off */
  1641.                         
  1642.         -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1643.         -- Selecion Change Function (Enabled and Disable UI)
  1644.         -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1645.         fn Cat_SelChange = 
  1646.         (
  1647.             If Selection.count != 1 then
  1648.             (
  1649.                 CAT_DoneRoll.CAT_Add.enabled = False
  1650.                 CAT_DoneRoll.CAT_AddTo.Enabled = False
  1651.                 CAT_DoneRoll.CAT_Delete.Enabled = False
  1652.         
  1653.         
  1654.             )
  1655.             Else
  1656.             (
  1657.                 CAT_DoneRoll.CAT_Add.enabled = True
  1658.                 CAT_DoneRoll.CAT_AddTo.Enabled = True
  1659.                 CAT_DoneRoll.CAT_Delete.Enabled = True
  1660.                 
  1661.             )
  1662.             
  1663.             Try (if CAT_DeleteUIRoll != undefined do DestroyDialog CAT_DeleteUIRoll)Catch()
  1664.         )     
  1665.     
  1666.              
  1667.         -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1668.         -- Reset Function
  1669.         -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1670.  
  1671.         FN Cat_Reset = 
  1672.         (
  1673.             Try
  1674.             (
  1675.                 CAT_UINum = undefined
  1676.                 CAT_CheckedText = ""
  1677.                 CAT_UIText = ""
  1678.                 CloseRolloutFloater Cat_Float
  1679.             )
  1680.             Catch()
  1681.         )
  1682.         
  1683.         -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1684.         -- Check Definition Data
  1685.         -- This function is used to check the custom atrributes definition data, See if it exists
  1686.         -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1687.         fn CAT_DefExist =
  1688.         (
  1689.         if getCommandPanelTaskMode() != #Modify Then Max Modify Mode
  1690.  
  1691.             /* Localize on */
  1692.             
  1693.             CAT_AttribName = "Custom_Attributes"
  1694.             
  1695.             /* Localize off */
  1696.             
  1697.             Try(
  1698.             Case  CAT_DoneRoll.CAT_AddTo.selection of
  1699.             (
  1700.                 1:(CAT_Defs = CustAttributes.getdefs Selection[1].BaseObject)
  1701.                 2:(CAT_Defs = CustAttributes.getdefs Selection[1].modifiers[CAT_ModIndex])
  1702.                 3:(CAT_Defs = CustAttributes.getdefs Selection[1].material)
  1703.             )    
  1704.             )CATCH()
  1705.             
  1706.             local res = false
  1707.             If CAT_Defs != undefined then 
  1708.             (    
  1709.                 For a in 1 to Cat_Defs.count where not res do
  1710.                     res = (CAT_Defs[a].name as string) == CAT_AttribName
  1711.             )
  1712.             res
  1713.         
  1714.         ) 
  1715.         -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1716.         -- Set Definition Data
  1717.         -- This function is used to Set the custom atrributes definition data to the selected object
  1718.         -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1719.         
  1720.         fn CAT_SetDef =
  1721.         (
  1722.             If Debug == True then Format "%\n" ("------------------------------------------------------------- \n -- Set Definition Performed.. \n -------------------------------------------------------------")
  1723.  
  1724.             if getCommandPanelTaskMode() != #Modify Then Max Modify Mode
  1725.             
  1726.             /* Localize on */
  1727.             
  1728.             CAT_AttribName = "Custom_Attributes"        
  1729.             
  1730.             /* Localize off */
  1731.             
  1732.             Case  CAT_DoneRoll.CAT_AddTo.selection of
  1733.             (
  1734.             
  1735.                 1:(CAT_Defs = CustAttributes.getdefs Selection[1].baseobject)
  1736.                 2:(CAT_Defs = CustAttributes.getdefs Selection[1].modifiers[CAT_ModIndex])
  1737.                 3:(CAT_Defs = CustAttributes.getdefs Selection[1].material)
  1738.                     
  1739.             )
  1740.                 
  1741.             If CAT_Defs != undefined then 
  1742.             (    
  1743.                 For a in 1 to Cat_Defs.count do
  1744.                 (
  1745.                     if (CAT_Defs[a].name as string) == CAT_AttribName then 
  1746.                     (
  1747.                         custAttributes.setDefData CAT_Defs[a] (CAT_Source as array)
  1748.                     )            
  1749.                 )
  1750.             )
  1751.                 
  1752.             if Debug == True then Format "%\n" ("CAT_NewAttrib from CAT_Setdef ():" + CAT_NewAttrib as string)
  1753.         ) 
  1754.         
  1755.         -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1756.         -- Get Definition Data
  1757.         -- This function is used to retrieve the custom atrributes definition data from the selected object
  1758.         -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1759.         fn CAT_GetDef = 
  1760.         (
  1761.             Case CAT_DoneRoll.CAT_AddTo.selection of
  1762.             (
  1763.                 2:(Try(CAT_ModIndex = modpanel.getModifierIndex Selection[1] (modpanel.getcurrentObject ()))Catch())
  1764.             )
  1765.         
  1766.             If Debug == True then Format "%\n" ("------------------------------------------------------------- \n -- Get Definition Performed.. \n -------------------------------------------------------------")
  1767.             
  1768.             if getCommandPanelTaskMode() != #Modify Then Max Modify Mode
  1769.             
  1770.             /* Localize on */
  1771.             
  1772.             CAT_AttribName = "Custom_Attributes"
  1773.             
  1774.             /* Localize off */
  1775.             
  1776.             CAT_ParamBlock_Array = #()
  1777.             CAT_UIItems_Array = #()
  1778.             CAT_Source = #()
  1779.             CAT_NewAttrib = #()    
  1780.             CAT_UI_Array = #()
  1781.             
  1782.             Case CAT_DoneRoll.CAT_AddTo.selection of
  1783.             (
  1784.                 1:(CAT_Defs = CustAttributes.getdefs Selection[1].BaseObject)
  1785.                 2:(CAT_Defs = CustAttributes.getdefs Selection[1].modifiers[CAT_ModIndex])
  1786.                 3:(CAT_Defs = CustAttributes.getdefs Selection[1].material)
  1787.             )
  1788.             
  1789.             If CAT_Defs == Undefined then CAT_Defs = #()
  1790.                 
  1791.             For a in 1 to Cat_Defs.count do
  1792.             (
  1793.                 if (CAT_Defs[a].name as string) == CAT_AttribName then 
  1794.                 (
  1795.                     CAT_CurrentDef = CAT_Defs[a]
  1796.                     CAT_DefData = CAT_Defs[a].defdata
  1797.                     CAT_ParamBlock_Array = CAT_DefData[1]
  1798.                     CAT_UIItems_Array = CAT_DefData[2]
  1799.                     
  1800.                     CAT_UI_Array = #()
  1801.                     
  1802.                     CAT_Source[1] = CAT_ParamBlock_Array as array
  1803.                     CAT_Source[2] = CAT_UIItems_Array as array
  1804.                     
  1805.                     For i in 1 to CAT_DefData[2].count do
  1806.                     (
  1807.                         Append CAT_UI_Array (CAT_DefData[2][i].UI as string + " ---- " +  CAT_DefData[2][i].String as string)
  1808.                     )
  1809.                 )
  1810.                 Else
  1811.                 (
  1812.                     /* Localize on */
  1813.                     
  1814.                     CAT_CurrentDef == "Deleted"
  1815.                     
  1816.                     /* Localize off */
  1817.                 )
  1818.                     
  1819.             )    
  1820.             
  1821.             /* Localize on */
  1822.             
  1823.             If Cat_Defs.count == 0 or Cat_CurrentDef == "Deleted" then (CAT_UI_Array = #())
  1824.             
  1825.             /* Localize off */
  1826.         
  1827.             If Cat_Debug == True then Format "%\n" CAT_UIItems_Array
  1828.             
  1829.             If Debug == True then Format "%\n" ("CAT_NewAttrib from CAT_GetDef() :" + CAT_Source as string)
  1830.         )
  1831.         
  1832.             
  1833.         -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1834.         -- Paramblock Definition
  1835.         -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1836.         
  1837.         FN CAT_TextChecker t = 
  1838.         (
  1839.             str = "\""
  1840.             location = findString t str
  1841.             master_location = 0
  1842.             while location != undefined do
  1843.             ( 
  1844.                 master_location += location
  1845.                 t = replace t master_location 1 "\\\""
  1846.                 location = findString (subString t (master_location + 2) -1) str
  1847.                 master_location += 1
  1848.             )
  1849.  
  1850.             Cat_UIText = t
  1851.             
  1852.             str = "'"
  1853.             master_location = 0
  1854.             location = findString t str
  1855.             while location != undefined do
  1856.             ( 
  1857.                 if location == 1 or location == t.count then
  1858.                     (t = replace t location 1 "")
  1859.                 else
  1860.                     (t = replace t location 1 "_")
  1861.                 location = findString t str
  1862.             )
  1863.  
  1864.             Cat_CheckedText = "'" + t + "'"
  1865.         )     
  1866.         
  1867.         FN CAT_Set_Roll_Float = 
  1868.         (
  1869.             Try(RemoveRollout CAT_TestRoll CAT_Float)Catch()
  1870.             Try(RemoveRollout CAT_DoneRoll CAT_Float)Catch()
  1871.             Try(RemoveRollout CAT_PropRoll_Boolean CAT_Float)Catch()
  1872.             Try(RemoveRollout CAT_PropRoll_Array CAT_Float)Catch()
  1873.             Try(RemoveRollout CAT_PropRoll_Color CAT_Float)Catch()
  1874.             Try(RemoveRollout CAT_PropRoll_Node CAT_Float)Catch()
  1875.             Try(RemoveRollout CAT_PropRoll_Material CAT_Float)Catch()
  1876.             Try(RemoveRollout CAT_PropRoll_Integer CAT_Float)Catch()
  1877.             
  1878.             AddRollout CAT_PropRoll_Float CAT_Float
  1879.                         
  1880.             AddRollout CAT_DoneRoll CAT_Float
  1881.             AddRollout CAT_TestRoll CAT_Float
  1882.                                     
  1883.             CAT_ParamRoll.CAT_UIType.items = #("Spinner", "Slider")
  1884.             CAT_ParamRoll.CAT_UIType.selection = 1
  1885.             Cat_EvalUI () 
  1886.         
  1887.         )
  1888.         
  1889.         FN CAT_Set_Roll_Boolean = 
  1890.         (
  1891.             Try(RemoveRollout CAT_TestRoll CAT_Float)Catch()
  1892.             Try(RemoveRollout CAT_DoneRoll CAT_Float)Catch()
  1893.             Try(RemoveRollout CAT_PropRoll_Boolean CAT_Float)Catch()
  1894.             Try(RemoveRollout CAT_PropRoll_Array CAT_Float)Catch()
  1895.             Try(RemoveRollout CAT_PropRoll_Color CAT_Float)Catch()
  1896.             Try(RemoveRollout CAT_PropRoll_Node CAT_Float)Catch()
  1897.             Try(RemoveRollout CAT_PropRoll_Material CAT_Float)Catch()
  1898.             Try(RemoveRollout CAT_PropRoll_Float CAT_Float)Catch()
  1899.             Try(RemoveRollout CAT_PropRoll_Integer CAT_Float)Catch()
  1900.                         
  1901.             AddRollout CAT_PropRoll_Boolean CAT_Float
  1902.             AddRollout CAT_DoneRoll CAT_Float
  1903.             AddRollout CAT_TestRoll CAT_Float
  1904.                 
  1905.              CAT_ParamRoll.CAT_UIType.items = #("CheckBox", "CheckButton")
  1906.             CAT_ParamRoll.CAT_UIType.selection = 1
  1907.             Cat_EvalUI() 
  1908.         
  1909.         )
  1910.         
  1911.         FN CAT_Set_Roll_Integer = 
  1912.         (
  1913.             Try(RemoveRollout CAT_TestRoll CAT_Float)Catch()
  1914.             Try(RemoveRollout CAT_DoneRoll CAT_Float)Catch()
  1915.             Try(RemoveRollout CAT_PropRoll_Boolean CAT_Float)Catch()
  1916.             Try(RemoveRollout CAT_PropRoll_Array CAT_Float)Catch()
  1917.             Try(RemoveRollout CAT_PropRoll_Color CAT_Float)Catch()
  1918.             Try(RemoveRollout CAT_PropRoll_Node CAT_Float)Catch()
  1919.             Try(RemoveRollout CAT_PropRoll_Material CAT_Float)Catch()
  1920.             Try(RemoveRollout CAT_PropRoll_Float CAT_Float)Catch()
  1921.                     
  1922.             AddRollout CAT_PropRoll_Integer CAT_Float
  1923.                             
  1924.             AddRollout CAT_DoneRoll CAT_Float
  1925.             AddRollout CAT_TestRoll CAT_Float
  1926.                                 
  1927.             CAT_ParamRoll.CAT_UIType.items = #("Spinner", "Slider")
  1928.             CAT_ParamRoll.CAT_UIType.selection = 1                                
  1929.              Cat_EvalUI() 
  1930.         )
  1931.         
  1932.         FN CAT_Set_Roll_Array = 
  1933.         (
  1934.             
  1935.             Try(RemoveRollout CAT_TestRoll CAT_Float)Catch()
  1936.             Try(RemoveRollout CAT_DoneRoll CAT_Float)Catch()
  1937.             Try(RemoveRollout CAT_PropRoll_Boolean CAT_Float)Catch()
  1938.             Try(RemoveRollout CAT_PropRoll_Array CAT_Float)Catch()
  1939.             Try(RemoveRollout CAT_PropRoll_Color CAT_Float)Catch()
  1940.             Try(RemoveRollout CAT_PropRoll_Node CAT_Float)Catch()
  1941.             Try(RemoveRollout CAT_PropRoll_Material CAT_Float)Catch()
  1942.             Try(RemoveRollout CAT_PropRoll_Float CAT_Float)Catch()
  1943.             Try(RemoveRollout CAT_PropRoll_Integer CAT_Float)Catch()
  1944.                                 
  1945.             AddRollout CAT_PropRoll_Array CAT_Float
  1946.                                 
  1947.             AddRollout CAT_DoneRoll CAT_Float
  1948.             AddRollout CAT_TestRoll CAT_Float
  1949.                             
  1950.             CAT_ParamRoll.CAT_UIType.selection = 1
  1951.             CAT_ParamRoll.CAT_UIType.items = #("DropDownList")
  1952.             Cat_EvalUI()
  1953.         )
  1954.         
  1955.         FN CAT_Set_Roll_Node = 
  1956.         (
  1957.             Try(RemoveRollout CAT_TestRoll CAT_Float)Catch()
  1958.             Try(RemoveRollout CAT_DoneRoll CAT_Float)Catch()
  1959.             Try(RemoveRollout CAT_PropRoll_Boolean CAT_Float)Catch()
  1960.             Try(RemoveRollout CAT_PropRoll_Array CAT_Float)Catch()
  1961.             Try(RemoveRollout CAT_PropRoll_Color CAT_Float)Catch()
  1962.             Try(RemoveRollout CAT_PropRoll_Node CAT_Float)Catch()
  1963.             Try(RemoveRollout CAT_PropRoll_Material CAT_Float)Catch()
  1964.             Try(RemoveRollout CAT_PropRoll_Float CAT_Float)Catch()
  1965.             Try(RemoveRollout CAT_PropRoll_Integer CAT_Float)Catch()
  1966.                         
  1967.             AddRollout CAT_PropRoll_Node CAT_Float
  1968.                         
  1969.             AddRollout CAT_DoneRoll CAT_Float
  1970.             AddRollout CAT_TestRoll CAT_Float
  1971.                             
  1972.             CAT_ParamRoll.CAT_UIType.items = #("PickButton")
  1973.             CAT_ParamRoll.CAT_UIType.selection = 1
  1974.             Cat_EvalUI() 
  1975.         )
  1976.         FN CAT_Set_Roll_Color =
  1977.         ( 
  1978.             Try(RemoveRollout CAT_TestRoll CAT_Float)Catch()
  1979.             Try(RemoveRollout CAT_DoneRoll CAT_Float)Catch()
  1980.             Try(RemoveRollout CAT_PropRoll_Boolean CAT_Float)Catch()
  1981.             Try(RemoveRollout CAT_PropRoll_Array CAT_Float)Catch()
  1982.             Try(RemoveRollout CAT_PropRoll_Color CAT_Float)Catch()
  1983.             Try(RemoveRollout CAT_PropRoll_Node CAT_Float)Catch()
  1984.             Try(RemoveRollout CAT_PropRoll_Material CAT_Float)Catch()
  1985.             Try(RemoveRollout CAT_PropRoll_Float CAT_Float)Catch()
  1986.             Try(RemoveRollout CAT_PropRoll_Integer CAT_Float)Catch()    
  1987.                                 
  1988.             AddRollout CAT_PropRoll_Color CAT_Float
  1989.                             
  1990.             AddRollout CAT_DoneRoll CAT_Float
  1991.             AddRollout CAT_TestRoll CAT_Float
  1992.                                   
  1993.             CAT_ParamRoll.CAT_UIType.items = #("ColorPicker")
  1994.             CAT_ParamRoll.CAT_UIType.selection = 1
  1995.             Cat_EvalUI() 
  1996.         )
  1997.         
  1998.         FN CAT_Set_Roll_TextureMap =
  1999.         (
  2000.             Try(RemoveRollout CAT_TestRoll CAT_Float)Catch()
  2001.             Try(RemoveRollout CAT_DoneRoll CAT_Float)Catch()
  2002.             Try(RemoveRollout CAT_PropRoll_Boolean CAT_Float)Catch()
  2003.             Try(RemoveRollout CAT_PropRoll_Array CAT_Float)Catch()
  2004.             Try(RemoveRollout CAT_PropRoll_Color CAT_Float)Catch()
  2005.             Try(RemoveRollout CAT_PropRoll_Node CAT_Float)Catch()
  2006.             Try(RemoveRollout CAT_PropRoll_Material CAT_Float)Catch()
  2007.             Try(RemoveRollout CAT_PropRoll_Float CAT_Float)Catch()
  2008.             Try(RemoveRollout CAT_PropRoll_Integer CAT_Float)Catch()
  2009.                                 
  2010.             AddRollout CAT_PropRoll_Material CAT_Float
  2011.                              
  2012.             AddRollout CAT_DoneRoll CAT_Float
  2013.             AddRollout CAT_TestRoll CAT_Float
  2014.                                 
  2015.             CAT_ParamRoll.CAT_UIType.items = #("MapButton")
  2016.             CAT_ParamRoll.CAT_UIType.selection = 1
  2017.             Cat_EvalUI() 
  2018.         )
  2019.         
  2020.         -- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  2021.         -- Function for initializing the Edits
  2022.         -- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  2023.         
  2024.         FN CAT_Edit_Set i = 
  2025.         (
  2026.                 CAT_ParamRoll.CAT_UIName.text = CAT_UIItems_Array[i].string
  2027.                 
  2028.                 Case CAT_UIItems_Array[i].type of 
  2029.                 (
  2030.                     "Float":(
  2031.                                 CAT_Set_Roll_Float ()
  2032.                                 
  2033.                                 CAT_ParamRoll.CAT_Type.selection = 1 
  2034.                                 CAT_PropRoll_Float.CAT_Width.value = CAT_UIItems_Array[i].Width as float
  2035.                                 CAT_PropRoll_Float.CAT_UIRangeStart.value = (execute (CAT_UIItems_Array[i].Range)).x as float
  2036.                                 CAT_PropRoll_Float.CAT_UIRangeEnd.value = (execute (CAT_UIItems_Array[i].Range)).y as float
  2037.                                 CAT_PropRoll_Float.CAT_UIRangeDefault.value = (execute (CAT_UIItems_Array[i].Range)).z as float
  2038.                                 
  2039.                                 Case CAT_UIItems_Array[i].Align of
  2040.                                 (
  2041.                                     "Left":(CAT_PropRoll_Float.CAT_Align.State = 1)
  2042.                                     "Right":(CAT_PropRoll_Float.CAT_Align.State = 2)
  2043.                                     "Center":(CAT_PropRoll_Float.CAT_Align.State = 3)
  2044.                                 
  2045.                                 )
  2046.                                 
  2047.                                 Case CAT_UIItems_Array[i].UI of
  2048.                                 (
  2049.                                     "Spinner":(CAT_ParamRoll.CAT_UIType.selection = 1)
  2050.                                     "Slider":(CAT_ParamRoll.CAT_UIType.selection = 2)
  2051.                                 )
  2052.                                 
  2053.                                 Case CAT_UIItems_Array[i].orient of
  2054.                                 (
  2055.                                     "Horizontal":(
  2056.                                                     CAT_PropRoll_Float.CAT_Orient.state = False
  2057.                                                     CAT_PropRoll_Float.CAT_Orient.Enabled = False
  2058.                                                     CAT_PropRoll_Float.CAT_Ticks.Enabled = False
  2059.                                                         
  2060.                                                 )
  2061.                                     "Vertical":(
  2062.                                                     CAT_PropRoll_Float.CAT_Orient.state = True
  2063.                                                     CAT_PropRoll_Float.CAT_Orient.Enabled = True
  2064.                                                     CAT_PropRoll_Float.CAT_Ticks.Enabled = True
  2065.                                                 )
  2066.                                 )
  2067.                                 
  2068.                                 CAT_PropRoll_Float.CAT_Ticks.value = CAT_UIItems_Array[i].ticks as integer
  2069.                                 CAT_EvalUI()    
  2070.                                 
  2071.                     
  2072.                             )
  2073.                             
  2074.                     "Integer":(
  2075.                                 CAT_Set_Roll_Integer()
  2076.                                 
  2077.                                 CAT_ParamRoll.CAT_Type.selection = 2
  2078.                                 CAT_PropRoll_Integer.CAT_Width.value = CAT_UIItems_Array[i].Width as integer
  2079.                                 CAT_PropRoll_Integer.CAT_UIRangeStart.value = (execute (CAT_UIItems_Array[i].Range)).x as integer
  2080.                                 CAT_PropRoll_Integer.CAT_UIRangeEnd.value = (execute (CAT_UIItems_Array[i].Range)).y as integer
  2081.                                 CAT_PropRoll_Integer.CAT_UIRangeDefault.value = (execute (CAT_UIItems_Array[i].Range)).z as integer
  2082.                                 
  2083.                                 Case CAT_UIItems_Array[i].Align of
  2084.                                 (
  2085.                                     "Left":(CAT_PropRoll_Integer.CAT_Align.State = 1)
  2086.                                     "Right":(CAT_PropRoll_Integer.CAT_Align.State = 2)
  2087.                                     "Center":(CAT_PropRoll_Integer.CAT_Align.State = 3)
  2088.                                 
  2089.                                 )
  2090.                                 
  2091.                                 Case CAT_UIItems_Array[i].UI of
  2092.                                 (
  2093.                                     "Spinner":(CAT_ParamRoll.CAT_UIType.selection = 1)
  2094.                                     "Slider":(CAT_ParamRoll.CAT_UIType.selection = 2)
  2095.                                 )
  2096.                                 
  2097.                                 Case CAT_UIItems_Array[i].orient of
  2098.                                 (
  2099.                                     "Horizontal":(
  2100.                                                     CAT_PropRoll_Integer.CAT_Orient.state = False
  2101.                                                     CAT_PropRoll_Integer.CAT_Orient.Enabled = False
  2102.                                                     CAT_PropRoll_Integer.CAT_Ticks.Enabled = False
  2103.                                                         
  2104.                                                 )
  2105.                                     "Vertical":(
  2106.                                                     CAT_PropRoll_Integer.CAT_Orient.state = True
  2107.                                                     CAT_PropRoll_Integer.CAT_Orient.Enabled = True
  2108.                                                     CAT_PropRoll_Integer.CAT_Ticks.Enabled = True
  2109.                                                 )
  2110.                                 )
  2111.                                 
  2112.                                 CAT_PropRoll_Integer.CAT_Ticks.value = CAT_UIItems_Array[2].ticks as integer
  2113.                                 CAT_EvalUI()    
  2114.                               )
  2115.                               
  2116.                     "Boolean":(
  2117.                                                             
  2118.                                 CAT_Set_Roll_Boolean ()    
  2119.                                 CAT_ParamRoll.CAT_Type.selection = 3 
  2120.                                 
  2121.                                 CAT_PropRoll_Boolean.CAT_Width.value = CAT_UIItems_Array[i].Width as integer
  2122.                                 CAT_PropRoll_Boolean.CAT_Height.value = CAT_UIItems_Array[i].Height as integer
  2123.                                                             
  2124.                                 Case CAT_UIItems_Array[i].Align of
  2125.                                 (
  2126.                                     "Left":(CAT_PropRoll_Boolean.CAT_Align.State = 1)
  2127.                                     "Right":(CAT_PropRoll_Boolean.CAT_Align.State = 2)
  2128.                                     "Center":(CAT_PropRoll_Boolean.CAT_Align.State = 3)
  2129.                                 
  2130.                                 )
  2131.                                 
  2132.                                 Case CAT_UIItems_Array[i].UI of
  2133.                                 (
  2134.                                     "CheckBox ":(
  2135.                                                 CAT_ParamRoll.CAT_UIType.selection = 1
  2136.                                                 CAT_PropRoll_Boolean.CAT_Highlight.enabled = False
  2137.                                                 CAT_PropRoll_Boolean.CAT_Highlight.color = (execute (CAT_UIItems_Array[i].HighLightColor))                                            
  2138.                                                 )
  2139.                                                 
  2140.                                     "CheckButton ":(
  2141.                                                     CAT_ParamRoll.CAT_UIType.selection = 2
  2142.                                                     CAT_PropRoll_Boolean.CAT_Highlight.enabled = True
  2143.                                                     CAT_PropRoll_Boolean.CAT_Highlight.color = (execute (CAT_UIItems_Array[i].HighLightColor))
  2144.                                                     )
  2145.                                 )
  2146.                                 
  2147.                                 CAT_EvalUI()    
  2148.                     
  2149.                                 )
  2150.                                 
  2151.                     "Array":(
  2152.                                 CAT_Set_Roll_Array()
  2153.                                 CAT_ParamRoll.CAT_Type.selection = 4 
  2154.                                 
  2155.                                 CAT_PropRoll_Array.CAT_Width.value = CAT_UIItems_Array[i].Width as integer
  2156.                                 CAT_PropRoll_Array.CAT_Height.value = CAT_UIItems_Array[i].Height as integer
  2157.                                                             
  2158.                                 Case CAT_UIItems_Array[i].Align of
  2159.                                 (
  2160.                                     "Left":(CAT_PropRoll_Array.CAT_Align.State = 1)
  2161.                                     "Right":(CAT_PropRoll_Array.CAT_Align.State = 2)
  2162.                                     "Center":(CAT_PropRoll_Array.CAT_Align.State = 3)
  2163.                                 
  2164.                                 )
  2165.                                 
  2166.                                 CAT_PropRoll_Array.CAT_AItems.Items = CAT_UIItems_Array[i].Array
  2167.                                 CAT_PropRoll_Array.CAT_MYArray = CAT_UIItems_Array[i].Array
  2168.                                 
  2169.                                 CAT_EvalUI()                                
  2170.                             
  2171.                             )
  2172.                 
  2173.                     "Node":(
  2174.                                 CAT_Set_Roll_Node ()
  2175.                                 CAT_ParamRoll.CAT_Type.selection = 5
  2176.                                 
  2177.                                 CAT_PropRoll_Node.CAT_Width.value = CAT_UIItems_Array[i].Width as integer
  2178.                                 CAT_PropRoll_Node.CAT_Height.value = CAT_UIItems_Array[i].Height as integer
  2179.                                                             
  2180.                                 Case CAT_UIItems_Array[i].Align of
  2181.                                 (
  2182.                                     "Left":(CAT_PropRoll_Node.CAT_Align.State = 1)
  2183.                                     "Right":(CAT_PropRoll_Node.CAT_Align.State = 2)
  2184.                                     "Center":(CAT_PropRoll_Node.CAT_Align.State = 3)
  2185.                                 
  2186.                                 )
  2187.                             
  2188.                                 
  2189.                             CAT_EvalUI()    
  2190.  
  2191.                             )
  2192.         
  2193.                     "Color":(
  2194.                                 CAT_Set_Roll_Color ()
  2195.                                 CAT_ParamRoll.CAT_Type.selection = 6  
  2196.                                 
  2197.                                 CAT_PropRoll_Color.CAT_Width.value = CAT_UIItems_Array[i].Width as integer
  2198.                                 CAT_PropRoll_Color.CAT_Height.value = CAT_UIItems_Array[i].Height as integer
  2199.                                                             
  2200.                                 Case CAT_UIItems_Array[i].Align of
  2201.                                 (
  2202.                                     "Left":(CAT_PropRoll_Color.CAT_Align.State = 1)
  2203.                                     "Right":(CAT_PropRoll_Color.CAT_Align.State = 2)
  2204.                                     "Center":(CAT_PropRoll_Color.CAT_Align.State = 3)
  2205.                                 
  2206.                                 )
  2207.                                 
  2208.                                 CAT_PropRoll_Color.CAT_DColor.Color = (execute (CAT_UIItems_Array[i].Color))
  2209.                                 CAT_EvalUI()    
  2210.  
  2211.                             )
  2212.                             
  2213.                     "TextureMap":(
  2214.                                     CAT_Set_Roll_TextureMap()
  2215.                                     CAT_ParamRoll.CAT_Type.selection = 7   
  2216.  
  2217.                                     CAT_PropRoll_Material.CAT_Width.value = CAT_UIItems_Array[i].Width as integer
  2218.                                     CAT_PropRoll_Material.CAT_Height.value = CAT_UIItems_Array[i].Height as integer
  2219.                                                             
  2220.                                     Case CAT_UIItems_Array[i].Align of
  2221.                                     (
  2222.                                         "Left":(CAT_PropRoll_Material.CAT_Align.State = 1)
  2223.                                         "Right":(CAT_PropRoll_Material.CAT_Align.State = 2)
  2224.                                         "Center":(CAT_PropRoll_Material.CAT_Align.State = 3)
  2225.                                 
  2226.                                     )
  2227.                                     CAT_EvalUI()    
  2228.  
  2229.                                 )
  2230.                     )
  2231.                 )
  2232.         
  2233.     -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  2234.     -- Funtion for Editing UI Elements
  2235.     -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  2236.     FN CAT_EditUI = 
  2237.     (
  2238.         
  2239.     /* Localize on */
  2240.     
  2241.         Rollout CAT_EditUIRoll "Edit Attribute" SilentErrors:(CAT_Debug != True)
  2242.         (
  2243.             ListBox CAT_UIList             "Attributes:"
  2244.             Button CAT_EditUI_OK         "Edit Selected"     Across:2    Align:#Right     Offset:[35,0]
  2245.             Button CAT_EditUI_Cancel     "Close"                Align:#Right
  2246.             
  2247.     /* Localize off */
  2248.     
  2249.             On CAT_UIList selected i do
  2250.             (
  2251.                 CAT_Edit_Set i
  2252.             )
  2253.         
  2254.             On CAT_EditUI_OK pressed do 
  2255.             (
  2256.                 -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  2257.                 -- This is where the delete selected button action takes place.
  2258.                 -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  2259.             
  2260.             
  2261.             
  2262.                 If Debug == True then Format "%\n" ("Current Def Data Information Defore Edit = " + CAT_Source as string)
  2263.                 
  2264.                 -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  2265.                 -- This is where the Paramblock and UI edits take place.
  2266.                 -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  2267.                 
  2268.                 CAT_UIItems_Array[CAT_UIList.selection].string = Cat_UIText
  2269.                 
  2270.                 --CAT_TextChecker CAT_ParamRoll.CAT_UIName.text
  2271.                 --CAT_ParamBlock_Array[CAT_UIList.selection].UI = CAT_CheckedText
  2272.                 --CAT_ParamBlock_Array[CAT_UIList.selection].UI = CAT_CheckedText
  2273.                 
  2274.                 Case CAT_ParamRoll.CAT_UIType.selected of
  2275.                 (
  2276.                                             
  2277.                 
  2278.                     "Spinner":(
  2279.                                 /* Localize on */
  2280.                                 Format "%\n" "Spinner Edited"    
  2281.                                 /* Localize off */
  2282.                                 
  2283.                                 CAT_UIItems_Array[CAT_UIList.selection].UI = CAT_ParamRoll.CAT_UIType.selected
  2284.                                 CAT_UIItems_Array[CAT_UIList.selection].Type = CAT_ParamRoll.CAT_Type.selected
  2285.                                 
  2286.                                 Case CAT_ParamRoll.CAT_Type.selected of
  2287.                                 (
  2288.                                                                             
  2289.                                     "Integer":(
  2290.                                                                                             
  2291.                                                 CAT_UIItems_Array[CAT_UIList.selection].Range = ("[" + CAT_PropRoll_Integer.CAT_UIRangeStart.value as string + "," + CAT_PropRoll_Integer.CAT_UIRangeEnd.value as string + "," + CAT_PropRoll_Integer.CAT_UIRangeDefault.value as string + "]")
  2292.                                                 CAT_UIItems_Array[CAT_UIList.selection].Width = CAT_PropRoll_Integer.CAT_Width.value as string
  2293.                                     
  2294.                                                 Case CAT_PropRoll_Float.CAT_Align.State of
  2295.                                                 (
  2296.                                                     1:(CAT_UIItems_Array[CAT_UIList.selection].Align = "Left")
  2297.                                                     2:(CAT_UIItems_Array[CAT_UIList.selection].Align = "Right")
  2298.                                                     3:(CAT_UIItems_Array[CAT_UIList.selection].Align = "Center")
  2299.                                                 )
  2300.                                                 
  2301.                                                 CAT_ParamBlock_Array[CAT_UIList.selection].Type = "Integer"
  2302.                                                 CAT_ParamBlock_Array[CAT_UIList.selection].Default = CAT_PropRoll_Integer.CAT_UIRangeDefault.value as string
  2303.                                                 
  2304.                                             )
  2305.                                     "Float":(
  2306.                                                 CAT_UIItems_Array[CAT_UIList.selection].Range = ("[" + CAT_PropRoll_Float.CAT_UIRangeStart.value as string + "," + CAT_PropRoll_Float.CAT_UIRangeEnd.value as string + "," + CAT_PropRoll_Float.CAT_UIRangeDefault.value as string + "]")
  2307.                                                 CAT_UIItems_Array[CAT_UIList.selection].Width = CAT_PropRoll_Float.CAT_Width.value as string
  2308.                                     
  2309.                                                 Case CAT_PropRoll_Float.CAT_Align.State of
  2310.                                                 (
  2311.                                                     1:(CAT_UIItems_Array[CAT_UIList.selection].Align = "Left")
  2312.                                                     2:(CAT_UIItems_Array[CAT_UIList.selection].Align = "Right")
  2313.                                                     3:(CAT_UIItems_Array[CAT_UIList.selection].Align = "Center")
  2314.                                                 )
  2315.                                                 CAT_ParamBlock_Array[CAT_UIList.selection].Type = "Float"
  2316.                                                 CAT_ParamBlock_Array[CAT_UIList.selection].Default = CAT_PropRoll_Float.CAT_UIRangeDefault.value as string
  2317.                                             )
  2318.                                             
  2319.                                     )    
  2320.                                 )
  2321.                     "Slider":(
  2322.                                     /* Localize on */
  2323.                                     Format "%\n" "Slider Edited"
  2324.                                     /* Localize off */
  2325.                 
  2326.                                     CAT_UIItems_Array[CAT_UIList.selection].UI = CAT_ParamRoll.CAT_UIType.selected
  2327.                                     CAT_UIItems_Array[CAT_UIList.selection].Type = CAT_ParamRoll.CAT_Type.selected
  2328.                                     
  2329.                                     Case CAT_ParamRoll.CAT_Type.selected of
  2330.                                     (
  2331.                                         
  2332.                                                                                         
  2333.                                         "Integer":(
  2334.                                                     CAT_UIItems_Array[CAT_UIList.selection].Range = ("[" + CAT_PropRoll_Integer.CAT_UIRangeStart.value as string + "," + CAT_PropRoll_Integer.CAT_UIRangeEnd.value as string + "," + CAT_PropRoll_Integer.CAT_UIRangeDefault.value as string + "]")
  2335.                                                     CAT_UIItems_Array[CAT_UIList.selection].Width = CAT_PropRoll_Integer.CAT_Width.value as string
  2336.                                         
  2337.                                                     Case CAT_PropRoll_Float.CAT_Align.State of
  2338.                                                     (
  2339.                                                         1:(CAT_UIItems_Array[CAT_UIList.selection].Align = "Left")
  2340.                                                         2:(CAT_UIItems_Array[CAT_UIList.selection].Align = "Right")
  2341.                                                         3:(CAT_UIItems_Array[CAT_UIList.selection].Align = "Center")
  2342.                                                     )
  2343.                                                     CAT_ParamBlock_Array[CAT_UIList.selection].Type = "Integer"
  2344.                                                                                                     )
  2345.                                         "Float":(
  2346.                                                     CAT_UIItems_Array[CAT_UIList.selection].Range = ("[" + CAT_PropRoll_Float.CAT_UIRangeStart.value as string + "," + CAT_PropRoll_Float.CAT_UIRangeEnd.value as string + "," + CAT_PropRoll_Float.CAT_UIRangeDefault.value as string + "]")
  2347.                                                     CAT_UIItems_Array[CAT_UIList.selection].Width = CAT_PropRoll_Float.CAT_Width.value as string
  2348.                                         
  2349.                                                     Case CAT_PropRoll_Float.CAT_Align.State of
  2350.                                                     (
  2351.                                                         1:(CAT_UIItems_Array[CAT_UIList.selection].Align = "Left")
  2352.                                                         2:(CAT_UIItems_Array[CAT_UIList.selection].Align = "Right")
  2353.                                                         3:(CAT_UIItems_Array[CAT_UIList.selection].Align = "Center")
  2354.                                                     )
  2355.                                                     CAT_ParamBlock_Array[CAT_UIList.selection].Type = "Float"
  2356.                                                     
  2357.                                                 )    
  2358.                                     )
  2359.                                 )
  2360.                                 
  2361.                     "CheckBox":(    
  2362.                                     /* Localize on */
  2363.                                     Format "%\n" "Checkbox Edited"
  2364.                                     /* Localize off */
  2365.     
  2366.                                     CAT_UIItems_Array[CAT_UIList.selection].UI = CAT_ParamRoll.CAT_UIType.selected
  2367.                                     CAT_UIItems_Array[CAT_UIList.selection].Type = CAT_ParamRoll.CAT_Type.selected
  2368.                                     
  2369.                                     CAT_UIItems_Array[CAT_UIList.selection].Width = CAT_PropRoll_Boolean.CAT_Width.value as string
  2370.                                     CAT_UIItems_Array[CAT_UIList.selection].Height = CAT_PropRoll_Boolean.CAT_Height.value as string
  2371.                                     
  2372.                                     Case CAT_PropRoll_Boolean.CAT_Align.State of
  2373.                                     (
  2374.                                         1:(CAT_UIItems_Array[CAT_UIList.selection].Align = "Left")
  2375.                                         2:(CAT_UIItems_Array[CAT_UIList.selection].Align = "Right")
  2376.                                         3:(CAT_UIItems_Array[CAT_UIList.selection].Align = "Center")
  2377.                                 
  2378.                                     )
  2379.                                     CAT_ParamBlock_Array[CAT_UIList.selection].Type = "Boolean"
  2380.                                     CAT_ParamBlock_Array[CAT_UIList.selection].Default = "False"
  2381.                                     
  2382.                                 )
  2383.                     "CheckButton":(
  2384.                                     /* Localize on */
  2385.                                     Format "%\n" "Checkbutton Edited"    
  2386.                                     /* Localize off */
  2387.                                     
  2388.                                     CAT_UIItems_Array[CAT_UIList.selection].UI = CAT_ParamRoll.CAT_UIType.selected
  2389.                                     CAT_UIItems_Array[CAT_UIList.selection].Type = CAT_ParamRoll.CAT_Type.selected
  2390.                                     
  2391.                                     CAT_UIItems_Array[CAT_UIList.selection].Width = CAT_PropRoll_Boolean.CAT_Width.value as string
  2392.                                     CAT_UIItems_Array[CAT_UIList.selection].Height = CAT_PropRoll_Boolean.CAT_Height.value as string
  2393.                                     
  2394.                                     CAT_UIItems_Array[CAT_UIList.selection].HighlightColor = CAT_PropRoll_Boolean.CAT_Highlight.color as string
  2395.  
  2396.                                     
  2397.                                     Case CAT_PropRoll_Boolean.CAT_Align.State of
  2398.                                     (
  2399.                                         1:(CAT_UIItems_Array[CAT_UIList.selection].Align = "Left")
  2400.                                         2:(CAT_UIItems_Array[CAT_UIList.selection].Align = "Right")
  2401.                                         3:(CAT_UIItems_Array[CAT_UIList.selection].Align = "Center")
  2402.                                 
  2403.                                     )
  2404.                                     CAT_ParamBlock_Array[CAT_UIList.selection].Type = "Boolean"
  2405.                                     CAT_ParamBlock_Array[CAT_UIList.selection].Default = "False"
  2406.                                     
  2407.                                 )
  2408.                     "ColorPicker":(
  2409.                                     /* Localize on */
  2410.                                     Format "%\n" "Colorpicker Edited"    
  2411.                                     /* Localize off */
  2412.                                     
  2413.                                     CAT_UIItems_Array[CAT_UIList.selection].UI = CAT_ParamRoll.CAT_UIType.selected
  2414.                                     CAT_UIItems_Array[CAT_UIList.selection].Type = CAT_ParamRoll.CAT_Type.selected
  2415.                                     
  2416.                                     CAT_UIItems_Array[CAT_UIList.selection].Width = CAT_PropRoll_Color.CAT_Width.value as string
  2417.                                     CAT_UIItems_Array[CAT_UIList.selection].Height = CAT_PropRoll_Color.CAT_Height.value as string
  2418.                                     
  2419.                                     CAT_UIItems_Array[CAT_UIList.selection].Color = ("[" + CAT_PropRoll_Color.CAT_DColor.Color.R as string + "," + CAT_PropRoll_Color.CAT_DColor.Color.G as string + "," + CAT_PropRoll_Color.CAT_DColor.Color.B as string + "]")
  2420.  
  2421.                                     
  2422.                                     Case CAT_PropRoll_Color.CAT_Align.State of
  2423.                                     (
  2424.                                         1:(CAT_UIItems_Array[CAT_UIList.selection].Align = "Left")
  2425.                                         2:(CAT_UIItems_Array[CAT_UIList.selection].Align = "Right")
  2426.                                         3:(CAT_UIItems_Array[CAT_UIList.selection].Align = "Center")
  2427.                                 
  2428.                                     )
  2429.                                     CAT_ParamBlock_Array[CAT_UIList.selection].Type = "Color"
  2430.                                     CAT_ParamBlock_Array[CAT_UIList.selection].Default = CAT_UIItems_Array[CAT_UIList.selection].Color
  2431.                                     
  2432.                             )
  2433.                     "PickButton":(
  2434.                                     /* Localize on */
  2435.                                     Format "%\n" "Pickbutton Edited"    
  2436.                                     /* Localize off */
  2437.                                     
  2438.                                     CAT_UIItems_Array[CAT_UIList.selection].UI = "PickButton"
  2439.                                     CAT_UIItems_Array[CAT_UIList.selection].Type = CAT_ParamRoll.CAT_Type.selected
  2440.                                     
  2441.                                     CAT_UIItems_Array[CAT_UIList.selection].Width = CAT_PropRoll_Node.CAT_Width.value as string
  2442.                                     CAT_UIItems_Array[CAT_UIList.selection].Height = CAT_PropRoll_Node.CAT_Height.value as string
  2443.                                                                         
  2444.                                     Case CAT_PropRoll_Node.CAT_Align.State of
  2445.                                     (
  2446.                                         1:(CAT_UIItems_Array[CAT_UIList.selection].Align = "Left")
  2447.                                         2:(CAT_UIItems_Array[CAT_UIList.selection].Align = "Right")
  2448.                                         3:(CAT_UIItems_Array[CAT_UIList.selection].Align = "Center")
  2449.                                 
  2450.                                     )
  2451.                                     CAT_ParamBlock_Array[CAT_UIList.selection].Type = "Node"
  2452.                                     
  2453.                             )
  2454.                     "MapButton":(    
  2455.                                     /* Localize on */    
  2456.                                     Format "%\n" "Mapbutton Edited"
  2457.                                     /* Localize off */
  2458.     
  2459.                                     CAT_UIItems_Array[CAT_UIList.selection].UI = CAT_ParamRoll.CAT_UIType.selected
  2460.                                     CAT_UIItems_Array[CAT_UIList.selection].Type = CAT_ParamRoll.CAT_Type.selected
  2461.                                     
  2462.                                     CAT_UIItems_Array[CAT_UIList.selection].Width = CAT_PropRoll_Material.CAT_Width.value as string
  2463.                                     CAT_UIItems_Array[CAT_UIList.selection].Height = CAT_PropRoll_Material.CAT_Height.value as string
  2464.                                     
  2465.                                     Case CAT_PropRoll_Color.CAT_Align.State of
  2466.                                     (
  2467.                                         1:(CAT_UIItems_Array[CAT_UIList.selection].Align = "Left")
  2468.                                         2:(CAT_UIItems_Array[CAT_UIList.selection].Align = "Right")
  2469.                                         3:(CAT_UIItems_Array[CAT_UIList.selection].Align = "Center")
  2470.                                 
  2471.                                     )
  2472.                                     CAT_ParamBlock_Array[CAT_UIList.selection].Type = "TextureMap"
  2473.                                     
  2474.                             )
  2475.                     "DropDownList":(
  2476.                                     /* Localize on */
  2477.                                     Format "%\n" "Dropdownlist Edited"
  2478.                                     /* Localize off */
  2479.     
  2480.                                     CAT_UIItems_Array[CAT_UIList.selection].UI = "DropdownList"
  2481.                                     CAT_UIItems_Array[CAT_UIList.selection].Type = CAT_ParamRoll.CAT_Type.selected
  2482.                                     
  2483.                                     CAT_UIItems_Array[CAT_UIList.selection].Width = CAT_PropRoll_Array.CAT_Width.value as string
  2484.                                     CAT_UIItems_Array[CAT_UIList.selection].Height = CAT_PropRoll_Array.CAT_Height.value as string
  2485.                                     
  2486.                                     CAT_UIItems_Array[CAT_UIList.selection].Array = CAT_PropRoll_Array.CAT_MyArray 
  2487.                                     
  2488.                                     Case CAT_PropRoll_Array.CAT_Align.State of
  2489.                                     (
  2490.                                         1:(CAT_UIItems_Array[CAT_UIList.selection].Align = "Left")
  2491.                                         2:(CAT_UIItems_Array[CAT_UIList.selection].Align = "Right")
  2492.                                         3:(CAT_UIItems_Array[CAT_UIList.selection].Align = "Center")
  2493.                                 
  2494.                                     )
  2495.                                     CAT_ParamBlock_Array[CAT_UIList.selection].Type = "Integer"
  2496.                                     CAT_ParamBlock_Array[CAT_UIList.selection].Default = "1"
  2497.                                     
  2498.                                     
  2499.                             )
  2500.                     
  2501.                                             
  2502.                 )    
  2503.          
  2504.             -- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  2505.             -- CAT_NewAttrib is the source for defdata, CAT_NewAttrib[1] is the paramblock array, CAT_NewAttrib[2] is the UI items associated with the paramblock. This is what is associated
  2506.             -- in the the defdata of the object.
  2507.             --
  2508.             -- Once the item is deleted, A new CAT_NewAttrib is made and the array are stuffed into CAT_NewAttrib[1] and CAT_NewAttrib[2]
  2509.             -- The Current definition is then set back to the current definition, "CAT_CurrentDef.Defdata = CAT_NewAttrib"
  2510.             -- CAT_CurrentDef is the current custom attribute and is retrieved whenever CAT_GetDef() is called on the selected object.
  2511.             -- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  2512.                 undo "Edit CA" on 
  2513.                 (                        
  2514.                     CAT_Source[1] = CAT_ParamBlock_Array as array
  2515.                     CAT_Source[2] = CAT_UIItems_Array as array
  2516.                                     
  2517.                     Cat_SetDef()
  2518.             -- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  2519.             -- This flag is set to tell tha Cat_AddUI funtion that we are currently deleting
  2520.             -- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////        
  2521.             
  2522.                     CAT_IsDeleting = True
  2523.             
  2524.             -- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////        
  2525.             -- CAT_AddUI is the function that adds the actually custom attribute    
  2526.             -- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////    
  2527.                     
  2528.                     If Debug == True then Format "%\n" ("Current Def Data Information after Editing = " + CAT_Source as string)
  2529.                     
  2530.                     CAT_AddUI ()
  2531.                     
  2532.                     DestroyDialog CAT_EditUIRoll
  2533.                     CAT_GetDef()
  2534.                     (CreateDialog CAT_EditUIRoll Pos:([CAT_Float.Pos.x + 225, CAT_Float.Pos.y + 250]) Width:200 Height:200)
  2535.                 )    
  2536.                                                     
  2537.             -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////        
  2538.             -- Update Delete List Box
  2539.             -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////            
  2540.                 
  2541.                     CAT_UIList.items = CAT_UI_Array
  2542.     
  2543.             )
  2544.             On CAT_EditUI_Cancel pressed Do 
  2545.             (
  2546.                 DestroyDialog CAT_EditUIRoll
  2547.             )
  2548.             
  2549.         
  2550.      
  2551.         )
  2552.         
  2553.         CAT_GetDef()
  2554.         
  2555.         CreateDialog CAT_EditUIRoll Pos:([CAT_Float.Pos.x + 225, CAT_Float.Pos.y + 250]) Width:200 Height:220
  2556.                 
  2557.         CAT_EditUIRoll.CAT_UIList.Items = CAT_UI_Array
  2558.         CAT_Edit_Set 1
  2559.     )    
  2560.         -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  2561.         -- UI Items Definition
  2562.         --- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  2563.         Struct CAT_ParamBlock
  2564.         (
  2565.             Name,
  2566.             Type,
  2567.             UI,
  2568.             Default = ""
  2569.             
  2570.         )
  2571.         
  2572.         Struct CAT_UIItem
  2573.         (
  2574.             UI,
  2575.             Name,
  2576.             String,
  2577.             Type,
  2578.             Range = "[0,100,0]",
  2579.             Default = "1",
  2580.             Width = "70",
  2581.             Height = "25",
  2582.             Enabled = "True",
  2583.             Orient = "Horizontal",
  2584.             Checked = "False",
  2585.             Color = "[0,0,0]",
  2586.             HighLightColor = "[0,255,0]",
  2587.             Align = "Left",
  2588.             Items = "#()",
  2589.             Ticks = "10",
  2590.             Array = #()
  2591.         )
  2592.         -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  2593.         -- Define Valid Parameter Characters
  2594.         -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  2595.         
  2596.         /* Localize on */
  2597.         
  2598.         -- CAT_ValidCharacters = #(" ","_","1","2","3","4","5","6","7","8","9","0","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z")
  2599.         
  2600.         /* Localize off */
  2601.     
  2602.         -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  2603.         -- Open up UI and addrollouts
  2604.         -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  2605.         
  2606.         If CAT_Float != undefined then CloseRolloutFloater CAT_Float
  2607.         If CAT_UI_Size == undefined then CAT_UI_Size = [225, 470]
  2608.         If CAT_UI_Pos == undefined then CAT_UI_Pos = [0, 0]
  2609.         IF CAT_CheckedText == undefined or CAT_CheckedText == "" do
  2610.         (
  2611.             CAT_CheckedText = "Param1"
  2612.             Cat_UIText = Cat_CheckedText
  2613.         )
  2614.                         
  2615.         If CAT_Float_State == undefined then CAT_Float_State = True
  2616.         If CAT_Integer_State == undefined then CAT_Integer_State = True
  2617.         If CAT_Boolean_State == undefined then CAT_Boolean_State = True
  2618.         If CAT_Array_State == undefined then CAT_Array_State = True
  2619.         If CAT_Color_State == undefined then CAT_Color_State = True
  2620.         If CAT_Node_State == undefined then CAT_Node_State = True
  2621.         If CAT_Material_State == undefined then CAT_Material_State = True
  2622.         
  2623.         /* Localize on */
  2624.         
  2625.         CAT_Float = NewRolloutFloater "Add Parameter" CAT_UI_Size.X CAT_UI_Size.Y CAT_UI_Pos.X CAT_UI_Pos.Y
  2626.         
  2627.         /* Localize off */
  2628.                     
  2629.         AddRollout CAT_ParamRoll CAT_Float 
  2630.         AddRollout CAT_PropRoll_Float CAT_Float 
  2631.         AddRollout CAT_DoneRoll CAT_Float 
  2632.         AddRollout CAT_TestRoll CAT_Float 
  2633.         
  2634.         -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  2635.         -- Create Selection handler
  2636.         -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  2637.         
  2638.         Callbacks.RemoveScripts ID:#CAT_Callback_Reset
  2639.         
  2640.         Callbacks.Addscript #selectionSetChanged "Cat_SelChange ()" ID:#CAT_Callback
  2641.         Callbacks.Addscript #systemPreReset "Cat_Reset ()" ID:#CAT_Callback_Reset
  2642.         Callbacks.Addscript #filePreOpen "Cat_Reset ()" ID:#CAT_Callback_Reset
  2643.         Callbacks.Addscript #systemPreNew "Cat_Reset ()" ID:#CAT_Callback_Reset
  2644.         CAT_SelChange ()
  2645.         
  2646.         -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  2647.         -- Clear Update and Delete handlers
  2648.         -- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  2649.             
  2650.         CAT_IsDeleting = False
  2651.         
  2652.     
  2653. )
  2654.