## XIDInterf
Class XIIIMenuDoc5

source: C:\XIII\XIDInterf\Classes\XIIIMenuDoc5.uc

    Core.Object
       |
       +--GUI.GUI
          |
          +--GUI.GUIComponent
             |
             +--GUI.GUIMultiComponent
                |
                +--GUI.GUIPage
                   |
                   +--XIDInterf.XIIIWindow
                      |
                      +--XIDInterf.XIIIMenuDoc5

Direct Known Subclasses:None

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

End Source Code