## XIDInterf
Class XIIIMenuLiveSettings

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

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

Direct Known Subclasses:None

class XIIIMenuLiveSettings
extends XIDInterf.XIIILiveWindow

Variables
`XIIIGUIButton` | `Buttons[6]`
`string` | `LabelNames[6]`
`GUILabel` | `Labels[6]`
`MemoName,` | `MemoTeam`
`MyName,` | `MyTeam`
`NumSkin,` | `NbSkins`
`NoString,` | `OffString`
`PlayerSkin,` | `PlayerClass`
`string` | `SaveQuestionText`
`string` | `TitleText`
`int` | `VoiceMaskID`
`XboxLiveManager.eVoiceMask` | `VoiceMasks[VOICEMASKCOUNT]`
`string` | `VoiceStrings[VOICEMASKCOUNT]`
`bool` | `bOnlineStatus`
`bool` | `bVoiceEnabled`
`bool` | `bVoiceMaskEnabled`
`bool` | `bVoiceThroughSpeakers`
`XIIIGUIButton` | `sliders[4]`
`float` | `sliderval1`
`float` | `sliderval2`
`float` | `sliderval3`
`float` | `sliderval4`

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)`
`bool` | `MayISave()`
`bool` | `NextValue(GUIComponent Sender)`
    // Called when a button is clicked
`void` | `Paint(Canvas C, float X, float Y)`
`bool` | `PrevValue(GUIComponent Sender)`
    // Called when a button is clicked
`void` | `ProcessSave()`
`void` | `ResetButtons()`
`void` | `SaveMsgBoxReturn(byte bButton)`
`void` | `ShowWindow()`

Source Code

    00001	class XIIIMenuLiveSettings extends XIIILiveWindow;
    00002
    00003	var localized string TitleText;
    00004	var XIIIGUIButton Buttons[6];
    00005	var GUILabel Labels[6];
    00006	var localized string LabelNames[6];
    00007	var localized string YesString, NoString, OffString;
    00008	var bool bVoiceThroughSpeakers;
    00009	var bool bOnlineStatus;
    00010	var bool bVoiceEnabled;
    00011	var bool bVoiceMaskEnabled;
    00012
    00013	var int VoiceMaskID;
    00014	const VOICEMASKCOUNT = 14;
    00015	var XboxLiveManager.eVoiceMask VoiceMasks[VOICEMASKCOUNT];
    00016	var localized string VoiceStrings[VOICEMASKCOUNT];
    00017	var localized string SaveQuestionText;
    00018	var float sliderval1;
    00019	var float sliderval2;
    00020	var float sliderval3;
    00021	var float sliderval4;
    00022
    00023	var int NumSkin, NbSkins;
    00024	var string MyClass, MyName, MyTeam;
    00025	var string MemoClass, MemoName, MemoTeam;
    00026	var Array<string> PlayerSkin, PlayerClass;
    00027
    00028	var XIIIGUIButton  sliders[4];
    00029
    00030	function Created()
    00031	{
    00032	  local int i;
    00033	  local XboxLiveManager.eVoiceMask VoiceMask;
    00034	  Super.Created();
    00035
    00036		bVoiceThroughSpeakers = xboxlive.GetVoiceThroughSpeakers();
    00037	  bOnlineStatus = xboxlive.GetOnlineStatus();
    00038	  bVoiceEnabled = xboxlive.GetVoiceStatus();
    00039	  bVoiceMaskEnabled = xboxlive.GetVoiceMaskEnabled();
    00040
    00041	  VoiceMask = xboxlive.GetVoiceMask();
    00042
    00043	  for (i=0; i<VOICEMASKCOUNT; i++)
    00044	  {
    00045	    if (VoiceMasks[i] == VoiceMask)
    00046	    {
    00047	      VoiceMaskID = i;
    00048	    }
    00049	  }
    00050
    00051	  for (i=0; i<4; i++)
    00052	  {
    00053	    Buttons[i] = XIIIGUIButton(CreateControl(class'XIIIGUIButton', 490+5+30, 135+i*35, 60, 30));
    00054	    Buttons[i].StyleName = "SquareButton";
    00055	    Buttons[i].bDrawArrows = true;
    00056	  	Controls[i] = Buttons[i];
    00057	    Labels[i] = GUILabel(CreateControl(class'GUILabel', 280-9, 135+i*35, 230, 26));
    00058	    Labels[i].caption = LabelNames[i];
    00059	    Labels[i].StyleName="LabelWhite";
    00060	    Labels[i].TextColor.R=255;
    00061	    Labels[i].TextColor.G=255;
    00062	    Labels[i].TextColor.B=255;
    00063	    controls[10+i] = Labels[i];
    00064	  }
    00065	  Buttons[i] = XIIIGUIButton(CreateControl(class'XIIIGUIButton', 465-5, 135+4*35, 125, 30));
    00066	  Buttons[i].StyleName = "SquareButton";
    00067	  Buttons[i].bDrawArrows = true;
    00068		Controls[i] = Buttons[i];
    00069	  Labels[i] = GUILabel(CreateControl(class'GUILabel', 280-9, 135+4*35, 200, 26));
    00070	  Labels[i].caption = LabelNames[i];
    00071	  Labels[i].StyleName="LabelWhite";
    00072	  Labels[i].TextColor.R=255;
    00073	  Labels[i].TextColor.G=255;
    00074	  Labels[i].TextColor.B=255;
    00075	  controls[10+i] = Labels[i];
    00076	  i++;
    00077	  Buttons[i] = XIIIGUIButton(CreateControl(class'XIIIGUIButton', 465-5, 135+5*35, 125, 30));
    00078	  Buttons[i].StyleName = "SquareButton";
    00079	  Buttons[i].bDrawArrows = true;
    00080		Controls[i] = Buttons[i];
    00081	  Labels[i] = GUILabel(CreateControl(class'GUILabel', 280-9, 135+5*35, 200, 26));
    00082	  Labels[i].caption = LabelNames[i];
    00083	  Labels[i].StyleName="LabelWhite";
    00084	  Labels[i].TextColor.R=255;
    00085	  Labels[i].TextColor.G=255;
    00086	  Labels[i].TextColor.B=255;
    00087	  controls[10+i] = Labels[i];
    00088
    00089	  sliderval1 = xboxlive.GetVoiceMaskSpecEnergyWeight();
    00090	  sliderval2 = xboxlive.GetVoiceMaskPitchScale();
    00091	  sliderval3 = xboxlive.GetVoiceMaskWhisperValue();
    00092	  sliderval4 = xboxlive.GetVoiceMaskRoboticValue();
    00093
    00094	  sliders[0] = XIIIGUIButton(CreateControl(class'XIIIGUIButton', 490, 275, 100, 30));
    00095	  sliders[1] = XIIIGUIButton(CreateControl(class'XIIIGUIButton', 490, 305, 100, 30));
    00096	  sliders[2] = XIIIGUIButton(CreateControl(class'XIIIGUIButton', 490, 335, 100, 30));
    00097	  sliders[3] = XIIIGUIButton(CreateControl(class'XIIIGUIButton', 490, 365, 100, 30));
    00098	  sliders[0].StyleName="SquareButton";
    00099	  sliders[1].StyleName="SquareButton";
    00100	  sliders[2].StyleName="SquareButton";
    00101	  sliders[3].StyleName="SquareButton";
    00102	  Controls[6] = sliders[0];
    00103	  Controls[7] = sliders[1];
    00104	  Controls[8] = sliders[2];
    00105	  Controls[9] = sliders[3];
    00106
    00107	/*
    00108		MyClass = GetPlayerOwner().GetDefaultURL("Class");
    00109		MyName = GetPlayerOwner().GetDefaultURL("Name");
    00110		MyTeam = GetPlayerOwner().GetDefaultURL("Team");
    00111	*/
    00112		// version par GetDefaultUrl()
    00113		MyName = GetPlayerOwner().GetDefaultURL("MyName");
    00114		if (MyName == "")
    00115			MyName = GetPlayerOwner().GetDefaultURL("Name");
    00116		MyClass = GetPlayerOwner().GetDefaultURL("MySkin");
    00117		MyTeam = GetPlayerOwner().GetDefaultURL("MyTeam");
    00118
    00119		MemoName = MyName;
    00120		MemoClass = MyClass;
    00121		MemoTeam = MyTeam;
    00122
    00123		NbSkins = class'MeshSkinList'.default.MeshSkinListInfo.Length;
    00124		NumSkin = 0;
    00125		for (i=0;i<NbSkins;i++)
    00126		{
    00127			PlayerSkin[i] = class'MeshSkinList'.default.MeshSkinListInfo[i].SkinReadableName;
    00128			PlayerClass[i] = class'MeshSkinList'.default.MeshSkinListInfo[i].SkinName;
    00129			if ( MyClass == PlayerClass[i] )
    00130				NumSkin = i;
    00131		}
    00132		NumSkin = Clamp(NumSkin,0,NbSkins - 1);
    00133	  Buttons[5].Caption = PlayerSkin[NumSkin];
    00134	  if (xboxlive.IsIngame())
    00135	  {
    00136	    Buttons[5].bNeverFocus = true;
    00137	    Buttons[5].MenuState = MSAT_Disabled;
    00138	  }
    00139
    00140	  ResetButtons();
    00141	}
    00142
    00143	function ResetButtons()
    00144	{
    00145	  local int i;
    00146
    00147	  sliderval1 = xboxlive.GetVoiceMaskSpecEnergyWeight();
    00148	  sliderval2 = xboxlive.GetVoiceMaskPitchScale();
    00149	  sliderval3 = xboxlive.GetVoiceMaskWhisperValue();
    00150	  sliderval4 = xboxlive.GetVoiceMaskRoboticValue();
    00151
    00152	  if (bOnlineStatus)
    00153		  Buttons[0].Caption = YesString;
    00154	  else
    00155		  Buttons[0].Caption = NoString;
    00156
    00157		if (bVoiceEnabled)
    00158		  Buttons[1].Caption = NoString;
    00159		else
    00160		  Buttons[1].Caption = YesString;
    00161
    00162	  if (sliderval1>=0)
    00163	    sliders[0].Caption = ""$sliderval1;
    00164	  else
    00165	    sliders[0].Caption = offString;
    00166	  if (sliderval2>=0)
    00167	    sliders[1].Caption = ""$sliderval2;
    00168	  else
    00169	    sliders[1].Caption = offString;
    00170	  if (sliderval3>=0)
    00171	    sliders[2].Caption = ""$sliderval3;
    00172	  else
    00173	    sliders[2].Caption = offString;
    00174	  if (sliderval4>=0)
    00175	    sliders[3].Caption = ""$sliderval4;
    00176	  else
    00177	    sliders[3].Caption = offString;
    00178
    00179	  if (!bVoiceEnabled)
    00180	  {
    00181		  Buttons[2].Caption = NoString;
    00182	    Buttons[2].bNeverFocus = true;
    00183	    Buttons[2].MenuState = MSAT_Disabled;
    00184		  Buttons[3].Caption = NoString;
    00185	    Buttons[3].bNeverFocus = true;
    00186	    Buttons[3].MenuState = MSAT_Disabled;
    00187	    Buttons[4].bNeverFocus = true;
    00188	    Buttons[4].MenuState = MSAT_Disabled;
    00189	    sliders[0].bNeverFocus = true;
    00190	    sliders[1].bNeverFocus = true;
    00191	    sliders[2].bNeverFocus = true;
    00192	    sliders[3].bNeverFocus = true;
    00193	    sliders[0].bVisible    = false;
    00194	    sliders[1].bVisible    = false;
    00195	    sliders[2].bVisible    = false;
    00196	    sliders[3].bVisible    = false;
    00197	  }
    00198	  else
    00199	  {
    00200	    Buttons[2].bNeverFocus = false;
    00201	    if (Controller.FocusedControl == Buttons[2])
    00202	      Buttons[2].MenuState = MSAT_Focused;
    00203	    else
    00204	      Buttons[2].MenuState = MSAT_Blurry;
    00205	    if (bVoiceThroughSpeakers)
    00206	  	  Buttons[2].Caption = YesString;
    00207	    else
    00208	  	  Buttons[2].Caption = NoString;
    00209
    00210	    Buttons[3].bNeverFocus = false;
    00211	    if (Controller.FocusedControl == Buttons[3])
    00212	      Buttons[3].MenuState = MSAT_Focused;
    00213	    else
    00214	      Buttons[3].MenuState = MSAT_Blurry;
    00215	    if (bVoiceMaskEnabled)
    00216	  	  Buttons[3].Caption = YesString;
    00217	    else
    00218	  	  Buttons[3].Caption = NoString;
    00219
    00220	    if (!bVoiceMaskEnabled)
    00221	    {
    00222	      Buttons[4].bNeverFocus = true;
    00223	      Buttons[4].MenuState = MSAT_Disabled;
    00224	      sliders[0].bNeverFocus = true;
    00225	      sliders[1].bNeverFocus = true;
    00226	      sliders[2].bNeverFocus = true;
    00227	      sliders[3].bNeverFocus = true;
    00228	      sliders[0].bVisible    = false;
    00229	      sliders[1].bVisible    = false;
    00230	      sliders[2].bVisible    = false;
    00231	      sliders[3].bVisible    = false;
    00232	    }
    00233	    else
    00234	    {
    00235	      Buttons[4].bNeverFocus = false;
    00236	      if (Controller.FocusedControl == Buttons[4])
    00237	        Buttons[4].MenuState = MSAT_Focused;
    00238	      else
    00239	        Buttons[4].MenuState = MSAT_Blurry;
    00240	      if (VoiceMasks[VoiceMaskID] == VOICE_Custom)
    00241	      {
    00242	        sliders[0].bNeverFocus = false;
    00243	        sliders[1].bNeverFocus = false;
    00244	        sliders[2].bNeverFocus = false;
    00245
sliders[3].bNeverFocus = false; 00246 sliders[0].bVisible = true; 00247 sliders[1].bVisible = true; 00248 sliders[2].bVisible = true; 00249 sliders[3].bVisible = true; 00250 } 00251 else 00252 { 00253 sliders[0].bNeverFocus = true; 00254 sliders[1].bNeverFocus = true; 00255 sliders[2].bNeverFocus = true; 00256 sliders[3].bNeverFocus = true; 00257 sliders[0].bVisible = false; 00258 sliders[1].bVisible = false; 00259 sliders[2].bVisible = false; 00260 sliders[3].bVisible = false; 00261 } 00262 } 00263 } 00264 Buttons[4].Caption = VoiceStrings[VoiceMaskID]; 00265 } 00266 00267 00268 function InitComponent(GUIController MyController,GUIComponent MyOwner) 00269 { 00270 Super.InitComponent(MyController, MyOwner); 00271 OnClick = InternalOnClick; 00272 } 00273 00274 function ShowWindow() 00275 { 00276 OnMenu = 0; myRoot.bFired = false; 00277 Super.ShowWindow(); 00278 bShowBCK = true; 00279 bShowRUN = false; 00280 bShowSEL = false; 00281 } 00282 00283 00284 function Paint(Canvas C, float X, float Y) 00285 { 00286 Super.Paint(C, X, Y); 00287 PaintStandardBackground(C, X, Y, TitleText); 00288 00289 if (xboxlive.GetVoiceThroughSpeakers() != bVoiceThroughSpeakers) 00290 { 00291 bVoiceThroughSpeakers = xboxlive.GetVoiceThroughSpeakers(); 00292 if (bVoiceThroughSpeakers) 00293 Buttons[2].Caption = YesString; 00294 else 00295 Buttons[2].Caption = NoString; 00296 } 00297 } 00298 00299 00300 // Called when a button is clicked 00301 function bool InternalOnClick(GUIComponent Sender) 00302 { 00303 /*if (Sender == Controls[0]) 00304 { 00305 }*/ 00306 return true; 00307 } 00308 00309 // Called when a button is clicked 00310 function bool PrevValue(GUIComponent Sender) 00311 { 00312 if (Sender == sliders[0]) 00313 { 00314 if (sliderval1 <= 0) 00315 sliderval1 = -1.0; 00316 else if (sliderval1 > 0) 00317 { 00318 sliderval1-=0.05f; 00319 if (sliderval1<0) 00320 sliderval1 = 0; 00321 } 00322 xboxlive.SetVoiceMaskSpecEnergyWeight(sliderval1); 00323 if (sliderval1>=0) 00324 sliders[0].Caption = ""$sliderval1; 00325 else 00326 sliders[0].Caption = OffString; 00327 } 00328 if (Sender == sliders[1]) 00329 { 00330 if (sliderval2 <= 0) 00331 sliderval2 = -1.0; 00332 else if (sliderval2 > 0) 00333 { 00334 sliderval2-=0.05f; 00335 if (sliderval2<0) 00336 sliderval2 = 0; 00337 } 00338 xboxlive.SetVoiceMaskPitchScale(sliderval2); 00339 sliders[1].Caption = ""$sliderval2; 00340 if (sliderval2>=0) 00341 sliders[1].Caption = ""$sliderval2; 00342 else 00343 sliders[1].Caption = OffString; 00344 } 00345 if (Sender == sliders[2]) 00346 { 00347 if (sliderval3 <= 0) 00348 sliderval3 = -1.0; 00349 else if (sliderval3 > 0) 00350 { 00351 sliderval3-=0.05f; 00352 if (sliderval3<0) 00353 sliderval3 = 0; 00354 } 00355 xboxlive.SetVoiceMaskWhisperValue(sliderval3); 00356 sliders[2].Caption = ""$sliderval3; 00357 if (sliderval3>=0) 00358 sliders[2].Caption = ""$sliderval3; 00359 else 00360 sliders[2].Caption = offString; 00361 } 00362 if (Sender == sliders[3]) 00363 { 00364 if (sliderval4 <= 0) 00365 sliderval4 = -1.0; 00366 else if (sliderval4 > 0) 00367 { 00368 sliderval4-=0.05f; 00369 if (sliderval4<0) 00370 sliderval4 = 0; 00371 } 00372 xboxlive.SetVoiceMaskRoboticValue(sliderval4); 00373 sliders[3].Caption = ""$sliderval4; 00374 if (sliderval4>=0) 00375 sliders[3].Caption = ""$sliderval4; 00376 else 00377 sliders[3].Caption = offString; 00378 } 00379 00380 if (Sender == Controls[0]) 00381 { 00382 bOnlineStatus = !bOnlineStatus; 00383 xboxlive.SetOnlineStatus(bOnlineStatus); 00384 } 00385 if (Sender == Controls[1]) 00386 { 00387 bVoiceEnabled = !bVoiceEnabled; 00388 xboxlive.SetVoiceStatus(bVoiceEnabled); 00389 } 00390 if (Sender == Controls[2]) 00391 { 00392 bVoiceThroughSpeakers = !bVoiceThroughSpeakers; 00393 xboxlive.SetVoiceThroughSpeakers(bVoiceThroughSpeakers); 00394 bVoiceThroughSpeakers = xboxlive.GetVoiceThroughSpeakers(); 00395 } 00396 if (Sender == Controls[3]) 00397 { 00398 bVoiceMaskEnabled = !bVoiceMaskEnabled; 00399 xboxlive.SetVoiceMaskEnabled(bVoiceMaskEnabled); 00400 } 00401 if (Sender == Controls[4]) 00402 { 00403 VoiceMaskID--; 00404 if (VoiceMaskID<0) 00405 VoiceMaskID = VOICEMASKCOUNT-1; 00406 xboxlive.SetVoiceMask(VoiceMasks[VoiceMaskID]); 00407 } 00408 if (Sender == Buttons[5]) 00409 { 00410 NumSkin--; 00411 NumSkin = Clamp(NumSkin,0,NbSkins - 1); 00412 Buttons[5].Caption = PlayerSkin[NumSkin]; 00413 MyClass = PlayerClass[NumSkin]; 00414 } 00415 ResetButtons(); 00416 return true; 00417 } 00418 00419 // Called when a button is clicked 00420 function bool NextValue(GUIComponent Sender) 00421 { 00422 if (Sender == sliders[0]) 00423 { 00424 if (sliderval1 < 0) 00425 sliderval1 = 0; 00426 else if (sliderval1 < 1.0) 00427 { 00428 sliderval1+=0.05; 00429 if (sliderval1>1.0) 00430 sliderval1 = 1.0; 00431 } 00432 xboxlive.SetVoiceMaskSpecEnergyWeight(sliderval1); 00433 if (sliderval1>=0) 00434 sliders[0].Caption = ""$sliderval1; 00435 else 00436 sliders[0].Caption = OffString; 00437 } 00438 if (Sender == sliders[1]) 00439 { 00440 if (sliderval2 < 0) 00441 sliderval2 = 0; 00442 else if (sliderval2 < 1.0) 00443 { 00444 sliderval2+=0.05; 00445 if (sliderval2>1.0) 00446 sliderval2 = 1.0; 00447 } 00448 xboxlive.SetVoiceMaskPitchScale(sliderval2); 00449 if (sliderval2>=0) 00450 sliders[1].Caption = ""$sliderval2; 00451 else 00452 sliders[1].Caption = OffString; 00453 } 00454 if (Sender == sliders[2]) 00455 { 00456 if (sliderval3 < 0) 00457 sliderval3 = 0; 00458 else if (sliderval3 < 1.0) 00459 { 00460 sliderval3+=0.05; 00461 if (sliderval3>1.0) 00462 sliderval3 = 1.0; 00463 } 00464 xboxlive.SetVoiceMaskWhisperValue(sliderval3); 00465 if (sliderval3>=0) 00466 sliders[2].Caption = ""$sliderval3; 00467 else 00468 sliders[2].Caption = OffString; 00469 } 00470 if (Sender == sliders[3]) 00471 { 00472 if (sliderval4 < 0) 00473 sliderval4 = 0; 00474 else if (sliderval4 < 1.0) 00475 { 00476 sliderval4+=0.05; 00477 if (sliderval4>1.0) 00478 sliderval4 = 1.0; 00479 } 00480 xboxlive.SetVoiceMaskRoboticValue(sliderval4); 00481 if (sliderval4>=0) 00482 sliders[3].Caption = ""$sliderval4; 00483 else 00484 sliders[3].Caption = OffString; 00485 } 00486 00487 if (Sender == Controls[0]) 00488 { 00489 bOnlineStatus = !bOnlineStatus; 00490 xboxlive.SetOnlineStatus(bOnlineStatus); 00491 } 00492 if (Sender == Controls[1]) 00493 { 00494 bVoiceEnabled = !bVoiceEnabled; 00495 xboxlive.SetVoiceStatus(bVoiceEnabled); 00496 } 00497 if (Sender == Controls[2]) 00498 { 00499 bVoiceThroughSpeakers = !bVoiceThroughSpeakers; 00500 xboxlive.SetVoiceThroughSpeakers(bVoiceThroughSpeakers); 00501 bVoiceThroughSpeakers = xboxlive.GetVoiceThroughSpeakers(); 00502 } 00503 if (Sender == Controls[3]) 00504 { 00505 bVoiceMaskEnabled = !bVoiceMaskEnabled; 00506 xboxlive.SetVoiceMaskEnabled(bVoiceMaskEnabled); 00507 } 00508 if (Sender == Controls[4]) 00509 { 00510 VoiceMaskID++; 00511 if (VoiceMaskID>=VOICEMASKCOUNT) 00512 VoiceMaskID = 0; 00513 xboxlive.SetVoiceMask(VoiceMasks[VoiceMaskID]); 00514 } 00515 if (Sender == Buttons[5]) 00516 { 00517 NumSkin++; 00518 NumSkin = Clamp(NumSkin,0,NbSkins - 1); 00519 Buttons[5].Caption = PlayerSkin[NumSkin]; 00520 MyClass = PlayerClass[NumSkin]; 00521 } 00522 ResetButtons(); 00523 return true; 00524 } 00525 00526 function bool MayISave() 00527 { 00528 return ( 00529 ( MemoClass != MyClass ) 00530 ); 00531 } 00532 function SaveMsgBoxReturn(byte bButton) 00533 { 00534 if ( (bButton & QBTN_Yes) != 0) 00535 { 00536 ProcessSave(); 00537 } 00538 else 00539 { 00540 myRoot.CloseMenu(true); 00541 } 00542 } 00543 00544 00545 function ProcessSave() 00546 { 00547 GetPlayerOwner().UpdateURL("MySkin",MyClass,true); 00548 SaveConfigs(); 00549 } 00550 00551 function bool InternalOnKeyEvent(out byte Key, out byte State, float delta) 00552 { 00553 if (state==1/* || state==2*/)// IST_Press // to avoid auto-repeat 00554 { 00555 if ((Key==0x0D/*IK_Enter*/) || (Key==0x01)) 00556 { 00557 //Controller.FocusedControl.OnClick(Self); 00558 InternalOnClick(Controller.FocusedControl); 00559 return true; 00560 } 00561 if ((Key==0x08/*IK_Backspace*/)|| (Key==0x1B)) 00562 { 00563 //SaveConfigs(); 00564 //myRoot.CloseMenu(true); 00565 if (MayISave()) 00566 { 00567 myRoot.OpenMenu("XIDInterf.XIIILiveMsgBox"); 00568 MsgBox = XIIILiveMsgBox(myRoot.ActivePage); 00569 MsgBox.InitBox(220*fRatioX, 130*fRatioY*fScaleTo, 10, 10, 220*fRatioX, 230*fRatioY*fScaleTo); 00570 MsgBox.SetupQuestion(SaveQuestionText, QBTN_Yes | QBTN_No, QBTN_Yes, ""); 00571 MsgBox.OnButtonClick = SaveMsgBoxReturn; 00572 } 00573 else 00574 { 00575 myRoot.CloseMenu(true); 00576 } 00577 return true; 00578 } 00579 if (Key==0x25/*IK_Left*/) 00580 { 00581 PrevValue(Controller.FocusedControl); 00582 return true; 00583 } 00584 if (Key==0x27/*IK_Right*/) 00585 { 00586 NextValue(Controller.FocusedControl); 00587 return true; 00588 } 00589 } 00590 else if (state==2) 00591 { 00592 if (Key==0x25/*IK_Left*/) 00593 { 00594 PrevValue(Controller.FocusedControl); 00595 return true; 00596 } 00597 if (Key==0x27/*IK_Right*/) 00598 { 00599 NextValue(Controller.FocusedControl); 00600 return true; 00601 } 00602 } 00603 return super.InternalOnKeyEvent(Key, state, delta); 00604 } 00605 00606 00607

End Source Code