## XIDInterf
Class XIIIMenuLiveFriendsInvited

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

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

Direct Known Subclasses:None

class XIIIMenuLiveFriendsInvited
extends XIDInterf.XIIILiveWindow

Variables
`string` | `ButtonNames[2]`
`XIIIGUIButton` | `Buttons[2]`
`string` | `TitleText`
`XboxLiveManager.FRIEND_PACKET` | `activeFriend`
`string` | `activeFriendName`
`XIIILiveMsgBox` | `msgbox`
`int` | `popupStatus`
`strRemoveFriendQuestion,` | `strRevokeGameInviteQuestion`

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

End Source Code