XIDInterf
Class XIIIMenuDoc2

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

class XIIIMenuDoc2
extends XIDInterf.XIIIWindow

//============================================================================ // Save Game menu. // //============================================================================
Variables
 Doc7Button, Doc8Button
 Doc7Label, Doc8Label
 Doc7Text, Doc8Text
 XIIIComboControl DocumentCombo
 Time, Index
 int IsEmpty
 int MaxSlots
 Ind, Message
 Hour, Min
 int MyLastSlot
 int MyLastTime
 string ObjectName[8]
 NbMap, OnGame
 int ReturnCode
 int Year
 int i
 sHighlight[11], sOnomatopee[11]
 tHighlight[11], tOnomatopee[11]
 int texturenb


Function Summary
 void Created()
     
//============================================================================
 bool InternalOnKeyEvent(out byte, out byte, float delta)
 void IterateDocuments()
 void Paint(Canvas C, float X, float Y)
     
//============================================================================
 void ShowWindow()
     
//============================================================================



Source Code


00001	//============================================================================
00002	// Save Game menu.
00003	//
00004	//============================================================================
00005	class XIIIMenuDoc2 extends XIIIWindow;
00006	
00007	
00008	var XIIIComboControl DocumentCombo;
00009	var localized string ObjectName[8];
00010	
00011	var XIIITextureButton Doc1Button, Doc2Button, Doc3Button, Doc4Button, Doc5Button, Doc6Button, Doc7Button, Doc8Button;
00012	var XIIILabel Doc1Label, Doc2Label, Doc3Label, Doc4Label, Doc5Label, Doc6Label, Doc7Label, Doc8Label;
00013	var  localized string TitleText, Doc1Text, Doc2Text, Doc3Text, Doc4Text, Doc5Text, Doc6Text, Doc7Text, Doc8Text;
00014	
00015	var texture tBackGround[15], tHighlight[11], tOnomatopee[11];
00016	var string sBackGround[15], sHighlight[11], sOnomatopee[11];
00017	
00018	var int texturenb;
00019	var int MaxSlots;
00020	var int ReturnCode;
00021	var int IsEmpty;
00022	var int i;
00023	var int Year;
00024	var byte Month, Day, Hour, Min;
00025	
00026	var string Description, Emission, Ind, Message;
00027	
00028	var int Time, Index;
00029	var int MyLastTime;
00030	var int MyLastSlot;
00031	var int NbMap, OnGame;
00032	
00033	
00034	
00035	//============================================================================
00036	function Created()
00037	{
00038	    local int i;
00039	
00040	    Super.Created();
00041	
00042	   for (i=0; i<15; i++)
00043	    {
00044	        //tHighlight[i] = texture(DynamicLoadObject(sHighlight[i], class'Texture'));
00045	        tBackGround[i] = texture(DynamicLoadObject(sBackGround[i], class'Texture'));
00046	    }
00047	
00048	    // Document Type
00049	        DocumentCombo = XIIIComboControl(CreateControl(class'XIIIComboControl', 260, 380*fScaleTo, 340,40*fScaleTo));
00050	    //DocumentCombo.Text = Doc1Text;
00051	    //DocumentCombo.bSmallFont = true;
00052	    DocumentCombo.bArrows = true;
00053	    //DocumentCombo.bAlwaysFocus = true;
00054	    IterateDocuments();
00055	    Controls[0] = DocumentCombo;
00056	
00057	
00058	}
00059	
00060	function IterateDocuments()
00061	{
00062		local int i;
00063		
00064		for (i=0;i<7;i++)
00065		{
00066			
00067			
00068			DocumentCombo.AddItem(ObjectName[i]);
00069			
00070		}
00071	
00072		DocumentCombo.SetSelectedIndex(0);
00073	}
00074	
00075	//============================================================================
00076	function ShowWindow()
00077	{
00078	    Super.ShowWindow();
00079	    bShowBCK = true;
00080	    ////bShowSEL = true;
00081	}
00082	
00083	
00084	//============================================================================
00085	function Paint(Canvas C, float X, float Y)
00086	{
00087		local float fScale, fHeight, W, H;
00088	
00089	        super.paint(C,X,Y);     
00090	
00091		// big black border behind documents
00092		 C.bUseBorder = true;
00093		 DrawStretchedTexture(C, 180*fRatioX, 36*fRatioY*fScaleTo, 430*fRatioX, 368*fRatioY*fScaleTo, myRoot.FondMenu);
00094	
00095		// document itself
00096		 //C.bUseBorder = true;
00097		// DrawStretchedTexture(C, 190*fRatioX, 46*fRatioY, 410*fRatioX, 348*fRatioY, tBackGround[texturenb]);
00098	
00099	
00100		// image behind title
00101		//DrawStretchedTexture(C, 40*fRatioX, 36*fRatioY, 130*fRatioX, 80*fRatioY, tBackGround[0]);
00102		C.bUseBorder = false;
00103		switch(texturenb)
00104		{
00105		case 0 :
00106		   DrawStretchedTexture(C, 230*fRatioX, 86*fRatioY*fScaleTo, 330*fRatioX, 268*fRatioY*fScaleTo, tBackGround[0]);
00107		break;
00108		case 1 :
00109	           DrawStretchedTexture(C, 230*fRatioX, 86*fRatioY*fScaleTo, 330*fRatioX, 268*fRatioY*fScaleTo, tBackGround[1]);
00110		break;
00111		case 2 :
00112	           DrawStretchedTexture(C, 230*fRatioX, 86*fRatioY*fScaleTo, 330*fRatioX, 268*fRatioY*fScaleTo, tBackGround[2]);
00113		break;
00114		case 3 :
00115		   DrawStretchedTexture(C, 190*fRatioX, 46*fRatioY*fScaleTo, 410*fRatioX, 348*fRatioY*fScaleTo, tBackGround[3]);
00116		break;
00117		case 4 :
00118	           DrawStretchedTexture(C, 230*fRatioX, 86*fRatioY*fScaleTo, 330*fRatioX, 268*fRatioY*fScaleTo, tBackGround[4]);
00119		break;
00120		case 5 :
00121		   DrawStretchedTexture(C, 190*fRatioX, 46*fRatioY*fScaleTo, 205*fRatioX, 174*fRatioY, tBackGround[5]);
00122		   DrawStretchedTexture(C, 190*fRatioX, 220*fRatioY*fScaleTo, 205*fRatioX, 174*fRatioY, tBackGround[7]);
00123	           DrawStretchedTexture(C, 395*fRatioX, 46*fRatioY*fScaleTo, 205*fRatioX, 174*fRatioY, tBackGround[6]);
00124	           DrawStretchedTexture(C, 395*fRatioX, 220*fRatioY*fScaleTo, 205*fRatioX, 174*fRatioY, tBackGround[8]);
00125		break;
00126		case 6 :
00127		   DrawStretchedTexture(C, 190*fRatioX, 46*fRatioY*fScaleTo, 205*fRatioX, 174*fRatioY*fScaleTo, tBackGround[10]);
00128		   DrawStretchedTexture(C, 190*fRatioX, 220*fRatioY*fScaleTo, 205*fRatioX, 174*fRatioY*fScaleTo, tBackGround[12]);
00129	           DrawStretchedTexture(C, 395*fRatioX, 46*fRatioY*fScaleTo, 205*fRatioX, 174*fRatioY*fScaleTo, tBackGround[11]);
00130	           DrawStretchedTexture(C, 395*fRatioX, 220*fRatioY*fScaleTo, 205*fRatioX, 174*fRatioY*fScaleTo, tBackGround[13]);
00131		break;
00132		}
00133		
00134		 // Title
00135		 C.bUseBorder = true;
00136		 DrawStretchedTexture(C, 30*fRatioX, 70*fRatioY*fScaleTo, 140*fRatioX, 32*fRatioY*fScaleTo, myRoot.FondMenu);
00137		 C.TextSize(TitleText, W, H);
00138		 C.DrawColor = BlackColor;
00139		 C.SetPos((30*fRatioX + (140*fRatioX-W)/2), (70*fRatioY+(32*fRatioY-H)/2)*fScaleTo); C.DrawText(TitleText, false);
00140		 C.bUseBorder = false;
00141		 C.DrawColor = WhiteColor;
00142	
00143	
00144		// image behind object name
00145		C.bUseBorder = false;
00146		DrawStretchedTexture(C, 50*fRatioX, 196*fRatioY, 98*fRatioX, 98*fRatioY, tBackGround[9]);
00147		
00148		 // object name
00149		 C.bUseBorder = true;
00150		 DrawStretchedTexture(C, 30*fRatioX, 280*fRatioY*fScaleTo, 140*fRatioX, 32*fRatioY*fScaleTo, myRoot.FondMenu);
00151		 C.TextSize(Doc2Text, W, H);
00152		 C.DrawColor = BlackColor;
00153		 C.SetPos((30*fRatioX + (140*fRatioX-W)/2), (280*fRatioY+(32*fRatioY-H)/2)*fScaleTo); C.DrawText(Doc2Text, false);
00154		 C.bUseBorder = false;
00155		 C.DrawColor = WhiteColor;
00156	
00157	
00158	
00159	}
00160	
00161	
00162	function bool InternalOnKeyEvent(out byte Key, out byte State, float delta)
00163	{
00164		if ((State==1) || (state==2))// IST_Press // to avoid auto-repeat
00165		{
00166	        if ((Key==0x08/*IK_Escape*/) || (Key==0x1B))
00167	        {
00168	            Index = 1;
00169	            Message = 
00170	                "?Transmitted="$Emission$
00171	                "?Ind="$Index;
00172	            log("Message = "$Message);
00173	            myRoot.CloseMenu(true,Message);
00174	            //myRoot.CloseMenu(true,Description);
00175	            //myRoot.OpenMenu("XIDInterf.XIIIMenuDocument",,Description);
00176	            return true;
00177	        }
00178			if (Key==0x26/*IK_Up*/)
00179			{
00180				PrevControl(FocusedControl);
00181				return true;
00182			}
00183			if (Key==0x28/*IK_Down*/)
00184			{
00185				NextControl(FocusedControl);
00186				return true;
00187			}
00188			if ((Key==0x25) || (Key==0x27))
00189			{
00190				OnMenu = FindComponentIndex(FocusedControl);
00191				if (OnMenu == 0)
00192				{
00193					if (Key==0x25) OnGame--;
00194					if (Key==0x27) OnGame++;
00195					if (OnGame < 0) OnGame = 0;
00196					else if (OnGame > 7-1) OnGame = 7-1;
00197					DocumentCombo.SetSelectedIndex(OnGame);
00198					texturenb = OnGame;
00199					//paint();
00200					//DocumentChanged(OnGame);
00201				}
00202				return true;
00203			}
00204		}
00205		return super.InternalOnKeyEvent(Key, state, delta);
00206	}
00207	
00208	
00209	event HandleParameters(string Param1, string Param2)
00210	{
00211	    Description = localParseOption(Param1,"Emission","");
00212	    log("Emission = "$Description);
00213	    Index = int(localParseOption(Param1,"Ind",""));
00214	    Emission=Description;
00215	}
00216	
00217	//============================================================================
00218	
00219	
00220	defaultproperties
00221	{
00222	     ObjectName(0)="Photo"
00223	     ObjectName(1)="Photo"
00224	     ObjectName(2)="Photo"
00225	     ObjectName(3)="Bullet"
00226	     ObjectName(4)="photo"
00227	     ObjectName(5)="coroner report"
00228	     ObjectName(6)="police report"
00229	     ObjectName(7)="glass"
00230	     TitleText="Documents"
00231	     Doc1Text="Passport"
00232	     Doc2Text="FBI File"
00233	     Doc3Text="Document3"
00234	     Doc4Text="Document4"
00235	     Doc5Text="Document5"
00236	     Doc6Text="Document6"
00237	     Doc7Text="Document7"
00238	     Doc8Text="Document8"
00239	     sBackground(0)="XIIIMenuStart.doc.photomeurtre"
00240	     sBackground(1)="XIIIMenuStart.doc.photosniper"
00241	     sBackground(2)="XIIIMenuStart.doc.morgueSheridan"
00242	     sBackground(3)="XIIIMenuStart.doc.balle"
00243	     sBackground(4)="XIIIMenuStart.doc.freresSheridan"
00244	     sBackground(5)="XIIIMenuStart.doc.ficheCoroner1"
00245	     sBackground(6)="XIIIMenuStart.doc.ficheCoroner2"
00246	     sBackground(7)="XIIIMenuStart.doc.ficheCoroner3"
00247	     sBackground(8)="XIIIMenuStart.doc.ficheCoroner4"
00248	     sBackground(9)="XIIIMenuStart.doc.dossierFBI1"
00249	     sBackground(10)="XIIIMenuStart.doc.rapportpolice1"
00250	     sBackground(11)="XIIIMenuStart.doc.rapportpolice2"
00251	     sBackground(12)="XIIIMenuStart.doc.rapportpolice3"
00252	     sBackground(13)="XIIIMenuStart.doc.rapportpolice4"
00253	     sBackground(14)="XIIIMenuStart.doc.rapportpolice3"
00254	     sHighlight(0)="XIIIMenuStart.conspiracy"
00255	     sHighlight(1)="XIIIMenuStart.competence"
00256	     sHighlight(2)="XIIIMenuStart.dossier"
00257	     sHighlight(3)="XIIIMenuStart.story"
00258	     sHighlight(4)="XIIIMenuStart.play"
00259	     sOnomatopee(0)="XIIIMenuStart.newgameWoowoo"
00260	     sOnomatopee(1)="XIIIMenuStart.multiplayerBam"
00261	     sOnomatopee(2)="XIIIMenuStart.optionBrrrr"
00262	     sOnomatopee(3)="XIIIMenuStart.loadgameSlam"
00263	     sOnomatopee(4)="XIIIMenuStart.bang"
00264	}

End Source Code