//-----------------------------------------------------------------------------
// Torque Game Engine 
// Copyright (C) GarageGames.com, Inc.
//-----------------------------------------------------------------------------

//-----------------------------------------------------------------------------
// Server Admin Commands
//-----------------------------------------------------------------------------

function SAD(%password)
{
   if (%password !$= "")
      commandToServer('SAD', %password);
}

function SADSetPassword(%password)
{
   commandToServer('SADSetPassword', %password);
}

//----------------------------------------------------------------------------
// Misc server commands
//----------------------------------------------------------------------------

function clientCmdSyncClock(%time)
{
   // Store the base time in the hud control it will automatically increment.
   if (isObject(HudClock))
      HudClock.setTime(%time);
}

//----------------------------------------------------------------------------
// Grow and Shrink GUI commands
// See http://www.garagegames.com/community/resources/view/15018
//----------------------------------------------------------------------------

function InitShrinkGrowGUI (%obj, %shrinkoffset) 
{
	/*if(%obj.sc)
	   return;
   
   %width = getWord(%obj.extent, 0);
   %height = getWord(%obj.extent, 1);
   %x = getWord(%obj.position, 0);
   %y = getWord(%obj.position, 1);
   
   if(%shrinkoffset $= "")  
      %shrinkoffset = 10;     
   
   %max = %width;
   %min = %max - %shrinkoffset;
   %obj.originalWidth = %width;
   %obj.originalHeight = %height;
   %obj.originalX = %x;
   %obj.originalY = %y;	
   
   %obj.horizRate = 2;
   %obj.vertRate = 1;
   
   ShrinkGrowGUI (%obj, %width, %height, %x, %y, %max, %min);*/
}

function ShrinkGrowGUI (%obj, %width, %height, %x, %y, %max, %min) 
{
   /*if (%width > %max) %obj.growup = false;
   else if (%width < %min)	%obj.growup = true;
   
   if (%obj.growup) {
      %width += %obj.horizRate;
      %height += %obj.vertRate;
      %x -= %obj.horizRate / 2;
      %y -= %obj.vertRate / 2;
   }
   else {
      %width -= %obj.horizRate;
      %height -= %obj.vertRate;
      %x += %obj.horizRate / 2;
      %y += %obj.vertRate / 2;		
   }
   
   %obj.extent = %width SPC %height;
   %obj.position = %x SPC %y;
   %obj.sc = scheduleLCA("HO", 70, 0, "ShrinkGrowGUI", 7, %obj, %width, %height, %x, %y, %max, %min);*/
}

function StopShrinkGrowGUI (%obj) 
{
	/*if(%obj.sc)
   {
      cancel(%obj.sc);
      %obj.sc = 0;
      
      %obj.extent = (%obj.originalWidth*%winScaleX) SPC (%obj.originalHeight*%winScaleY);
      %obj.position = (%obj.originalX*%winScaleX) SPC (%obj.originalY*%winScaleY);
   }*/
}