## XIII
Class CWndSFXTrigger

source: C:\XIII\XIII\Classes\CWndSFXTrigger.uc

    Core.Object
       |
       +--Engine.Actor
          |
          +--Engine.Triggers
             |
             +--XIII.XIIITriggers
                |
                +--XIII.CWndSFXTrigger

Direct Known Subclasses:CWndBackShotTrigger

class CWndSFXTrigger
extends XIII.XIIITriggers

    //-----------------------------------------------------------
    // Trigger to display CWnd on screen
    //-----------------------------------------------------------

Variables
`color` | `CWndBorderColor[4]`
`float` | `CWndDuration[4]`
`float` | `CWndFOV[4]`
`int` | `CWndPosX[4]`
`int` | `CWndPosY[4]`
`int` | `CWndSizeY[4]`
`int` | `CWndSize[4]`
`Actor` | `CamPosition[4]`
`vector` | `CamTargetOffset[4]`
`Actor` | `CamTarget[4]`
`float` | `DelayBeforeNextCWnd[3]`
`color` | `FilterColor[4]`
`Material` | `FilterTexture[4]`
`float` | `HighLight[4]`
`int` | `OnoPosX[4]`
`int` | `OnoPosY[4]`
`int` | `OnoSizeY[4]`
`int` | `OnoSize[4]`
`Texture` | `OnoTexture[4]`
`array` | `OverLayMessage0`
`array` | `OverLayMessage1`
`array` | `OverLayMessage2`
`array` | `OverLayMessage3`
`float` | `animationDuration[4]`
`bool` | `bAnimatedInRealtime`
`bool` | `bSeeXIII`
`bool` | `bTriggerOnTouch`
`bool` | `bTriggerOnceOnly`
`bool` | `bVisibleOnlyIfTargetIsBehind`
`enum` | `eCWndAppearFX`
`enum` | `eCWndSoundType`
`int` | `iPhase`

Function Summary
`void` | `Touch(Actor other)`
    //____________________________________________________________________
`void` | `Trigger(Actor Other, Pawn EventInstigator)`
    //____________________________________________________________________

Source Code

    00001	//-----------------------------------------------------------
    00002	// Trigger to display CWnd on screen
    00003	//-----------------------------------------------------------
    00004	class CWndSFXTrigger extends XIIITriggers
    00005	  native;
    00006
    00007	var int iPhase;
    00008	var() actor CamPosition[4];
    00009	//var() bool bHighquality; // no more use, just aligned the texture on screen (by casting coords to int)
    00010	var() actor CamTarget[4];
    00011	var() vector CamTargetOffset[4];
    00012	var() float CWndFOV[4];
    00013	var() float CWndDuration[4];
    00014	var() float DelayBeforeNextCWnd[3];
    00015	var() int CWndPosX[4];
    00016	var() int CWndPosY[4];
    00017	var() int CWndSize[4];
    00018	var() int CWndSizeY[4];
    00019	var() color CWndBorderColor[4];
    00020	var() color FilterColor[4];
    00021	var() float HighLight[4];
    00022	var() Material FilterTexture[4];
    00023	var() enum eCWndAppearFX
    00024	{
    00025		CAFX_None,
    00026		CAFX_ComeFromLeft,
    00027		CAFX_ComeFromAbove,
    00028		CAFX_StretchHorizontal,
    00029		CAFX_StretchVertical,
    00030		CAFX_Zoom,
    00031		CAFX_ComeFromRight,
    00032		CAFX_ComeFromUnder,
    00033		CAFX_ComeFromTopLeft,
    00034		CAFX_ComeFromTopRight,
    00035		CAFX_ComeFromDownLeft,
    00036		CAFX_ComeFromDownright,
    00037	} CWndAppearFX[4];
    00038	var() enum eCWndSoundType
    00039	{
    00040		CSTYPE_None,
    00041		CSTYPE_TipsOrWalkthrough,
    00042		CSTYPE_WarningOrDanger,
    00043		CSTYPE_DialogOrWait,
    00044	} CWndSoundType[4];
    00045
    00046	// to handle old CWndAlert coll type
    00047	var() bool bTriggerOnTouch;
    00048	var() bool bSeeXIII;
    00049	var() bool bTriggerOnceOnly;
    00050	var() bool bAnimatedInRealtime;
    00051	var() bool bVisibleOnlyIfTargetIsBehind;
    00052
    00053	var() Texture OnoTexture[4];
    00054	var() int OnoPosX[4];
    00055	var() int OnoPosY[4];
    00056	var() int OnoSize[4];
    00057	var() int OnoSizeY[4];
    00058	var() localized array<string> OverLayMessage0;
    00059	var() localized array<string> OverLayMessage1;
    00060	var() localized array<string> OverLayMessage2;
    00061	var() localized array<string> OverLayMessage3;
    00062
    00063	var() float animationDuration[4];
    00064
    00065
    00066	//____________________________________________________________________
    00067	function Touch(actor other)
    00068	{
    00069	    if ( !bTriggerOnTouch )
    00070	      return;
    00071	    if ( (Pawn(Other) != none) && Pawn(Other).IsPlayerPawn() )
    00072	    {
    00073	      bTriggerOnTouch = false;
    00074	      Trigger(Other, Pawn(Other));
    00075	    }
    00076	}
    00077
    00078	//____________________________________________________________________
    00079	function Trigger( actor Other, pawn EventInstigator )
    00080	{
    00081	//    Log(self@"trigger !!");
    00082
    00083	    local XIIIPlayerController XPC;
    00084
    00085	    XPC = XIIIGameInfo(Level.Game).MapInfo.XIIIController;
    00086
    00087	    // cas d une scene qui se passe sous les yeux du joueur
    00088	    if (( bVisibleOnlyIfTargetIsBehind ) && ( XPC.CanSee(Pawn(CamTarget[0])) ))
    00089	    {
    00090	    	Destroy();
    00091	    	return;
    00092	    }
    00093
    00094	    if ( (Level.Game != none) && (Level.Game.DetailLevel < 2) )
    00095	      bAnimatedInRealTime = false;
    00096	    iPhase = -1;
    00097	    SetTimer(0.001, false);
    00098	    Instigator = XPC.Pawn;
    00099	    Disable( 'Trigger' );
    00100	    TriggerEvent( Event, Self, EventInstigator );
    00101	}
    00102
    00103	//____________________________________________________________________
    00104	event Timer()
    00105	{
    00106	    Local CWndOnTrigger CWnd;
    00107	    local XIIIBaseHUD XBU;
    00108
    00109	    iPhase ++;
    00110	    if ( (CamPosition[iPhase] == none) || (CamTarget[iPhase] == none) )
    00111	    {
    00112	      if ( bTriggerOnceOnly )
    00113	        Destroy();
    00114	      else
    00115	        Enable( 'Trigger' );
    00116	      return;
    00117	    }
    00118
    00119	    foreach allactors(class'XIIIBaseHUD', XBU)
    00120	    {
    00121	      if ( XBU != none )
    00122	        break;
    00123	    }
    00124
    00125	    CWnd = Spawn(class'CWndOnTrigger', Instigator);
    00126	    if ( CWnd != none )
    00127	    {
    00128	//      CWnd.CWndNB = iPhase;
    00129	      CWnd.bSeeXIII = bSeeXIII;
    00130	      CWnd.bAnimatedInRealtime = bAnimatedInRealtime;
    00131	      if (CWndDuration[iPhase] < animationDuration[iPhase])
    00132	        CWnd.AnimationDuration = CWndDuration[iPhase]-0.01f;
    00133	      else
    00134	        CWnd.AnimationDuration = animationDuration[iPhase];
    00135	      CWnd.Cam = CamPosition[iPhase];
    00136	      if ( (CamTarget[iPhase].isa('gennmi') || CamTarget[iPhase].isa('GenPlongeurs')) && (CamTarget[iPhase].instigator != none) )
    00137	        CWnd.Tar = CamTarget[iPhase].Instigator;
    00138	      else
    00139	        CWnd.Tar = CamTarget[iPhase];
    00140	      CWnd.vTarOffset = CamTargetOffset[iPhase];
    00141	      CWnd.CWndDuration = CWndDuration[iPhase];
    00142	      CWnd.vScrPosX = CWndPosX[iPhase];
    00143	      CWnd.vScrPosY = CWndPosY[iPhase];
    00144	      CWnd.CWndSizeX = CWndSize[iPhase];
    00145	      if ( CWndSizeY[iPhase] == 0 )
    00146	        CWnd.CWndSizeY = CWndSize[iPhase];
    00147	      else
    00148	        CWnd.CWndSizeY = CWndSizeY[iPhase];
    00149	      CWnd.CWndFOV = CWndFOV[iPhase];
    00150	      CWnd.MyHudForFX = XBU;
    00151	      CWnd.CWndBorderColor = CWndBorderColor[iPhase];
    00152	      CWnd.FilterColor = FilterColor[iPhase];
    00153	      CWnd.HighLight = HighLight[iPhase];
    00154	      CWnd.FilterTexture = FilterTexture[iPhase];
    00155	      CWnd.CWndAppearFX = CWndAppearFX[iPhase];
    00156	      CWnd.CWndSoundType = CWndSoundType[iPhase];
    00157	      switch ( iPhase )
    00158	      { // can't declare array of dynamic arrays ;)
    00159	        case 0 :
    00160	          CWnd.OverlayMsg = OverLayMessage0;
    00161	          break;
    00162	        case 1 :
    00163	          CWnd.OverlayMsg = OverLayMessage1;
    00164	          break;
    00165	        case 2 :
    00166	          CWnd.OverlayMsg = OverLayMessage2;
    00167	          break;
    00168	        case 3 :
    00169	          CWnd.OverlayMsg = OverLayMessage3;
    00170	          break;
    00171	      }
    00172	      if ( OnoTexture[iPhase] != none )
    00173	      {
    00174	        CWnd.OnoTexture = OnoTexture[iPhase];
    00175	        CWnd.OnoPosX = OnoPosX[iPhase];
    00176	        CWnd.OnoPosY = OnoPosY[iPhase];
    00177	        CWnd.OnoSize = OnoSize[iPhase];
    00178	        if ( OnoSizeY[iPhase] == 0 )
    00179	          CWnd.OnoSizeY = OnoSize[iPhase]*OnoTexture[iPhase].VSize/OnoTexture[iPhase].USize;
    00180	        else
    00181	          CWnd.OnoSizeY = OnoSizeY[iPhase];
    00182	      }
    00183	      CWnd.Timer();
    00184	    }
    00185	    if ( iPhase < 3 )
    00186	      SetTimer( DelayBeforeNextCWnd[iPhase], false );
    00187	    else if ( bTriggerOnceOnly )
    00188	      Destroy();
    00189	    else
    00190	      Enable( 'Trigger' );
    00191	}
    00192
    00193
    00194	defaultproperties
    00195	{
    00196	     CWndFOV(0)=45.000000
    00197	     CWndFOV(1)=45.000000
    00198	     CWndFOV(2)=45.000000
    00199	     CWndFOV(3)=45.000000
    00200	     CWndDuration(0)=2.000000
    00201	     CWndDuration(1)=2.000000
    00202	     CWndDuration(2)=2.000000
    00203	     CWndDuration(3)=2.000000
    00204	     DelayBeforeNextCWnd(0)=0.500000
    00205	     DelayBeforeNextCWnd(1)=0.500000
    00206	     DelayBeforeNextCWnd(2)=0.500000
    00207	     CWndPosX(1)=132
    00208	     CWndPosX(2)=264
    00209	     CWndPosX(3)=396
    00210	     CWndSize(0)=128
    00211	     CWndSize(1)=128
    00212	     CWndSize(2)=128
    00213	     CWndSize(3)=128
    00214	     CWndBorderColor(0)=(B=255,G=255,R=255,A=255)
    00215	     CWndBorderColor(1)=(B=255,G=255,R=255,A=255)
    00216	     CWndBorderColor(2)=(B=255,G=255,R=255,A=255)
    00217	     CWndBorderColor(3)=(B=255,G=255,R=255,A=255)
    00218	     FilterColor(0)=(B=255,G=255,R=255)
    00219	     FilterColor(1)=(B=255,G=255,R=255)
    00220	     FilterColor(2)=(B=255,G=255,R=255)
    00221	     FilterColor(3)=(B=255,G=255,R=255)
    00222	     bTriggerOnceOnly=True
    00223	     bAnimatedInRealtime=True
    00224	     animationDuration(0)=15.000000
    00225	     animationDuration(1)=15.000000
    00226	     animationDuration(2)=15.000000
    00227	     animationDuration(3)=15.000000
    00228	}

End Source Code