Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |
00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022 00023 00024 00025 00026 00027 00028 00029 00030 00031 00032 00033 00034 00035 00036 00037 00038 00039 00040 00041 00042 00043 00044 00045 00046 00047 00048 00049 00050 00051 00052 00053 00054 00055 00056 00057 00058 00059 00060 00061 00062 00063 00064 00065 00066 00067 00068 00069 00070 00071 00072 00073 00074 00075 00076 00077 00078 00079 00080 00081 00082 00083 00084 00085 00086 00087 00088 00089 00090 00091 00092 00093 00094 00095 00096 00097 00098 00099 00100 00101 00102 00103 00104 00105 00106 00107 00108 00109 00110 00111 00112 00113 00114 00115 00116 00117 00118 00119 00120 00121 00122 00123 00124 00125 00126 00127 00128 00129 00130 00131 00132 00133 00134 00135 00136 00137 00138 00139 00140 00141 00142 |
/** * Copyright 1998-2008 Epic Games, Inc. All Rights Reserved. * * CD Key entry for UT3. */ class UTUIFrontEnd_CDKey extends UTUIFrontEnd_CustomScreen; var transient UIEditBox CDKeyEditBox[4]; var transient OnlineAccountInterface AccountInterface; /** PostInitialize event - Sets delegates for the scene. */ event PostInitialize( ) { local int EditboxIdx; Super.PostInitialize(); for(EditboxIdx=0; EditboxIdx<4; EditboxIdx++) { CDKeyEditbox[EditboxIdx] = UIEditBox(FindChild(name("txtKey"$(EditboxIdx+1)),true)); CDKeyEditbox[EditboxIdx].NotifyActiveStateChanged = OnNotifyActiveStateChanged; CDKeyEditbox[EditboxIdx].OnSubmitText=OnSubmitText; CDKeyEditbox[EditboxIdx].SetDataStoreBinding(""); CDKeyEditbox[EditboxIdx].SetValue(""); CDKeyEditbox[EditboxIdx].MaxCharacters = GS_CDKEY_PART_MAXLENGTH; } // Store reference to the account interface. AccountInterface=GetAccountInterface(); } /** Sets up the scene's button bar. */ function SetupButtonBar() { ButtonBar.Clear(); ButtonBar.AppendButton("<Strings:UTGameUI.ButtonCallouts.ExitGame>", OnButtonBar_Cancel); ButtonBar.AppendButton("<Strings:UTGameUI.ButtonCallouts.Accept>", OnButtonBar_Accept); } /** Callback for when the user wants to back out of this screen. */ function OnCancel() { ConsoleCommand("quit"); } /** Tries to create the user's account. */ function OnAccept() { local int EditboxIdx; local string CDKey; CDKey = CDKeyEditbox[EditboxIdx].GetValue(); // Concatenate the remaining strings WITH HYPHENS for (EditboxIdx=1; EditboxIdx<4; EditboxIdx++) { CDKey $= "-"$CDKeyEditbox[EditboxIdx].GetValue(); } // Verify contents of user name box if(AccountInterface.SaveKey(CDKey)) { CloseScene(self); } else { DisplayMessageBox("<Strings:UTGameUI.Errors.InvalidCDKey_Message>","<Strings:UTGameUI.Errors.InvalidCDKey_Title>"); } } /** Buttonbar Callbacks. */ function bool OnButtonBar_Cancel(UIScreenObject InButton, int InPlayerIndex) { OnCancel(); return true; } function bool OnButtonBar_Accept(UIScreenObject InButton, int InPlayerIndex) { OnAccept(); return true; } /** * Provides a hook for unrealscript to respond to input using actual input key names (i.e. Left, Tab, etc.) * * Called when an input key event is received which this widget responds to and is in the correct state to process. The * keys and states widgets receive input for is managed through the UI editor's key binding dialog (F8). * * This delegate is called BEFORE kismet is given a chance to process the input. * * @param EventParms information about the input event. * * @return TRUE to indicate that this input key was processed; no further processing will occur on this input key event. */ function bool HandleInputKey( const out InputEventParameters EventParms ) { local bool bResult; bResult=false; if(EventParms.EventType==IE_Released) { if(EventParms.InputKeyName=='XboxTypeS_B' || EventParms.InputKeyName=='Escape') { OnCancel(); bResult=true; } } return bResult; } /** * Called when the user presses enter (or any other action bound to UIKey_SubmitText) while this editbox has focus. * * @param Sender the editbox that is submitting text * @param PlayerIndex the index of the player that generated the call to SetValue; used as the PlayerIndex when activating * UIEvents; if not specified, the value of GetBestPlayerIndex() is used instead. * * @return if TRUE, the editbox will clear the existing value of its textbox. */ function bool OnSubmitText( UIEditBox Sender, int PlayerIndex ) { OnAccept(); return false; } defaultproperties { Begin Object Class=UIComp_Event Name=SceneEventComponent ObjName=SceneEventComponent Archetype=UIComp_Event'UTGame.Default__UTUIFrontEnd_CustomScreen:SceneEventComponent' ObjectArchetype=UIComp_Event'UTGame.Default__UTUIFrontEnd_CustomScreen:SceneEventComponent' End Object EventProvider=SceneEventComponent Name="Default__UTUIFrontEnd_CDKey" ObjectArchetype=UTUIFrontEnd_CustomScreen'UTGame.Default__UTUIFrontEnd_CustomScreen' } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |