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 |
class TribesGamespyCreate extends TribesGamespyLogin; var(TribesGui) private EditInline Config GUIEditBox EditConfirm; function InternalOnShow() { ActionButton.SetEnabled(true); //EditNick.SetText(""); EditEmail.SetText(""); EditPassword.SetText(""); EditConfirm.SetText(""); SetupGamespyVars(); } protected function bool Validate() { if (!Super.Validate()) return false; if (EditPassword.GetText() != EditConfirm.GetText()) { OpenDlg(PasswordMismatchText, QBTN_Ok); return false; } return true; } protected function OnPerformGamespyAction() { GamespyCreateAccount(); } private function GamespyCreateAccount() { local PlayerProfile p; p = TribesGUIController(Controller).profileManager.GetActiveProfile(); SetTimer(0, False); Log("Creating new user account:"); Log("Nick: " $ p.playerName); Log("Email: " $ EditEmail.GetText()); gm.OnEmailAlreadyTaken = OnGamespyEmailTaken; gm.OnProfileCreateResult = OnGamespyCreateResult; gm.CreateUserAccount(p.playerName, EditEmail.GetText(), EditPassword.GetText()); SetTimer(ActionTimeout, false); } private function OnGamespyCreateResult(GameSpyManager.EGameSpyResult result, int profileId) { SetTimer(0, false); switch (result) { case GSR_VALID_PROFILE: FillProfile(profileId); OpenDlg(GamespyCreateSuccessText, QBTN_Ok, "success"); break; case GSR_BAD_PASSWORD: OpenDlg(BadPasswordText, QBTN_Ok); break; case GSR_BAD_NICK: OpenDlg(BadNickText, QBTN_Ok); break; case GSR_GENERAL_FAILURE: OpenDlg(GeneralFailureText, QBTN_Ok); break; } } private function OnGamespyEmailTaken() { OpenDlg(GamespyEmailTakenText, QBTN_Ok); } function bool InternalOnKeyEvent(out byte Key, out byte State, float delta) { if( bVisible && bActiveInput && Key == EInputKey.IK_Tab && State == EInputAction.IST_Press ) { // Manually toggle between edit boxes if (EditEmail.MenuState==MSAT_Focused) EditPassword.Focus(); else if (EditPassword.MenuState==MSAT_Focused) EditConfirm.Focus(); else EditEmail.Focus(); return true; } return super.InternalOnKeyEvent(Key, State, delta); } defaultproperties { OnKeyEvent=InternalOnKeyEvent } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |