XIDInterf
Class XIIIMenuLiveMainWindow

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

class XIIIMenuLiveMainWindow
extends XIDInterf.XIIILiveWindow


Variables
 string ButtonNames[6]
 XIIIGUIButton Buttons[6]
 XIIILiveMsgBox msgbox
 int popupStatus
 strBootToDownloadableContentManager, strQuitXboxLive


Function Summary
 void Created()
 void InitComponent(GUIController MyController, GUIComponent MyOwner)
 bool InternalOnClick(GUIComponent Sender)
     
// Called when a button is clicked
 bool InternalOnKeyEvent(out byte, out byte, float delta)
 void Paint(Canvas C, float X, float Y)
 void ReturnMsgBox(byte bButton)
 void ShowWindow()



Source Code


00001	class XIIIMenuLiveMainWindow extends XIIILiveWindow;
00002	
00003	//var string MapList[64];
00004	//var int MaxMaps, onMap;
00005	
00006	//var GUIListBox listbox;
00007	//var GUISlider  slider;
00008	var localized string TitleText, strBootToDownloadableContentManager, strQuitXboxLive;
00009	
00010	var XIIIGUIButton Buttons[6];
00011	var localized string ButtonNames[6];
00012	
00013	var XIIILiveMsgBox msgbox;
00014	var int popupStatus;
00015	
00016	
00017	function Created()
00018	{
00019	  local int i;
00020	     Super.Created();
00021	
00022	/*     leftArrow = XIIIArrowbutton(CreateControl(class'XIIIArrowbutton', 0, 0, 12, 12));
00023	     leftArrow.WinLeft = 200;
00024	     leftArrow.WinTop = ControlOffset + 4;
00025	     leftArrow.bLeftOrient = true;
00026	     rightArrow = XIIIArrowbutton(CreateControl(class'XIIIArrowbutton', 0, 0, 12, 12));
00027	     rightArrow.WinLeft = 208;
00028	     rightArrow.WinTop = ControlOffset + 4;  */
00029	
00030	/*
00031	     listbox = GUIListbox(CreateControl(class'GUIListBox', 100, 100, 100, 200));
00032	     listbox.StyleName = "Listbox";
00033	     listbox.List.Add("Hello");
00034	     listbox.List.Add("World");
00035	     listbox.List.ItemsPerPage = 5;
00036	     Controls[0]=listbox;
00037	     */
00038	
00039	     //slider = GUISlider(CreateControl(class'GUISlider', 0, 120, 100, 20));
00040	     //Controls[2]=slider;
00041	
00042	     //listbox.WinLeft = 200;
00043	     //listbox.WinTop = 100;
00044	}
00045	
00046	
00047	function InitComponent(GUIController MyController,GUIComponent MyOwner)
00048	{
00049	  //local int numberOfAccounts, q;
00050	  //local string temp;
00051	
00052	  Super.InitComponent(MyController, MyOwner);
00053	     //listbox = GUIListBox(Controls[0]);
00054	
00055		Buttons[0] = XIIIGUIButton(Controls[0]);
00056		Buttons[0].Caption = ButtonNames[0];
00057		Buttons[1] = XIIIGUIButton(Controls[1]);
00058		Buttons[1].Caption = ButtonNames[1];
00059		Buttons[2] = XIIIGUIButton(Controls[2]);
00060		Buttons[2].Caption = ButtonNames[2];
00061		Buttons[3] = XIIIGUIButton(Controls[3]);
00062		Buttons[3].Caption = ButtonNames[3];
00063		Buttons[4] = XIIIGUIButton(Controls[4]);
00064		Buttons[4].Caption = ButtonNames[4];
00065	//	Buttons[5] = XIIIGUIButton(Controls[5]);
00066	//	Buttons[5].Caption = ButtonNames[5];
00067	
00068		OnClick = InternalOnClick;
00069	
00070	
00071	  xboxlive.EnumerateFriends(TRUE); //AJ should stop it when we start loading.
00072	     /*
00073	     listbox.list.clear();
00074	     numberOfAccounts = xboxlive.GetNumberOfAccounts();
00075	     for (q=0; q<numberOfAccounts; q++)
00076	     {
00077	       temp = xboxlive.GetAccountName(q);
00078	       listbox.list.Add(temp);
00079	     }
00080	
00081	     listbox.list.Add(newAccountString);
00082	     listbox.bVisibleWhenEmpty = true;
00083	     */
00084	}
00085	
00086	
00087	function ShowWindow()
00088	{
00089	     OnMenu = 0; myRoot.bFired = false;
00090	     Super.ShowWindow();
00091	     bShowBCK = true;
00092	     bShowRUN = false;
00093	     bShowSEL = true;
00094	}
00095	
00096	
00097	function Paint(Canvas C, float X, float Y)
00098	{
00099	  Super.Paint(C, X, Y);
00100	  PaintStandardBackground(C, X, Y, TitleText);
00101	}
00102	
00103	function ReturnMsgBox(byte bButton)
00104	{
00105	  switch (bButton)
00106	  {
00107	    case QBTN_Ok:
00108	      if (popupStatus == 1)
00109	      {
00110	        xboxlive.BootToDownloadManager();
00111	        myRoot.CloseMenu(true);
00112	      }
00113	      else if (popupStatus == 2)
00114	      {
00115	        xboxlive.ShutdownAndCleanup();
00116	        while (XIIIMenu(myRoot.ActivePage)==none)
00117	          myRoot.CloseMenu(true);
00118	      }
00119	
00120	      popupStatus = 0;
00121	      return;
00122	    break;
00123	
00124	    case QBTN_Cancel:
00125	      popupStatus = 0;
00126	    break;
00127	
00128	  }
00129	}
00130	
00131	// Called when a button is clicked
00132	function bool InternalOnClick(GUIComponent Sender)
00133	{
00134	    local int i;
00135	    if (Sender == Controls[0])
00136	    {
00137	      Controller.OpenMenu("XIDInterf.XIIIMenuLiveJoinStartWindow");
00138	    }
00139	    else if (Sender == Controls[1])
00140	    {
00141	      Controller.OpenMenu("XIDInterf.XIIIMenuLiveFriendsMainPage");
00142	    }
00143	    else if (Sender == Controls[2])
00144	    {
00145	      Controller.OpenMenu("XIDInterf.XIIIMenuLiveSettings");
00146	    }
00147	    else if (Sender == Controls[3])
00148	    {
00149	      Controller.OpenMenu("XIDInterf.XIIIMenuLiveScoreboard");
00150	    }
00151	//    else if (Sender == Controls[4])
00152	//    {
00153	//      Controller.OpenMenu("XIDInterf.XIIILiveMsgBox",false);
00154	//      msgbox = XIIILiveMsgBox(myRoot.ActivePage);
00155	//      msgbox.SetupQuestion(strBootToDownloadableContentManager, QBTN_Ok | QBTN_Cancel, QBTN_Cancel, "");
00156	//      msgbox.OnButtonClick=ReturnMsgBox;
00157	//      msgbox.InitBox(160*fRatioX, 130*fRatioY*fScaleTo, 16, 16, 320*fRatioX, 230*fRatioY*fScaleTo);
00158	//      popupStatus=1;
00159	
00160	      //Controller.OpenMenu("XIDInterf.XIIIMenuLiveDownload");
00161	//    }
00162	//    else if (Sender == Controls[5])
00163	    else if (Sender == Controls[4])
00164	    {
00165	      Controller.OpenMenu("XIDInterf.XIIILiveMsgBox",false);
00166	      msgbox = XIIILiveMsgBox(myRoot.ActivePage);
00167	      msgbox.SetupQuestion(strQuitXboxLive, QBTN_Ok | QBTN_Cancel, QBTN_Cancel, "");
00168	      msgbox.OnButtonClick=ReturnMsgBox;
00169	      msgbox.InitBox(160*fRatioX, 130*fRatioY*fScaleTo, 16, 16, 320*fRatioX, 230*fRatioY*fScaleTo);
00170	      popupStatus = 2;
00171	    }
00172	
00173	    return true;
00174	}
00175	
00176	
00177	function bool InternalOnKeyEvent(out byte Key, out byte State, float delta)
00178	{
00179	    if (state==1/* || state==2*/)// IST_Press // to avoid auto-repeat
00180	    {
00181	        if ((Key==0x0D/*IK_Enter*/) || (Key==0x01))
00182		    {
00183	          //Controller.FocusedControl.OnClick(Self);
00184	          InternalOnClick(Controller.FocusedControl);
00185	          return true;
00186		    }
00187		    if ((Key==0x08/*IK_Backspace*/)|| (Key==0x1B))
00188		    {
00189	        Controller.OpenMenu("XIDInterf.XIIILiveMsgBox",false);
00190	        msgbox = XIIILiveMsgBox(myRoot.ActivePage);
00191	        msgbox.SetupQuestion(strQuitXboxLive, QBTN_Ok | QBTN_Cancel, QBTN_Cancel, "");
00192	        msgbox.OnButtonClick=ReturnMsgBox;
00193	        msgbox.InitBox(160*fRatioX, 130*fRatioY*fScaleTo, 16, 16, 320*fRatioX, 230*fRatioY*fScaleTo);
00194	        popupStatus = 2;
00195	
00196	        return true;	
00197		    }
00198		    if (Key==0x25/*IK_Left*/)
00199		    {
00200	    	    return true;
00201		    }
00202		    if (Key==0x27/*IK_Right*/)
00203		    {
00204	    	    return true;
00205		    }
00206	    }
00207	    return super.InternalOnKeyEvent(Key, state, delta);
00208	}
00209	
00210	
00211	

End Source Code