XIDInterf
Class XIIIMenuLivePlayerMenuSelectedGamerTagNothing

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

class XIIIMenuLivePlayerMenuSelectedGamerTagNothing
extends XIDInterf.XIIILiveWindow


Variables
 string ButtonNames[4]
 XIIIGUIButton Buttons[4]
 string TitleText
 XboxLiveManager.FRIEND_PACKET activeFriend
 string activeFriendName
 XIIILiveMsgBox msgbox
 int popupStatus
 strKickQuestion, 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 XIIIMenuLivePlayerMenuSelectedGamerTagNothing extends XIIILiveWindow;
00002	
00003	var localized string TitleText;
00004	
00005	var XIIIGUIButton Buttons[4];
00006	var localized string ButtonNames[4];
00007	var localized string strTitle, strVoiceOn, strVoiceMuted, strKickQuestion, 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		Buttons[2] = XIIIGUIButton(Controls[2]);
00042		Buttons[2].Caption = ButtonNames[2];
00043		Buttons[3] = XIIIGUIButton(Controls[3]);
00044		Buttons[3].Caption = ButtonNames[3];
00045	
00046		OnClick = InternalOnClick;
00047	}
00048	
00049	
00050	function ShowWindow()
00051	{
00052	  OnMenu = 0; myRoot.bFired = false;
00053	  Super.ShowWindow();
00054	  bShowBCK = true;
00055	  bShowRUN = false;
00056	  bShowSEL = true;
00057	
00058	  activeFriend = xboxlive.GetActiveFriend();
00059	  activeFriendName = xboxlive.GetActiveFriendName();
00060	  TitleText = activeFriendName;
00061	
00062	//  ButtonNames(0)="Send a game invitation"
00063	//  ButtonNames(1)="Remove friend"
00064	//  ButtonNames(2)="Join"
00065	
00066	/* Should not happen!
00067	  if ( (activeFriend.onlineStatusFlags & xboxlive.XONLINE_FRIENDSTATE_FLAG_RECEIVEDREQUEST) != 0 )
00068	  {
00069	    Buttons[0].bVisible=true;
00070	    Buttons[1].bVisible=true;
00071	    Buttons[2].bVisible=true;
00072	    SetFocus(Buttons[0]);
00073	    Buttons[0].SetFocus(none);
00074	  }
00075	  else
00076	  {
00077	    Buttons[0].bVisible=false;
00078	    Buttons[1].bVisible=false;
00079	    Buttons[2].bVisible=false;
00080	    SetFocus(Buttons[3]);
00081	    Buttons[3].SetFocus(none);
00082	  }
00083	*/
00084	  if (xboxlive.IsHost())
00085	    Buttons[2].bVisible=true;
00086	  else
00087	    Buttons[2].bVisible=false;
00088	
00089	
00090	  if (activeFriend.voiceStatus == eVoiceStatus.VOICESTATUS_voicemuted)
00091	    Buttons[1].Caption = strVoiceMuted;//"Voice is muted";
00092	  else
00093	    Buttons[1].Caption = strVoiceOn;//Voice is on;
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 == 2)
00109	      {
00110	        xboxlive.Kick(activeFriendName);
00111	        myRoot.CloseMenu(true);
00112	      }
00113	      else if (popupstatus == 1)
00114	      {
00115	        xboxlive.SendFriendRequest(activeFriendName);
00116	        myRoot.CloseMenu(true);
00117	      }
00118	      popupStatus = 0;
00119	      return;
00120	    break;
00121	
00122	    case QBTN_Cancel:
00123	      popupStatus = 0;
00124	    break;
00125	
00126	  }
00127	}
00128	
00129	// Called when a button is clicked
00130	function bool InternalOnClick(GUIComponent Sender)
00131	{
00132	    local int i;
00133	    if (Sender == Controls[0])
00134	    {
00135	      Controller.OpenMenu("XIDInterf.XIIILiveMsgBox",false);
00136	      msgbox = XIIILiveMsgBox(myRoot.ActivePage);
00137	      msgbox.SetupQuestion(strSendFriendRequestQuestion, QBTN_Ok | QBTN_Cancel, QBTN_Cancel, activeFriendName);
00138	      msgbox.OnButtonClick=ReturnMsgBox;
00139	      msgbox.InitBox(160*fRatioX, 130*fRatioY*fScaleTo, 16, 16, 320*fRatioX, 230*fRatioY*fScaleTo);
00140	      popupStatus = 1;
00141	      return true;
00142	    }
00143	    else if (Sender == Controls[1])
00144	    {
00145	      if (activeFriend.voiceStatus == eVoiceStatus.VOICESTATUS_voicemuted)
00146	      {
00147	        xboxlive.SetPlayerVoiceStatus(activeFriendName, false);
00148	        xboxlive.RemovePlayerFromMuteListByName(activeFriendName);
00149	        activeFriend.voiceStatus = eVoiceStatus.VOICESTATUS_voiceon;
00150	        Buttons[1].Caption = strVoiceOn;//Voice is on;
00151	      }
00152	      else
00153	      {
00154	        xboxlive.SetPlayerVoiceStatus(activeFriendName, true);
00155	        xboxlive.AddPlayerToMuteListByName(activeFriendName);
00156	        activeFriend.voiceStatus = eVoiceStatus.VOICESTATUS_voicemuted;
00157	        Buttons[1].Caption = strVoiceMuted;//"Voice is muted";
00158	      }
00159	
00160	    }
00161	    else if (Sender == Controls[2])
00162	    {
00163	      Controller.OpenMenu("XIDInterf.XIIILiveMsgBox",false);
00164	      msgbox = XIIILiveMsgBox(myRoot.ActivePage);
00165	      msgbox.SetupQuestion(strKickQuestion, QBTN_Ok | QBTN_Cancel, QBTN_Cancel, activeFriendName);
00166	      msgbox.OnButtonClick=ReturnMsgBox;
00167	      msgbox.InitBox(160*fRatioX, 130*fRatioY*fScaleTo, 16, 16, 320*fRatioX, 230*fRatioY*fScaleTo);
00168	      popupStatus = 2;
00169	      //xboxlive.Kick(activeFriendName);
00170	    }
00171	    else if (Sender == Controls[3])
00172	    {
00173	      myRoot.OpenMenu("XIDInterf.XIIIMenuLiveFeedback");
00174	      return true;
00175	    }
00176	
00177	    return true;
00178	}
00179	
00180	
00181	function bool InternalOnKeyEvent(out byte Key, out byte State, float delta)
00182	{
00183	    if (state==1/* || state==2*/)// IST_Press // to avoid auto-repeat
00184	    {
00185	        if ((Key==0x0D/*IK_Enter*/) || (Key==0x01))
00186		    {
00187	          //Controller.FocusedControl.OnClick(Self);
00188	          InternalOnClick(Controller.FocusedControl);
00189	          return true;
00190		    }
00191		    if ((Key==0x08/*IK_Backspace*/)|| (Key==0x1B))
00192		    {
00193		        myRoot.CloseMenu(true);
00194	    	    return true;
00195		    }
00196		    if (Key==0x25/*IK_Left*/)
00197		    {
00198	    	    return true;
00199		    }
00200		    if (Key==0x27/*IK_Right*/)
00201		    {
00202	    	    return true;
00203		    }
00204	    }
00205	    return super.InternalOnKeyEvent(Key, state, delta);
00206	}
00207	
00208	
00209	

End Source Code