XIDInterf
Class XIIIMenuLiveFeedback

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

class XIIIMenuLiveFeedback
extends XIDInterf.XIIILiveWindow


Variables
 string ButtonNames[7]
 XIIIGUIButton Buttons[7]
 string LabelNames[2]
 GUILabel Labels[2]
 XboxLiveManager.FRIEND_PACKET activePlayer
 string activePlayerName
 XIIILiveMsgBox msgbox
 int popupStatus
 strFeedback6, strFeedback7


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 XIIIMenuLiveFeedback extends XIIILiveWindow;
00002	
00003	
00004	enum XBL_FEEDBACK
00005	{
00006	  unrealscriptsuckscanthaveelementstartingonone,
00007		NEG_NICKNAME,
00008		NEG_GAMEPLAY,
00009		NEG_SCREAMING,
00010		NEG_HARASSMENT,
00011		NEG_LEWDNESS,
00012		NEG_STATS_ATTACHMENT,
00013	
00014		POS_ATTITUDE,
00015		POS_SESSION,
00016		POS_STATS_ATTACHMENT
00017	};
00018	
00019	
00020	var localized string TitleText, strFeedback1, strFeedback2, strFeedback3, strFeedback4, strFeedback5, strFeedback6, strFeedback7;
00021	
00022	var XIIIGUIButton Buttons[7];
00023	var localized string ButtonNames[7];
00024	//var localized string strFeedback, strComplaints;
00025	
00026	var GUILabel Labels[2];
00027	var localized string LabelNames[2];
00028	
00029	var XIIILiveMsgBox msgbox;
00030	var int popupStatus;
00031	
00032	
00033	
00034	var XboxLiveManager.FRIEND_PACKET activePlayer;
00035	var string                        activePlayerName;
00036	
00037	
00038	
00039	function Created()
00040	{
00041	  local int i;
00042	     Super.Created();
00043	
00044	
00045	  Labels[0] = GUILabel(CreateControl(class'GUILabel', 300, 90, 150, 26));
00046	  Labels[0].caption = LabelNames[0];
00047	  Labels[0].StyleName="LabelWhite";
00048	  Labels[0].TextColor.R=255;
00049	  Labels[0].TextColor.G=255;
00050	  Labels[0].TextColor.B=255;
00051	  controls[7] = Labels[0];
00052	  Labels[1] = GUILabel(CreateControl(class'GUILabel', 300, 195, 350, 26));
00053	  Labels[1].caption = LabelNames[1];
00054	  Labels[1].StyleName="LabelWhite";
00055	  Labels[1].TextColor.R=255;
00056	  Labels[1].TextColor.G=255;
00057	  Labels[1].TextColor.B=255;
00058	  controls[8] = Labels[1];
00059	
00060	
00061	}
00062	
00063	
00064	function InitComponent(GUIController MyController,GUIComponent MyOwner)
00065	{
00066	  local int i;
00067	  Super.InitComponent(MyController, MyOwner);
00068	
00069	  for (i=0; i<7; i++)
00070	  {
00071		  Buttons[i] = XIIIGUIButton(Controls[i]);
00072		  Buttons[i].Caption = ButtonNames[i];
00073	  }
00074	
00075		OnClick = InternalOnClick;
00076	}
00077	
00078	
00079	function ShowWindow()
00080	{
00081	  OnMenu = 0; myRoot.bFired = false;
00082	  Super.ShowWindow();
00083	  bShowBCK = true;
00084	  bShowRUN = false;
00085	  bShowSEL = true;
00086	
00087	  activePlayer = xboxlive.GetActiveFriend();
00088	  activePlayerName = xboxlive.GetActiveFriendName();
00089	  TitleText = activePlayerName $ " - " $ LabelNames[0];
00090	
00091	}
00092	
00093	
00094	function Paint(Canvas C, float X, float Y)
00095	{
00096	     Super.Paint(C, X, Y);
00097	  PaintStandardBackground(C, X, Y, TitleText);
00098	}
00099	
00100	function ReturnMsgBox(byte bButton)
00101	{
00102	  switch (bButton)
00103	  {
00104	    case QBTN_Ok:
00105	
00106	      if (popupStatus == 1)
00107	      {
00108	        xboxlive.SendFeedBack(activePlayerName, XBL_FEEDBACK.POS_ATTITUDE);
00109	        myRoot.CloseMenu(true);
00110	      }
00111	      else if (popupStatus == 2)
00112	      {
00113	        xboxlive.SendFeedBack(activePlayerName, XBL_FEEDBACK.POS_SESSION);
00114	        myRoot.CloseMenu(true);
00115	      }
00116	      else if (popupStatus == 3)
00117	      {
00118	        xboxlive.SendFeedBack(activePlayerName, XBL_FEEDBACK.NEG_NICKNAME);
00119	        myRoot.CloseMenu(true);
00120	      }
00121	      else if (popupStatus == 4)
00122	      {
00123	        xboxlive.SendFeedBack(activePlayerName, XBL_FEEDBACK.NEG_GAMEPLAY);
00124	        myRoot.CloseMenu(true);
00125	      }
00126	      else if (popupStatus == 5)
00127	      {
00128	        xboxlive.SendFeedBack(activePlayerName, XBL_FEEDBACK.NEG_SCREAMING);
00129	        myRoot.CloseMenu(true);
00130	      }
00131	      else if (popupStatus == 6)
00132	      {
00133	        xboxlive.SendFeedBack(activePlayerName, XBL_FEEDBACK.NEG_HARASSMENT);
00134	        myRoot.CloseMenu(true);
00135	      }
00136	      else if (popupStatus == 7)
00137	      {
00138	        xboxlive.SendFeedBack(activePlayerName, XBL_FEEDBACK.NEG_LEWDNESS);
00139	        myRoot.CloseMenu(true);
00140	      }
00141	
00142	      popupStatus = 0;
00143	      return;
00144	
00145	    break;
00146	
00147	    case QBTN_Cancel:
00148	      popupStatus = 0;
00149	    break;
00150	
00151	  }
00152	}
00153	
00154	// Called when a button is clicked
00155	function bool InternalOnClick(GUIComponent Sender)
00156	{
00157	    local int i;
00158	    // GOOD ONES
00159	    if (Sender == Controls[0])
00160	    {
00161	      Controller.OpenMenu("XIDInterf.XIIILiveMsgBox",false);
00162	      msgbox = XIIILiveMsgBox(myRoot.ActivePage);
00163	      msgbox.SetupQuestion(strFeedback1, QBTN_Ok | QBTN_Cancel, QBTN_Cancel, activePlayerName);
00164	      msgbox.OnButtonClick=ReturnMsgBox;
00165	      msgbox.InitBox(160*fRatioX, 130*fRatioY*fScaleTo, 16, 16, 320*fRatioX, 230*fRatioY*fScaleTo);
00166	
00167	      popupStatus = 1;
00168	//      xboxlive.SendFeedBack(activePlayerName, XBL_FEEDBACK.POS_ATTITUDE);
00169	//      myRoot.CloseMenu(true);
00170	      return true;
00171	    }
00172	    else if (Sender == Controls[1])
00173	    {
00174	      Controller.OpenMenu("XIDInterf.XIIILiveMsgBox",false);
00175	      msgbox = XIIILiveMsgBox(myRoot.ActivePage);
00176	      msgbox.SetupQuestion(strFeedback2, QBTN_Ok | QBTN_Cancel, QBTN_Cancel, activePlayerName);
00177	      msgbox.OnButtonClick=ReturnMsgBox;
00178	      msgbox.InitBox(160*fRatioX, 130*fRatioY*fScaleTo, 16, 16, 320*fRatioX, 230*fRatioY*fScaleTo);
00179	
00180	      popupStatus = 2;
00181	//      xboxlive.SendFeedBack(activePlayerName, XBL_FEEDBACK.POS_SESSION);
00182	//      myRoot.CloseMenu(true);
00183	      return true;
00184	    }
00185	    // BAD ONES
00186	    else if (Sender == Controls[2])
00187	    {
00188	      Controller.OpenMenu("XIDInterf.XIIILiveMsgBox",false);
00189	      msgbox = XIIILiveMsgBox(myRoot.ActivePage);
00190	      msgbox.SetupQuestion(strFeedback3, QBTN_Ok | QBTN_Cancel, QBTN_Cancel, activePlayerName);
00191	      msgbox.OnButtonClick=ReturnMsgBox;
00192	      msgbox.InitBox(160*fRatioX, 130*fRatioY*fScaleTo, 16, 16, 320*fRatioX, 230*fRatioY*fScaleTo);
00193	
00194	      popupStatus = 3;
00195	//      xboxlive.SendFeedBack(activePlayerName, XBL_FEEDBACK.NEG_NICKNAME);
00196	//      myRoot.CloseMenu(true);
00197	      return true;
00198	    }
00199	    else if (Sender == Controls[3])
00200	    {
00201	      Controller.OpenMenu("XIDInterf.XIIILiveMsgBox",false);
00202	      msgbox = XIIILiveMsgBox(myRoot.ActivePage);
00203	      msgbox.SetupQuestion(strFeedback4, QBTN_Ok | QBTN_Cancel, QBTN_Cancel, activePlayerName);
00204	      msgbox.OnButtonClick=ReturnMsgBox;
00205	      msgbox.InitBox(160*fRatioX, 130*fRatioY*fScaleTo, 16, 16, 320*fRatioX, 230*fRatioY*fScaleTo);
00206	
00207	      popupStatus = 4;
00208	//      xboxlive.SendFeedBack(activePlayerName, XBL_FEEDBACK.NEG_GAMEPLAY);
00209	//      myRoot.CloseMenu(true);
00210	      return true;
00211	    }
00212	    else if (Sender == Controls[4])
00213	    {
00214	      Controller.OpenMenu("XIDInterf.XIIILiveMsgBox",false);
00215	      msgbox = XIIILiveMsgBox(myRoot.ActivePage);
00216	      msgbox.SetupQuestion(strFeedback5, QBTN_Ok | QBTN_Cancel, QBTN_Cancel, activePlayerName);
00217	      msgbox.OnButtonClick=ReturnMsgBox;
00218	      msgbox.InitBox(160*fRatioX, 130*fRatioY*fScaleTo, 16, 16, 320*fRatioX, 230*fRatioY*fScaleTo);
00219	
00220	      popupStatus = 5;
00221	//      xboxlive.SendFeedBack(activePlayerName, XBL_FEEDBACK.NEG_SCREAMING);
00222	//      myRoot.CloseMenu(true);
00223	      return true;
00224	    }
00225	    else if (Sender == Controls[5])
00226	    {
00227	      Controller.OpenMenu("XIDInterf.XIIILiveMsgBox",false);
00228	      msgbox = XIIILiveMsgBox(myRoot.ActivePage);
00229	      msgbox.SetupQuestion(strFeedback6, QBTN_Ok | QBTN_Cancel, QBTN_Cancel, activePlayerName);
00230	      msgbox.OnButtonClick=ReturnMsgBox;
00231	      msgbox.InitBox(160*fRatioX, 130*fRatioY*fScaleTo, 16, 16, 320*fRatioX, 230*fRatioY*fScaleTo);
00232	
00233	      popupStatus = 6;
00234	//      xboxlive.SendFeedBack(activePlayerName, XBL_FEEDBACK.NEG_HARASSMENT);
00235	//      myRoot.CloseMenu(true);
00236	      return true;
00237	    }
00238	    else if (Sender == Controls[6])
00239	    {
00240	      Controller.OpenMenu("XIDInterf.XIIILiveMsgBox",false);
00241	      msgbox = XIIILiveMsgBox(myRoot.ActivePage);
00242	      msgbox.SetupQuestion(strFeedback7, QBTN_Ok | QBTN_Cancel, QBTN_Cancel, activePlayerName);
00243	      msgbox.OnButtonClick=ReturnMsgBox;
00244	      msgbox.InitBox(160*fRatioX, 130*fRatioY*fScaleTo, 16, 16, 320*fRatioX, 230*fRatioY*fScaleTo);
00245	
00246	      popupStatus = 7;
00247	//      xboxlive.SendFeedBack(activePlayerName, XBL_FEEDBACK.NEG_LEWDNESS);
00248	//      myRoot.CloseMenu(true);
00249	      return true;
00250	    }
00251	
00252	    return true;
00253	}
00254	
00255	
00256	function bool InternalOnKeyEvent(out byte Key, out byte State, float delta)
00257	{
00258	    if (state==1/* || state==2*/)// IST_Press // to avoid auto-repeat
00259	    {
00260	        if ((Key==0x0D/*IK_Enter*/) || (Key==0x01))
00261		    {
00262	          //Controller.FocusedControl.OnClick(Self);
00263	          InternalOnClick(Controller.FocusedControl);
00264	          return true;
00265		    }
00266		    if ((Key==0x08/*IK_Backspace*/)|| (Key==0x1B))
00267		    {
00268		        myRoot.CloseMenu(true);
00269	    	    return true;
00270		    }
00271		    if (Key==0x25/*IK_Left*/)
00272		    {
00273	    	    return true;
00274		    }
00275		    if (Key==0x27/*IK_Right*/)
00276		    {
00277	    	    return true;
00278		    }
00279	    }
00280	    return super.InternalOnKeyEvent(Key, state, delta);
00281	}
00282	
00283	
00284	

End Source Code