XIDInterf
Class XIIIMenuBriefingWindow

source: C:\XIII\XIDInterf\Classes\XIIIMenuBriefingWindow.uc
Core.Object
   |
   +--GUI.GUI
      |
      +--GUI.GUIComponent
         |
         +--GUI.GUIMultiComponent
            |
            +--GUI.GUIPage
               |
               +--XIDInterf.XIIIWindow
                  |
                  +--XIDInterf.XIIIMenuBriefingWindow
Direct Known Subclasses:None

class XIIIMenuBriefingWindow
extends XIDInterf.XIIIWindow

//============================================================================ // Display the briefing //============================================================================
Variables
 OldSettings, BackText
 float ControlOffset
 MapInfo CurrentMap
 XIIIButton NextButton
 string NextGameText
 bool bInGame
 bool bInitialized


Function Summary
 void BeforePaint(Canvas C, float X, float Y)
     
/*
 void Created()
     
//var  XIIIRootWindow myRoot;
 void GotoNextWindow()
     
//_____________________________________________________________
// When the briefing has been read, the player shall choose his weapons
 void HideWindow()
     
/*
 void InitBriefingAndGoals()
 bool InternalOnKeyEvent(out byte, out byte, float delta)
 void Paint(Canvas C, float X, float Y)
     
//     SetGoalPosition();
}*/
 void SetGoalPosition()
     
/*
 void ShowWindow()



Source Code


00001	//============================================================================
00002	// Display the briefing
00003	//============================================================================
00004	class XIIIMenuBriefingWindow extends XIIIWindow;
00005	
00006	var bool       bInitialized;
00007	var string     OldSettings, BackText;
00008	var float      ControlOffset;
00009	
00010	var XIIIbutton          NextButton;
00011	var localized string    NextGameText;
00012	
00013	var bool      bInGame;
00014	//var int        GoalArraySize;
00015	//var array<UWindowCheckbox> GoalCheck;
00016	
00017	var MapInfo    CurrentMap;
00018	//var  XIIIRootWindow myRoot;
00019	
00020	
00021	function Created()
00022	{
00023	     Super.Created();
00024	
00025	//     myRoot = XIIIRootWindow(Root);
00026	
00027	     NextButton = XIIIbutton(CreateControl(class'XIIIbutton', 510, 420*fScaleTo, 100, 30*fScaleTo));
00028	     NextButton.Text = NextGameText;
00029	     NextButton.bUseBorder = true;
00030	}
00031	
00032	function InitBriefingAndGoals()
00033	{
00034	     local int ControlOffset, ControlPos, ControlWidth, t, newGoal;
00035	     local string temp;
00036	
00037	     CurrentMap = XIIIGameInfo(GetPlayerOwner().Player.Actor.Level.Game).MapInfo;
00038	/*     GoalArraySize = CurrentMap.Objectif.Length;
00039	     log("Map: "$CurrentMap$"    nb obj: "$CurrentMap.Objectif.Length$" GoalSize: "$GoalArraySize);
00040	//     if (GoalArraySize > 0) CtrlOffset = (100 / (GoalArraySize/2));
00041	     ControlWidth = (WinWidth/4)*3;
00042	     ControlPos = (WinWidth - ControlWidth)/2;
00043	     ControlOffset = WinHeight/2 + 50;
00044	
00045	     for (t = 0; t < GoalArraySize; t++)
00046	     {
00047	          if (!CurrentMap.Objectif[t].bAntiGoal)
00048	          {
00049	               GoalCheck[t] = UWindowCheckbox(CreateControl(class'UWindowCheckbox', ControlPos, ControlOffset, ControlWidth, 1));
00050	               GoalCheck[t].SetText(CurrentMap.Objectif[t].GoalText);
00051	
00052	               GoalCheck[t].SetFont(F_Normal);
00053	               GoalCheck[t].SetTextColor(BlackColor);
00054	               GoalCheck[t].Align = TA_Left;
00055	               ControlOffset += 40;
00056	               newGoal++;
00057	               log("Obj "$t$": "$GoalCheck[t].Text);//$" Primary: "$CurrentMap.Objectif[t].bPrimary);
00058	          }
00059	     }
00060	     GoalArraySize = newGoal;*/
00061	}
00062	
00063	
00064	function ShowWindow()
00065	{
00066	     InitBriefingAndGoals();
00067	//     SetGoalPosition();
00068	     if (!bInGame){
00069	          NextButton.Text = NextGameText;
00070	     }
00071	     else NextButton.Text = BackText;
00072	     Super.ShowWindow();
00073	     bShowRUN = true;
00074	}
00075	
00076	/*
00077	function SetGoalPosition()
00078	{
00079	     local int ControlWidth, ControlLeft, ControlRight;
00080	     local int CenterWidth, CenterPos, t;
00081	
00082	     ControlWidth = WinWidth/2.5;
00083	     ControlLeft = (WinWidth/2 - ControlWidth)/2;
00084	     ControlRight = WinWidth/2 + ControlLeft;
00085	     CenterWidth = (WinWidth/4)*3;
00086	//     CenterPos = (WinWidth - CenterWidth)/2;
00087	
00088	     for (t = 0; t < GoalArraySize; t++)
00089	     {
00090	          GoalCheck[t].bChecked = CurrentMap.Objectif[t].bCompleted;
00091	          if (!CurrentMap.Objectif[t].bPrimary)
00092	          {
00093	               GoalCheck[t].WinLeft=96;
00094	               GoalCheck[t].SetSize(CenterWidth-32, 1);
00095	               GoalCheck[t].bDisabled = true;
00096	          }
00097	          else {
00098	          GoalCheck[t].SetSize(CenterWidth, 1);
00099	          GoalCheck[t].WinLeft = 64;//CenterPos;
00100	          }
00101	//          if (!CurrentMap.Objectif[t].bPrimary) GoalCheck[t].HideWindow();
00102	//          else GoalCheck[t].ShowWindow();
00103	          //else GoalCheck[t].ShowWindow();
00104	     }
00105	}*/
00106	
00107	
00108	/*function BeforePaint(Canvas C, float X, float Y)
00109	{
00110	     local int t;
00111	
00112	     for (t = 0; t < GoalArraySize-1; t++)
00113	          GoalCheck[t].bChecked = CurrentMap.Objectif[t].bCompleted;
00114	
00115	//     SetGoalPosition();
00116	}*/
00117	
00118	
00119	function Paint(Canvas C, float X, float Y)
00120	{
00121	     local string text;
00122	
00123	     super.Paint(C, X, Y);
00124	
00125	     DrawStretchedTexture(C, 0, 0, C.ClipX, C.ClipY, myRoot.FondMenu);
00126	
00127	//     C.Font = myRoot.Fonts[F_Large];
00128	     C.DrawColor = GoldColor;
00129	     C.SetPos( 30, 50); C.DrawText(Caps("Briefing"), false);
00130	//     C.Font = myRoot.Fonts[F_Normal];
00131	
00132	     // MLK Printing the briefing text
00133	    log(CurrentMap);
00134	     if (CurrentMap != none) {
00135	     if (CurrentMap.bBriefing)
00136	     {
00137	          text = CurrentMap.TexteduBriefing;
00138	          log(Text);
00139	     //MOD     myRoot.Printf(C, 50, 240, text);
00140	//          C.DrawColor = BlackColor;
00141	//          myRoot.Printf(C, text, 65, 101, WinWidth - 124);
00142	          //if (bInGame)
00143	          C.DrawColor = BlackColor;
00144	          //else C.DrawColor = WhiteColor;
00145	          if (text!="")
00146	          myRoot.Printf(C, text, 64*fRatioX, 100*fRatioY, C.ClipX - 100);// - 128);
00147	    }
00148	    }
00149	
00150	    C.DrawColor = WhiteColor;
00151	}
00152	
00153	
00154	function bool InternalOnKeyEvent(out byte Key, out byte State, float delta)
00155	{
00156	    local int index;
00157	    local bool bLeftOrRight, bUpOrDown;
00158	
00159	    if (State==1)// IST_Press // to avoid auto-repeat
00160	    {
00161	        if ((Key==0x0D/*IK_Enter*/)|| (Key==0x1B))
00162		    {
00163	//            Controller.FocusedControl.OnClick(FocusedControl);
00164	            if (bInGame)
00165	                myRoot.CloseMenu(true);
00166	            else {
00167	                myRoot.gotostate('');
00168	                myRoot.CloseAll(true);
00169	            }
00170	            myRoot.bBriefingDone = true;
00171	            myRoot.bBriefing= false;
00172	//            return InternalOnClick(FocusedControl);
00173		    }
00174	        //return false;
00175	    }
00176	    return super.InternalOnKeyEvent(Key, state, delta);
00177	//    return false;
00178	}
00179	
00180	/*function HideWindow()
00181	{
00182	     local int t;
00183	
00184	     Super.HideWindow();
00185	     for (t=0; t<GoalCheck.Length; t++)
00186	          GoalCheck[t].Close();
00187	     GoalCheck.Length = 0;
00188	} */
00189	
00190	
00191	/*
00192	//_____________________________________________________________
00193	// When the briefing has been read, the player shall choose his weapons
00194	function GotoNextWindow()
00195	{
00196	     if (NextWindow == none)
00197	          NextWindow = XIIIWindow(Root.CreateWindow(class'XIIIMenuWeaponWindow',0, 0, 640, 480));
00198	     if (NextWindow != none)
00199	          NextWindow.ShowWindow();
00200	     XIIIMenuWeaponWindow(NextWindow).PrevWindow = self;
00201	     HideWindow();
00202	}*/
00203	
00204	
00205	
00206	
00207	defaultproperties
00208	{
00209	     BackText="Back"
00210	     NextGameText="Continue"
00211	     bForceHelp=True
00212	}

End Source Code