home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2002 April / maximum-cd-2002-04.iso / Software / Apps / gmax / gmaxinst.exe / gmaxsetup11.cab / animatecolorfunctions.ms < prev    next >
Encoding:
Text File  |  2001-09-12  |  1.8 KB  |  48 lines

  1. -- Animate Button System Colors
  2. --
  3. -- Created:          Sept 12 2000
  4. -- Last Updated:     
  5. --
  6. -- Author :   Fred Ruff
  7. -- Version:  3D Studio Max Version 4.0
  8. --
  9. --***********************************************************************************************
  10. -- MODIFY THIS AT YOUR OWN RISK
  11. -- These functions gets called when the animate button gets turned on and Off
  12.  
  13. QuadAnimButtonState = False
  14.  
  15. fn ChangeSystemColorsAnimateOn =
  16. (
  17.     -- Store original quad border colors in array then change corder color
  18.     global QuadOriginalColors = #()
  19.     for i = 1 to 4 do QuadOriginalColors[i] = quadmenusettings.GetTitleBarBackgroundColor i
  20.     -- get Ui color of animate button and convert from 0 - 1 to 0 - 255
  21.     AnimateColorR = ((GetUiColor 12)*255.) as color
  22.     for i = 1 to 4 do quadmenusettings.SetTitleBarBackgroundColor i AnimateColorR
  23.     QuadAnimButtonState = True
  24. )
  25.  
  26.  
  27. fn ChangeSystemColorsAnimateOff =
  28. (
  29.     if QuadAnimButtonState then 
  30.     (
  31.         -- Change quads back to original colors
  32.         for i = 1 to 4 do quadmenusettings.SetTitleBarBackgroundColor i QuadOriginalColors[i]
  33.     )
  34.     QuadAnimButtonState = False
  35. )
  36.  
  37.  
  38. --Register callbacks from animate button
  39. ChangeSystemColorsAnimateOn()
  40. ChangeSystemColorsAnimateOff()
  41. callbacks.addscript #AnimateOn "ChangeSystemColorsAnimateOn()" id:#AnimateOnChangeUIColors
  42. callbacks.addscript #AnimateOff "ChangeSystemColorsAnimateOff()" id:#AnimateOffChangeUIColors
  43.  
  44. -- Register callbacks to turn the colors back befre a file load and a reset.
  45. callbacks.addscript #SystemPreReset "ChangeSystemColorsAnimateOff()" id:#ResetAnimateOffChangeUIColors
  46. callbacks.addscript #FilePreOpen "ChangeSystemColorsAnimateOff()" id:#PreLoadAnimateOffChangeUIColors
  47. callbacks.addscript #SystemPreNew "ChangeSystemColorsAnimateOff()" id:#PreNewAnimateOffChangeUIColors
  48.