XIDInterf
Class XIIIMenuDoc8

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

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

End Source Code