XIDInterf
Class XIIIMenuLiveOldPlayerMenuSelectedGamerTagNothing

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

class XIIIMenuLiveOldPlayerMenuSelectedGamerTagNothing
extends XIDInterf.XIIILiveWindow


Variables
 string ButtonNames[2]
 XIIIGUIButton Buttons[2]
 string TitleText
 XboxLiveManager.FRIEND_PACKET activeFriend
 string activeFriendName
 XIIILiveMsgBox msgbox
 int popupStatus
 strTitle, strSendFriendRequestQuestion


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 XIIIMenuLiveOldPlayerMenuSelectedGamerTagNothing extends XIIILiveWindow;
00002	
00003	var localized string TitleText;
00004	
00005	var XIIIGUIButton Buttons[2];
00006	var localized string ButtonNames[2];
00007	var localized string strTitle, strSendFriendRequestQuestion;
00008	
00009	var XboxLiveManager.FRIEND_PACKET activeFriend;
00010	var string                        activeFriendName;
00011	
00012	var XIIILiveMsgBox msgbox;
00013	var int popupStatus;
00014	
00015	enum eVoiceStatus
00016	{
00017	  VOICESTATUS_voiceon,
00018	  VOICESTATUS_voicemuted,
00019	  VOICESTATUS_voicetv,
00020	  VOICESTATUS_voicenone,
00021	};
00022	
00023	
00024	
00025	function Created()
00026	{
00027	  local int i;
00028	     Super.Created();
00029	
00030	}
00031	
00032	
00033	function InitComponent(GUIController MyController,GUIComponent MyOwner)
00034	{
00035	  Super.InitComponent(MyController, MyOwner);
00036	
00037		Buttons[0] = XIIIGUIButton(Controls[0]);
00038		Buttons[0].Caption = ButtonNames[0];
00039		Buttons[1] = XIIIGUIButton(Controls[1]);
00040		Buttons[1].Caption = ButtonNames[1];
00041	
00042		OnClick = InternalOnClick;
00043	}
00044	
00045	
00046	function ShowWindow()
00047	{
00048	  OnMenu = 0; myRoot.bFired = false;
00049	  Super.ShowWindow();
00050	  bShowBCK = true;
00051	  bShowRUN = false;
00052	  bShowSEL = true;
00053	
00054	  activeFriend = xboxlive.GetActiveFriend();
00055	  activeFriendName = xboxlive.GetActiveFriendName();
00056	  TitleText = activeFriendName;
00057	}
00058	
00059	
00060	function Paint(Canvas C, float X, float Y)
00061	{
00062	     Super.Paint(C, X, Y);
00063	  PaintStandardBackground(C, X, Y, TitleText);
00064	}
00065	
00066	function ReturnMsgBox(byte bButton)
00067	{
00068	  switch (bButton)
00069	  {
00070	    case QBTN_Ok:
00071	      if (popupStatus == 1)
00072	      {
00073	        xboxlive.SendFriendRequest(activeFriendName);
00074	        myRoot.CloseMenu(true);
00075	      }
00076	      
00077	      popupStatus = 0;
00078	      return;
00079	    break;
00080	
00081	    case QBTN_Cancel:
00082	      popupStatus = 0;
00083	    break;
00084	
00085	  }
00086	}
00087	
00088	// Called when a button is clicked
00089	function bool InternalOnClick(GUIComponent Sender)
00090	{
00091	    local int i;
00092	    if (Sender == Controls[0])
00093	    { // send friend request
00094	      Controller.OpenMenu("XIDInterf.XIIILiveMsgBox",false);
00095	      msgbox = XIIILiveMsgBox(myRoot.ActivePage);
00096	      msgbox.SetupQuestion(strSendFriendRequestQuestion, QBTN_Ok | QBTN_Cancel, QBTN_Cancel, activeFriendName);
00097	      msgbox.OnButtonClick=ReturnMsgBox;
00098	      msgbox.InitBox(160*fRatioX, 130*fRatioY*fScaleTo, 16, 16, 320*fRatioX, 230*fRatioY*fScaleTo);
00099	      popupStatus = 1;
00100	      return true;
00101	    }
00102	    else if (Sender == Controls[1])
00103	    {
00104	      // send feedback
00105	      myRoot.OpenMenu("XIDInterf.XIIIMenuLiveFeedback");
00106	      return true;
00107	    }
00108	
00109	    return true;
00110	}
00111	
00112	
00113	function bool InternalOnKeyEvent(out byte Key, out byte State, float delta)
00114	{
00115	    if (state==1/* || state==2*/)// IST_Press // to avoid auto-repeat
00116	    {
00117	        if ((Key==0x0D/*IK_Enter*/) || (Key==0x01))
00118		    {
00119	          //Controller.FocusedControl.OnClick(Self);
00120	          InternalOnClick(Controller.FocusedControl);
00121	          return true;
00122		    }
00123		    if ((Key==0x08/*IK_Backspace*/)|| (Key==0x1B))
00124		    {
00125		        myRoot.CloseMenu(true);
00126	    	    return true;
00127		    }
00128		    if (Key==0x25/*IK_Left*/)
00129		    {
00130	    	    return true;
00131		    }
00132		    if (Key==0x27/*IK_Right*/)
00133		    {
00134	    	    return true;
00135		    }
00136	    }
00137	    return super.InternalOnKeyEvent(Key, state, delta);
00138	}
00139	
00140	
00141	

End Source Code