## XIDCine
Class LiftButton

source: C:\XIII\XIDCine\Classes\LiftButton.uc

    Core.Object
       |
       +--Engine.Actor
          |
          +--Engine.Mover
             |
             +--XIII.XIIIMover
                |
                +--XIDCine.LiftButton

Direct Known Subclasses:None

class LiftButton
extends XIII.XIIIMover

    //-----------------------------------------------------------
    //
    //-----------------------------------------------------------

Variables
`bool` | `FlashPhase`
`float` | `FlashTime`
`MovingUpSM,` | `MovingDownSM`
`StaticMesh` | `NoMoveSM`

States
MovingDown, MovingUp, LittleBreak

Function Summary
`void` | `CageIsCalled(bool Z)`
`void` | `CageMoves(bool Z)`
`void` | `CageStops( )`
`void` | `DoOpen()`
`void` | `FinishedOpening()`
    // Handle when the mover finishes opening.
`void` | `InterpolateTo(byte NewKeyNum, float Seconds)`
    //____________________________________________________________________
`void` | `PlayerTrigger(Actor Other, Pawn EventInstigator)`
    //extends TriggerToggle
`void` | `PostBeginPlay()`
    //____________________________________________________________________

State MovingDown Function Summary

State MovingUp Function Summary

State LittleBreak Function Summary
`void` | `MakeGroupReturn()`

Source Code

    00001	//-----------------------------------------------------------
    00002	//
    00003	//-----------------------------------------------------------
    00004	class LiftButton extends XIIIMover;
    00005
    00006	VAR() StaticMesh MovingUpSM, MovingDownSM;
    00007	VAR StaticMesh NoMoveSM;
    00008	VAR float FlashTime;
    00009	VAR bool FlashPhase;
    00010
    00011	//____________________________________________________________________
    00012	function PostBeginPlay()
    00013	{
    00014		Super.PostBeginPlay();
    00015		NoMoveSM = StaticMesh;
    00016	}
    00017
    00018	//____________________________________________________________________
    00019	function InterpolateTo( byte NewKeyNum, float Seconds )
    00020	{
    00021	//	LOG ("BON SANG DE BON SANG DE ...bip..."@name);
    00022	    NewKeyNum = Clamp( NewKeyNum, 0, ArrayCount(KeyPos)-1 );
    00023		bInterpolating=false;
    00024	    if ( NewKeyNum == KeyNum-1 ) // Going backward
    00025	    {
    00026	//      PhysRate = 1.0 / FMax( fVarMoveTime[ NewKeyNum ], 0.005);
    00027	//      if ( VarStaticMesh[NewKeyNum] != none )
    00028	  //      StaticMesh = VarStaticMesh[NewKeyNum];
    00029	    }
    00030	    else // Going forward
    00031	    {
    00032	  //    PhysRate = 1.0 / FMax( fVarMoveTime[ KeyNum ], 0.005);
    00033	//      if ( VarStaticMesh[KeyNum] != none )
    00034	  //      StaticMesh = VarStaticMesh[KeyNum];
    00035	    }
    00036	    PrevKeyNum       = KeyNum;
    00037	    KeyNum           = NewKeyNum;
    00038
    00039	}
    00040
    00041	FUNCTION DoOpen()
    00042	{
    00043	     PlaySound( OpeningSound );
    00044	     if ( !bMusicOnlyOnce || !bAlreadyOpening )
    00045	     {
    00046	          bAlreadyOpening = true;
    00047	          PlayMusic( OpeningMusic );
    00048	     }
    00049		 PlaySound(MoveAmbientSound);
    00050	}
    00051
    00052	// Handle when the mover finishes opening.
    00053	function FinishedOpening()
    00054	{
    00055	     // Update sound effects.
    00056	     PlaySound( OpenedSound );
    00057	     if ( !bMusicOnlyOnce || !bAlreadyOpened )
    00058	     {
    00059	          bAlreadyOpened = true;
    00060	          PlayMusic( OpenedMusic );
    00061	     }
    00062
    00063	     // Trigger any chained movers.
    00064	     TriggerEvent(Event, Self, Instigator);
    00065
    00066	//     If ( MyMarker != None )
    00067	//          MyMarker.MoverOpened();
    00068	     FinishNotify();
    00069	}
    00070
    00071	STATE() PlayerTriggerToggle //extends TriggerToggle
    00072	{
    00073	    ignores bump;
    00074
    00075	    FUNCTION PlayerTrigger( actor Other, pawn EventInstigator )
    00076	    {
    00077	        SavedTrigger = Other;
    00078	        Instigator = EventInstigator;
    00079	        if ( SavedTrigger != None )
    00080	          SavedTrigger.BeginEvent();
    00081	          if ( EventInstigator.IsPlayerPawn() )
    00082	            bWarnSoldiers = true;
    00083			  DoOpen();
    00084			  FinishedOpening();
    00085	    }
    00086	}
    00087
    00088	FUNCTION CageIsCalled ( bool Z ) // true = Up, false = down
    00089	{
    00090		bNoInteractionIcon=true;
    00091		if ( Z )
    00092		{
    00093	//		LOG( self@"CageIsCalled => MovingUpSM" );
    00094			StaticMesh = MovingUpSM;
    00095		}
    00096		else
    00097		{
    00098	//		LOG( self@"CageIsCalled => MovingDownSM" );
    00099			StaticMesh = MovingDownSM;
    00100		}
    00101	}
    00102
    00103	FUNCTION CageMoves( bool Z ) // true = Up, false = down
    00104	{
    00105		if ( Z )
    00106		{
    00107			if ( MovingUpSM!=none)
    00108				GotoState( 'MovingUp' );
    00109		}
    00110		else
    00111		{
    00112			if ( MovingDownSM!=none)
    00113				GotoState( 'MovingDown' );
    00114		}
    00115
    00116	}
    00117
    00118	FUNCTION CageStops( )
    00119	{
    00120		GotoState( 'LittleBreak' );
    00121	}
    00122
    00123	STATE LittleBreak
    00124	{
    00125	begin:
    00126		sleep( 1.0 );
    00127		bNoInteractionIcon=false;
    00128		GotoState( 'PlayerTriggerToggle' );
    00129	}
    00130
    00131	FUNCTION MakeGroupReturn()
    00132	{
    00133	}
    00134
    00135	STATE MovingUp
    00136	{
    00137		EVENT BeginState( )
    00138		{
    00139	//		LOG( self@"MovingUp::BeginState => MovingUpSM" );
    00140			bNoInteractionIcon=true;
    00141			StaticMesh = MovingUpSM;
    00142			FlashPhase=true;
    00143			if ( FlashTime>0 )
    00144				SetTimer( FlashTime, true );
    00145		}
    00146		EVENT EndState( )
    00147		{
    00148	//		LOG( self@"MovingUp::EndState => NoMoveSM" );
    00149			StaticMesh = NoMoveSM;
    00150		}
    00151		EVENT Timer( )
    00152		{
    00153			if ( FlashPhase )
    00154			{
    00155	//			LOG( self@"MovingUp::Timer => NoMoveSM" );
    00156				StaticMesh = NoMoveSM;
    00157			}
    00158			else
    00159			{
    00160	//			LOG( self@"MovingUp::Timer => MovingUpSM" );
    00161				StaticMesh = MovingUpSM;
    00162			}
    00163			FlashPhase = !FlashPhase;
    00164		}
    00165	}
    00166
    00167	STATE MovingDown
    00168	{
    00169		EVENT BeginState( )
    00170		{
    00171	//		LOG( self@"MovingDown::BeginState => MovingUpSM" );
    00172			bNoInteractionIcon=true;
    00173			StaticMesh = MovingDownSM;
    00174			FlashPhase=true;
    00175			if ( FlashTime>0 )
    00176				SetTimer( FlashTime, true );
    00177		}
    00178		EVENT EndState( )
    00179		{
    00180	//		LOG( self@"MovingDown::EndState => NoMoveSM" );
    00181			StaticMesh = NoMoveSM;
    00182		}
    00183		EVENT Timer( )
    00184		{
    00185			if ( FlashPhase )
    00186			{
    00187	//			LOG( self@"MovingDown::Timer => NoMoveSM" );
    00188				StaticMesh = NoMoveSM;
    00189			}
    00190			else
    00191			{
    00192	//			LOG( self@"MovingDown::Timer => MovingDownSM" );
    00193				StaticMesh = MovingDownSM;
    00194			}
    00195			FlashPhase = !FlashPhase;
    00196		}
    00197	}
    00198
    00199
    00200
    00201	defaultproperties
    00202	{
    00203	     FlashTime=0.500000
    00204	     InitialState="PlayerTriggerToggle"
    00205	}

End Source Code