XIDInterf
Class XIIIMenuDoc1

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

class XIIIMenuDoc1
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[15], sOnomatopee[15]
 tHighlight[15], tOnomatopee[15]
 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 XIIIMenuDoc1 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[15], tOnomatopee[15];
00016	var string sBackGround[15], sHighlight[15], sOnomatopee[15];
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<6;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, 190*fRatioX, 46*fRatioY*fScaleTo, 205*fRatioX, 174*fRatioY*fScaleTo, tBackGround[0]);
00107		   DrawStretchedTexture(C, 190*fRatioX, 220*fRatioY*fScaleTo, 205*fRatioX, 174*fRatioY*fScaleTo, tBackGround[2]);
00108	           DrawStretchedTexture(C, 395*fRatioX, 46*fRatioY*fScaleTo, 205*fRatioX, 174*fRatioY*fScaleTo, tBackGround[1]);
00109	           DrawStretchedTexture(C, 395*fRatioX, 220*fRatioY*fScaleTo, 205*fRatioX, 174*fRatioY*fScaleTo, tBackGround[3]);
00110		break;
00111		case 1 :
00112	           DrawStretchedTexture(C, 190*fRatioX, 46*fRatioY*fScaleTo, 205*fRatioX, 174*fRatioY*fScaleTo, tBackGround[4]);
00113		   DrawStretchedTexture(C, 190*fRatioX, 220*fRatioY*fScaleTo, 205*fRatioX, 174*fRatioY*fScaleTo, tBackGround[11]);
00114	           DrawStretchedTexture(C, 395*fRatioX, 46*fRatioY*fScaleTo, 205*fRatioX, 174*fRatioY*fScaleTo, tBackGround[10]);
00115	           DrawStretchedTexture(C, 395*fRatioX, 220*fRatioY*fScaleTo, 205*fRatioX, 174*fRatioY*fScaleTo, tBackGround[12]);
00116		break;
00117		case 2 :
00118	           DrawStretchedTexture(C, 190*fRatioX, 46*fRatioY*fScaleTo, 410*fRatioX, 348*fRatioY*fScaleTo, tBackGround[5]);
00119		break;
00120		case 3 :
00121		   DrawStretchedTexture(C, 190*fRatioX, 46*fRatioY*fScaleTo, 205*fRatioX, 348*fRatioY*fScaleTo, tBackGround[6]);
00122		   DrawStretchedTexture(C, 395*fRatioX, 46*fRatioY*fScaleTo, 205*fRatioX, 348*fRatioY*fScaleTo, tBackGround[7]);
00123		break;
00124		case 4 :
00125	           DrawStretchedTexture(C, (190+40)*fRatioX, 121*fRatioY*fScaleTo, (410-80)*fRatioX, 152*fRatioY*fScaleTo, tBackGround[8]);
00126		break;
00127		case 5 :
00128	           DrawStretchedTexture(C, (395-102)*fRatioX, 46*fRatioY*fScaleTo, 205*fRatioX, 174*fRatioY*fScaleTo, tBackGround[13]);
00129	           DrawStretchedTexture(C, (395-102)*fRatioX, 220*fRatioY*fScaleTo, 205*fRatioX, 174*fRatioY*fScaleTo, tBackGround[14]);
00130		break;
00131	
00132	
00133		}
00134		
00135		 // Title
00136		 C.bUseBorder = true;
00137		 DrawStretchedTexture(C, 30*fRatioX, 70*fRatioY*fScaleTo, 140*fRatioX, 32*fRatioY*fScaleTo, myRoot.FondMenu);
00138		 C.TextSize(TitleText, W, H);
00139		 C.DrawColor = BlackColor;
00140		 C.SetPos((30*fRatioX + (140*fRatioX-W)/2), (70*fRatioY+(32*fRatioY-H)/2)*fScaleTo); C.DrawText(TitleText, false);
00141		 C.bUseBorder = false;
00142		 C.DrawColor = WhiteColor;
00143	
00144	
00145		// image behind object name
00146		C.bUseBorder = false;
00147		DrawStretchedTexture(C, 50*fRatioX, 196*fRatioY, 98*fRatioX, 98*fRatioY, tBackGround[9]);
00148		
00149		 // object name
00150		 C.bUseBorder = true;
00151		 DrawStretchedTexture(C, 30*fRatioX, 280*fRatioY*fScaleTo, 140*fRatioX, 32*fRatioY*fScaleTo, myRoot.FondMenu);
00152		 C.TextSize(Doc2Text, W, H);
00153		 C.DrawColor = BlackColor;
00154		 C.SetPos((30*fRatioX + (140*fRatioX-W)/2), (280*fRatioY+(32*fRatioY-H)/2)*fScaleTo); C.DrawText(Doc2Text, false);
00155		 C.bUseBorder = false;
00156		 C.DrawColor = WhiteColor;
00157	
00158	
00159	
00160	}
00161	
00162	
00163	function bool InternalOnKeyEvent(out byte Key, out byte State, float delta)
00164	{
00165		if ((State==1) || (state==2))// IST_Press // to avoid auto-repeat
00166		{
00167	        if ((Key==0x08/*IK_Escape*/) || (Key==0x1B))
00168	        {
00169	            Index = 0;
00170	            Message = 
00171	                "?Transmitted="$Emission$
00172	                "?Ind="$Index;
00173	            log("Message = "$Message);
00174	            myRoot.CloseMenu(true,Message);
00175	            //myRoot.CloseMenu(true,Description);
00176	            //myRoot.OpenMenu("XIDInterf.XIIIMenuDocument",,Description);
00177	            return true;
00178	        }
00179			if (Key==0x26/*IK_Up*/)
00180			{
00181				PrevControl(FocusedControl);
00182				return true;
00183			}
00184			if (Key==0x28/*IK_Down*/)
00185			{
00186				NextControl(FocusedControl);
00187				return true;
00188			}
00189			if ((Key==0x25) || (Key==0x27))
00190			{
00191				OnMenu = FindComponentIndex(FocusedControl);
00192				if (OnMenu == 0)
00193				{
00194					if (Key==0x25) OnGame--;
00195					if (Key==0x27) OnGame++;
00196					if (OnGame < 0) OnGame = 0;
00197					else if (OnGame > 6-1) OnGame = 6-1;
00198					DocumentCombo.SetSelectedIndex(OnGame);
00199					texturenb = OnGame;
00200					//paint();
00201					//DocumentChanged(OnGame);
00202				}
00203				return true;
00204			}
00205		}
00206		return super.InternalOnKeyEvent(Key, state, delta);
00207	}
00208	
00209	
00210	event HandleParameters(string Param1, string Param2)
00211	{
00212	    Description = localParseOption(Param1,"Emission","");
00213	    log("Emission = "$Description);
00214	    Index = int(localParseOption(Param1,"Ind",""));
00215	    Emission=Description;
00216	}
00217	
00218	//============================================================================
00219	
00220	
00221	defaultproperties
00222	{
00223	     ObjectName(0)="Passport"
00224	     ObjectName(1)="Photo"
00225	     ObjectName(2)="Money"
00226	     ObjectName(3)="Account Number"
00227	     ObjectName(4)="Photo McCall"
00228	     ObjectName(5)="book"
00229	     ObjectName(6)="fork"
00230	     ObjectName(7)="glass"
00231	     TitleText="Documents"
00232	     Doc1Text="Passport"
00233	     Doc2Text="Suitcase"
00234	     Doc3Text="Document3"
00235	     Doc4Text="Document4"
00236	     Doc5Text="Document5"
00237	     Doc6Text="Document6"
00238	     Doc7Text="Document7"
00239	     Doc8Text="Document8"
00240	     sBackground(0)="XIIIMenuStart.doc.passport1"
00241	     sBackground(1)="XIIIMenuStart.doc.passport2"
00242	     sBackground(2)="XIIIMenuStart.doc.passport3"
00243	     sBackground(3)="XIIIMenuStart.doc.passport4"
00244	     sBackground(4)="XIIIMenuStart.conspi.galerieportraits1"
00245	     sBackground(5)="XIIIMenuStart.doc.dollars"
00246	     sBackground(6)="XIIIMenuStart.doc.Acount3_Rowland01"
00247	     sBackground(7)="XIIIMenuStart.doc.Acount3_Rowland02"
00248	     sBackground(8)="XIIIMenuStart.doc.01phototreizemacall"
00249	     sBackground(9)="XIIIMenuStart.doc.malette"
00250	     sBackground(10)="XIIIMenuStart.conspi.galerieportraits2"
00251	     sBackground(11)="XIIIMenuStart.conspi.galerieportraits3"
00252	     sBackground(12)="XIIIMenuStart.conspi.galerieportraits4"
00253	     sBackground(13)="XIIIMenuStart.doc.photokim01"
00254	     sBackground(14)="XIIIMenuStart.doc.photokim02"
00255	     sHighlight(0)="XIIIMenuStart.conspiracy"
00256	     sHighlight(1)="XIIIMenuStart.competence"
00257	     sHighlight(2)="XIIIMenuStart.dossier"
00258	     sHighlight(3)="XIIIMenuStart.story"
00259	     sHighlight(4)="XIIIMenuStart.play"
00260	     sOnomatopee(0)="XIIIMenuStart.newgameWoowoo"
00261	     sOnomatopee(1)="XIIIMenuStart.multiplayerBam"
00262	     sOnomatopee(2)="XIIIMenuStart.optionBrrrr"
00263	     sOnomatopee(3)="XIIIMenuStart.loadgameSlam"
00264	     sOnomatopee(4)="XIIIMenuStart.bang"
00265	}

End Source Code