protected virtual void Start()
 {
     Service.Get <ICPSwrveService>().Funnel(Service.Get <MembershipService>().AccountFunnelName, "03", "create");
     createController = GetComponentInParent <AbstractCreateController>();
     createController.OnCreateError      += onCreateError;
     createController.CanShowAccountError = true;
     createController.CheckRegConfigReady();
 }
Example #2
0
    private void Start()
    {
        Service.Get <ICPSwrveService>().Funnel(Service.Get <MembershipService>().AccountFunnelName, "05", "display_name");
        createController = GetComponentInParent <AbstractCreateController>();
        createController.OnUpdateDisplayNameError += OnUpdateDisplayNameError;
        referAFriendEnabled = true;
        if (Service.Get <SessionManager>().LocalUser != null && (Service.Get <SessionManager>().LocalUser.RegistrationProfile.DisplayNameProposedStatus == DisplayNameProposedStatus.Rejected || (Service.Get <SessionManager>().LocalUser.RegistrationProfile.DisplayNameProposedStatus == DisplayNameProposedStatus.Pending && Service.Get <SessionManager>().LocalUser.RegistrationProfile.ProposedDisplayName.StartsWith("DNAME-REJ-"))))
        {
            Instructions.text   = Service.Get <Localizer>().GetTokenTranslation("Account.DisplayName.DisplayNameRejected");
            referAFriendEnabled = false;
        }
        if (ReferAFriendSection != null)
        {
            ReferAFriendSection.SetActive(referAFriendEnabled);
        }
        else
        {
            referAFriendEnabled = false;
        }
        setDisplayNameValid = false;
        AccountFlowData accountFlowData = Service.Get <MembershipService>().GetAccountFlowData();
        SessionManager  sessionManager  = Service.Get <SessionManager>();

        if (!string.IsNullOrEmpty(sessionManager.LocalUser.RegistrationProfile.Username) && accountFlowData.PreValidatedDisplayNames.Contains(sessionManager.LocalUser.RegistrationProfile.Username))
        {
            DisplayNameInputField.TextInput.text       = sessionManager.LocalUser.RegistrationProfile.Username;
            DisplayNameInputField.HasError             = false;
            DisplayNameInputField.IsValidationComplete = true;
            setDisplayNameValid = true;
        }
        AvatarRenderTextureComponent componentInChildren    = GetComponentInChildren <AvatarRenderTextureComponent>();
        CPDataEntityCollection       cPDataEntityCollection = Service.Get <CPDataEntityCollection>();
        DataEntityHandle             localPlayerHandle      = cPDataEntityCollection.LocalPlayerHandle;
        AvatarDetailsData            component = default(AvatarDetailsData);

        if (!localPlayerHandle.IsNull && cPDataEntityCollection.TryGetComponent(localPlayerHandle, out component))
        {
            componentInChildren.RenderAvatar(component);
        }
        else
        {
            componentInChildren.RenderAvatar(new DCustomEquipment[0]);
        }
    }