## XIDInterf
Class XIIIMenuDoc11

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

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

Direct Known Subclasses:None

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

End Source Code